Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Podsumowanie dokumentów jest cennym narzędziem do przeglądania treści, szybkiego wglądu lub przygotowywania streszczeń. Aspose.Words obsługuje podsumowanie dokumentów przy użyciu modeli opartych na AI, co ułatwia przetwarzanie długiego tekstu. Ta funkcja, dostępna w funkcji Aspose.Words opartej na AI, integruje zaawansowane generatywne modele językowe z OpenAI i Google, a także Claude’s antropiczne generatywne modele językowe. Lista obsługiwanych modeli jest dostępna w wyliczeniu AiModelType.
Możesz określić różne opcje podsumowania zawartości dokumentu. Użyj metody Summarize, aby wygenerować podsumowanie dokumentu. Możesz także ustawić długość podsumowania za pomocą właściwości SummaryLength.
Dzięki Aspose.Words implementacja podsumowania dokumentu jest prosta. Poniższy przykład kodu pokazuje, jak podsumować dokument przy użyciu 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.