Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

由于 token 长度限制,怎么在 prompting 构造时输入更多的标注样本,提升分类精度呢? #23

Open
leonall opened this issue Mar 20, 2023 · 3 comments

Comments

@leonall
Copy link

leonall commented Mar 20, 2023

transformers_tasks/LLM/llm_classification.py

楼主给每一个类目提供了一个样本,实际业务场景中,一个样本肯定不够。理论上输入的样本越多,识别精度会约好。

大模型的token长度一般是有限的(输入的长度越长,耗时也会越长),ChatGLM-6B 推荐的 token 长度是 2048,如何更高效的利用业务场景已有的样本呢?

@HarderThenHarder
Copy link
Owner

Hi,我的想法是可以根据「分层」的方法来解决「类别多」的问题。
可以考虑先分到粗的类别,再细分到具体的类别。
举例来讲:如果要分类「乒乓球」这个类别,可以先分类到第一层:运动,再分到第二层:球类,再分类到乒乓球。

@leonall
Copy link
Author

leonall commented Mar 21, 2023

@HarderThenHarder 感谢回复。因为输入token长度限制,大类也可能分错,后续子类就没有啥意义了呀。这个可能还不是最好的方案

@tcoln
Copy link

tcoln commented May 29, 2024

@HarderThenHarder 你好,utils.py里面只将数据处理成p-tuing格式,请问lora还能训练这种数据格式吗?因为lora微调分类的时候好像把label也包含进去了,标签泄漏了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants