|
--- |
|
language: |
|
- en |
|
license: mit |
|
tags: |
|
- text-classification |
|
datasets: |
|
- trec |
|
model-index: |
|
- name: aychang/distilbert-base-cased-trec-coarse |
|
results: |
|
- task: |
|
type: text-classification |
|
name: Text Classification |
|
dataset: |
|
name: trec |
|
type: trec |
|
config: default |
|
split: test |
|
metrics: |
|
- type: accuracy |
|
value: 0.97 |
|
name: Accuracy |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZGNmZTQ1Mjk3YTQ0NTdiZmY2NGM2NDM2Yzc2OTI4NGNiZDg4MmViN2I0ZGZiYWJlMTg1ZDU0MTc2ZTg1NjcwZiIsInZlcnNpb24iOjF9.4x_Ze9S5MbAeIHZ4p1EFmWev8RLkAIYWKqouAzYOxTNqdfFN0HnqULiM19EMP42v658vl_fR3-Ig0xG45DioCA |
|
- type: precision |
|
value: 0.9742915631870833 |
|
name: Precision Macro |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMjA2MWVjMDc3MDYyY2M3NzY4NGNhY2JlNzJjMGQzZDUzZjE3ZWI1MjVmMzc4ODM2ZTQ4YmRhOTVkZDU0MzJiNiIsInZlcnNpb24iOjF9.EfmXJ6w5_7dK6ys03hpADP9h_sWuPAHgxpltUtCkJP4Ys_Gh8Ak4pGS149zt5AdP_zkvsWlXwAvx5BDMEoB2AA |
|
- type: precision |
|
value: 0.97 |
|
name: Precision Micro |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiNDVjOGFjM2RkMDMxZTFiMzE1ZDM4OTRjMzkwOWE2NTJmMmUwMDdiZDg5ZjExYmFmZjg2Y2Y5NzcxZWVkODkwZSIsInZlcnNpb24iOjF9.BtO7DqJsUhSXE-_tJZJOPPd421VmZ3KR9-KkrhJkLNenoV2Xd6Pu6i5y6HZQhFB-9WfEhU9cCsIPQ1ioZ7dyDA |
|
- type: precision |
|
value: 0.9699546283251607 |
|
name: Precision Weighted |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMGQ0Mzc2MTE2YjkwNGY1MDEzNWQwYmNlZDMzZjBmNWM0ODExYjM1OTQyZGJkNjI2OTA5MDczZjFmOGM5MmMzMyIsInZlcnNpb24iOjF9.fGi2qNpOjWd1ci3p_E1p80nOqabiKiQqpQIxtk5aWxe_Nzqh3XiOCBF8vswCRvX8qTKdCc2ZEJ4s8dZMeltfCA |
|
- type: recall |
|
value: 0.972626762268805 |
|
name: Recall Macro |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMjQwMWZiYjIyMGVhN2M1ZDE5M2EzZmQ1ODRlYzE0MzJhZmU3ZTM1MmIyNTg5ZjBlMDcyMmQ0NmYzZjFmMmM4NSIsInZlcnNpb24iOjF9.SYDxsRw0xoQuQhei0YBdUbBxG891gqLafVFLdPMCJtQIktqCTrPW0sMKtis7GA-FEbNQVu8lp92znvlryNiFCw |
|
- type: recall |
|
value: 0.97 |
|
name: Recall Micro |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMjQ0MjczYjFhZDdiMjdkMWVlZTAzYWU0ODVhNjkxN2I1N2Y1Y2IyOTNlYWQxM2UxODIyNDZhZDM3MWIwMTgzZCIsInZlcnNpb24iOjF9.C5cfDTz_H4Y7nEO4Eq_XFy92CSbo3IBuL5n8wBKkTuB6hSgctTHOdOJzV8gWyMJ9gRcNqxp_yVU4BEB_I_0KAA |
|
- type: recall |
|
value: 0.97 |
|
name: Recall Weighted |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiNDZmYWM3OWExZWI1ZjRiZjczYWQwOWI5NWQzNDNkODcyMjBhMmVkYjY0MGZjYzlhNWQ0Y2MyMjc3OWEyZjY4NCIsInZlcnNpb24iOjF9.65WM5ihNfbKOCNZ6apX7iVAC2Ge_cwz9Xwa5oJHFq3Ci97eBFqK-qtADdB_SFRcSQUoNodaBeIhNfe0hVddxCA |
|
- type: f1 |
|
value: 0.9729834427867218 |
|
name: F1 Macro |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiYWQyZGZmYjU4NjE4M2YzMTUxOWVkYjU0YTFmYzE3MmQ2NjhmNDY1MGRmNGQ1MWZjYjM1Mzg5Y2RmNTk5YmZiMSIsInZlcnNpb24iOjF9.WIF-fmV0SZ6-lcg3Rz6TjbVl7nLvy_ftDi8PPhDIP1V61jgR1AcjLFeEgeZLxSFMdmU9yqG2DWYubF0luK0jCg |
|
- type: f1 |
|
value: 0.97 |
|
name: F1 Micro |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMDM0NDY0YzI2ZTBjYWVmZmVkOTI4ODkzM2RhNWM2ZjkwYTU3N2FjNjA4NjUwYWVjODNhMGEwMzdhYmE2YmIwYyIsInZlcnNpb24iOjF9.sihEhcsOeg8dvpuGgC-KCp1PsRNyguAif2uTBv5ELtRnM5KmMaHzRqpdpdc88Dj_DeuY6Y6qPQJt_dGk2q1rDQ |
|
- type: f1 |
|
value: 0.9694196751375908 |
|
name: F1 Weighted |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMTQ5ZjdiM2NiNDNkZTY5ZjNjNWUzZmI1MzgwMjhhNDEzMTEzZjFiNDhmZDllYmI0NjIwYjY0ZjcxM2M0ODE3NSIsInZlcnNpb24iOjF9.x4oR_PL0ALHYl-s4S7cPNPm4asSX3s3h30m-TKe7wpyZs0x6jwOqF-Tb1kgd4IMLl23pzsezmh72e_PmBFpRCg |
|
- type: loss |
|
value: 0.14272506535053253 |
|
name: loss |
|
verified: true |
|
verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiODU3NGFiMzIxYWI4NzYxMzUxZGE5ZTZkYTlkN2U5MTI1NzA5NTBiNGM3Y2Q5YmVmZjU0MmU5MjJlZThkZTllMCIsInZlcnNpb24iOjF9.3QeWbECpJ0MHV5gC0_ES6PpwplLsCHPKuToErB1MSG69xNWVyMjKu1-1YEWZOU6dGfwKGh_HvwucY5kC9qwWBQ |
|
--- |
|
|
|
# TREC 6-class Task: distilbert-base-cased |
|
|
|
## Model description |
|
|
|
A simple base distilBERT model trained on the "trec" dataset. |
|
|
|
## Intended uses & limitations |
|
|
|
#### How to use |
|
|
|
##### Transformers |
|
|
|
```python |
|
# Load model and tokenizer |
|
from transformers import AutoModelForSequenceClassification, AutoTokenizer |
|
|
|
model = AutoModelForQuestionAnswering.from_pretrained(model_name) |
|
tokenizer = AutoTokenizer.from_pretrained(model_name) |
|
|
|
# Use pipeline |
|
from transformers import pipeline |
|
|
|
model_name = "aychang/distilbert-base-cased-trec-coarse" |
|
|
|
nlp = pipeline("sentiment-analysis", model=model_name, tokenizer=model_name) |
|
|
|
results = nlp(["Where did the queen go?", "Why did the Queen hire 1000 ML Engineers?"]) |
|
``` |
|
|
|
##### AdaptNLP |
|
|
|
```python |
|
from adaptnlp import EasySequenceClassifier |
|
|
|
model_name = "aychang/distilbert-base-cased-trec-coarse" |
|
texts = ["Where did the queen go?", "Why did the Queen hire 1000 ML Engineers?"] |
|
|
|
classifer = EasySequenceClassifier |
|
results = classifier.tag_text(text=texts, model_name_or_path=model_name, mini_batch_size=2) |
|
``` |
|
|
|
#### Limitations and bias |
|
|
|
This is minimal language model trained on a benchmark dataset. |
|
|
|
## Training data |
|
|
|
TREC https://huggingface.co/datasets/trec |
|
|
|
## Training procedure |
|
|
|
Preprocessing, hardware used, hyperparameters... |
|
#### Hardware |
|
One V100 |
|
|
|
#### Hyperparameters and Training Args |
|
```python |
|
from transformers import TrainingArguments |
|
|
|
training_args = TrainingArguments( |
|
output_dir='./models', |
|
overwrite_output_dir=False, |
|
num_train_epochs=2, |
|
per_device_train_batch_size=16, |
|
per_device_eval_batch_size=16, |
|
warmup_steps=500, |
|
weight_decay=0.01, |
|
evaluation_strategy="steps", |
|
logging_dir='./logs', |
|
fp16=False, |
|
eval_steps=500, |
|
save_steps=300000 |
|
) |
|
``` |
|
|
|
## Eval results |
|
|
|
``` |
|
{'epoch': 2.0, |
|
'eval_accuracy': 0.97, |
|
'eval_f1': array([0.98220641, 0.91620112, 1. , 0.97709924, 0.98678414, |
|
0.97560976]), |
|
'eval_loss': 0.14275787770748138, |
|
'eval_precision': array([0.96503497, 0.96470588, 1. , 0.96969697, 0.98245614, |
|
0.96385542]), |
|
'eval_recall': array([1. , 0.87234043, 1. , 0.98461538, 0.99115044, |
|
0.98765432]), |
|
'eval_runtime': 0.9731, |
|
'eval_samples_per_second': 513.798} |
|
``` |
|
|