Summarize Texts
This package can be used to summarize longs texts to custom summarized sentence.
How to use?
install the package
using npm
npm install text-summarize
using yarn
yarn add text-summarize
Usage
You can just simply call the function and get the summary of the text without passing your target sentence.
const summarize = require("text-summarize");
const text = "Alice and Bob are friends. Alice is fun and cuddly. Bob is cute and quirky. Together they go on wonderful adventures in the land of tomorrow. Alice's cuddliness and Bob's cuteness allow them to reach their goals. But before they get to them, they have to go past their mortal enemy — Mr. Boredom. He is ugly and mean. They will surely defeat him. He is no match for their abilities.";
summarize(text).then(data => console.log(data));
You can pass custom target sentence that you want after summarize the text.
const summarize = require("text-summarize");
const text = "Alice and Bob are friends. Alice is fun and cuddly. Bob is cute and quirky. Together they go on wonderful adventures in the land of tomorrow. Alice's cuddliness and Bob's cuteness allow them to reach their goals. But before they get to them, they have to go past their mortal enemy — Mr. Boredom. He is ugly and mean. They will surely defeat him. He is no match for their abilities.";
summarize(text, { sentences: 2 }).then(data => console.log(data));
You can pass language to translate the summarized text.
const summarize = require("text-summarize");
const text = "Alice and Bob are friends. Alice is fun and cuddly. Bob is cute and quirky. Together they go on wonderful adventures in the land of tomorrow. Alice's cuddliness and Bob's cuteness allow them to reach their goals. But before they get to them, they have to go past their mortal enemy — Mr. Boredom. He is ugly and mean. They will surely defeat him. He is no match for their abilities.";
summarize(text, { sentences: 2, translate: 'bn' }).then(data => console.log(data));
The options can be
const options = {
sentences: 2,
translate: 'bn'
}
summarize(text, options).then(data => console.log(data));
Defaults