Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于标注部分的问题 #51

Closed
oneapmlj opened this issue Apr 9, 2017 · 7 comments
Closed

关于标注部分的问题 #51

oneapmlj opened this issue Apr 9, 2017 · 7 comments

Comments

@oneapmlj
Copy link

oneapmlj commented Apr 9, 2017

大神好,我昨天仔细研究了您新添加的词性标注模块,然后我发现有几步好像有点问题,我自己尝试更改了一下,现在已经跑通了,99.57%的准确率,请您看看,问题如下:
1、在第五步骤,传入参数“lines_withpos.txt”,然而在代码里面并没有写入信息,我觉得应该得在代码里面添加 写入每个标注与其对应的序号。
2、在第六步骤,传入的第三个参数应该是上一步生成的词典“lines_withpos.txt”而不是”pos_vocab.txt“。

您看这样是正确的吗?

@koth
Copy link
Owner

koth commented Apr 9, 2017

你是不是没更新代码呢?

@oneapmlj
Copy link
Author

oneapmlj commented Apr 9, 2017

是的,我错了,没有更新代码 -!- 那看来我是自己在本地更新了一下您的代码!哈哈

@kinghuangdd
Copy link

用python3.6跑报错:
Traceback (most recent call last):
File "kcws/train/train_pos.py", line 348, in
tf.app.run()
File "/home/kinghuang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "kcws/train/train_pos.py", line 311, in main
FLAGS.char_word2vec_path, FLAGS.num_hidden)
File "kcws/train/train_pos.py", line 80, in init
self.w2v = self.load_w2v(w2vPath, FLAGS.embedding_word_size)
File "kcws/train/train_pos.py", line 205, in load_w2v
line = fp.readline().strip()
File "/home/kinghuang/anaconda3/envs/tensorflow/lib/python3.6/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 4282-4283: invalid continuation byte

用python2.7跑报错:
Traceback (most recent call last):
File "kcws/train/train_pos.py", line 347, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv))
File "kcws/train/train_pos.py", line 312, in main
wX, cX, Y = inputs(trainDataPath)
File "kcws/train/train_pos.py", line 290, in inputs
features = tf.transpose(tf.stack(whole[0:FLAGS.max_sentence_len]))
AttributeError: 'module' object has no attribute 'stack'
麻烦问下是不是代码未更新的问题?

@koth
Copy link
Owner

koth commented Sep 27, 2017

@kinghuangdd 需要升级下你的TF到1.1+

@kinghuangdd
Copy link

好啦,谢谢大神!

@koth koth closed this as completed Sep 27, 2017
@AlleyEli
Copy link

AlleyEli commented May 10, 2018

@oneapmlj 你上面说的第二点是正确的吗? 在第6步中”pos_vocab.txt“换位“lines_withpos.txt”

@oneapmlj
Copy link
Author

@oneapmlj 你上面说的第二点是正确的吗? 在第6步中”pos_vocab.txt“换位“lines_withpos.txt”
是之前没有更新代码的原因!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants