From: Jp Hastings-spital Date: 2009-09-14T22:53:40+09:00 Subject: Re: (Bayesian) Linguistic Analysis Thanks for your reply! I guess I'm just looking to see if its been done before, I'm not worried about sitting down and working out new algorithms to do precisely this - in fact it could be quite fun - but there's nothing worse than building your own then finding there's a ruby class that does just that and more! Classifier has a '#categories' method that will return the probabilities for each category you've specified (in fact, the way a category is chosen is by picking the one with the highest probability) but I don't see how to make it work with binary terms. With the standard 'spam' example you train to two categories (spam, not spam) but the probabilities for 'spam' and 'not spam' will almost never total 100% because of the way the algorithm works. Of course I could always scale the results; if Phrase A is 25% 'neutral', 36% 'unhappy' and 44% 'happy' I can do (0.25 * 0 + 0.36 * -1 + 0.44 * 1)/(0.25 + 0.36 + 0.44) and I'll have a reasonable percentage for the 'happiness' of that phrase. Looks like its testing time! Thanks again -- Posted via http://www.ruby-forum.com/.