Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including sentiment-and-keyword with all npm packages installed. Try it out:

var sentimentAndKeyword = require("sentiment-and-keyword")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

sentiment-and-keyword v1.0.8

Analyze strings based on sentiment and keyword strength using synonyms and related concepts

sentiment-and-keyword

Analyze strings based on sentiment and keyword strength using synonyms and related concepts.

See https://www.npmjs.com/package/sentiment-and-keyword

Install

npm i sentiment-and-keyword

Usage

const sentkey = require('sentiment-and-keyword');

// Set your text to analyzed *required
var text = "The text you want to be analyzed";
// Set your keywords to be used for analysis *required
var keywords = ["Independent", "Honest", "Collaborative", "Brilliant", "Caring"];

sentkey.analyze(text,keywords,function(err,res){
    if(err){
        console.log(err);
        return
    } 
    console.log(res);
})

Result parse

{
  "text": "The text you want to be analyzed",
  "sentiment_score": 0,
  "sentiment_status": "Neutral",
  "sentiment_calculation":  [  
                              {"Independent": 0},
                              {"Honest": 0},
                              {"Collaborative": 0},
                              {"Brilliant": 0},
                              {"Caring": 0} 
                            ],
  "sentiment_comparative": "0",
  "strength_tracker": [ 
                        {"keyword": "Independent", "score": 0},
                        {"keyword": "Honest", "score": 0},
                        {"keyword": "Collaborative", "score": 0},
                        {"keyword": "Brilliant", "score": 0},
                        {"keyword": "Caring", "score": 0} 
                      ],
  "graph_data": [ 
                  [ 
                    "Keyword", 
                    "Percentage", 
                    { "role": "style" }
                  ],
                  ["keyword1", 0, "#color"],
                  ["keyword3", 0, "#color"],
                  ["keyword4", 0, "#color"],
                  ["keyword5", 0, "#color"],
                  ["keyword6", 0, "#color"],  
                ]
};

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free