Document AI

itu Aspose.Words Document AI for .NET plugin membolehkan pembangun untuk menterjemah atau merumuskan dokumen dan memeriksa tatabahasa mereka. Mengintegrasikan dengan LLM seperti Gemini, Claude, dan OpenAI.

Pemasangan dan Persediaan

  1. Pasang Aspose.Words untuk pakej .NET melalui NuGet atau Konsol Pengurus Pakej.
  2. Konfigurasikan Lesen Bermeter sebelum menjalankan operasi mail-merge.

Serasi dengan Windows, Linux, macOS, dan platform mudah alih menggunakan .NET Framework, .NET Core, atau Mono. IDE yang disokong termasuk Visual Studio (2010–2026), Xamarin, dan MonoDevelop 2.4+.

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

Format Templat / Output yang Disokong: DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM, Word 2003 XML, dan Word 2007 XML.

Terjemah Dokumen

Terjemahkan dokumen anda ke mana-mana bahasa yang diwakili dalam Bahasa enumerasi:

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");

Ringkaskan Dokumen

Jana ringkasan dokumen, nyatakan panjangnya:

  • Sangat Pendek – 1-2 ayat
  • Pendek – 3-4 ayat
  • Sederhana – 5-6 ayat
  • Panjang – 7-10 ayat
  • Sangat Panjang – 11-20 ayat
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");

Semak Tatabahasa Dokumen

Semak tatabahasa dan kesan ralat dalam dokumen:

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");

Soalan Lazim

  1. Q: Format fail apa yang boleh digunakan dengan Document AI untuk .NET? Itu Aspose.Words Document AI for .NET plugin menyokong format DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM, Word 2003 XML, dan Word 2007 XML.
  2. Q: Model apa yang boleh saya gunakan dengan Aspose.Words Document AI untuk .NET? Document AI untuk .NET boleh diintegrasikan dengan LLMs seperti Gemini, Claude, dan OpenAI.
 Melayu