aimeelee77 / senti_analysis Goto Github PK
View Code? Open in Web Editor NEW利用Python实现酒店评论的中文情感分析
利用Python实现酒店评论的中文情感分析
我用的python3将py2转化为py3来运行的,怎么在process.py就报错了呢?
用这句正确吗?
joblib.dump(clf, 'model.pkl')
我目的是运用该model去分析其他文章,谢谢!
生成完毕PCA_X以后应该shuffle一下吧,直接用SVM跑不太好吧
而且训练集验证集测试集也没有分,hyperparameter也需要tune一下吧
我在运行楼主代码时第一步合并积极和消极语料时,有txt文件生成,但是文档里面无内容,请问是什么原因呢,编译器也没有报错。
问题
Mac git clone 下来的评论语料乱码 如下所示
➜ neg git:(master) ✗ head neg.0.txt
����̫�� ���仹����3�ǵ� ������ʩ�dz��¾�.����Ƶ���ϵı�����¸���.
解决
#读取文件内容
def getContent(fullname):
- f = codecs.open(fullname, 'r')
+ f = codecs.open(fullname, 'r', encoding="gbk", errors="ignore")
为何你在合并1000个评论变成一个合并文件2000_neg.txt或者2000_pos.txt的时候读取的都是每个文件的第一行呢?
def getContent(fullname):
f = codecs.open(fullname, 'r')
content = f.readline()
f.close()
return content
readline()不是只读取了一行吗
数据链接打不开怎么办呢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.