crownpku / Information-Extraction-Chinese

Chinese Named Entity Recognition with IDCNN/biLSTM+CRF, and Relation Extraction with biGRU+2ATT 中文实体识别与关系提取
2.22k stars 814 forks source link

我碰到了这样问题 #42

Open nlp-wh opened 6 years ago

nlp-wh commented 6 years ago

Traceback (most recent call last): File "main.py", line 229, in tf.app.run(main) File "D:\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "main.py", line 223, in main train() File "main.py", line 180, in train step, batch_loss = model.run_step(sess, True, batch) File "C:\Users\weihao\Desktop\NER_IDCNN_CRF0\NER_IDCNN_CRF0\model.py", line 343, in run_step feed_dict) File "D:\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\client\session.py", line 789, in run run_metadata_ptr) File "D:\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\client\session.py", line 968, in _run np_val = np.asarray(subfeed_val, dtype=subfeed_dtype) File "D:\Anaconda3\envs\tensorflow-gpu\lib\site-packages\numpy\core\numeric.py", line 531, in asarray return array(a, dtype, copy=False, order=order) ValueError: setting an array element with a sequence.

NatureLye commented 6 years ago

我也遇到了同样的问题,请问解决了吗?

nlp-wh commented 6 years ago

不好意思,我确实忘记了怎么修改....应该是数据格式问题

tljsource commented 6 years ago

我也是出现这个问题,是数据集的问题吗?请问怎么改啊

nlp-wh commented 6 years ago

你的数据集是中文还是英文?

------------------ 原始邮件 ------------------ 发件人: "tljsource"notifications@github.com; 发送时间: 2018年4月19日(星期四) 下午3:49 收件人: "crownpku/Information-Extraction-Chinese"Information-Extraction-Chinese@noreply.github.com; 抄送: "浮生若梦丶"372138325@qq.com; "Author"author@noreply.github.com; 主题: Re: [crownpku/Information-Extraction-Chinese] 我碰到了这样问题 (#42)

我也是出现这个问题,是数据集的问题吗?请问怎么改啊

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

tljsource commented 6 years ago

中文的,如下,但是一直显示上述错误,但是用github下载的数据集没报错 能 O 够 O 快 O 速 O 构 O 造 O 出 O 程 O 序 O 或 O 者 O 房 O 子 O 。 O 软 O 件 O 开 O 发 O 职 O 业 O 生 O 涯 O 进 O 阶 O , O 职 O

tljsource commented 6 years ago

准确地说是,中英文都有,包括标点。第一个是单词,一个空格,然后是标注

NatureLye commented 6 years ago

我解决了,我的问题有第一列长度大于1的情况(比如英文单词我直接当一列了),改成第一列都是一个字符后能运行了。

tljsource commented 6 years ago

我的英文单词已经是一个字符的形式了。标签我自己改了,不知道哪里的原因。中间是要以空格分开的吧 欲 O 求 O 1 O 名 O 学 O 生 O 1 O 0 O 次 O C O 语 O 言 O 程 B-THE 序 I-THE 设 O 计 O 的 O 测 O 试 O 成 O 绩 O 总 O 分 O 与 O 平 O 均 O 分 O

nlp-wh commented 6 years ago

因为我的是英文,我把seg部分注释掉了

------------------ 原始邮件 ------------------ 发件人: "tljsource"notifications@github.com; 发送时间: 2018年4月19日(星期四) 下午4:07 收件人: "crownpku/Information-Extraction-Chinese"Information-Extraction-Chinese@noreply.github.com; 抄送: "浮生若梦丶"372138325@qq.com; "Author"author@noreply.github.com; 主题: Re: [crownpku/Information-Extraction-Chinese] 我碰到了这样问题 (#42)

我的英文单词已经是一个字符的形式了。标签我自己改了,不知道哪里的原因 欲 O 求 O 1 O 名 O 学 O 生 O 1 O 0 O 次 O C O 语 O 言 O 程 B-THE 序 I-THE 设 O 计 O 的 O 测 O 试 O 成 O 绩 O 总 O 分 O 与 O 平 O 均 O 分 O

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

viewv commented 5 years ago

因为我的是英文,我把seg部分注释掉了 ------------------ 原始邮件 ------------------ 发件人: "tljsource"notifications@github.com; 发送时间: 2018年4月19日(星期四) 下午4:07 收件人: "crownpku/Information-Extraction-Chinese"Information-Extraction-Chinese@noreply.github.com; 抄送: "浮生若梦丶"372138325@qq.com; "Author"author@noreply.github.com; 主题: Re: [crownpku/Information-Extraction-Chinese] 我碰到了这样问题 (#42) 我的英文单词已经是一个字符的形式了。标签我自己改了,不知道哪里的原因 欲 O 求 O 1 O 名 O 学 O 生 O 1 O 0 O 次 O C O 语 O 言 O 程 B-THE 序 I-THE 设 O 计 O 的 O 测 O 试 O 成 O 绩 O 总 O 分 O 与 O 平 O 均 O 分 O — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

你好,您是具体是注释掉那些代码呢?