mlkorra commited on
Commit
fc5624a
·
1 Parent(s): 39a4693

Remove forms

Browse files
Files changed (1) hide show
  1. app.py +14 -20
app.py CHANGED
@@ -105,10 +105,8 @@ def app():
105
 
106
  check_examples = st.sidebar.checkbox("Try Examples!")
107
 
108
- st.markdown(read_markdown('userguide.md'))
109
- #companyname = st.text_input('Input company name here:', value="")
110
- #companygrp = st.text_input('Input industry group here:', value="")
111
- #companydesc = st.text_input("Input company description: (can be found in the company's linkedin page)", value="")
112
  states= ['Georgia', 'California', 'Texas', 'Tennessee', 'Massachusetts',
113
  'New York', 'Ohio', 'Delaware', 'Florida', 'Washington',
114
  'Connecticut', 'Colorado', 'South Carolina', 'New Jersey',
@@ -124,34 +122,30 @@ def app():
124
  #states_used = st.multiselect('Select states you want to analyse', states)
125
 
126
  examples = [['Coursera','Education','California',['California','New York','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']]
127
-
128
- user = st.form(key='tm')
129
 
130
  if check_examples:
131
-
132
-
133
  example = examples[0]
134
- companyname = user.text_input('Input company name here:', example[0])
135
- companygrp = user.text_input('Input industry group here:', example[1])
136
- companydesc = user.text_input("Input company description: (can be found in the company's linkedin page)", example[4])
137
- state = user.selectbox('Select state the company is based in',states,index = 1)
138
- states_used = user.multiselect('Select states you want to analyse', states,example[3])
139
  #model_path = 'topicmodel/my_model.pkl'
140
  #topic,prob_req,embed,df,index = load_topic_model(model_path,example[0],example[1],example[2],example[3],example[4])
141
  #visualizer(prob_req,embed,df,index,company_name)
142
 
143
  else:
144
 
145
- companyname = user.text_input('Input company name here:', value="")
146
- companygrp = user.text_input('Input industry group here:', value="")
147
- companydesc = user.text_input("Input company description: (can be found in the company's linkedin page)", value="")
148
- state= user.selectbox('Select state the company is based in', states)
149
- states_used = user.multiselect('Select states you want to analyse', states)
150
 
151
- if(user.form_submit_button(label = "Analyse Competition")):
152
 
153
  if companyname=="" or companydesc=="" or companygrp=="" or states_used==[]:
154
- user.error("Some fields are empty!")
155
  else:
156
  model_path = 'topicmodel/my_model.pkl'
157
  topic,prob_req,embed,df,index = load_topic_model(model_path, companyname, companygrp, state, states_used, companydesc)
 
105
 
106
  check_examples = st.sidebar.checkbox("Try Examples!")
107
 
108
+ st.markdown(read_markdown("userguide.md"))
109
+
 
 
110
  states= ['Georgia', 'California', 'Texas', 'Tennessee', 'Massachusetts',
111
  'New York', 'Ohio', 'Delaware', 'Florida', 'Washington',
112
  'Connecticut', 'Colorado', 'South Carolina', 'New Jersey',
 
122
  #states_used = st.multiselect('Select states you want to analyse', states)
123
 
124
  examples = [['Coursera','Education','California',['California','New York','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']]
 
 
125
 
126
  if check_examples:
 
 
127
  example = examples[0]
128
+ companyname = st.text_input('Input company name here:', example[0])
129
+ companygrp = st.text_input('Input industry group here:', example[1])
130
+ companydesc = st.text_input("Input company description: (can be found in the company's linkedin page)", example[4])
131
+ state = st.selectbox('Select state the company is based in',states,index = 1)
132
+ states_used = st.multiselect('Select states you want to analyse', states,example[3])
133
  #model_path = 'topicmodel/my_model.pkl'
134
  #topic,prob_req,embed,df,index = load_topic_model(model_path,example[0],example[1],example[2],example[3],example[4])
135
  #visualizer(prob_req,embed,df,index,company_name)
136
 
137
  else:
138
 
139
+ companyname = st.text_input('Input company name here:', value="")
140
+ companygrp = st.text_input('Input industry group here:', value="")
141
+ companydesc = st.text_input("Input company description: (can be found in the company's linkedin page)", value="")
142
+ state= st.selectbox('Select state the company is based in', states)
143
+ states_used = st.multiselect('Select states you want to analyse', states)
144
 
145
+ if(st.button("Analyse Competition")):
146
 
147
  if companyname=="" or companydesc=="" or companygrp=="" or states_used==[]:
148
+ st.error("Some fields are empty!")
149
  else:
150
  model_path = 'topicmodel/my_model.pkl'
151
  topic,prob_req,embed,df,index = load_topic_model(model_path, companyname, companygrp, state, states_used, companydesc)