aloqas-qa-fastapi / modeles.py
alexandre-huynh's picture
Update modeles.py
3aaaf7b verified
raw
history blame
No virus
432 Bytes
import subprocess
import sys
def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", "--user", package])
install("transformers")
from transformers import pipeline
def bert(context, question):
question_answerer = pipeline("question-answering", "alexandre-huynh/bert-base-uncased-finetuned-squad-single-epoch", framework="tf")
return(question_answerer(context=context, question=question))