threefoldo

threefoldo / ChineseSentimentAnalysis / 0.3.2

README.md

Overview

Very basic sentiment analysis for Chinese text. At present, it only supports two modes: dictionary lookup and LSTM. More models will be added later.

Usage

Input

Specify the model, predict the sentiment of the text.

In 'dict' mode, the sentiment value is calculated based on how many 'positive' words and 'negative' words in the text.

In 'lstm' mode, the sentiment is the direct output of a single layer, binary classification LSTM network.

ParameterDescription
modetwo options: dict, or lstm
documentA string no more than 1000 characters

Output

The sentiment of the text.

ParameterDescription
sentiment0: negative, 1: positive

Examples

Input: { "model":"lstm", "document": "听说梦幻寻游记很好看,可惜一直没时间" }

Output: { "sentiment": 0 }