PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
12.09k stars 2.93k forks source link

[Bug]: Taskflow文本纠错text_correction 调用输出结果和官方示例结果不一样错别字只有"既"字 #7000

Closed yhl666mail closed 9 months ago

yhl666mail commented 1 year ago

软件环境

- paddlepaddle:2.5.1
- paddlepaddle-cpu 
- paddlenlp: 2.6.0

重复问题

错误描述

代码
from paddlenlp import Taskflow
corrector = Taskflow("text_correction")
result =  corrector("遇到逆竟时,我们必须勇于面对,而且要愈挫愈勇。")
print(result)
结果:
[{'source': '遇到逆竟时,我们必须勇于面对,而且要愈挫愈勇。', 'target': '遇到逆竟时,我既必须既既面既,而既既愈挫既勇。', 'errors': [{'position': 7, 'correction': {'们': '既'}}, {'position': 10, 'correction': {'勇': '既'}}, {'position': 11, 'correction': {'于': '既'}}, {'position': 13, 'correction': {'对': '既'}}, {'position': 16, 'correction': {'且': '既'}}, {'position': 17, 'correction': {'要': '既'}}, {'position': 20, 'correction': {'愈': '既'}}]}]

稳定复现步骤 & 代码

每次调用结果一样

yhl666mail commented 1 year ago

这个是官方示例输出结果 [{'source': '遇到逆竟时,我们必须勇于面对,而且要愈挫愈勇。', 'target': '遇到逆境时,我们必须勇于面对,而且要愈挫愈勇。', 'errors': [{'position': 3, 'correction': {'竟': '境'}}]}]

yhl666mail commented 1 year ago

corrector('遇到逆竟时,我们必须勇于面对,而且要愈挫愈勇。') image

Chanwb commented 1 year ago

应该是paddlepaddle和paddlenlp的问题,我原本的结果和你的一样,然后把paddlepaddle降到2.3.0 paddlenlp版本降到2.3.4 就能得到demo的展示效果

ichigo-xin commented 1 year ago

我用的paddlepaddle是2.5.0,paddlenlp是2.6.0,也有这样的问题。不降版本的话有什么解决方法吗?

moqiaaa commented 11 months ago

pip install paddlepaddle==2.5.0rc1 用这个版本没问题

github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

github-actions[bot] commented 9 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。