
什么是Zero-Shot Classification
https://huggingface.co/tasks/zero-shot-classification
hugging face上的零样本分类模型
facebook/bart-large-mnli
https://huggingface.co/facebook/bart-large-mnli
当然这是一个英文模型,我们要去用一些多语言的模型。
可以在这里找更多适合自己的

零样本分类能力测试效果
当然这是一个英文模型,我们要去用一些多语言的模型。
可以先看看中文效果,也还行
问:请帮我润色一下这句话
分类结果:

用英文测试
问答

问答

问答

总结

摘要

总结
这个案例还是很经典的。它表面上是在问答,实际上是要做总结。

测试结论
从上述的测试用例来看,分类效果还是很不错的。这样实际上我是可以使用该模型,进行问题意图识别的。因为搜索框,对话框,被传进来的内容类型是未知的。但是不同类型的问题,去到不同的分支上,效果一定是最好的。就像上边的测试案例。通过模型,可以推测出来,输入框的内容到底是什么意图,是总结任务?还是摘要任务?还是问答任务?
在模型中,我们只需要去定义已知的和能够处理的分支即可。轻松利用模型的能力,来做意图识别。
当然这是一个初步的探索。想要获得更好的效果,还会要进行模型调优的。