Document AI

De Aspose.Words Document AI for .NET plugin stelt ontwikkelaars in staat om documenten te vertalen of samen te vatten en hun grammatica te controleren. Integreert met LLM’s zoals Gemini, Claude en OpenAI.

Installatie en configuratie

  1. Installeer de Aspose.Words voor .NET pakket via NuGet of de Package Manager Console.
  2. Configureer Metered Licensing voordat u mail-merge bewerkingen uitvoert.

Compatibel met Windows, Linux, macOS en mobiele platformen met .NET Framework, .NET Core, of Mono. Ondersteunde IDEs omvatten Visual Studio (2010–2026), Xamarin en MonoDevelop 2.4+.

IDEs: Visual Studio 2017–2026, JetBrains Rider, MonoDevelop.

Ondersteunde sjabloon / uitvoerformaten: DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM, Word 2003 XML en Word 2007 XML.

Vertaal een document

Vertaal uw documenten naar elke taal die wordt weergegeven in de Taal enumeratie:

Document doc = new Document(MyDir + "Document.docx");

string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Use Google generative language models.
AiModel model = AiModel.Create(AiModelType.GeminiFlashLatest).WithApiKey(apiKey);

Document translatedDoc = model.Translate(doc, Language.Arabic);
translatedDoc.Save(ArtifactsDir + "AI.AiTranslate.docx");

Vat een document samen

Genereer een samenvatting van een document, met vermelding van de lengte:

  • ZeerKort – 1-2 zinnen
  • Kort – 3-4 zinnen
  • Gemiddeld – 5-6 zinnen
  • Lang – 7-10 zinnen
  • ZeerLang – 11-20 zinnen
Document firstDoc = new Document("Big document.docx");
Document secondDoc = new Document("Document.docx");

string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Use OpenAI or Google generative language models.
AiModel 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("AI.AiSummarize.One.docx");

options.SummaryLength = SummaryLength.Long;
Document multiDocumentSummary = model.Summarize(new Document[] { firstDoc, secondDoc }, options);
multiDocumentSummary.Save("AI.AiSummarize.Multi.docx");

Controleer de grammatica van het document

Controleer grammatica en detecteer fouten in documenten:

Document doc = new Document(MyDir + "Big document.docx");

string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Use OpenAI generative language models.
AiModel model = AiModel.Create(AiModelType.Gpt4OMini).WithApiKey(apiKey);

CheckGrammarOptions grammarOptions = new CheckGrammarOptions();
grammarOptions.ImproveStylistics = true;

Document proofedDoc = model.CheckGrammar(doc, grammarOptions);
proofedDoc.Save("AI.AiGrammar.docx");

Veelgestelde vragen

  1. Q: Welke bestandsformaten kan ik gebruiken met de Document AI voor .NET? De Aspose.Words Document AI for .NET plugin ondersteunt DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM, Word 2003 XML en Word 2007 XML-formaten.
  2. Q: Welke modellen kan ik gebruiken met de Aspose.Words Document AI voor .NET? Document AI voor .NET kan worden geïntegreerd met LLM’s zoals Gemini, Claude en OpenAI.
 Nederlands