Skip to content

Amodio/cemantbot

Repository files navigation

cemantbot

Bot for a web game where you have to guess a word each day (FR + EN).

Installation

  1. For Chrome, activate the developper mode and install the Tampermonkey extension; for Firefox, install Tampermonkey.
  2. Click on the cemantbot userscript then install. If TamperMonkey does not launch, paste the previous URL into: Dashboard > Utilities > Import from an URL.

If paranoid on Chrome, you can restrict TamperMonkey's access only to: https://*.certitudes.org/* & https://raw.githubusercontent.com/*.

Usage

Joker button

First

Cemantle in 6 attempts

Description

The main algorithm is now drastically improved: it should find the secret word in 3 attempts/words and less than 5 seconds :)

The standalone script find answers in less than a second. You can either try the first two words yourself, or let the bot choose (first word is random).

It basically bruteforces the cosine distance (temperature) for every tried word and selects the closest candidate.

The fallback algorithm (that should never be reached anyways) uses dot-product (scalar product) scores to converge to the secret word's vector embedding v by:

  1. assembling a small linear system with known query-word vectors (bi =⟨v,wi⟩ where wi are the known Word2Vec distances to the secret word),
  2. solving for v the least-squares solution minimizing ‖A v − b‖₂,
  3. finding the nearest neighbor for v in the Gensim/word2vec model and trying it,
  4. restarting until the secret word is found.

Standalone script

git clone https://github.com/Amodio/cemantbot.git
cd cemantbot/
pip3 install aiohttp gensim numpy --break-system-packages # (or use python -m venv cemantbot)
python3 ./cemantbot.py # add any argument to solve Cemantle instead of Cémantix

Notes

Models from Jean-Philippe Fauconnier and Google (for Cemantle).

I have tested 55402 valid words on Cémantix (even if some do not exist in French); 46212 for Cemantle. There's a 100% match between the model I have stripped from Google and the one used by Cemantle; 97% for Cémantix (as accents were a problem apparently).

The author has added protections client-side to make this bot useless (suspicious timing), so there's a standalone version of the bot now (just in case more protections were added).

Thanks to vivien7806 for the great help!

About

Cemantix & Cemantle bot

Resources

Stars

Watchers

Forks