How to use
#2
by
erickmaziero
- opened
Could someone provide a code exemplifying how to use the model?
Do you still need help?
Yes, @hugtex . Do you have a code snippet with what is necessary to use the model? Thanks a lot!
@erickmaziero
try the following code:
from transformers import pipeline
qa_model = pipeline("question-answering", "mrm8488/bert-base-portuguese-cased-finetuned-squad-v1-pt")
query = "" # write here your questions
source_information = "" # write here the text you would like to use has a base for your questions
answer = qa_model(question = query, context = source_information)
print(answer)