amritzeon commited on
Commit
7223537
·
1 Parent(s): ae87cf4

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+ import pytesseract
4
+ from PIL import Image
5
+ nlp = pipeline("document-question-answering",model = "naver-clova-ix/donut-base-finetuned-docvqa")
6
+
7
+ st.title("DocumentAI Entity Extractor")
8
+ file_name = st.file_uploader("Upload an invoice image")
9
+
10
+ image = Image.open(file_name)
11
+ outputs = nlp(image,"what is the nature of transaction?")
12
+ print(outputs[0]['answer'])