6
$\begingroup$

I have been working on a project involving the new Classify[] function. More specifically, the sentiment analysis function. It works perfectly well, as in the documentation:

Classify["Sentiment", { "I love this movie", "so depressed today", "My phone broke again"}]

Returns:

{Positive, Negative, Negative}

But I fail to find any documentation on "how" this is computed, what polarity algorithm is used...

Is it possible to at least get a numerical value of the Polarity and not merely a Positive/Negative ?

$\endgroup$
2
$\begingroup$

As stated in the documentation, this is simply

Classify["Sentiment", 
 { "I love this movie", "so depressed today", "My phone broke again"},   
 "Probabilities"
]
(* {<|"Positive" -> 0.709808, "Neutral" -> 0.0555217, "Negative" -> 0.23467|>, 
<|"Positive" -> 0.499522, "Neutral" -> 0.28636, "Negative" -> 0.214118|>, 
<|"Positive" -> 0.0498463, "Neutral" -> 0.0615645, "Negative" -> 0.888589|>}*)

Although, to be fair, the information is found in the documentation for ClassifierFunction under the Details section.

$\endgroup$
  • 1
    $\begingroup$ Thanks for that, but is there a way to know the classifier used for the sentiment analysis ? $\endgroup$ – afentis Oct 28 '14 at 14:48
  • $\begingroup$ @afentis it is a custom built classifier off of data we acquired, the specifics of which I don't know if I can discuss. But, in principle, it is built in the same manner you would using your own data set. $\endgroup$ – rcollyer Oct 28 '14 at 14:49
  • $\begingroup$ @afentis If knowing which classifier is used and the details of the algorithm are important, then I highly suggest using python for this. Its NLTK and Machine Learning libraries are light years ahead of what Mathematica is currently offering. They've also been around for several years, as opposed to just 4 or so months for Mathematica, thus tried and tested and more importantly, bugs are actively fixed and new algorithms are routinely added. $\endgroup$ – rm -rf Oct 28 '14 at 14:52
  • 1
    $\begingroup$ @rm-rf publicly available for 4 months ... $\endgroup$ – rcollyer Oct 28 '14 at 14:54
  • $\begingroup$ @afentis Look up Naïve Bayes classifiers and hierarchical classification. $\endgroup$ – rm -rf Oct 28 '14 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.