Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,7 +35,7 @@ h5 {font-family: "Poppins", sans-serif} body {font-size: 16px;} img {margin-bott
|
|
| 35 |
class="w3-padding-large w3-white"> <div class="w3-row-padding-large"> <div class="w3-col"> <h1
|
| 36 |
class="w3-jumbo"><b>Bubble Check-In🐦💭</b></h1> <h1 class="w3-xxxlarge w3-text-blue"><b>Check-in-on someone's Twitter 'bubble'.</b></h1> <p><span class="w3-xlarge">Scroll down to use Bubble Check-In 1.0. ⬇
|
| 37 |
</span> Bubble Check-In is a tool designed to allow you to check-in-on the type of content someone on Twitter is
|
| 38 |
-
being exposed to - be that yourself, a friend, loved one, etc. The goal here is to empower
|
| 39 |
each-other and identify early if someone is experiencing activity such as hate speech or extremism. We use a queue
|
| 40 |
system, which means <b> you may need to wait your turn to run Bubble Check-In</b>. Bubble Check-In is simple to use simply enter the username of the Twitter account you want to check-in-on and click run!</p>
|
| 41 |
<a href="https://www.jamesstevenson.me/cartographer-labs/"><button class="w3-button w3-light-grey w3-padding-large w3-section
|
|
@@ -373,9 +373,11 @@ def button_pressed(text_box):
|
|
| 373 |
)])
|
| 374 |
|
| 375 |
# Comprise text for summary label
|
| 376 |
-
|
| 377 |
"{} directly via following them.".format(tweets, text_box, text_box, mentions, following)
|
| 378 |
|
|
|
|
|
|
|
| 379 |
high_identifiers = []
|
| 380 |
extreme_identifiers = []
|
| 381 |
|
|
@@ -433,6 +435,9 @@ def button_pressed(text_box):
|
|
| 433 |
elif total_average_neg_sentiment > 0.9 and total_average_neg_sentiment > total_average_pos_sentiment:
|
| 434 |
text = text + " '{} is experiencing a significantly high amount of negative sentiment content.".format(text_box)
|
| 435 |
|
|
|
|
|
|
|
|
|
|
| 436 |
return [toxicity_plot_fig, sentiment_plot_fig, fig, text]
|
| 437 |
|
| 438 |
|
|
|
|
| 35 |
class="w3-padding-large w3-white"> <div class="w3-row-padding-large"> <div class="w3-col"> <h1
|
| 36 |
class="w3-jumbo"><b>Bubble Check-In🐦💭</b></h1> <h1 class="w3-xxxlarge w3-text-blue"><b>Check-in-on someone's Twitter 'bubble'.</b></h1> <p><span class="w3-xlarge">Scroll down to use Bubble Check-In 1.0. ⬇
|
| 37 |
</span> Bubble Check-In is a tool designed to allow you to check-in-on the type of content someone on Twitter is
|
| 38 |
+
being exposed to - be that yourself, a friend, loved one, etc. The goal here is to empower users to look out for
|
| 39 |
each-other and identify early if someone is experiencing activity such as hate speech or extremism. We use a queue
|
| 40 |
system, which means <b> you may need to wait your turn to run Bubble Check-In</b>. Bubble Check-In is simple to use simply enter the username of the Twitter account you want to check-in-on and click run!</p>
|
| 41 |
<a href="https://www.jamesstevenson.me/cartographer-labs/"><button class="w3-button w3-light-grey w3-padding-large w3-section
|
|
|
|
| 373 |
)])
|
| 374 |
|
| 375 |
# Comprise text for summary label
|
| 376 |
+
original_text = "A total number of {} recent tweets in @{}'s mentions and timeline were reviewed, of which @{} was exposed to {} users via mentions and " \
|
| 377 |
"{} directly via following them.".format(tweets, text_box, text_box, mentions, following)
|
| 378 |
|
| 379 |
+
text = original_text
|
| 380 |
+
|
| 381 |
high_identifiers = []
|
| 382 |
extreme_identifiers = []
|
| 383 |
|
|
|
|
| 435 |
elif total_average_neg_sentiment > 0.9 and total_average_neg_sentiment > total_average_pos_sentiment:
|
| 436 |
text = text + " '{} is experiencing a significantly high amount of negative sentiment content.".format(text_box)
|
| 437 |
|
| 438 |
+
if len(text) =- len(original_text):
|
| 439 |
+
text = text + " No excessive hate speech or low sentiment was observed in @{}'s mentions or timeline".format(text_box)
|
| 440 |
+
|
| 441 |
return [toxicity_plot_fig, sentiment_plot_fig, fig, text]
|
| 442 |
|
| 443 |
|