Giter Site home page Giter Site logo

chinese_sentiment's Issues

关于程序运行中的几个问题

首先非常感谢作者您的视频讲解和详细的代码,让小白能基本理解情感分析的过程。
但是在我运行程序过程中,有几个疑问得不到解答,希望能得到您的帮助~
1.pos文件夹中的文件并没有标记,positive_samples有,那么positive_samples是下载来的呢,还是自己标记的?
2.为什么要在BLSTM后还要加一层LSTM?一般有一层LSTM不就可以了吗?
3.在fit模型后,更改了回调函数的某个参数后再一次fit,为什么运行是基于上一次fit的结果来运行的?怕您不理解,我解释一下,就是上一次的结果为val_loss=0.31515,这次所有epoch的结果就全是0.31515。
4.为什么同一个epoch里,loss和accuracy不一样?
比如,epoch6/20,loss=0.3315,epoch00006,loss=0.3326,两个不一样
5.为什么运行结果显示的是把模型存入了sentiment_checkpoint.h5文件中,但我通过hdp查看却发现文件中一点数据也没有?
基础不是很好,如果问了些没水平的问题还请见谅~
期待您的解答!
再一次感谢您的付出~

predict_sentiment(text)

您好,非常感谢您的分享,我在听完您的视频后,运行了程序,
test_list = [
'酒店设施不是新的,服务态度很不好',
'酒店卫生条件非常不好',
'床铺非常舒适',
'房间很凉,不给开暖气',
'房间很凉爽,空调冷气很足',
'酒店环境不好,住宿体验很不好',
'房间隔音不到位' ,
'晚上回来发现没有打扫卫生',
'因为过节所以要我临时加钱,比团购的价格贵'
]
for text in test_list:
predict_sentiment(text)
运行到上面的代码时报错了,
报错信息:InvalidArgumentError (see above for traceback): indices[0,231] = 83086 is not in [0, 50000)
[[Node: embedding/Gather = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, validate_indices=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](embedding/embeddings/read, embedding/Cast)]]
不知道是不是tensorflow版本的问题,请问你用的是哪个版本的tensorflow?

你好,对于这个情感分析任务,我有几个疑问。

1.我们将一条短评,进行分词,然后将利用预训练的word2vec构建构建这个短评的embeddding,让这个embuding作为LSTM的输入项.而LSTM输入项应该是分词词语的向量才对吧,因为只有词语和词语之间才会有时间序列上的关联,而句子和句子间是没有的。
例如下图中的 x , x , x<t+1> ,应该是词语向量,而不是一个个embedding。
fb9ee87ffc5345babef134df0ab7259
2.如果LSTM输入的是词语向量,而LSTM中每个一LSTM单元的输出层都是二分类的话,是对一个一个词语去判断他的情感极性么?我觉得应该是整个LSTM循环之后再连接一个输出层二分类这样才是合理吧,然后如果是这样的话,我们对每一条短评都建立一个LSTM神经网络模型和二分类的输出层,最后一共m个短评构建出一个LSTM神经网络集群,从而去定义整个集群的损失函数sum(loss)/m么?
很抱歉,我是个初学者,在对LSTM和Word2vec上得理解得不够准确和透彻,希望得到您的解答,谢谢。

Originally posted by @Sujunheng in #2 (comment)

Unable to open file (Unable to open file: name = 'sentiment_checkpoint.keras',

您好,当我执行到
path_checkpoint='sentiment_checkpoint.keras'
checkpoint=ModelCheckpoint(filepath=path_checkpoint,monitor='val_loss',
verbose=1,save_weights_only=True,
save_best_only=True)
try:
model.load_weights(path_checkpoint)
except Exception as e:
print(e)

报错信息:

Unable to open file (Unable to open file: name = 'sentiment_checkpoint.keras', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)

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.