Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Shrnutí dokumentů je cenným nástrojem pro kontrolu obsahu, rychlé postřehy nebo přípravu abstraktů. Aspose.Words podporuje sumarizaci dokumentů pomocí modelů poháněných AI, což usnadňuje zpracování dlouhého textu. Tato funkce, která je k dispozici ve funkci AI založené na Aspose.Words, integruje pokročilé generativní jazykové modely z OpenAI a Google a také Claude’s antropické generativní jazykové modely. Seznam podporovaných modelů je k dispozici ve výčtu AiModelType.
Můžete zadat různé možnosti pro shrnutí obsahu dokumentu. Pomocí metody Summarize Vygenerujte souhrn dokumentu. Můžete také nastavit délku souhrnu pomocí vlastnosti SummaryLength.
S Aspose.Words je shrnutí implementačního dokumentu jednoduché. Následující příklad kódu ukazuje, jak shrnout dokument pomocí modelu GPT-4o:
Document firstDoc = new Document(getMyDir() + "Big document.docx");
Document secondDoc = new Document(getMyDir() + "Document.docx");
String apiKey = System.getenv("API_KEY");
// Use OpenAI or Google generative language models.
IAiModelText model = (IAiModelText)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);
Document oneDocumentSummary = model.summarize(firstDoc, new SummarizeOptions(); { oneDocumentSummary.setSummaryLength(SummaryLength.SHORT); });
oneDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.One.docx");
Document multiDocumentSummary = model.summarize(new Document[] { firstDoc, secondDoc }, new SummarizeOptions(); { multiDocumentSummary.setSummaryLength(SummaryLength.LONG); });
multiDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.Multi.docx");
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.