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

大神你好,请教一些关于报错的问题 #170

Open
ljx761795750 opened this issue Apr 2, 2021 · 1 comment
Open

大神你好,请教一些关于报错的问题 #170

ljx761795750 opened this issue Apr 2, 2021 · 1 comment

Comments

@ljx761795750
Copy link

大神你好,我的配置都没问题,数据是韩文中文和英文,数据都是用B/I/E-ORG标记的,在train期间是正常的,但是decode就出错,我的raw_dems数据是三种文字,后边标记全是O,请问下面报错是什么原因啊。我的python3.8和pytorch1.6.。。。
下面是我decode后报错的问题,请问 这是版本的问题么?还是其他的问题。谢谢。

`DATA SUMMARY END.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Traceback (most recent call last):
File "/tmp/test_ljx/2/NCRFpp-master/utils/alphabet.py", line 49, in get_index
return self.instance2index[instance]
KeyError: 'O'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 562, in
data.generate_instance('raw')
File "/tmp/test_ljx/2/NCRFpp-master/utils/data.py", line 306, in generate_instance
self.raw_texts, self.raw_Ids = read_instance(self.raw_dir, self.word_alphabet, self.char_alphabet, self.feature_alphabets, self.label_alphabet, self.number_normalized, self.MAX_SENTENCE_LENGTH, self.sentence_classification, self.split_token)
File "/tmp/test_ljx/2/NCRFpp-master/utils/functions.py", line 109, in read_instance
label_Ids.append(label_alphabet.get_index(label))
File "/tmp/test_ljx/2/NCRFpp-master/utils/alphabet.py", line 56, in get_index
return self.instance2index[self.UNKNOWN]
KeyError: ''
`

@jiesutd
Copy link
Owner

jiesutd commented Jun 20, 2022

可能需要检查一下数据格式

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

2 participants