VQA_new / layoutlm.py
MediPlusPlus's picture
layoutLM
0282277 verified
raw
history blame contribute delete
255 Bytes
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']