GithubHelp home page GithubHelp logo

anglc / nlp-sentimentclassification Goto Github PK

View Code? Open in Web Editor NEW

This project forked from morris821028/nlp-sentimentclassification

0.0 2.0 0.0 10.74 MB

project in school. Passive-Aggressive Algorithm, Language Modeling, and Winnow algorithm.

Java 100.00%

nlp-sentimentclassification's Introduction

NLP SentimentClassification

blog content

Reference

2006 Comparative Experiments on Sentiment Classification for Online Product Reviews. Hang Cui, Vibhu Mittal, Mayur Datar here

Data Crawler

To Do

  • add more features

Complete

  • Simple Passive-Aggressive Algorithm here
  • Simple Winnow algorithm here
  • Simple Language Modeling here
  • Passive-Aggressive Algorithm & Winnow algorithm adjust training here

Usage

  • JavaSE-1.7
  • Eclipse

If you compiler error with NOT FOUND MAIN CLASS on eclipse, find menu bar Project > Clean ... and run it to rebuild /bin.

Options

prompt> java -jar NLP-SentimentClassification.jar

Usage: java -jar NLP-SentimentClassification.jar [options]

Input Options

	-path <TRAINING_PATH>	training set folder path. default <TRAINING_PATH>="training_set".

	-tpath <TEST_PATH>		user test folder path. default <TEST_PATH>="user_test".

Processing Options	
	
	-n <NGRAM_MAX>			n-grams size. default <NGRAM_MAX>="3".

	-top <FEATURE_MAX>		pick the number of feature n-grams. default <FEATURE_MAX>="40000".

	-cross <CROSS_TIMES>	default <CROSS_TIMES>="5".

	-crosspart <RATIO>		pick <RATIO> : 5 = TRAINING : OTHER, default <RATIO>="5".

	-ittime <ITCOUNT> 		training model, default <ITCOUNT>="20"

	-oittime <ITCOUNT>		online training model, default <ITCOUNT>="20"

	-ui 					call UI interface.

Sample

Sample 1

java -jar NLP-SentimentClassification.jar -n 3 -top 40000 -path training_set -tpath user_test

Sample 2

java -jar NLP-SentimentClassification.jar -n 3 -top 10000 -path training_set2 -tpath user_test

output with markdown format, and classifier will output under path/output/. For example, ouotput/neg/Adaboost.txt.

<TRAINING_PATH> folder must give the file dictionary like this

.
├── extra		// support data, like dictionary, ban list, ...
├── neg 		// negative processed data 
└── pos 		// positive processed data

<TEST_PATH> folder must give the file dictionary like this

.
├── neg 		// test data which expected negative
└── pos 		// test data which expected positive

If you want to test unknown data, put them in user_test/neg or user_test/pos folder. Program will generate result of classifier to output/neg or output/pos folder.

Good Luck.

nlp-sentimentclassification's People

Contributors

morris821028 avatar moporgic avatar flowerhop avatar irisshu avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.