jkomoros / flux-bot

Discord bot for GALE-x
3 stars 1 forks source link

Have a command to have the bot rename a thread based on distinctive words #35

Open jkomoros opened 3 years ago

jkomoros commented 3 years ago

For example, use TFIDF to pick out diistinctive words to rename a thread distinctively.

There could be a slash command that could be run in the thread to update it.

Threads created by forking (see #34) could also automatically be named with this.

Generating a TFIDF index is hard for the whole corpus. We could use a TFIDF map extractec from https://thecompendium.cards as a default to start from. And use the same stemming.

jkomoros commented 3 years ago
jkomoros commented 3 years ago

See also #10 which captures some of the TFIDF stuff

jkomoros commented 3 years ago

Actually, all of this behavior about expiring old messages from the cache implies I'm making this way too hard. Especially if we're moving to #41 where there's a more long-term backup data store.

IDF rarely changes (especially for large guilds). Instead of keeping it live to generate it on demand, just do a batch process every so often (every day?) where it fetches all messages and calculates the IDF and saves that to disk in a cache, along with a timestamp so it can figure out when loading back up if it needs to regenerate it. And then when asking for a channel's suggested title, live fetch the messages, calculate the TFIDF, and return that.