-5

I am very new to Sentiment analysis. How can I judge if a given word or sentence is positive or negative. I have to implement it with java. I tried to read something like lingpipe, rapidminer tutorial, but I do not understand. In their examples they use a lot of data. In my case I do not have much data. All I have is a word or a sentence, lets say. I tried to read the questions from stackoverflow too. But they do not help me much. Thanks in advance.

Sasue Nie
  • 61
  • 1
  • 9
  • You might be able to use a web service to do this like http://developer.wordnik.com. If you want to do this your self there are many methods however some require a lexicon. – Graham Smith Jan 13 '12 at 01:57

4 Answers4

3

Computers don't know about a human thing like sentiment unless they learn it from examples that a human has labeled as positive or negative.

The goal of Machine Learning is in fact to make the most informed decision about a new example based on the empirical data of previous examples. Statistically, the more data, the better.

To "judge" the sentiment of a sentence, you'll need to have trained a model or classifier on some sentences labeled for sentiment. The classifier takes an unlabeled sentence as input and outputs a label: positive or negative.

First get training examples. I'm sure you can find some labeled sentiment data in the public domain. One of the best data set repositories is the UCI KDD Archive. You may then train a classifier on the data to judge new examples. There are a host of learning algorithm resources available. My favorites are jBoost, which can output a classifier as Java code, and Rapidminer, which is better for visual analysis.

calebds
  • 25,670
  • 9
  • 46
  • 74
1

You could use an existing web-service which is trained from prior data. For example:

Chatterbox Sentiment Detection API

Which has libraries for Java & Android.

(Disclosure: I work for the company that builds this API)

Stuart
  • 1,251
  • 2
  • 11
  • 18
0

This is not really programming related (neuro-linguistic programming is not programming), and in general there is no reliable solution.

My best idea is to make it work like Google "Pigeon"Rank, i.e. collect words and sentences, and then collect human feedback whether they are positive or negative, and then use Bayesian matching with this data.

P Varga
  • 19,174
  • 12
  • 70
  • 108
0

Your can try to use Wordnet for searching word's Semantic Orientation based on "distance" calculation between your word and "good" or "bad" words.Shorter distance will give you word's SO. Results seems will be a bit weak but not a lot of data(or time) is necessary for this approach.

ashingel
  • 494
  • 3
  • 11