Spaces:
Running
Running
Commit
·
efb03fe
1
Parent(s):
071fa02
Update app.py
Browse files
app.py
CHANGED
@@ -300,37 +300,35 @@ with gr.Blocks() as demo:
|
|
300 |
_As we are currently updating this demo, submitting your own data is unavailable for the moment._
|
301 |
_Try out the showcase mode._
|
302 |
""")
|
303 |
-
with gr.
|
304 |
-
with gr.
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
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 |
___
|
|
|
300 |
_As we are currently updating this demo, submitting your own data is unavailable for the moment._
|
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 |
+
with gr.Column():
|
307 |
+
gr.Markdown("""
|
308 |
+
Run in showcase mode or use your own data
|
309 |
+
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.
|
310 |
+
""")
|
311 |
+
with gr.Row():
|
312 |
+
with gr.Column():
|
313 |
+
input_file = gr.File(
|
314 |
+
label="Upload a dataset")
|
315 |
+
input_checks = gr.CheckboxGroup(
|
316 |
+
["emotion frequencies", "emotion distribution over time", "peaks", "topics"],
|
317 |
+
label = "Select options")
|
318 |
+
send_btn = gr.Button("Submit data")
|
319 |
+
with gr.Column():
|
320 |
+
gr.Markdown("""
|
321 |
+
#### Data format
|
322 |
+
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.
|
323 |
+
|
324 |
+
#### Options
|
325 |
+
**Emotion frequencies** outputs a bar plot with the prediction frequencies of each emotion category (anger, fear, joy, love, sadness or neutral).
|
326 |
+
**Emotion distribution over time** outputs a line plot that visualises the frequency of predicted emotions over time for each emotion category.
|
327 |
+
**Peaks** outputs a step graph that only shows the significant fluctuations (upwards and downwards) in emotion frequencies over time.
|
328 |
+
**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.
|
329 |
+
""")
|
|
|
|
|
|
|
330 |
|
331 |
+
|
332 |
with gr.Row():
|
333 |
gr.Markdown("""
|
334 |
___
|