Update README.md
Browse files
README.md
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: italian
|
3 |
+
widget:
|
4 |
+
- text: "Quando nacque D'Annunzio?"
|
5 |
+
context: "D'Annunzio nacque nel 1863"
|
6 |
+
---
|
7 |
+
|
8 |
+
# Italian Bert Base Uncased on Squad-it
|
9 |
+
|
10 |
+
## Model description
|
11 |
+
|
12 |
+
This model is the uncased base version of the italian BERT trained by `dbmdz`, which you may find at `dbmdz/bert-base-italian-uncased`.
|
13 |
+
|
14 |
+
#### How to use
|
15 |
+
|
16 |
+
```python
|
17 |
+
from transformers import pipeline
|
18 |
+
|
19 |
+
nlp = pipeline('question-answering', model='antoniocappiello/bert-base-italian-uncased-squad-it')
|
20 |
+
|
21 |
+
# nlp(context="D'Annunzio nacque nel 1863", question="Quando nacque D'Annunzio?")
|
22 |
+
# {'score': 0.9990354180335999, 'start': 22, 'end': 25, 'answer': '1863'}
|
23 |
+
```
|
24 |
+
|
25 |
+
## Training data
|
26 |
+
|
27 |
+
It has been trained on the question answering task using [SQuAD-it](http://sag.art.uniroma2.it/demo-software/squadit/), derived from the original SQuAD dataset and obtained through the semi-automatic translation of the SQuAD dataset in Italian.
|
28 |
+
|
29 |
+
## Training procedure
|
30 |
+
|
31 |
+
```bash
|
32 |
+
python ./examples/run_squad.py \
|
33 |
+
--model_type bert \
|
34 |
+
--model_name_or_path ./bert-base-italian-uncased/ \
|
35 |
+
--do_train \
|
36 |
+
--do_eval \
|
37 |
+
--train_file ./squad_it_uncased/train-v1.1.json \
|
38 |
+
--predict_file ./squad_it_uncased/dev-v1.1.json \
|
39 |
+
--learning_rate 3e-5 \
|
40 |
+
--num_train_epochs 2 \
|
41 |
+
--max_seq_length 384 \
|
42 |
+
--doc_stride 128 \
|
43 |
+
--output_dir ./models/bert-base-italian-uncased-squad-it/ \
|
44 |
+
--per_gpu_eval_batch_size=3 \
|
45 |
+
--per_gpu_train_batch_size=3 \
|
46 |
+
--do_lower_case \
|
47 |
+
```
|
48 |
+
|
49 |
+
## Eval results
|
50 |
+
|
51 |
+
| Model | batch | EM | F1 |
|
52 |
+
| ------------- |:-----:|:-----:| -----:|
|
53 |
+
| BERT base uncased | 3 | **63.8** | **75.30** |
|