-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Labels
Description
请提出你的问题
我使用的是Taskflow API做0样本的分类,如果要对不同的schema进行分类,需要分别设置schema,以下是我的代码
from paddlenlp import Taskflow
cls = Taskflow("zero_shot_text_classification")
cls.set_schema(["喜事", "灾祸", "暴力倾向"])
result = cls(["前几天的时候,张三打了我一耳光,我想报复他", "昨天你侄子家,生了一个男孩", "昨天他开车出车祸死了"])
print(result)
cls.set_schema(["开心", "伤心"])
result = cls(["这次考试我成绩非常不好", "这次我的成绩好极了!"])
print(result)
是否能针对同一个batch,设置不同的schema呢
cls([[schema1, examples1], [schema2, examples2]]