Back to Devexpress

AbstractiveSummaryRequest.SentenceCount Property

corelibraries-devexpress-dot-aiintegration-dot-extensions-dot-abstractivesummaryrequest-aeee8520.md

latest2.5 KB
Original Source

AbstractiveSummaryRequest.SentenceCount Property

Gets or sets the number of sentences in the summary.

Namespace : DevExpress.AIIntegration.Extensions

Assembly : DevExpress.AIIntegration.v25.2.dll

NuGet Package : DevExpress.AIIntegration

Declaration

csharp
public int? SentenceCount { get; set; }
vb
Public Property SentenceCount As Integer?

Property Value

TypeDescription
Nullable<Int32>

The number of sentences in the summary.

|

Remarks

The following example registers an Azure Text Analytics client and uses the AI-powered extension to generate a summary for originalText:

csharp
using Azure;
using Azure.AI.TextAnalytics;
using DevExpress.AIIntegration;
using DevExpress.AIIntegration.Extensions;

AIExtensionsContainerDefault defaultAIExtensionsContainer;

RegisterTextAnalyticsService(
    Environment.GetEnvironmentVariable("AZURE_TEXT_ANALYTICS_ENDPOINT"),
    Environment.GetEnvironmentVariable("AZURE_TEXT_ANALYTICS_API_KEY")
);

string originalText = "This must be a long text...";
var response = await defaultAIExtensionsContainer.AbstractiveSummaryAsync(
    new AbstractiveSummaryRequest(originalText) { Language = "de", SentenceCount = 3 }
);

Console.WriteLine(response);

void RegisterTextAnalyticsService(string azureTextAnalyticsEndpoint, string azureTextAnalyticsAIKey)
{
    defaultAIExtensionsContainer = new AIExtensionsContainerDefault();
    var textAnalyticsClient = new TextAnalyticsClient(
        new Uri(azureTextAnalyticsEndpoint),
        new AzureKeyCredential(azureTextAnalyticsAIKey)
    );
    defaultAIExtensionsContainer.RegisterTextAnalyticsAzureAIService(textAnalyticsClient);
}

See Also

AbstractiveSummaryRequest Class

AbstractiveSummaryRequest Members

DevExpress.AIIntegration.Extensions Namespace