Spaces:
Running
Running
Download layoutlm.py from MediPlusPlus/VQA_new: direct link, hf CLI and curl.
- Browser
- Download file 255 Bytes
-
https://huggingface.co/spaces/MediPlusPlus/VQA_new/resolve/main/layoutlm.py
- Command line
-
hf download hf://spaces/MediPlusPlus/VQA_new/layoutlm.py
-
curl -L -o layoutlm.py https://huggingface.co/spaces/MediPlusPlus/VQA_new/resolve/main/layoutlm.py
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'] |