Deeply Moving: Deep Learning for Sentiment Analysis
nlp.stanford.edu
nlp.stanford.edu
The really neat part is moving away from bag of words representations. Bag of words was always a bit of a hack. But seriously, watch those videos, it will give you a good idea on how it all works, the op is using similar methods.
Edit: thanks gallamine, I fixed the link
http://nlp.stanford.edu/courses/NAACL2013/
Take a look at a recent homework assignment they had to do with Named Entity Recognition and Deep Learning: http://nlp.stanford.edu/~socherr/pa4_ner.pdf
It's good to see neural networks being leveraged as they are. Conditional Random Fields have been dominant for sequence based classifiers for a while. We've been needing to push the envelope a bit further.
Are the risks larger because we are successful?
"larger because we are" is marked as positive, "successful" is marked as very positive, the rest are marked as neutral. But the entire sentence is marked as negative (which to me it certainly reads negative).
// Negative > This is shit.
// Positive > This is the shit.
Most engines can't sort that out. I'm definitely going to take a more in-depth look at this.
That is to say, people generally aren't describing the physical material occupying a toilet in a corpus of movie reviews.
> I have seen many good movies, this one is not one of them.
> All movies, except this one, are good.
> I thought this movie was going to be bad, but I was wrong.
which rate positive, positive and negative.
I'm full of hope that the modern neural net and linear algebra type methods will eventually crack this though!
Without knowing who said something or in what context it was said, even humans would fail to accurately detect sarcasm. Here are some hasty examples that could vary, depending on the author or situation:
"Michael Bay really outdid himself on that one." "That Kanye West song is so well-written." "It'd fun to build that PHP."
You also bring up a very good point about humans being able to barely detect it. It's hard to infer from text without tone a good portion of the time.
It'd be neat to see what we could do with tone as an input feature (obviously we couldn't get that most of the time) but maybe if enough tech becomes available that voice inputs are common, sarcasm can be a relevant enough problem to solve.
In general, I know it's not really worth it to try to solve (that I could think of immediately anyways) aside from "just because".
That being said: ambiguity is ambiguous. What can you do aside from approximate as best you can?
miket has already replied with a well-established lexical parser. The Stanford parser is one of the most robust out there, you could also go for the BLLIP (or Charniak or Charniak and Johnson) re-ranking parser [1] that although a bit old and fiddly (the GitHub version is very solid though) tends to perform well.
However, both the Stanford and BLLIP parsers are constituency parsers (now we are going to go all linguistic here) and there is an alternate paradigm of dependency grammars [2]. I have heard a couple of times that Google is running a variant of the MaltParser [3] in-house and it is a very solid piece of work (the command-line interface requires some patience though, but there is plenty of documentation). People for example in Information Extraction (IE) tends to favour dependency grammars, probably since you get relevant modifiers closer to your point of interest in the tree.
Now, we could also go into richer grammars like Combinatory Categorial Grammar (CCG) [4] and Head-driven Phrase Structure Grammar (HPSG) [5] but I think this reply is long enough by now...
Personally I favour dependency parsing since there is more annotated data for it across plenty of languages. Also, the paradigm can cope with a lot of linguistic wonkiness that is very much present in language other than English (free word order and non-projective structures for example)
[1]: https://github.com/dmcc/bllip-parser
[2]: http://en.wikipedia.org/wiki/Dependency_grammar
[4]: http://en.wikipedia.org/wiki/Combinatory_categorial_grammar
[5]: http://en.wikipedia.org/wiki/Head-driven_phrase_structure_gr...
Wait, that is all that's necessary to invoke the term "deep learning"?? Wow. Wikipedia seems to agree. I had thought there was something more to this buzzword than "slightly less shallow heuristic guesswork than the AI you already know and love".
Maybe you still find deep-learning disappointing, but there have been some successes from having the computer learn multiple levels of internal structure/representation from data.
And I disagree that trying to actually understand sentences is merely "slightly less shallow" than existing sentiment analysis systems (which, for the most part, treat sentences a just a bunch of words, count the positive and negative words, and take the average).