Highlights bad tweets in a big red border. You train your personal algorithm to decide what tweets get highlighted.
The idea is that negative emotions from your feed generally harm your mental health. Meanwhile, most tweets are just honestly not that valuable. So let's make a firewall to just filter out posts with bad attitude and vibes.
These are all examples from my personal curated algorithm. You can train the extension to filter whatever you want. Note that I do not have any beef with the particular posters I just don't like seeing negative things on my timeline because they make me sad.
Political content:
Unsavory celebrity gossip with negative sentiment:
Negative sentiment hot takes:
Commercial announcements:
AGI doomposting
Engagement bait
general Doomposting
Inference: Tweet username + content -> OpenAI text-embedding-3-small
-> 256 dimensions embedding -> binary classifier
Data: It puts all the shit into IndexedDB on x.com Lol
Training: Piece of shit training script (see train.py
)
Extension lets you label tweets as bad or neutral. Then you save this data and rerun the training script.
- populate
Source/api-key.js
with:const OPENAI_API_KEY = 'sk-proj-...';
- Install the extension, go on the timeline
- To mark a tweet as bad, hover the tweet and press "1" on keyboard
- To mark a tweet as always safe, hover the tweet and press "2" on keyboard
- To mark a tweet as safe, hover the tweet and press "0" on the keyboard
- You can also press "3" to inspect the score of the hovered tweet
- Unmarked tweets are default to safe
- Extract training data: copy paste contents of helper.js into js console on x.com
- Copy downloaded files into this directory
- populate
.env
withOPENAI_API_KEY=...
- Run embed.py to (re-)compute embeddings with openai. If you add more training data later, it will not recompute embedding you already have
- Run train.py to produce a pytorch model
- Run export-model-to-onnx.py to convert pytorch model to ONNX and place it in browser extension folder (
Source/
) - Reload the browser extension, now you have loaded the newly trained model