Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,8 +3,7 @@ from pprint import pprint
|
|
| 3 |
|
| 4 |
from mastodon import Mastodon, MastodonNotFoundError # Mastodon.py
|
| 5 |
|
| 6 |
-
list_of_servers = ['
|
| 7 |
-
'libretooth.gr',
|
| 8 |
'tilde.zone',
|
| 9 |
'hostux.social',
|
| 10 |
'social.linux.pizza',
|
|
@@ -264,7 +263,9 @@ def block_users(client, threshold, dataset):
|
|
| 264 |
for user in users:
|
| 265 |
print("Reviewing user {}".format(user))
|
| 266 |
if "Violent" in dataset:
|
| 267 |
-
|
|
|
|
|
|
|
| 268 |
user_id = str(user["acct"])
|
| 269 |
if block_user(user_id, user, "Violent"):
|
| 270 |
num_users_blocked = num_users_blocked + 1
|
|
|
|
| 3 |
|
| 4 |
from mastodon import Mastodon, MastodonNotFoundError # Mastodon.py
|
| 5 |
|
| 6 |
+
list_of_servers = ['libretooth.gr',
|
|
|
|
| 7 |
'tilde.zone',
|
| 8 |
'hostux.social',
|
| 9 |
'social.linux.pizza',
|
|
|
|
| 263 |
for user in users:
|
| 264 |
print("Reviewing user {}".format(user))
|
| 265 |
if "Violent" in dataset:
|
| 266 |
+
# Due to the low number of posts used to aggregate the initial dataset and unreliability of this model,
|
| 267 |
+
# the weight has been lowered to represent this.
|
| 268 |
+
if user["violence-threshold"]/2 >= threshold:
|
| 269 |
user_id = str(user["acct"])
|
| 270 |
if block_user(user_id, user, "Violent"):
|
| 271 |
num_users_blocked = num_users_blocked + 1
|