Spaces:
Runtime error
Runtime error
import streamlit as st | |
from transformers import pipeline | |
import pytesseract | |
from PIL import Image | |
nlp = pipeline("document-question-answering",model = "naver-clova-ix/donut-base-finetuned-docvqa") | |
st.title("DocumentAI Entity Extractor") | |
file_name = st.file_uploader("Upload an invoice image") | |
image = Image.open(file_name) | |
outputs = nlp(image,"what is the nature of transaction?") | |
print(outputs[0]['answer']) |