本文整理汇总了Python中classifier.Classifier.remember方法的典型用法代码示例。如果您正苦于以下问题:Python Classifier.remember方法的具体用法?Python Classifier.remember怎么用?Python Classifier.remember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类classifier.Classifier
的用法示例。
在下文中一共展示了Classifier.remember方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_genres
# 需要导入模块: from classifier import Classifier [as 别名]
# 或者: from classifier.Classifier import remember [as 别名]
import argparse
parser = argparse.ArgumentParser(description='Genre classifier')
parser.add_argument('--path', help='Folder to load genres learning data from')
args = parser.parse_args()
path = args.path
if not classify.is_already_trained():
if path is None:
print """ Please specify root with genres folder"""
else:
process_genres(path)
print classify.genres
else:
print 'using loaded data'
test_text = open('../test_data/test_adv.txt').read()
#test_text = 'he has kill her. she was in love'
#test_text = 'it was the best trip in my life. a lot of new countries apes parrots following'
print classify.document_class(test_text.lower())
classify.remember()
# measurement script
#evaluate_data_path = path + '_measure'
#print evaluate_data_path
#measure = MeasureClassifier(evaluate_data_path, classify)
#measure.evaluate()