Views
No views yet
batch_size = 56
n_epochs = 4
max_seq_len = 384
learning_rate = 3e-5
lr_schedule = LinearWarmup
embeds_dropout_prob = 0.1
temperature = 3
distillation_loss_weight = 0.751reader = FARMReader(model_name_or_path="deepset/xlm-roberta-base-squad2-distilled")
2# or
3reader = TransformersReader(model_name_or_path="deepset/xlm-roberta-base-squad2-distilled",tokenizer="deepset/xlm-roberta-base-squad2-distilled")deepset/xlm-roberta-base-squad2-distilled being used for [question answering], check out the Tutorials in Haystack Documentation1from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
2
3model_name = "deepset/xlm-roberta-base-squad2-distilled"
4
5# a) Get predictions
6nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
7QA_input = {
8 'question': 'Why is model conversion important?',
9 'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.'
10}
11res = nlp(QA_input)
12
13# b) Load model & tokenizer
14model = AutoModelForQuestionAnswering.from_pretrained(model_name)
15tokenizer = AutoTokenizer.from_pretrained(model_name)"exact": 74.06721131980123%
"f1": 76.39919553344667%
