This is the
bert-base-finnish-cased-v1 model, fine-tuned using an automatically translated
Finnish version of the SQuAD2.0 dataset in combination with the Finnish partition of the
TyDi-QA dataset. It's been trained on question-answer pairs,
excluding unanswerable questions , for the task of question answering.
Another QA model that has been fine-tuned with also unanswerable questions is also available:
bert-base-finnish-cased-squad2-fi .
Language model: bert-base-finnish-cased-v1
Language: Finnish
Downstream-task: Extractive QA
Training data: Answerable questions from
Finnish SQuAD 2.0 + Finnish partition of TyDi-QA
Eval data: Answerable questions from
Finnish SQuAD 2.0 + Finnish partition of TyDi-QA
1 from transformers import AutoModelForQuestionAnswering , AutoTokenizer , pipeline
2
3 model_name = "ilmariky/bert-base-finnish-cased-squad1-fi"
4
5 # a) Get predictions
6 nlp = pipeline ( 'question-answering' , model = model_name , tokenizer = model_name )
7 QA_input = {
8 'question' : 'Mikä tämä on?' ,
9 'context' : 'Tämä on testi.'
10 }
11 res = nlp ( QA_input )
12
13 # b) Load model & tokenizer
14 model = AutoModelForQuestionAnswering . from_pretrained ( model_name )
15 tokenizer = AutoTokenizer . from_pretrained ( model_name )
Evaluated with a slightly modified version of the
official eval script .
{
"exact": 58.00497718788884,
"f1": 69.90891092523077,
"total": 4822,
"HasAns_exact": 58.00497718788884,
"HasAns_f1": 69.90891092523077,
"HasAns_total": 4822
}