can we classify text using SVM classifier in python-TextBlob? -


>>> train = [    ('i love sandwich.', 'pos'),    ('this amazing place!', 'pos'),    ('i feel these beers.', 'pos'),    ('this best work.', 'pos'),    ("what awesome view", 'pos'),    ('i not restaurant', 'neg'),    ('i tired of stuff.', 'neg'),    ("i can't deal this", 'neg'),    ('he sworn enemy!', 'neg'),    ('my boss horrible.', 'neg')    ] >>> test = [     ('the beer good.', 'pos'),     ('i not enjoy job', 'neg'),     ("i ain't feeling dandy today.", 'neg'),     ("i feel amazing!", 'pos'),     ('gary friend of mine.', 'pos'),     ("i can't believe i'm doing this.", 'neg')     ] >>> textblob.classifiers import naivebayesclassifier >>> cl = naivebayesclassifier(train) >>> cl.classify("this amazing library!") 'pos' 

the above code classifying text using python using naivebayesclassifier. have used maxentclassifier, decisiontreeclassifier. want know there classifeirs other ones have mentioned classifying in python. please let me know!!!


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -