Powerful text summarization algorithms from research papers and dedicated research.
npm install nlpsumnode test.js and the summaries and debug data will be written into the /output folder.
/research papers)
var nlpsum = require('nlpsum');
var sum = new nlpsum();
var summary = sum.fractalSummary(content, 6); // output 6 sentences
// output the summary, as a string
`
#### Output ####
`
The brain of one monkey has been used to control the movements of another, "avatar", monkey, US scientists report..
Brain scans read the master monkey's mind and were used to electrically stimulate the avatar's spinal cord, resulting in controlled movement..
Damage to the spinal cord can stop the flow of information from the brain to the body, leaving people unable to walk or feed themselves..
The scientists at Harvard Medical School said they could not justify paralysing a monkey.Instead, two were used - a master monkey and a sedated avatar..
The avatar had 36 electrodes implanted in the spinal cord and tests were performed to see how stimulating different combinations of electrodes affected movement..
The two monkeys were then hooked up so that the brain scans in one controlled movements in real time in the other.
`
$3
A basic algorithm that selects sentences based on the sum of their words' weights relative to the document.
This algorithm doesn't care about paragraphs, and will work with most texts and articles.
`
var nlpsum = require('nlpsum');
var sum = new nlpsum();
var summary = sum.wordFrequencySummary(content, 6); // output 6 sentences
// output the summary, as a string
`
#### Output ####
`
The brain of one monkey has been used to control the movements of another, "avatar", monkey, US scientists report.
Brain scans read the master monkey's mind and were used to electrically stimulate the avatar's spinal cord, resulting in controlled movement.
The scientists at Harvard Medical School said they could not justify paralysing a monkey.Instead, two were used - a master monkey and a sedated avatar.
The avatar had 36 electrodes implanted in the spinal cord and tests were performed to see how stimulating different combinations of electrodes affected movement.
The two monkeys were then hooked up so that the brain scans in one controlled movements in real time in the other.
`
$3
An update of the Word Frequency algorithm, that gives more weight to the beginning and end of the text, and less weight to the center.
This algorithm works best for scientific papers and articles based around an introduction and conclusion.
`
var nlpsum = require('nlpsum');
var sum = new nlpsum();
var summary = sum.sinFrequencySummary(content, 6); // output 6 sentences
// output the summary, as a string
`
#### Output ####
`
The brain of one monkey has been used to control the movements of another, "avatar", monkey, US scientists report.
Brain scans read the master monkey's mind and were used to electrically stimulate the avatar's spinal cord, resulting in controlled movement.
The scientists at Harvard Medical School said they could not justify paralysing a monkey.Instead, two were used - a master monkey and a sedated avatar.
The avatar had 36 electrodes implanted in the spinal cord and tests were performed to see how stimulating different combinations of electrodes affected movement.
The two monkeys were then hooked up so that the brain scans in one controlled movements in real time in the other.
`
$3
An update of the Sin Transform Frequency algorithm, that gives more weight to the words located at the beginning and end of the text, and less weight to the words in the middle.
This weight is compounded everytime the word is found, witht he value based on its location.
As a result, the algorithm is able to better grasp the main subject of the text, without requiring any machine learning.
This algorithm works well on any kind of text.
`
var nlpsum = require('nlpsum');
var sum = new nlpsum();
var summary = sum.sinWordFrequencySummary(content, 6); // output 6 sentences
// output the summary, as a string
`
#### Output ####
`
The brain of one monkey has been used to control the movements of another, "avatar", monkey, US scientists report.
Brain scans read the master monkey's mind and were used to electrically stimulate the avatar's spinal cord, resulting in controlled movement.
The scientists at Harvard Medical School said they could not justify paralysing a monkey.Instead, two were used - a master monkey and a sedated avatar.
The avatar had 36 electrodes implanted in the spinal cord and tests were performed to see how stimulating different combinations of electrodes affected movement.
In 98% of tests, the master could correctly control the avatar's arm.
``