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

一个文本要是有多个标签要怎么用这个模型呢 #104

Open
Deerkangkang opened this issue Mar 13, 2023 · 3 comments
Open

一个文本要是有多个标签要怎么用这个模型呢 #104

Deerkangkang opened this issue Mar 13, 2023 · 3 comments

Comments

@Deerkangkang
Copy link

如题,今天在格式化数据的时候发现,该仓库的数据都是一条文本对应一个类别, 如果一个本文对应多个类别时候怎么办

@Eminem-lamar
Copy link

同问,请问大佬解决了吗

@Deerkangkang
Copy link
Author

解决了,不过得自己写一个函数,比如说把输出的output = model(input) 的向量卡一个阈值设置为1,其余为0,然后标签使用的sklearn库的multilabel 什么的函数,可以自动把一个列表值变成和输出同维度的one-hot,然后就可以计算了

@Eminem-lamar
Copy link

啊好的谢谢大佬,可以看看您是怎么写的吗,因为我是第一次接触这个,没有什么经验

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

2 participants