Spaces:
Runtime error
Runtime error
initial test
Browse files- app.py +59 -0
- report_template.docx +0 -0
- requirements.txt +4 -0
app.py
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
# from utils import *
|
3 |
+
|
4 |
+
########## Title for the Web App ##########
|
5 |
+
st.title("Report Generator")
|
6 |
+
|
7 |
+
########## Create Input field ##########
|
8 |
+
# feedback = st.text_input('Type your text here', 'Customer suggested that the customer service needs to be improved and the response time needs to be improved.')
|
9 |
+
|
10 |
+
# if st.button('Click for predictions!'):
|
11 |
+
# with st.spinner('Generating predictions...'):
|
12 |
+
|
13 |
+
# topics_prob, sentiment_prob, touchpoint_prob = get_single_prediction(feedback)
|
14 |
+
|
15 |
+
# bar_topic = px.bar(topics_prob, x='probability', y='topic')
|
16 |
+
|
17 |
+
# bar_touchpoint = px.bar(touchpoint_prob, x='probability', y='touchpoint')
|
18 |
+
|
19 |
+
# pie = px.pie(sentiment_prob,
|
20 |
+
# values='probability',
|
21 |
+
# names='sentiment',
|
22 |
+
# color_discrete_map={'positive':'rgb(0, 204, 0)',
|
23 |
+
# 'negative':'rgb(215, 11, 11)'
|
24 |
+
# },
|
25 |
+
# color='sentiment'
|
26 |
+
# )
|
27 |
+
|
28 |
+
# st.plotly_chart(bar_topic, use_container_width=True)
|
29 |
+
# st.plotly_chart(bar_touchpoint, use_container_width=True)
|
30 |
+
# st.plotly_chart(pie, use_container_width=True)
|
31 |
+
|
32 |
+
# st.write("\n")
|
33 |
+
# st.subheader('Or... Upload a csv file if you have a file instead.')
|
34 |
+
# st.write("\n")
|
35 |
+
|
36 |
+
# st.download_button(
|
37 |
+
# label="Download sample file here",
|
38 |
+
# data=sample_file,
|
39 |
+
# file_name='sample_data.csv',
|
40 |
+
# mime='text/csv',
|
41 |
+
# )
|
42 |
+
|
43 |
+
uploaded_files = st.file_uploader("Upload multiple files", accept_multiple_files=True)
|
44 |
+
|
45 |
+
if uploaded_files is not None:
|
46 |
+
|
47 |
+
# with st.spinner('Generating report...'):
|
48 |
+
# results = get_multiple_predictions(uploaded_file)
|
49 |
+
for uploaded_file in uploaded_files:
|
50 |
+
st.write("filename: " + uploaded_file.name)
|
51 |
+
|
52 |
+
# st.download_button(
|
53 |
+
# label="Download report here",
|
54 |
+
# data=results,
|
55 |
+
# file_name='results.csv',
|
56 |
+
# mime='text/csv',
|
57 |
+
# )
|
58 |
+
|
59 |
+
|
report_template.docx
ADDED
Binary file (32.7 kB). View file
|
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit==1.4.0
|
2 |
+
docxtpl
|
3 |
+
pandas==1.2.4
|
4 |
+
datetime
|