|
# 🧠 Mô hình multi-task |
|
## 📝 Giới thiệu |
|
Mô hình DeBERTa‑v3‑base được fine‑tune theo multi-task learning trên hơn 600 tác vụ thuộc bộ TaskSource, bao gồm Natural Language Inference (NLI), Zero-Shot Classification, token classification và multiple-choice. |
|
Mô hình được đánh giá mạnh trong zero-shot và đạt thành tích hàng đầu trong các benchmark do IBM tổ chức. |
|
|
|
## 📌 Khả năng chính |
|
Zero-Shot Classification |
|
Natural Language Inference (NLI) |
|
Multiple-choice & Token classification |
|
TaskSource-adapters – Gọi hàng trăm tác vụ chỉ với 1 dòng lệnh |
|
|
|
## 📥 Đầu vào & 📤 Đầu ra |
|
### 🔍 Zero-Shot Classification |
|
```python |
|
from transformers import pipeline |
|
classifier = pipeline("zero-shot-classification", model="zhaospei/Model_17") |
|
classifier("I love programming.", ["tech", "politics", "sports"]) |
|
``` |
|
### 🔎 NLI (Natural Language Inference) |
|
```python |
|
from transformers import pipeline |
|
pipe = pipeline("text-classification", model="zhaospei/Model_17") |
|
pipe([{"text": "A cat is on the mat.", "text_pair": "An animal is lying down."}]) |
|
``` |
|
### 🔌 [TA] Tasksource-adapters: Truy cập hàng trăm tác vụ với 1 dòng |
|
```python |
|
# !pip install tasknet |
|
import tasknet as tn |
|
|
|
pipe = tn.load_pipeline('zhaospei/Model_17', 'glue/sst2') # hoạt động với 500+ tác vụ TaskSource |
|
pipe(['That movie was great!', 'Awful movie.']) |
|
# [{'label': 'positive', 'score': 0.9956}, {'label': 'negative', 'score': 0.9967}] |
|
Hỗ trợ các tập như: GLUE, SuperGLUE, ANLI, BIG-Bench, BoolQ, COPA... |
|
``` |
|
|
|
### 🔧 Fine-tuning nhanh với TaskNet |
|
```python |
|
import tasknet as tn |
|
|
|
model, trainer = tn.Model_Trainer( |
|
[tn.AutoTask("glue/rte")], |
|
hparams={"model_name": "zhaospei/Model_17", "learning_rate": 2e-5} |
|
) |
|
trainer.train() |
|
``` |
|
|
|
## ⚙️ Cài đặt |
|
```bash |
|
pip install torch transformers tasknet |
|
``` |
|
## 📊 Huấn luyện & Hiệu năng |
|
Dataset: 600+ tác vụ |
|
Epochs: 200k steps |
|
Batch size: 384 |
|
Peak learning rate: 2e-5 |
|
Thiết bị: A30 24GB x2 trong 15 ngày |
|
|