تلخيص وثيقة

Contents
[ ]

يعد تلخيص المستندات أداة قيمة لمراجعة المحتوى أو الرؤى السريعة أو إعداد الملخصات. Aspose.Words يدعم تلخيص المستندات باستخدام نماذج تعمل بالطاقة AI، مما يسهل معالجة النص الطويل. هذه الميزة، المتوفرة في Aspose.Words.AI مساحة الاسم، تدمج نماذج اللغة التوليدية المتقدمة من OpenAI و Google، وكذلك Claude’s نماذج اللغة التوليدية البشرية. تتوفر قائمة النماذج المدعومة في AiModelType تعداد.

يمكنك تحديد خيارات مختلفة لتلخيص محتوى المستند. استخدم طريقة Summarize لإنشاء ملخص للمستند الخاص بك. يمكنك أيضا تعيين طول الملخص باستخدام خاصية SummaryLength.

باستخدام Aspose.Words، يكون تنفيذ تلخيص المستندات أمرا بسيطا. يوضح مثال الكود التالي كيفية تلخيص مستند باستخدام نموذج GPT-4o:

// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git.
Document firstDoc = new Document(MyDir + "Big document.docx");
Document secondDoc = new Document(MyDir + "Document.docx");
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Use OpenAI or Google generative language models.
IAiModelText 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(ArtifactsDir + "AI.AiSummarize.One.docx");
options.SummaryLength = SummaryLength.Long;
Document multiDocumentSummary = model.Summarize(new Document[] { firstDoc, secondDoc }, options);
multiDocumentSummary.Save(ArtifactsDir + "AI.AiSummarize.Multi.docx");
view raw ai-summarize.cs hosted with ❤ by GitHub