shiyybua / NER

基于tensorflow深度学习的中文的命名实体识别
1.04k stars 400 forks source link

source_vocab.txt和target_vocab.txt文件 #56

Open Kiiver opened 6 years ago

Kiiver commented 6 years ago

请问source_vocab.txt和target_vocab.txt文件长什么样,有样例吗?比如与source.txt文件相对应的文件

另外wiki.zh.vec词向量是在哪下载的呢?可以用自己根据source.txt文件得到的词向量替代吗?

zbxzc35 commented 5 years ago

修改config.py的action为train,运行rnn.py,可以得到source_vocab.txt和target_vocab.txt,wiki词向量可以参考这个自己训练https://blog.csdn.net/weixin_40400177/article/details/79366065

SuooL commented 5 years ago

修改了之后还是报错 IOError: [Errno 2] No such file or directory: 'resource/target_vocab.txt'

hudianyong commented 5 years ago

你好,我也遇到这个问题了,一致没解决,请问你解决了吗?

Foehnc commented 5 years ago

@zbxzc35 你好 请问能详细说一下怎么改吗

juebanchengzi commented 5 years ago

我想問一下你這個問題解決沒有?方便告知一下吧,謝謝

pipipuppypaul commented 5 years ago

修改了之后还是报错 IOError: [Errno 2] No such file or directory: 'resource/target_vocab.txt'

可能是python版本不一样导致的编译顺序不同。owner是p2,虽然先import了utils,但是似乎只会在调用get_class_size() 和 target_vocab.txt时才会去寻找需要的文件。而p3似乎在开始时就要准备齐全文件。 不对的话当我没说。

zdx1012 commented 5 years ago

2楼正解,感谢

nwf5d commented 5 years ago

source_vocab.txt和target_vocab.txt都是用utils.py中build_word_index方法生成的。如果用的Python3,需要单独先运行utils.py

SeekPoint commented 4 years ago

还是不行啊@nwf5d

Yolky-1996 commented 4 years ago

修改config.py里word_embedding_file的存放路径为你自己wiki.zh.vec的存放路径