Giter Site home page Giter Site logo

sentiment's Issues

指出几点需要修改的地方(由于第三方库版本更迭)

  • 第23行 (第三方库导入)
# from keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.preprocessing.sequence import pad_sequences
  • 122行 (由于tensorflow版本更迭)
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) 

非常感谢作者的开源, 代码跑得很快, 再次感谢~

I face to a issuse!

需要的包已经更新,但是遇到这个错误~~~~,不知道作者能否跑通~~~。
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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.