Document AI
Това Aspose.Words Document AI за .NET plugin позволява на разработчиците да превеждат или обобщават документи и да проверяват тяхната граматика. Интегрира се с LLMs като Gemini, Claude и OpenAI.
Инсталиране и настройка
- Инсталирайте пакета Aspose.Words за .NET чрез NuGet или Package Manager Console.
- Конфигурирайте Metered Licensing преди да изпълните mail-merge операции.
Съвместим с Windows, Linux, macOS и мобилни платформи използвайки .NET Framework, .NET Core или Mono. Поддържаните IDE включват Visual Studio (2010–2026), Xamarin и MonoDevelop 2.4+.
IDE-та: Visual Studio 2017–2026, JetBrains Rider, MonoDevelop.
Поддържани шаблони / изходни формати: DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM, Word 2003 XML и Word 2007 XML.
Превод на документ
Превеждайте вашите документи на всеки език, представен в Език изброяване:
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");Обобщение на документ
Създайте резюме на документа, като посочите дължината му:
- VeryShort – 1‑2 изречения
- Кратко – 3-4 изречения
- Средно – 5-6 изречения
- Дълго – 7-10 изречения
- Много дълго – 11-20 изречения
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");Провери граматиката на документа
Провери граматиката и открий грешки в документите:
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");Често задавани въпроси
- Q: Какви файлови формати могат да се използват с Document AI за .NET? Това Aspose.Words Document AI for .NET плъгинът поддържа формати DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM, Word 2003 XML и Word 2007 XML.
- Q: Какви модели мога да използвам с Aspose.Words Document AI за .NET? Document AI за .NET може да бъде интегриран с LLM, като Gemini, Claude и OpenAI.