-
Notifications
You must be signed in to change notification settings - Fork 937
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
添加自己的标签没有成功 #111
Comments
请问下 我的word2id文件打开乱码怎么办? |
|
word2id文件打开就乱码,试了下您说的方法,还是不好使,您能帮忙看看吗?
…------------------ 原始邮件 ------------------
发件人: "lluckydog"<[email protected]>;
发送时间: 2019年12月13日(星期五) 上午9:36
收件人: "Determined22/zh-NER-TF"<[email protected]>;
抄送: "磊"<[email protected]>;"Comment"<[email protected]>;
主题: Re: [Determined22/zh-NER-TF] 添加自己的标签没有成功 (#111)
请问下 我的word2id文件打开乱码怎么办?
读写用的是二进制方法,你可以用pickle打开,看一下对不对
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
建议看看data.py的代码 |
我是用自己的数据然后也报错了 File "D:\nlp\zhnertf\zh-NER-TF\data.py", line 150, in KeyError: 'I-job_info' |
I have the same problem.Have you solved it? |
你现在弄得怎么样了 |
你好,我按照你写的代码添加了自己的标签但是好像有报错
Traceback (most recent call last):
File "main.py", line 121, in
DISEASE, LAB, JIEPOU, MEDICINE, SURGERY, IMAGE = get_entity(tag, demo_sent)
File "/home/ruoyuzhao/test/utils.py", line 15, in get_entity
DISEASE = get_DISEASE_entity(tag_seq, char_seq)
File "/home/ruoyuzhao/test/utils.py", line 36, in get_DISEASE_entity
disease += char
UnboundLocalError: local variable 'disease' referenced before assignment
这是我对应修改的代码
def get_DISEASE_entity(tag_seq, char_seq):
length = len(char_seq)
DISEASE = []
for i, (char, tag) in enumerate(zip(char_seq, tag_seq)):
if tag == 'B-DISEASE':
if 'disease' in locals().keys():
DISEASE.append(disease)
del disease
disease = char
if i+1 == length:
DISEASE.append(disease)
if tag == 'I-DISEASE':
disease += char
if i+1 == length:
DISEASE.append(disease)
if tag not in ['I-DISEASE', 'B-DISEASE']:
if 'disease' in locals().keys():
DISEASE.append(disease)
del disease
continue
return DISEASE
还有这个报错我不是很明白为什么
unexpected number of features: 4 (3)
The text was updated successfully, but these errors were encountered: