プログラムでテキストやドキュメントから重要な情報を抽出します。 JavaScript の大きな言語モデル(LLM)を使用して、テキストの意味をキャプチャする簡潔で有益な要約を生成します。 ソフトウェアテキスト要約のアプリケーションは広大で多様です。 テキスト要約は、現在のイベントに関する最新の情報を提供するために使用することができます。 テキスト要約機能をソフトウェアに統合することで、生産性を向上させるだけでなく、重要なデータにできるだけ早くアクセスすることで意思決定を向上させることができます。
Aspose.Wordsと大きな言語モデル間の相互作用はRESTアーキテクチャ上に構築されています。 このアプローチは、Node.js via .NET アプリケーションとさまざまなAIサービスとの間の信頼性の高い安全な通信を提供します。 認証を設定するには、プライベートAPIキーと、必要なモデルを提供するAIサービスのendpointを指定する必要があります(OpenAiModel, GoogleAiModel, AnthropicAiModel). サポートされているLLM型の完全なリストについては、API Referenceを参照してください。
今すぐ JavaScript でインテリジェントなテキスト処理の未来を体験してください。
npm install @aspose/words
コピー
const aw = require('@aspose/words');
const doc = new aw.Document("Document.docx");
const apiKey = process.env.API_KEY;
// OpenAI または Google の生成言語モデルを使用します。
const model = aw.AI.AiModel.createGpt4OMini();
model.setApiKey(apiKey);
const options = new aw.AI.SummarizeOptions();
options.summaryLength = aw.AI.SummaryLength.Short;
const summary = model.summarize(doc, options);
summary.save("Output.docx");
const aw = require('@aspose/words');
const doc = new aw.Document("Document.docx");
// Pass an empty string if the self-hosted model does not require an API key.
const model = new CustomAiModel("my-model-24b", "https://your-server.com/v1");
model.setApiKey("");
const options = new aw.AI.SummarizeOptions();
options.summaryLength = aw.AI.SummaryLength.Short;
const summary = model.summarize(doc, options);
summary.save("Output.docx");
class CustomAiModel extends aw.AI.OpenAiModel {
constructor(name, url) {
super(name);
this._url = url;
}
get url() {
return this._url;
}
}
We host our Node.js via .Net packages in NPM repositories. Please follow the step-by-step instructions on how to install "Aspose.Words for Node.js via .NET" to your developer environment.
This package is compatible with Node.js 14.17.0 or higher.