mlkorra commited on
Commit
96a99b3
·
1 Parent(s): 000fa39

Add examples to try

Browse files
Files changed (1) hide show
  1. app.py +40 -15
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import streamlit as st
2
  import pandas as pd
3
  import numpy as np
@@ -94,22 +95,46 @@ def load_topic_model(model_path, name, group, state, states_used, desc):
94
  def app():
95
 
96
  st.title("Competitive Analysis of Companies ")
97
- companyname = st.text_input('Input company name here:', value="")
98
- companygrp = st.text_input('Input industry group here:', value="")
99
- companydesc = st.text_input("Input company description: (can be found in the company's linkedin page)", value="")
 
 
 
100
  states= ['Georgia', 'California', 'Texas', 'Tennessee', 'Massachusetts',
101
- 'New York', 'Ohio', 'Delaware', 'Florida', 'Washington',
102
- 'Connecticut', 'Colorado', 'South Carolina', 'New Jersey',
103
- 'Michigan', 'Maryland', 'Pennsylvania', 'Virginia', 'Vermont',
104
- 'Minnesota', 'Illinois', 'North Carolina', 'Montana', 'Kentucky',
105
- 'Oregon', 'Iowa', 'District of Columbia', 'Arizona', 'Wisconsin',
106
- 'Louisiana', 'Idaho', 'Utah', 'Nevada', 'Nebraska', 'New Mexico',
107
- 'Missouri', 'Kansas', 'New Hampshire', 'Wyoming', 'Arkansas',
108
- 'Indiana', 'North Dakota', 'Hawaii', 'Alabama', 'Maine',
109
- 'Rhode Island', 'Mississippi', 'Alaska', 'Oklahoma',
110
- 'Washington DC', 'Giorgia']
111
- state= st.selectbox('Select state the company is based in', states)
112
- states_used = st.multiselect('Select states you want to analyse', states)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
  if(st.button("Analyse Competition")):
115
  if companyname=="" or companydesc=="" or companygrp=="" or states_used==[]:
 
1
+ from json import load
2
  import streamlit as st
3
  import pandas as pd
4
  import numpy as np
 
95
  def app():
96
 
97
  st.title("Competitive Analysis of Companies ")
98
+
99
+ check_examples = st.sidebar.checkbox("Try Examples!")
100
+
101
+ #companyname = st.text_input('Input company name here:', value="")
102
+ #companygrp = st.text_input('Input industry group here:', value="")
103
+ #companydesc = st.text_input("Input company description: (can be found in the company's linkedin page)", value="")
104
  states= ['Georgia', 'California', 'Texas', 'Tennessee', 'Massachusetts',
105
+ 'New York', 'Ohio', 'Delaware', 'Florida', 'Washington',
106
+ 'Connecticut', 'Colorado', 'South Carolina', 'New Jersey',
107
+ 'Michigan', 'Maryland', 'Pennsylvania', 'Virginia', 'Vermont',
108
+ 'Minnesota', 'Illinois', 'North Carolina', 'Montana', 'Kentucky',
109
+ 'Oregon', 'Iowa', 'District of Columbia', 'Arizona', 'Wisconsin',
110
+ 'Louisiana', 'Idaho', 'Utah', 'Nevada', 'Nebraska', 'New Mexico',
111
+ 'Missouri', 'Kansas', 'New Hampshire', 'Wyoming', 'Arkansas',
112
+ 'Indiana', 'North Dakota', 'Hawaii', 'Alabama', 'Maine',
113
+ 'Rhode Island', 'Mississippi', 'Alaska', 'Oklahoma',
114
+ 'Washington DC', 'Giorgia']
115
+ #state= st.selectbox('Select state the company is based in', states)
116
+ #states_used = st.multiselect('Select states you want to analyse', states)
117
+
118
+ examples = [['Coursera','Education','California',['California','Washington','Ohio'],'We are a social entrepreneurship company that partners with the top universities in the world to offer courses online for anyone to take, for free. We envision a future where the top universities are educating not only thousands of students, but millions. Our technology enables the best professors to teach tens or hundreds of thousands of students']]
119
+
120
+ if check_examples:
121
+ example = examples[0]
122
+ companyname = st.text_input('Input company name here:', example[0])
123
+ companygrp = st.text_input('Input industry group here:', example[1])
124
+ companydesc = st.text_input("Input company description: (can be found in the company's linkedin page)", example[4])
125
+ state = st.selectbox('Select state the company is based in',states,index = 1)
126
+ states_used = st.multiselect('Select states you want to analyse', states,example[3])
127
+ #model_path = 'topicmodel/my_model.pkl'
128
+ #topic,prob_req,embed,df,index = load_topic_model(model_path,example[0],example[1],example[2],example[3],example[4])
129
+ #visualizer(prob_req,embed,df,index,company_name)
130
+
131
+ else:
132
+
133
+ companyname = st.text_input('Input company name here:', value="")
134
+ companygrp = st.text_input('Input industry group here:', value="")
135
+ companydesc = st.text_input("Input company description: (can be found in the company's linkedin page)", value="")
136
+ state= st.selectbox('Select state the company is based in', states)
137
+ states_used = st.multiselect('Select states you want to analyse', states)
138
 
139
  if(st.button("Analyse Competition")):
140
  if companyname=="" or companydesc=="" or companygrp=="" or states_used==[]: