mynlp icon indicating copy to clipboard operation
mynlp copied to clipboard

fasttext支持只有正例样本的训练分类

Open Strong-Gavin opened this issue 4 years ago • 4 comments

fasttext训练时需要指定至少两个分类标签,假如我只有正例,新来的样本判断是不是该分类 能不能支持 我试了一下 发现无论输入什么 单样本的训练出来的模型 预测都是100%

Strong-Gavin avatar Sep 14 '20 04:09 Strong-Gavin

原理上你只能根据预测结果的打分来控制,比如超过0.9分才算正确

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: Gavin <[email protected]> 发送时间: 2020年9月14日 12:02 收件人: mayabot/mynlp <[email protected]> 抄送: Subscribed <[email protected]> 主题: 回复:[mayabot/mynlp] fasttext支持只有正例样本的训练分类 (#30)

fasttext训练时需要指定至少两个分类标签,假如我只有正例,新来的样本判断是不是该分类 能不能支持 我试了一下 发现无论输入什么 单样本的训练出来的模型 预测都是100%

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jimichan avatar Sep 14 '20 04:09 jimichan

原理上你只能根据预测结果的打分来控制,比如超过0.9分才算正确 发自我的iPhone ------------------ 原始邮件 ------------------ 发件人: Gavin <[email protected]> 发送时间: 2020年9月14日 12:02 收件人: mayabot/mynlp <[email protected]> 抄送: Subscribed <[email protected]> 主题: 回复:[mayabot/mynlp] fasttext支持只有正例样本的训练分类 (#30) fasttext训练时需要指定至少两个分类标签,假如我只有正例,新来的样本判断是不是该分类 能不能支持 我试了一下 发现无论输入什么 单样本的训练出来的模型 预测都是100% — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

我使用只有一个label的进行训练,然后接着无论输入什么进行预测,打分都是1,也就是100%,是样本问题吗,稍后我用酒店评论那个只留下积极的试试

Strong-Gavin avatar Sep 14 '20 04:09 Strong-Gavin

试验了下 用酒店只保留pos标签的数据,训练的模型对后来数据进行分类,也是1 如图 1 2 3

Strong-Gavin avatar Sep 14 '20 05:09 Strong-Gavin

那我的理解就是错误的,可能fasttext不满足需求。 你再试试把Loss改成hs或者softmax试试。 你这个需求太特殊了,因为ns是负采样,没有负样本采样肯定不行

jimichan avatar Sep 14 '20 05:09 jimichan