Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,31 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from utils import *
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from utils import *
|
| 3 |
|
| 4 |
+
def main():
|
| 5 |
+
|
| 6 |
+
st.set_page_config(page_title="Invoice Extraction Bot")
|
| 7 |
+
st.title("Invoice Extraction Bot ")
|
| 8 |
+
|
| 9 |
+
# Upload the Invoices (pdf files)
|
| 10 |
+
pdf = st.file_uploader("Upload invoices here, only PDF format", type=["pdf"],accept_multiple_files=True)
|
| 11 |
+
|
| 12 |
+
submit=st.button("Extract Data")
|
| 13 |
+
|
| 14 |
+
if submit:
|
| 15 |
+
with st.spinner('Loader'):
|
| 16 |
+
df=create_docs(pdf)
|
| 17 |
+
st.write(df.head())
|
| 18 |
+
|
| 19 |
+
data_as_csv= df.to_csv(index=False).encode("utf-8")
|
| 20 |
+
st.download_button(
|
| 21 |
+
"Download data as CSV",
|
| 22 |
+
data_as_csv,
|
| 23 |
+
"benchmark-tools.csv",
|
| 24 |
+
"text/csv",
|
| 25 |
+
key="download-tools-csv",
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
if __name__ == '__main__':
|
| 29 |
+
main()
|
| 30 |
+
|
| 31 |
+
|