Questions tagged «textblob»

2
Python泡菜错误:UnicodeDecodeError
我正在尝试使用Textblob进行一些文本分类。我首先训练模型并使用pickle对其进行序列化,如下所示。 import pickle from textblob.classifiers import NaiveBayesClassifier with open('sample.csv', 'r') as fp: cl = NaiveBayesClassifier(fp, format="csv") f = open('sample_classifier.pickle', 'wb') pickle.dump(cl, f) f.close() 当我尝试运行此文件时: import pickle f = open('sample_classifier.pickle', encoding="utf8") cl = pickle.load(f) f.close() 我收到此错误: UnicodeDecodeError:'utf-8'编解码器无法解码位置0的字节0x80:无效的起始字节 以下是我的sample.csv的内容: 我的SQL根本无法正常工作。这是一个错误的选择,SQL 我有问题。请立即回复,支持 我在哪里错了?请帮忙。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.