# ml-sentiment

> Machine learner sentiment classifier, with ability to negate words, with english and german

Latest version **2.0.7** (published 2017-02-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install ml-sentiment
pnpm add ml-sentiment
yarn add ml-sentiment
bun add ml-sentiment
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.7 |
| Published | 2017-02-03 |
| First published | 2015-12-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36 |
| Maintainers | syzer |
| Keywords | machine learning, sentiment, analyser, nlp, ml, natural language processing |

## Links

- npm: https://www.npmjs.com/package/ml-sentiment
- Repository: https://github.com/syzer/sentiment-analyser
- Homepage: https://github.com/syzer/sentiment-analyser#readme
- Issues: https://github.com/syzer/sentiment-analyser/issues
- npm.io page: https://npm.io/package/ml-sentiment

## Dependencies (1)

- [lodash-fp](https://npm.io/package/lodash-fp.md) ^0.10.4

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 2.0.7 (latest) — 2017-02-03
- 2.0.6 — 2016-06-17
- 2.0.5 — 2016-06-17
- 2.0.4 — 2016-06-17
- 2.0.3 — 2016-06-17
- 2.0.2 — 2016-06-17
- 1.1.5 — 2016-05-23
- 1.1.3 — 2015-12-10
- 1.0.3 — 2015-12-10
- 1.0.1 — 2015-12-10
- 1.0.0 — 2015-12-10

## README

[![npm version](https://badge.fury.io/js/ml-sentiment.svg)](https://badge.fury.io/js/ml-sentiment)
[![build status](http://img.shields.io/travis/syzer/sentiment-analyser.svg?style=flat)](http://travis-ci.org/syzer/sentiment-analyser)
[![Dependency Status](https://david-dm.org/syzer/sentiment-analyser.svg)](https://david-dm.org/syzer/sentiment-analyser)
[![devDependency Status](https://david-dm.org/syzer/sentiment-analyser/dev-status.svg)](https://david-dm.org/syzer/sentiment-analyser#info=devDependencies)
[![Code Coverage](https://img.shields.io/codecov/c/github/syzer/sentiment-analyser/master.svg)](https://codecov.io/github/syzer/sentiment-analyser?branch=master)
[![Downloads Today](https://img.shields.io/npm/dt/ml-sentiment.svg)](https://badge.fury.io/js/ml-sentiment)
[![Downloads Month](https://img.shields.io/npm/dm/ml-sentiment.svg)](https://badge.fury.io/js/ml-sentiment)

# Wat

Simple text sentiment analyser.


# Install

```sh
npm install ml-sentiment
```

### Usage

```js
var ml = require('ml-sentiment')
ml.classify('Rainy day but still in a good mood')
//=> 2 ... (overall positive sentiment)
```


# How

Returns a positive number for positive sentiment association
and negative number for negative sentiment association.

#### Basics

```js
var longSentence = `Transform json to csv data. The difference to my other
module json2csv is json2csv-stream uses streams for transforming the incoming
data. The module is built with the new streaming API from Node.js v0.10.0 but
maintains backwards compatibility to earlier Node.js versions. Listen for
header and line events or pipe the data directly to a readable stream.`

var ml = require('ml-sentiment')()
ml.classify(longSentence)
//=> 0 ... (very boring encyclopedia like text)

ml.classify('Rainy day but still in a good mood')
//=> 2 ... (overall positive sentiment)
```

#### Negations

```js
var ml = require('ml-sentiment')()
ml.classify(`not awesome`)
//=> -3 (negative)

ml.classify(`awesome`)
//=> 3 (positive)
```

#### German

```js
var ml = require('ml-sentiment')({lang: 'de'})
ml.classify(`Es ist nicht so toll`)
//=> (negative)
```

# Credits

Original model and data:
Finn Årup Nielsen, "A new ANEW: Evaluation of a word list for
sentiment analysis in microblogs", http://arxiv.org/abs/1103.2903

For german model:
R. Remus, U. Quasthoff & G. Heyer: SentiWS - a Publicly Available German-language Resource for Sentiment Analysis.
In: Proceedings of the 7th International Language Ressources and Evaluation (LREC'10), 2010

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