I have this code, and want to extract out just the number. I tried QuantityMagnitude and a transformation rule.
In[1]:= Normal[Classify["Sentiment", "I love this book.", "Probabilities"] 100][[1]]
Out[1]= "Positive" -> 72.8592
Classify["Sentiment", "I love this book.", "Probabilities"]["Positive"]
(* Out: 0.728592 *)
%*100
(* Out: 72.8592 *)
Whenever you have this kind of problem, use FullForm to figure out what you actually have. Start with your statement, assign it a name, and look at the FullForm:
sol = Normal[Classify["Sentiment", "I love this book.", "Probabilities"] 100][[1]]
sol//FullForm
Rule["Positive",72.85922417349849`]
so you need to extract the number from the Rule. This can be done several ways:
sol[[2]]
"Positive" /. sol
both return your desired number.