greco commited on
Commit
ad54918
·
1 Parent(s): c6af1a7

update text description

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -368,7 +368,6 @@ st.write(f'''
368
  An an example, within the topic of 'Climate Change', we are interested in finance, politics, technology, and wildlife.
369
  Using **Zero-shot Classification**, we can classify responses into one of these four categories.
370
  As an added bonus, we can also find out how responders feel about the categories using **Sentiment Analysis**.
371
- We'll use a different set of {len(sentiment_results):,} tweets related to climate change.
372
  ''')
373
  st.write('\n')
374
 
@@ -429,14 +428,14 @@ with st.form('classify_tweets'):
429
  sample_tweet_index = user_define_tweet
430
  sample_tweet = sentiment_results['Tweet'].iloc[sample_tweet_index]
431
  # input for user defined text
432
- user_defined_input = st.text_input('Enter custom text (optional, leave blank to use Tweets):', '')
433
  # check if user has entered any custom text
434
  # if user_define_input is not blank, then override sample_tweet
435
  if user_defined_input:
436
  sample_tweet = user_defined_input
437
 
438
  # submit form
439
- submit = st.form_submit_button('Classify Tweet')
440
  st.write('\n')
441
 
442
  st.write(f'''
@@ -535,7 +534,7 @@ fig = px.pie(
535
  height=600
536
  )
537
  fig.update_traces(textposition='inside', textinfo='percent+label')
538
- st.plotly_chart(fig)
539
 
540
  fig = px.bar(
541
  classification_sentiment_agg,
@@ -548,7 +547,7 @@ fig = px.bar(
548
  )
549
  fig.update_yaxes(range=[0, 1])
550
  fig.add_hline(y=0.5, line_width=3, line_color='darkgreen')
551
- st.plotly_chart(fig)
552
 
553
  st.write('\n')
554
- st.markdown('''---''')
 
368
  An an example, within the topic of 'Climate Change', we are interested in finance, politics, technology, and wildlife.
369
  Using **Zero-shot Classification**, we can classify responses into one of these four categories.
370
  As an added bonus, we can also find out how responders feel about the categories using **Sentiment Analysis**.
 
371
  ''')
372
  st.write('\n')
373
 
 
428
  sample_tweet_index = user_define_tweet
429
  sample_tweet = sentiment_results['Tweet'].iloc[sample_tweet_index]
430
  # input for user defined text
431
+ user_defined_input = st.text_input('Enter custom text (optional, leave blank to use tweets):', '')
432
  # check if user has entered any custom text
433
  # if user_define_input is not blank, then override sample_tweet
434
  if user_defined_input:
435
  sample_tweet = user_defined_input
436
 
437
  # submit form
438
+ submit = st.form_submit_button('Classify Text')
439
  st.write('\n')
440
 
441
  st.write(f'''
 
534
  height=600
535
  )
536
  fig.update_traces(textposition='inside', textinfo='percent+label')
537
+ st.plotly_chart(fig, use_container_width=True)
538
 
539
  fig = px.bar(
540
  classification_sentiment_agg,
 
547
  )
548
  fig.update_yaxes(range=[0, 1])
549
  fig.add_hline(y=0.5, line_width=3, line_color='darkgreen')
550
+ st.plotly_chart(fig, use_container_width=True)
551
 
552
  st.write('\n')
553
+ st.markdown('''---''')