Hemasagar commited on
Commit
c76a309
·
verified ·
1 Parent(s): 92bf8e0

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -0
app.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from dotenv import load_dotenv
3
+ from utils import *
4
+
5
+
6
+
7
+ def main():
8
+ load_dotenv()
9
+
10
+ st.set_page_config(page_title="Invoice Extraction Bot")
11
+ st.title("Audio_to_text & Invoice Extraction Bot...💁 ")
12
+ st.subheader("I can help you in extracting text and invoice data and Aduio2text")
13
+
14
+
15
+ # Upload the Invoices (pdf files)...
16
+ pdf = st.file_uploader("Upload invoices here for now, only PDF files allowed and will accept other formate as well", type=["pdf"],accept_multiple_files=True)
17
+
18
+ submit=st.button("Extract Data")
19
+
20
+ if submit:
21
+ with st.spinner('Wait for it...'):
22
+ df=create_docs(pdf)
23
+ st.write(df.head())
24
+
25
+ data_as_csv= df.to_csv(index=False).encode("utf-8")
26
+
27
+ st.download_button(
28
+ "Download data as CSV",
29
+ data_as_csv,
30
+ "benchmark-tools.csv",
31
+ "text/csv",
32
+ key="download-tools-csv",
33
+ )
34
+ st.success("Hope I was able to save your time❤️")
35
+
36
+
37
+
38
+ #Invoking main function
39
+ if __name__ == '__main__':
40
+ main()