# Class GetNlgInsightsComponent

An Angular component that fetches and displays a collapsible analysis of the provided query using natural language generation (NLG). Specifying NLG parameters is similar to providing parameters to the QueryService.executeQuery service method, using dimensions, measures, and filters.

# Example

An example of using the GetNlgInsightsComponent:

<!--Component HTML template in example.component.html-->
<csdk-get-nlg-insights
 [dataSource]="nlgParams.dataSource"
 [dimensions]="nlgParams.dimensions"
 [measures]="nlgParams.measures"
/>
// Component behavior in example.component.ts
import { Component } from '@angular/core';
import { measureFactory } from '@sisense/sdk-data';
import * as DM from '../../assets/sample-healthcare-model';

@Component({
 selector: 'example',
 templateUrl: './example.component.html',
 styleUrls: ['./example.component.scss'],
})
export class ExampleComponent {
 nlgParams = {
   dataSource: DM.DataSource.title,
   dimensions: [DM.Divisions.Divison_name],
   measures: [measureFactory.sum(DM.Admissions.Cost_of_admission)],
 };
}

# Implements

  • AfterViewInit
  • OnChanges
  • OnDestroy

# Constructors

# constructor

new GetNlgInsightsComponent( sisenseContextService, themeService, aiService): GetNlgInsightsComponent

Constructor for the GetNlgInsightsProps.

# Parameters

Parameter Type Description
sisenseContextService SisenseContextService Sisense context service
themeService ThemeService Theme service
aiService AiService AI service

# Returns

GetNlgInsightsComponent

# Properties

# Constructor

# aiService

aiService: AiService

AI service


# sisenseContextService

sisenseContextService: SisenseContextService

Sisense context service


# themeService

themeService: ThemeService

Theme service

# Other

# dataSource

dataSource: DataSource

The data source that the query targets - e.g. Sample ECommerce


# dimensions

dimensions: Attribute[] | undefined

Dimensions of the query


# filters

filters: FilterRelations | Filter[] | undefined

Filters of the query


# measures

measures: Measure[] | undefined

Measures of the query


# verbosity

verbosity: "High" | "Low" | undefined

The verbosity of the NLG summarization