Views
No views yet
1from transformers import pipeline
2classifier = pipeline("zero-shot-classification",model="sileod/deberta-v3-base-tasksource-nli")
3
4text = "one day I will see the world"
5candidate_labels = ['travel', 'cooking', 'dancing']
6classifier(text, candidate_labels)1from transformers import pipeline
2pipe = pipeline("text-classification",model="sileod/deberta-v3-base-tasksource-nli")
3pipe([dict(text='there is a cat',
4 text_pair='there is a black cat')]) #list of (premise,hypothesis)
5# [{'label': 'neutral', 'score': 0.9952911138534546}]1# !pip install tasknet
2import tasknet as tn
3pipe = tn.load_pipeline('sileod/deberta-v3-base-tasksource-nli','glue/sst2') # works for 500+ tasksource tasks
4pipe(['That movie was great !', 'Awful movie.'])
5# [{'label': 'positive', 'score': 0.9956}, {'label': 'negative', 'score': 0.9967}]1# !pip install tasknet
2import tasknet as tn
3hparams=dict(model_name='sileod/deberta-v3-base-tasksource-nli', learning_rate=2e-5)
4model, trainer = tn.Model_Trainer([tn.AutoTask("glue/rte")], hparams)
5trainer.train()@article{sileo2023tasksource,
title={tasksource: Structured Dataset Preprocessing Annotations for Frictionless Extreme Multi-Task Learning and Evaluation},
author={Sileo, Damien},
url= {https://arxiv.org/abs/2301.05948},
journal={arXiv preprint arXiv:2301.05948},
year={2023}
}