🚀 Italian BERT fine-tuned on SQuAD_it v1
This is an Italian BERT base cased model fine-tuned on italian SQuAD for the Q&A downstream task.
📚 Details of Italian BERT
The source data for the Italian BERT model includes a recent Wikipedia dump and various texts from the OPUS corpora collection. The final training corpus is 13GB in size and contains 2,050,057,573 tokens.
For sentence splitting, we use NLTK (which is faster than spacy). Our cased and uncased models are trained with an initial sequence length of 512 subwords for approximately 2 - 3 million steps.
For the XXL Italian models, we use the same training data from OPUS and supplement it with data from the Italian part of the OSCAR corpus. As a result, the final training corpus is 81GB in size and contains 13,138,379,147 tokens.
More details can be found in its official model card
This model was created by Stefan at MDZ
📚 Details of the downstream task (Q&A) - Dataset
Italian SQuAD v1.1 is derived from the SQuAD dataset and is obtained through semi - automatic translation of the SQuAD dataset into Italian. It is a large - scale dataset for open question answering on factoid questions in Italian.
The dataset contains more than 60,000 question/answer pairs derived from the original English dataset. The dataset is split into training and test sets to support the replicability of the benchmarking of QA systems:
SQuAD_it-train.json
: It contains training examples derived from the original SQuAD 1.1 training material.
SQuAD_it-test.json
: It contains test/benchmarking examples derived from the original SQuAD 1.1 development material.
More details about SQuAD - it can be found in [Croce et al. 2018]. The original paper can be found at this link.
🏋️ Model training
The model was trained on a Tesla P100 GPU with 25GB of RAM.
The script for fine - tuning can be found here
📝 Results
Property |
Details |
EM |
62.51 |
F1 score |
74.16 |
Raw metrics
{
"exact": 62.5180707057432,
"f1": 74.16038329042492,
"total": 7609,
"HasAns_exact": 62.5180707057432,
"HasAns_f1": 74.16038329042492,
"HasAns_total": 7609,
"best_exact": 62.5180707057432,
"best_exact_thresh": 0.0,
"best_f1": 74.16038329042492,
"best_f1_thresh": 0.0
}
⚖️ Comparison
🚀 Model in action
💻 Usage Examples
Basic Usage
from transformers import pipeline
nlp_qa = pipeline(
'question-answering',
model='mrm8488/bert-italian-finedtuned-squadv1-it-alfa',
tokenizer='mrm8488/bert-italian-finedtuned-squadv1-it-alfa'
)
nlp_qa(
{
'question': 'Per quale lingua stai lavorando?',
'context': 'Manuel Romero è colaborando attivamente con HF / trasformatori per il trader del poder de las últimas ' +
'técnicas di procesamiento de lenguaje natural al idioma español'
}
)
Created by Manuel Romero/@mrm8488 | LinkedIn
Made with ♥ in Spain
📄 License
Dataset citation
@InProceedings{10.1007/978-3-030-03840-3_29,
author="Croce, Danilo and Zelenanska, Alexandra and Basili, Roberto",
editor="Ghidini, Chiara and Magnini, Bernardo and Passerini, Andrea and Traverso, Paolo",
title="Neural Learning for Question Answering in Italian",
booktitle="AI*IA 2018 -- Advances in Artificial Intelligence",
year="2018",
publisher="Springer International Publishing",
address="Cham",
pages="389--402",
isbn="978-3-030-03840-3"
}