text-summarizer-ai

1.0.1 • Public • Published

Text Summarizer AI 🚀

Node Build

A JavaScript library for summarizing text using the TextRank algorithm.

Installation

To install the package, run the following command in your project directory:

npm install text-summarizer-ai

or

yarn add text-summarizer-ai

Usage

import TextSummarizer from 'text-summarizer-ai';

const textSummarizer = new TextSummarizer();
const text = "This is the text that you want to summarize. It can be a long article or a short paragraph. The function will take the text and condense it into a summary using the TextRank algorithm.";
const numSentences = 3;
const summary = textSummarizer.summarizeText(text, numSentences);
console.log(summary);

This will output an array containing the top 3 sentences from the text, based on the TextRank algorithm's analysis of the text.

API

summarizeText(text: string, numSentences: number): string[] This function takes a text and a number of sentences as arguments, and returns an array of sentences that summarize the text.

Contributing

If you find any bugs or have suggestions for improvements, please open an issue or a pull request.

Licensing

This project is licensed under the ISC License.

Readme

Keywords

Package Sidebar

Install

npm i text-summarizer-ai

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

3.94 kB

Total Files

4

Last publish

Collaborators

  • laurentiu_bitheap