以程式設計方式從文字和文件中提取關鍵資訊。使用 Java 中的大型語言模型 (LLM) 產生簡潔、資訊豐富的摘要,以捕捉文本的含義。軟體文本摘要的應用範圍廣泛且多元。文字摘要可用於提供有關當前事件的最新資訊。透過將文字摘要功能整合到您的軟體中,您不僅可以提高工作效率,還可以透過盡快存取重要數據來改善決策。.
Aspose.Words 和大型語言模型之間的交互作用建構在 REST 架構之上。此方法可在您的 Java 應用程式和各種 AI 服務之間提供可靠且安全的通訊。要設定驗證,您需要指定您的私鑰 API 和提供您所需模型的 AI 服務的 endpoint(GoogleAiModel、OpenAiModel)。有關受支援的 LLM 類型的完整列表,請參閱 API Reference。.
立即體驗 Java 智慧文字處理的未來!!
// Repository path: https://releases.aspose.com/java/repo/
// Maven, where 'ver' - Aspose.Words version number, for example, 24.4.
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>ver</version>
<classifier>jdk17</classifier>
</dependency>
複製
// Repository path: https://releases.aspose.com/java/repo/
// Gradle, where 'ver' - Aspose.Words version number, for example, 24.4.
compile(group: 'com.aspose', name: 'aspose-words', version: 'ver', classifier: 'jdk17')
複製
// Repository path: https://releases.aspose.com/java/repo/
// Ivy, where 'ver' - Aspose.Words version number, for example, 24.4.
<dependency org="com.aspose" name="aspose-words" rev="ver">
<artifact name="aspose-words" m:classifier="jdk17" ext="jar"/>
</dependency>
複製
// Repository path: https://releases.aspose.com/java/repo/
// Sbt, where 'ver' - Aspose.Words version number, for example, 24.4.
libraryDependencies += "com.aspose" % "aspose-words" % "ver"
複製
Document doc = new Document("Document.docx");
String apiKey = System.getenv("API_KEY");
// 使用 OpenAI 或 Google 產生語言模型。
IAiModelText model = (IAiModelText) AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);
SummarizeOptions options = new SummarizeOptions();
options.setSummaryLength(SummaryLength.SHORT);
Document summary = model.summarize(doc, options);
summary.save("Output.pdf")
我們在Maven存儲庫中託管我們的 Java 'Aspose.Words for Java' 是一個常見的包含字節碼的 JAR 請按照有關如何將其安裝到 Java 開發人員環境的分步說明進行操作。
Java SE 7 和更新的 Java 版本。 Java SE 6 提供了一個單獨的包,以防您不得不使用這個過時的 JRE 。
我們的 Java 包是跨平台的,可以在所有具有 JVM 實現的 Microsoft Windows 、Linux、macOS、Android 和 iOS。
有關可選包依賴項的信息,例如 JogAmp JOGL 、 Harfbuzz 字體引擎、 Java Advanced Imaging JAI ,請參閱產品文檔。