# text-summarisation

> Summarize text according to specific sentence and translate tp any language

Latest version **2.0.0** (published 2019-03-16) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install text-summarisation
pnpm add text-summarisation
yarn add text-summarisation
bun add text-summarisation
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-03-16 |
| First published | 2019-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 101.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Naimur Rahman Sourov |
| Maintainers | naimur103 |
| Keywords | summarize, summarize-text, translate, node, javascript |

## Links

- npm: https://www.npmjs.com/package/text-summarisation
- Repository: https://bitbucket.org/naimur103/text-summarize
- Homepage: https://bitbucket.org/naimur103/text-summarize#readme
- Issues: https://bitbucket.org/naimur103/text-summarize/issues
- npm.io page: https://npm.io/package/text-summarisation

## Dependencies (2)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.3.0
- [@k3rn31p4nic/google-translate-api](https://npm.io/package/@k3rn31p4nic/google-translate-api.md) ^1.0.5

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2019-03-16
- 1.0.0 — 2019-03-16

## README

# 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.

```javascript

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 function returns a Promise
summarize(text).then(data => console.log(data));
// output: 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.

```

You can pass custom target sentence that you want after summarize the text.

```javascript

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 function returns a Promise
summarize(text, { sentences: 2 }).then(data => console.log(data));
// output: Alice and Bob are friends. Alice's cuddliness and Bob's cuteness allow them to reach their goals.

```
You can pass language to translate the summarized text.

```javascript

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 function returns a Promise
summarize(text, { sentences: 2, translate: 'bn' }).then(data => console.log(data));
// output: এলিস এবং বব বন্ধু। অ্যালিসের কুশ্রীতা এবং বব এর কর্তৃত্ব তাদেরকে তাদের লক্ষ্যে পৌছাতে দেয়।

```

The options can be

```javascript

const options = {
  sentences: 2, // return specific lines of summary
  translate: 'bn' // translate the summary into the target language
}
summarize(text, options).then(data => console.log(data));

```
### Defaults
- `sentence` is set to `10`.

---
_Source: https://npm.io/package/text-summarisation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
