MorenoLaQuatra commited on
Commit ·
37316da
1
Parent(s): 3979eaa
Adding model and first version of the README
Browse files- README.md +43 -0
- config.json +36 -0
- pytorch_model.bin +3 -0
- tokenizer_config.json +1 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
README.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
| 3 |
---
|
| 4 |
+
|
| 5 |
+
# Inclusively Classification Model
|
| 6 |
+
|
| 7 |
+
This model is an Italian classification model fine-tuned from the [Italian BERT model](https://huggingface.co/dbmdz/bert-base-italian-xxl-cased) for the classification of inclusive language in Italian.
|
| 8 |
+
|
| 9 |
+
It has been trained to detect three classes:
|
| 10 |
+
- `inclusive`: the sentence is inclusive (e.g. "Il personale docente e non docente")
|
| 11 |
+
- `not_inclusive`: the sentence is not inclusive (e.g. "I professori")
|
| 12 |
+
- `not_pertinent`: the sentence is not pertinent to the task (e.g. "La scuola è chiusa")
|
| 13 |
+
|
| 14 |
+
## Training data
|
| 15 |
+
|
| 16 |
+
The model has been trained on a dataset containing:
|
| 17 |
+
- 8580 training sentences
|
| 18 |
+
- 1073 validation sentences
|
| 19 |
+
- 1072 test sentences
|
| 20 |
+
|
| 21 |
+
The data collection has been manually annotated by experts in the field of inclusive language (dataset is not publicly available yet).
|
| 22 |
+
|
| 23 |
+
## Training procedure
|
| 24 |
+
|
| 25 |
+
The model has been fine-tuned from the [Italian BERT model](https://huggingface.co/dbmdz/bert-base-italian-xxl-cased) using the following hyperparameters:
|
| 26 |
+
- `max_length`: 128
|
| 27 |
+
- `batch_size`: 128
|
| 28 |
+
- `learning_rate`: 5e-5
|
| 29 |
+
- `warmup_steps`: 500
|
| 30 |
+
- `epochs`: 10 (best model is selected based on validation accuracy)
|
| 31 |
+
- `optimizer`: AdamW
|
| 32 |
+
|
| 33 |
+
## Evaluation results
|
| 34 |
+
|
| 35 |
+
The model has been evaluated on the test set and obtained the following results:
|
| 36 |
+
|
| 37 |
+
| Model | Accuracy | Inclusive F1 | Not inclusive F1 | Not pertinent F1 |
|
| 38 |
+
|-------|----------|--------------|------------------|------------------|
|
| 39 |
+
| TF-IDF + MLP | 0.68 | 0.63 | 0.69 | 0.66 |
|
| 40 |
+
| TF-IDF + SVM | 0.61 | 0.53 | 0.60 | 0.78 |
|
| 41 |
+
| TF-IDF + GB | 0.74 | 0.74 | 0.76 | 0.72 |
|
| 42 |
+
| multilingual | 0.86 | 0.88 | 0.89 | 0.83 |
|
| 43 |
+
| **This** | 0.89 | 0.88 | 0.92 | 0.85 |
|
| 44 |
+
|
| 45 |
+
The model has been compared with a multilingual model trained on the same data and obtained better results.
|
| 46 |
+
|
config.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "dbmdz/bert-base-italian-xxl-cased",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"classifier_dropout": null,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.1,
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "inclusive",
|
| 13 |
+
"1": "not_inclusive",
|
| 14 |
+
"2": "not_pertinent"
|
| 15 |
+
},
|
| 16 |
+
"initializer_range": 0.02,
|
| 17 |
+
"intermediate_size": 3072,
|
| 18 |
+
"label2id": {
|
| 19 |
+
"inclusive": 0,
|
| 20 |
+
"not_inclusive": 1,
|
| 21 |
+
"not_pertinent": 2
|
| 22 |
+
},
|
| 23 |
+
"layer_norm_eps": 1e-12,
|
| 24 |
+
"max_position_embeddings": 512,
|
| 25 |
+
"model_type": "bert",
|
| 26 |
+
"num_attention_heads": 12,
|
| 27 |
+
"num_hidden_layers": 12,
|
| 28 |
+
"pad_token_id": 0,
|
| 29 |
+
"position_embedding_type": "absolute",
|
| 30 |
+
"problem_type": "single_label_classification",
|
| 31 |
+
"torch_dtype": "float32",
|
| 32 |
+
"transformers_version": "4.17.0",
|
| 33 |
+
"type_vocab_size": 2,
|
| 34 |
+
"use_cache": true,
|
| 35 |
+
"vocab_size": 32102
|
| 36 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f11f5dfedbc3c7bbb7ca7e3eea0fa23fa32cde1b349449bcbe683cf3dd606874
|
| 3 |
+
size 442876973
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"do_lower_case": false, "max_len": 512, "init_inputs": []}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc383b5651db0bb264bad9740e8b854a6208441cb65120005c8af42af3496518
|
| 3 |
+
size 2991
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|