JavaScript에서 DOCX를 요약합니다.

JavaScript를 사용하여 DOCX를 요약합니다.

OpenAI, Claude 및 Gemini와 같은 주요 언어 모델과의 원활한 통합을 통해 Node.js 애플리케이션에 대한 광범위한 AI 기반 DOCX 처리 기능을 제공합니다.

코드 스니펫 보기

JavaScript 에서 DOCX 문서 요약

JavaScript 에서 대규모 언어 모델(LLM)을 사용하여 DOCX 파일에서 핵심 정보를 프로그래밍 방식으로 추출합니다. Aspose.Words for Node.js via .NET 이 DOCX 문서를 읽고 원본 텍스트의 핵심 의미를 포착하는 간결한 요약을 생성합니다.

JavaScript 에서 DOCX 파일을 요약하는 방법

  • DOCX 파일을 Document 객체에 로드합니다
  • AI 모델을 선택합니다 — OpenAI (GPT-4o), Google (Gemini) 또는 Claude
  • 선택적 길이 설정과 함께 Summarize 메서드를 호출합니다
  • 결과 요약을 DOCX, PDF 또는 지원되는 형식으로 저장합니다

다음 예제는 JavaScript 에서 DOCX 문서를 요약하는 방법을 보여줍니다:

JavaScript에서 DOCX를 요약하는 예제 코드
목록에서 대상 형식 선택
코드 실행
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;
    }
}
코드 실행

JavaScript에서 DOCX를 요약하는 방법

  1. Aspose.Words for Node.js via .NET를 설치합니다.
  2. JavaScript 프로젝트에 라이브러리 참조(라이브러리 가져오기)를 추가합니다.
  3. JavaScript에서 소스 파일을 엽니다.
  4. 메서드를 호출하고 문서와 SummarizeOptions 매개변수를 전달합니다.
  5. 완료되면 필요한 형식의 새 파일로 저장할 수 있는 간결한 문서 요약을 받게 됩니다.

DOCX 파일을 요약하기 위한 Node.js via .NET 라이브러리

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.

System Requirements

This package is compatible with Node.js 14.17.0 or higher.

5%

Aspose 제품 업데이트 구독

월간 뉴스레터와 제안을 우편함으로 직접 받으십시오.

© Aspose Pty Ltd 2001-2026. 판권 소유.