Document AI

Цей Aspose.Words Document AI for .NET плагін дозволяє розробникам перекладати або підсумовувати документи та перевіряти їх граматику. Інтегрується з LLM, такими як Gemini, Claude та OpenAI.

Встановлення та налаштування

  1. Встановіть Aspose.Words для пакету .NET через NuGet або консоль менеджера пакетів.
  2. Налаштуйте ліцензування за використанням перед запуском операцій 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");

Підсумувати документ

Створіть резюме документа, вказавши його довжину:

  • Дуже коротко – 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");

Часті запитання

  1. Q: Які формати файлів можна використовувати з Document AI для .NET? The Aspose.Words Document AI for .NET plugin підтримує формати DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM, Word 2003 XML та Word 2007 XML.
  2. Q: Які моделі я можу використовувати з Aspose.Words Document AI для .NET? Document AI для .NET можна інтегрувати з LLMs, такими як Gemini, Claude та OpenAI.
 Українська