Skip to content

Unsupervised text summarization using the lexrank algorithm

License

Notifications You must be signed in to change notification settings

gorango/lexrank.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0d5e900 · Jul 14, 2022

History

54 Commits
Sep 29, 2021
Mar 13, 2017
Oct 3, 2021
Mar 13, 2017
Jul 25, 2021
Sep 29, 2021
Oct 3, 2021
Jul 24, 2021
Jul 25, 2021
Jul 14, 2022
Oct 5, 2021
Jul 25, 2021

Repository files navigation

lexrank.js

Build Coverage Downloads Size

Unsupervised text summarization using the Lexrank algorithm.

Usage

Install from npm

npm i --save lexrank.js

In your script:

import lexrank from 'lexrank.js'

const result = lexrank(text)

Returns

Nested arrays of paragraphs containing sentences with ranked results.

// paragraphs array
[
  // sentences array
  [{
    weight: <Number(0-1)>    // relevance score
    text: <String>           // original sentence string
    index: <Number>          // global sentence index
  }],
  [ ... ]
]

Tests

Run npm test to run tests.

Run npm run coverage to produce a test coverage report.

License

MIT © Goran Spasojevic

Packages

No packages published