File size: 392 Bytes
7223537
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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'])