Released from
Facebook together with the paper
Cross-lingual Language Model Pretraining by Guillaume Lample and Alexis Conneau and fine-tuned on
XQuAD for multilingual (
11 different languages)
Q&A downstream task.
As the dataset is based on SQuAD v1.1, there are no unanswerable questions in the data. We chose this
setting so that models can focus on cross-lingual transfer.
We show the average number of tokens per paragraph, question, and answer for each language in the
table below. The statistics were obtained using
Jieba for Chinese
and the
Moses tokenizer
for the other languages.
As XQuAD is just an evaluation dataset, I used Data augmentation techniques (scraping, neural machine translation, etc) to obtain more samples and split the dataset in order to have a train and test set. The test set was created in a way that contains the same number of samples for each language. Finally, I got:
The model was trained on a Tesla P100 GPU and 25GB of RAM.
The script for fine tuning can be found
here
1from transformers import pipeline
2
3qa_pipeline = pipeline(
4 "question-answering",
5 model="mrm8488/xlm-multi-finetuned-xquadv1",
6 tokenizer="mrm8488/xlm-multi-finetuned-xquadv1"
7)
8
9# English
10qa_pipeline({
11 'context': "Manuel Romero has been working hardly in the repository hugginface/transformers lately",
12 'question': "Who has been working hard for hugginface/transformers lately?"
13})
14
15#Output: {'answer': 'Manuel', 'end': 6, 'score': 8.531880747878265e-05, 'start': 0}
16
17# Russian
18qa_pipeline({
19 'context': "Мануэль Ромеро в последнее время почти не работал в репозитории hugginface / transformers",
20 'question': "Кто в последнее время усердно работал над обнимашками / трансформерами?"
21
22})
23
24#Output: {'answer': 'работал в репозитории hugginface /','end': 76, 'score': 0.00012340750456964894, 'start': 42}