|
import streamlit as st |
|
from utils import * |
|
|
|
|
|
|
|
def main(): |
|
|
|
|
|
st.set_page_config(page_title="pdf invoice Extraction Bot") |
|
st.title("I am Bot. How can I help you today?... ") |
|
st.subheader("I can help you extract text from pdfs. You can download CSV as an output and Aduio2Text.") |
|
|
|
|
|
|
|
pdf = st.file_uploader("Upload pdf invoices here for now, only PDF files allowed for Now", type=["pdf"],accept_multiple_files=True) |
|
|
|
submit=st.button("Extract Data") |
|
|
|
if submit: |
|
with st.spinner('Wait for it...'): |
|
df=create_docs(pdf) |
|
st.write(df.head()) |
|
|
|
data_as_csv= df.to_csv(index=False).encode("utf-8") |
|
|
|
st.download_button( |
|
"Download data as CSV", |
|
data_as_csv, |
|
"benchmark-tools.csv", |
|
"text/csv", |
|
key="download-tools-csv", |
|
) |
|
st.success("Hope I was able to save your time❤️") |
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
main() |
|
|