Spaces:
Running
Running
from transformers import pipeline | |
def get_result(image_path, question): | |
nlp = pipeline( | |
"document-question-answering", | |
model="impira/layoutlm-document-qa", | |
) | |
result = nlp(image_path, question) | |
return result[0]['answer'] |