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?
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.
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.
Languages frequently distinguish grammatically three moods: the indicative, the imperative, and the subjunctive.
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.
Hand-classify a bunch of sentences by mood. Then feed these into a naive Bayes classifier. Use something like SpamBayes as a starting point.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With