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 przestrzeni nazw Aspose.Words.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:
void AiSummarize()
{
auto firstDoc = MakeObject<Document>(MyDir + u"Big document.docx");
auto secondDoc = MakeObject<Document>(MyDir + u"Document.docx");
SharedPtr<IAiModelText> model = System::ExplicitCast<OpenAiModel>(MakeObject<AiModel>()->Create(AiModelType::Gpt4OMini)->WithApiKey(u"API_KEY"))->WithOrganization(u"Organization")->WithProject(u"Project");
auto options = MakeObject<SummarizeOptions>();
options->set_SummaryLength(SummaryLength::Short);
auto firstDocumentSummary = model->Summarize(firstDoc, options);
firstDocumentSummary->Save(ArtifactsDir + u"AI.AiSummarize.One.docx");
System::ArrayPtr<System::SharedPtr<Document>> documents = System::MakeArray<System::SharedPtr<Document>>(2);
documents[0] = firstDoc;
documents[1] = secondDoc;
options->set_SummaryLength(SummaryLength::Long);
auto multiDocumentSummary = model->Summarize(documents, options);
firstDocumentSummary->Save(ArtifactsDir + u"AI.AiSummarize.Multi.docx");
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.