lunadebruyne commited on
Commit
8c09604
·
1 Parent(s): 78b72b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -22
app.py CHANGED
@@ -301,28 +301,36 @@ with gr.Blocks() as demo:
301
  _Try out the showcase mode._
302
  """)
303
  with gr.Row():
304
- with gr.Column():
305
- demo_btn = gr.Button("Showcase with example data", variant="primary")
306
- input_file = gr.File(
307
- label="Upload a dataset")
308
- input_checks = gr.CheckboxGroup(
309
- ["emotion frequencies", "emotion distribution over time", "peaks", "topics"],
310
- label = "Select options")
311
- send_btn = gr.Button("Submit data")
312
- with gr.Column():
313
- gr.Markdown("""
314
- #### Run in showcase mode or use your own data
315
- Try out the demo in showcase mode, which uses example data (609,206 tweets about the COVID-19 pandemic) with all the options provided by the demo, or upload your own dataset.
316
-
317
- #### Data format
318
- The data should be in tsv-format with two named columns: the first column (id) should contain the sentence IDs, and the second column (text) should contain the actual texts. Optionally, there is a third column named 'date', which specifies the date associated with the text (e.g., tweet date). This column is necessary when the options 'emotion distribution over time' and 'peaks' are selected. For now, we only accept files with maximum 400 sentences and a limit of 300 tokens per sentence.
319
-
320
- #### Options
321
- **Emotion frequencies** outputs a bar plot with the prediction frequencies of each emotion category (anger, fear, joy, love, sadness or neutral).
322
- **Emotion distribution over time** outputs a line plot that visualises the frequency of predicted emotions over time for each emotion category.
323
- **Peaks** outputs a step graph that only shows the significant fluctuations (upwards and downwards) in emotion frequencies over time.
324
- **Topics** uses [BERTopic](https://maartengr.github.io/BERTopic/index.html) to find topics in the datasets, and outputs a bar plot that shows the emotion distribution per topic.
325
- """)
 
 
 
 
 
 
 
 
326
  with gr.Row():
327
  gr.Markdown("""
328
  ___
 
301
  _Try out the showcase mode._
302
  """)
303
  with gr.Row():
304
+ with gr.Box():
305
+ with gr.Column():
306
+ demo_btn = gr.Button("Showcase with example data", variant="primary")
307
+ with gr.Column():
308
+ gr.Markdown("""
309
+ #### Run in showcase mode or use your own data
310
+ Try out the demo in showcase mode, which uses example data (609,206 tweets about the COVID-19 pandemic) with all the options provided by the demo, or upload your own dataset.
311
+ """)
312
+ with gr.Row():
313
+ with gr.Box():
314
+ with gr.Column():
315
+ input_file = gr.File(
316
+ label="Upload a dataset")
317
+ input_checks = gr.CheckboxGroup(
318
+ ["emotion frequencies", "emotion distribution over time", "peaks", "topics"],
319
+ label = "Select options")
320
+ send_btn = gr.Button("Submit data")
321
+ with gr.Column():
322
+ gr.Markdown("""
323
+ #### Data format
324
+ The data should be in tsv-format with two named columns: the first column (id) should contain the sentence IDs, and the second column (text) should contain the actual texts. Optionally, there is a third column named 'date', which specifies the date associated with the text (e.g., tweet date). This column is necessary when the options 'emotion distribution over time' and 'peaks' are selected. For now, we only accept files with maximum 400 sentences and a limit of 300 tokens per sentence.
325
+
326
+ #### Options
327
+ **Emotion frequencies** outputs a bar plot with the prediction frequencies of each emotion category (anger, fear, joy, love, sadness or neutral).
328
+ **Emotion distribution over time** outputs a line plot that visualises the frequency of predicted emotions over time for each emotion category.
329
+ **Peaks** outputs a step graph that only shows the significant fluctuations (upwards and downwards) in emotion frequencies over time.
330
+ **Topics** uses [BERTopic](https://maartengr.github.io/BERTopic/index.html) to find topics in the datasets, and outputs a bar plot that shows the emotion distribution per topic.
331
+ """)
332
+
333
+
334
  with gr.Row():
335
  gr.Markdown("""
336
  ___