File size: 893 Bytes
a88183c
c37d535
 
 
 
a88183c
 
b4d0d8e
 
c37d535
 
a88183c
 
c37d535
 
 
 
a88183c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from transformers import pipeline

def squeezebert(context, question):
    # Define the specific model and tokenizer for SqueezeBERT
    model_name = "ALOQAS/squeezebert-uncased-finetuned-squad-v2"
    pip = pipeline('question-answering', model=model_name, tokenizer=model_name)
    return pip(context=context, question=question)

def bert(context, question):
    # Define the specific model and tokenizer for BERT
    model_name = "ALOQAS/bert-large-uncased-finetuned-squad-v2"
    pip = pipeline('question-answering', model=model_name, tokenizer=model_name)
    return pip(context=context, question=question)

def deberta(context, question):
    # Define the specific model and tokenizer for DeBERTa
    model_name = "ALOQAS/deberta-large-finetuned-squad-v2"
    pip = pipeline('question-answering', model=model_name, tokenizer=model_name)
    return pip(context=context, question=question)