A library that creates summaries based on a text.
npm install text-summarizer-aiA JavaScript library for summarizing text using the TextRank algorithm.
To install the package, run the following command in your project directory:
``sh`
npm install text-summarizer-ai`
orsh`
yarn add text-summarizer-ai`Usage
javascript
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.