DeepKE icon indicating copy to clipboard operation
DeepKE copied to clipboard

在运行ner的few-shot的predict.py文件时出现问题:IndexError: list index out of range

Open zmt1002 opened this issue 3 years ago • 3 comments

Describe the bug 似乎是在运行deepke/name_entity_re/few_shot/module/train.py文件的这个语句出现的问题: line 155, in predict self.logger.info("Raw texts: " + " ".join(texts[idx])) 请问一下这个问题该怎么解决?谢谢!

Environment (please complete the following information):

  • OS: [e.g. mac ]
  • Python Version [3.8]

Screenshots image

zmt1002 avatar Dec 07 '22 14:12 zmt1002

请问运行的哪个数据集?

flow3rdown avatar Dec 07 '22 14:12 flow3rdown

请问运行的哪个数据集?

是我自己建的一个数据集

zmt1002 avatar Dec 07 '22 14:12 zmt1002

那你的数据集包含test_data吗,predict函数是预测test_data的,目测是test_data为None导致texts为空,所以出现list index out of range错误。

flow3rdown avatar Dec 07 '22 14:12 flow3rdown