SummaryLength
Contenido
[
Ocultar
]SummaryLength enumeration
Enumera las longitudes posibles del resumen.
public enum SummaryLength
Valores
| Nombre | Valor | Descripción |
|---|---|---|
| VeryShort | 0 | Intenta generar 1-2 oraciones. |
| Short | 1 | Intenta generar 3-4 oraciones. |
| Medium | 2 | Intenta generar 5-6 oraciones. |
| Long | 3 | Intenta generar entre 7 y 10 oraciones. |
| VeryLong | 4 | Intenta generar entre 11 y 20 oraciones. |
Ejemplos
Muestra cómo resumir texto utilizando OpenAI y modelos de Google.
Document firstDoc = new Document(MyDir + "Big document.docx");
Document secondDoc = new Document(MyDir + "Document.docx");
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Utilice modelos de lenguaje generativo de OpenAI o Google.
IAiModelText model = ((OpenAiModel)AiModel.Create(AiModelType.Gpt4OMini).WithApiKey(apiKey)).WithOrganization("Organization").WithProject("Project");
SummarizeOptions options = new SummarizeOptions();
options.SummaryLength = SummaryLength.Short;
Document oneDocumentSummary = model.Summarize(firstDoc, options);
oneDocumentSummary.Save(ArtifactsDir + "AI.AiSummarize.One.docx");
options.SummaryLength = SummaryLength.Long;
Document multiDocumentSummary = model.Summarize(new Document[] { firstDoc, secondDoc }, options);
multiDocumentSummary.Save(ArtifactsDir + "AI.AiSummarize.Multi.docx");
Ver también
- espacio de nombres Aspose.Words.AI
- asamblea Aspose.Words