Skip to content

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

@ljx761795750

Description

@ljx761795750

大神你好,我的配置都没问题,数据是韩文中文和英文,数据都是用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: ''
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions