Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bucketing sentences by mood

Let's start with a simple problem. Let's say that I have a 350 char sentence and would like to bucket the sentence into either a "Good mood" bucket or a "Bad mood" bucket.

What would be the best way to design an algorithm to bucket the sentence?

like image 863
locoboy Avatar asked Jul 29 '11 08:07

locoboy


People also ask

What are the 4 sentence moods?

Indicative, imperative, subjunctiveand infinitive are the four moods of English verbs. All manners and moods are expressed through these four verbs. While verb tenses (present, past and future) are used to talk about time, the four mood verbs show states, attitudes and reality.

What is an example of a mood sentence?

She was in a mood for brooding on the past. We were late for work but in a great mood when we finally arrived. After her life in the country, and in her present serious mood, all this seemed grotesque and amazing to Natasha. Maybe his mood would improve, anyway.

What are the 3 moods in grammar?

Languages frequently distinguish grammatically three moods: the indicative, the imperative, and the subjunctive.

What is an example of subjunctive mood?

The subjunctive mood is for expressing wishes, proposals, suggestions, or imagined situations. For example, in the sentence "I wish it were Friday", the verb "were" is written in the subjunctive mood.


2 Answers

Hand-classify a bunch of sentences by mood. Then feed these into a naive Bayes classifier. Use something like SpamBayes as a starting point.

like image 194
Michael J. Barber Avatar answered Sep 28 '22 00:09

Michael J. Barber


A simple/naive suggestion would be to either first split each sentence down into individual words, or use a regex and scan for specific words from both a "positive" list (e.g. "like", "happy", "can", "do", etc) and a "negative" list ("dislike", "sad", "can't", "don't"), work out which is more prevalent in each sentence, and bucket it accordingly.

Depending on your requirements and data-set this may be adequate, or you might want to investigate more advanced techniques like Bayesian filtering.

like image 28
Jon Grant Avatar answered Sep 28 '22 02:09

Jon Grant