Document AI

The Aspose.Words Document AI for .NET ปลั๊กอินช่วยให้นักพัฒนาสามารถแปลหรือสรุปเอกสารและตรวจสอบไวยากรณ์ของพวกเขาได้ รวมเข้ากับ LLMs เช่น Gemini, Claude, และ OpenAI.

การติดตั้งและตั้งค่า

  1. ติดตั้ง Aspose.Words สำหรับแพ็กเกจ .NET ผ่าน NuGet หรือ Package Manager Console.
  2. กำหนดค่า 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, and Word 2007 XML.

แปลเอกสาร

แปลเอกสารของคุณเป็นภาษาที่แสดงใน the ภาษา การนับรายการ:

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 ประโยค
  • Short – 3-4 ประโยค
  • Medium – 5-6 ประโยค
  • Long – 7-10 ประโยค
  • VeryLong – 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? นี้ Aspose.Words Document AI for .NET ปลั๊กอินรองรับรูปแบบ 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 ได้.
 แบบไทย