You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ner使用过程出现IndexError: list index out of range #2389
复现信息:如为报错,请给出复现环境、复现步骤
版本信息:
paddlenlp 2.2.3
paddlepaddle-gpu 2.3.0.post101
系统环境:
Linux ; Python 3.7.12
复现:
from paddlenlp import Taskflow
ner = Taskflow("ner", entity_only=True)
ner("搞笑尼斯湖怪物玩蓝色风笛卡车司机帽")
ner("蜜蜡迷你蜂巢誓言蜡烛-4支蜡烛礼盒-森林图像")
报错:
Traceback (most recent call last):
File "paddle_test.py", line 5, in
ner("蜜蜡迷你蜂巢誓言蜡烛-4支蜡烛礼盒-森林图像")
File "/opt/conda/lib/python3.7/site-packages/paddlenlp/taskflow/taskflow.py", line 244, in call
results = self.task_instance(inputs)
File "/opt/conda/lib/python3.7/site-packages/paddlenlp/taskflow/task.py", line 171, in call
results = self._postprocess(outputs)
File "/opt/conda/lib/python3.7/site-packages/paddlenlp/taskflow/named_entity_recognition.py", line 145, in _postprocess
inputs['all_pred_tags'])
File "/opt/conda/lib/python3.7/site-packages/paddlenlp/taskflow/named_entity_recognition.py", line 87, in _decode
tags_out.append(tag.split('-')[1])
IndexError: list index out of range
Activity
wawltor commentedon Jun 2, 2022
建议升级到最新PaddleNLP的版本,看了一下这个bug已经修复了,谢谢您给我们指出问题!
pip install paddlenlp --upgrade
github-actions commentedon Dec 24, 2022
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
EricHuang7 commentedon Dec 24, 2022
github-actions commentedon Feb 24, 2023
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
EricHuang7 commentedon Feb 24, 2023
github-actions commentedon Apr 27, 2023
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
EricHuang7 commentedon Apr 27, 2023
github-actions commentedon Jun 27, 2023
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
40 remaining items
EricHuang7 commentedon Apr 20, 2026
github-actions commentedon Jun 20, 2026
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
EricHuang7 commentedon Jun 20, 2026
github-actions commentedon Aug 20, 2026
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
EricHuang7 commentedon Aug 20, 2026
github-actions commentedon Oct 21, 2026
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
EricHuang7 commentedon Oct 21, 2026