DocVQA-Sanctum / layoutlm.py
krishnapal2308
Initial Commit
0bd5bed
raw
history blame
256 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']