donut_demo / app.py
amritzeon's picture
Update app.py
a1a349a
raw
history blame contribute delete
No virus
392 Bytes
import streamlit as st
from transformers import pipeline
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'])