Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/franciscojavierarceo/twitter-scan
An AI to Scan for Toxic Tweets
https://github.com/franciscojavierarceo/twitter-scan
bert celery django machine-learning python redis render toxicity-classification twitter
Last synced: 24 days ago
JSON representation
An AI to Scan for Toxic Tweets
- Host: GitHub
- URL: https://github.com/franciscojavierarceo/twitter-scan
- Owner: franciscojavierarceo
- License: mit
- Created: 2021-03-20T21:04:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-18T16:56:17.000Z (3 months ago)
- Last Synced: 2024-08-18T18:12:10.587Z (3 months ago)
- Topics: bert, celery, django, machine-learning, python, redis, render, toxicity-classification, twitter
- Language: Python
- Homepage:
- Size: 41.1 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Toxic Twitter Scanner
This repository is a web app that allows you to scan a
user's tweets to see how "toxi" they are according to an open source model.[I wrote about it in more detail in this article](https://www.chaos-engineering.dev/p/building-an-ai-to-scan-toxic-tweets).
# Render App
To run the poetry to get this started simply run:
```commandline
poetry install
```If you have issues with your shell just run:
```commandline
poetry env use python3.7
```# Getting Started
You'll need to add a .env file with the following keys:
```
SECRET_KEY=
ALLOWED_HOSTS=127.0.0.1,localhost,YOUR_DOMAIN_NAME
TWITTER_OAUTH_CALLBACK_URL=http://127.0.0.1:8000/twitter_callback/
TWITTER_API_KEY_OLD=
TWITTER_API_SECRET_OLD=
TWITTER_CLIENT_ID_OLD=
TWITTER_CLIENT_SECRET_OLD=
TWITTER_API_KEY=
TWITTER_API_SECRET=
TWITTER_API_BEARER_TOKEN=
TWITTER_CLIENT_ID=
TWITTER_CLIENT_SECRET=
SERVER_EMAIL=
CELERY_BROKER_URL=redis://@localhost
INTERNAL_MODEL_ENDPOINT=http://localhost:8000/score-tweets/
DJANGO_SETTINGS_MODULE=tweetscanner.settings```
To properly start the app simply run:```commandline
poetry shell
export $(xargs < .env)
python manage.py runserver
```# Celery
To launch the celery worker simply open up another terminal and run
```commandline
celery -A tweetscanner worker -l info
```