3
>>> train = [
   ('I love this sandwich.', 'pos'),
   ('this is an amazing place!', 'pos'),
   ('I feel very good about these beers.', 'pos'),
   ('this is my best work.', 'pos'),
   ("what an awesome view", 'pos'),
   ('I do not like this restaurant', 'neg'),
   ('I am tired of this stuff.', 'neg'),
   ("I can't deal with this", 'neg'),
   ('he is my sworn enemy!', 'neg'),
   ('my boss is horrible.', 'neg')
   ]
>>> test = [
    ('the beer was good.', 'pos'),
    ('I do not enjoy my job', 'neg'),
    ("I ain't feeling dandy today.", 'neg'),
    ("I feel amazing!", 'pos'),
    ('Gary is a friend of mine.', 'pos'),
    ("I can't believe I'm doing this.", 'neg')
    ]
>>> from textblob.classifiers import NaiveBayesClassifier
>>> cl = NaiveBayesClassifier(train)
>>> cl.classify("This is an amazing library!")
'pos'

上記のコードは、NaiveBayesClassifier を使用して、Python を使用してテキストを分類するためのものです。同様に、MaxEntClassifier、DecisionTreeClassifier を使用しました。今、私はpythonで分類するために言及したもの以外に分類がありますか知りたいです。私にお知らせください!!!

4

0 に答える 0