Thank you nostr:npub16zsllwrkrwt5emz2805vhjewj6nsjrw0ge0latyrn2jv5gxf5k0q5l92l7 for looking this.
>Is your relay adding content warning tags?
No it didn't. It will make new classification event tagging event id and pubkey of author (kind: 9978) with classification labels (Language, toxicity, etc). Actually, i want to change and migrate that into NIP-32 format instead of custom kind 9978 like now.
I think i really need to draw some flowchart later to explain but did not have time yet. I'm sorry hopefully this can explain a bit 😅
How it works:
1. nostr-filter-relay will run several softwares: atrifat/nostr-monitoring-tool, atrifat/nostr-filter, and hoytech/strfry relay in launch script at startup.
2. nostr-monitoring-tool is classification tool that fetch and subscribe notes (kind: 1) from various relays. It will process every notes (extraction of image url, text preprocessing) it seen and send it into external AI classification tool. Currently it will send processed notes content into NSFW Detector API instance (using atrifat/nsfw-detector-api), LibreTranslate instance, and Hate Speech Detector API instance (using atrifat/hate-speech-detector-api). All three API will give classification results (NSFW class, Language class, Toxic classification) that will be saved as custom kind 9978 in local strfry relay that has already been running. Data format shown in atrifat/nostr-monitoring-tool in github.
Basic Data flow:
source relays (notes) -> nostr-monitoring-tool (connect to external API for classification) -> local strfry
3. Now, using classification data (kind: 9978) saved in local strfry relay, atrifat/nostr-filter will act as proxy relay and intercept any REQ from nostr client and forward them into local strfry relay. Local strfry relay will respond as usual by giving events based on REQ back to nostr-filter. Before sending events back to nostr clients, nostr-filter will check events from strfry whether it has classification data (kind: 9978) or not. For example users set nostr-filter-relay parameters to only gives notes which has "English" language then nostr-filter will only gives those notes using classification data. Any non "English" notes will be skipped.
Basic Data flow:
nostr clients <-> nostr-filter (act like frontend proxy) <-> strfry
4. Nostr client will get filtered events (Real data from strfry are 2000 notes but filtered into 1500 "english" notes) and show that to users.