eliascai / sentiment Goto Github PK
View Code? Open in Web Editor NEWCCF大数据比赛,基于主题的文本情感分析
CCF大数据比赛,基于主题的文本情感分析
# from keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.preprocessing.sequence import pad_sequences
def getPredWord(model, word_index, x, y):
# 获取评论内容的预测关键词
# pos_pred = model.predict_classes(x) # 由于tensorflow新的版本将predict_classes删除了, 替换为下面这两行代码即可解决
predict_x = model.predict(x)
pos_pred = np.argmax(predict_x, axis=1)
非常感谢作者的开源, 代码跑得很快, 再次感谢~
需要的包已经更新,但是遇到这个错误~~~~,不知道作者能否跑通~~~。
Using TensorFlow backend.
('len of contents :', 20000)
('len of words : ', 20000)
关键词 / 被覆盖的关键词
Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
Loading model cost 0.210 seconds.
Prefix dict has been built succesfully.
Traceback (most recent call last):
File "sentiment_words.py", line 56, in
contents, words = calWordCover(contents, words, 15)
File "sentiment_words.py", line 50, in calWordCover
contents[i] = ' '.join(list(tags))
TypeError: list indices must be integers, not unicode
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.