🚀 deberta-v3-large_boolq
本模型是 microsoft/deberta-v3-large 在 boolq 數據集上的微調版本。它在評估集上取得了如下結果:
🚀 快速開始
本模型是 microsoft/deberta-v3-large 在 boolq 數據集上進行微調得到的。在評估集上,它展現出了良好的性能,損失值為 0.4601,準確率達到了 0.8835。
💻 使用示例
基礎用法
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model = AutoModelForSequenceClassification.from_pretrained("nfliu/deberta-v3-large_boolq")
tokenizer = AutoTokenizer.from_pretrained("nfliu/deberta-v3-large_boolq")
examples = [
("Lake Tahoe is in California", "Lake Tahoe is a popular tourist spot in California."),
("Water is wet", "Contrary to popular belief, water is not wet.")
]
encoded_input = tokenizer(examples, padding=True, truncation=True, return_tensors="pt")
with torch.no_grad():
model_output = model(**encoded_input)
probabilities = torch.softmax(model_output.logits, dim=-1).cpu().tolist()
probability_no = [round(prob[0], 2) for prob in probabilities]
probability_yes = [round(prob[1], 2) for prob in probabilities]
for example, p_no, p_yes in zip(examples, probability_no, probability_yes):
print(f"Question: {example[0]}")
print(f"Context: {example[1]}")
print(f"p(No | question, context): {p_no}")
print(f"p(Yes | question, context): {p_yes}")
print()
🔧 技術細節
訓練超參數
訓練過程中使用了以下超參數:
- 學習率:1e-05
- 訓練批次大小:16
- 評估批次大小:8
- 隨機種子:42
- 梯度累積步數:2
- 總訓練批次大小:32
- 優化器:Adam(β1=0.9,β2=0.999,ε=1e-08)
- 學習率調度器類型:線性
- 訓練輪數:5.0
訓練結果
訓練損失 |
輪數 |
步數 |
驗證損失 |
準確率 |
無日誌 |
0.85 |
250 |
0.5306 |
0.8823 |
0.1151 |
1.69 |
500 |
0.4601 |
0.8835 |
0.1151 |
2.54 |
750 |
0.5897 |
0.8792 |
0.0656 |
3.39 |
1000 |
0.6477 |
0.8804 |
0.0656 |
4.24 |
1250 |
0.6847 |
0.8838 |
框架版本
- Transformers 4.32.1
- Pytorch 2.0.1+cu117
- Datasets 2.14.4
- Tokenizers 0.13.3
📄 許可證
本模型採用 MIT 許可證。
📦 模型信息
屬性 |
詳情 |
模型類型 |
微調後的 deberta-v3-large 模型 |
訓練數據 |
boolq 數據集 |
評估指標 |
準確率 |