Aspose.Words for Node.js via .NET OpenAI, Google, Claude AI 모델을 사용하여 문서의 문법 오류를 감지하고 강조 표시합니다. CheckGrammar 메서드는 DOC, DOCX, RTF, PDF, HTML, Markdown, ODT, TXT, EPUB 파일을 분석하고 문법 문제를 표시합니다 — 수동 교정 없이도 깔끔하고 전문적인 콘텐츠를 제공할 수 있도록 도와줍니다.
인증을 위해서는 선택한 AI 제공업체의 API 키가 필요합니다. 지원되는 모델 전체 목록은 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의 생성 언어 모델을 사용하십시오.
const model = aw.AI.AiModel.createGpt4OMini();
model.setApiKey(apiKey);
const grammarOptions = new aw.AI.CheckGrammarOptions();
grammarOptions.improveStylistics = true;
const proofedDoc = model.checkGrammar(doc, grammarOptions);
proofedDoc.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 grammarOptions = new aw.AI.CheckGrammarOptions();
grammarOptions.improveStylistics = true;
const proofedDoc = model.checkGrammar(doc, grammarOptions);
proofedDoc.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.