LeeSureman / Batch_Parallel_LatticeLSTM

Chinese NER using Lattice LSTM. Reproduction for ACL 2018 paper.
129 stars 16 forks source link

errror happens when I use my data #2

Closed w5688414 closed 5 years ago

w5688414 commented 5 years ago

Exception happens at the3851th(from 1) instance. Traceback (most recent call last): File "main.py", line 115, in <module> _refresh=refresh_data,_cache_fp=cache_name) File "/home/eric/anaconda3/lib/python3.7/site-packages/fastNLP/core/utils.py", line 155, in wrapper results = func(*args, **kwargs) File "/home/eric/Documents/NER/Batch_Parallel_LatticeLSTM/load_data.py", line 849, in equip_chinese_ner_with_skip v.apply_field(partial(skips2skips_l2r,w_trie=w_trie),'chars','skips_l2r') File "/home/eric/anaconda3/lib/python3.7/site-packages/fastNLP/core/dataset.py", line 787, in apply_field raise e File "/home/eric/anaconda3/lib/python3.7/site-packages/fastNLP/core/dataset.py", line 783, in apply_field results.append(func(ins[field_name])) File "/home/eric/Documents/NER/Batch_Parallel_LatticeLSTM/load_data.py", line 819, in skips2skips_l2r result[e].append([s,w]) IndexError: list index out of range my data format is resume format

LeeSureman commented 5 years ago

I don't understand 'resume format'. please show your data format, is it like the form in https://github.com/jiesutd/LatticeLSTM ?

w5688414 commented 5 years ago

@LeeSureman yes, I copy the resume dataset from this respository, ant it works, my data format is similar to resume, but it doesn't work

LeeSureman commented 5 years ago

would you please send your data to me for debug? lixiaonan_xdu@outlook.com

w5688414 commented 5 years ago

I can't share the data, because it's for commercial use, here is my example: ` 他 B-PRODUCT 建 M-PRODUCT 大 M-PRODUCT 数 M-PRODUCT 据 M-PRODUCT 服 M-PRODUCT 务 M-PRODUCT 平 M-PRODUCT 台 E-PRODUCT 助 O 旧 O 衣 O 实 O 现 O 时 O 尚 O 新 O 生 O 覆 O 盖 O 2 O 0 O 0 O 余 O 城 O 月 O 回 O 收 O 3 O 0 O 0 O 0 O 吨 O

要 O 做 O 中 B-LOC 国 E-LOC 版 O 的 O “ O U B-PRODUCT S M-PRODUCT F M-PRODUCT O M-PRODUCT O M-PRODUCT D E-PRODUCT ” O “ O 锅 B-PRODUCT 圈 E-PRODUCT ” O 完 O 成 O 不 B-FIRM 惑 M-FIRM 创 M-FIRM 投 E-FIRM 4 O 5 O 0 O 0 O 万 O 元 O A O 轮 O 融 O 资 O `

w5688414 commented 5 years ago

@LeeSureman I debug my dataset, I didn't remove the space in my datasets, so the error occurs, so thanks for your guidence, it works

LeeSureman commented 5 years ago

@w5688414 great! congratulations!

001fr commented 10 months ago

@w5688414 我遇到同样的报错IndexError: list index out of range,但是还是没太明白怎么去解决,可以请教一下吗