ELMo LAC_demo的问题
Created by: wwjjy
根据LAC_demo中给的数据运行train文件,有如下错误:
Traceback (most recent call last): File "LAC_demo/train.py", line 344, in train(args) File "LAC_demo/train.py", line 275, in train cur_batch = next(reader_itr) File "/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/batch.py", line 35, in batch_reader for instance in r: File "/opt/conda/envs/python27-paddle120-env/lib/python2.7/site-packages/paddle/reader/decorator.py", line 101, in data_reader for e in reader(): File "/home/aistudio/LAC_demo/reader.py", line 58, in reader target_idx.append(int(label2id_dict["O"])) KeyError: 'O'
查看了以下LAC_demo/data/tag.dic文件中并没有"O",所以通过load_reverse_dict方法生成的label2id字典中并没有"O"这个关键词。