Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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'])
|