subject-extractor
This node package extracts the main topic/subject or topics given a string or sentence, that simple! The program also tries to do simple formatting like capitalization of names (first characters) and places.
This package uses compromise under the hood
Installation
npm install subject-extractor
Usage
extract
Returns a string, denoting the best topic or subject given a string or sentence
var subjects = //example containing namesconsole;> "Jose Mourinho" //exmaple containing placesconsole> "CALIFORNIA"
extractAll
Returns an array of topics or subjects from a given string or sentence
var subjects = //news article titleconsole;> "[ 'netflix', 'Password Sharing', 'Password' ]"