This project uses a pre-trained word embedding (English FastText as default) and a fixed spymaster vocabulary (from the file vocab.txt
) to generate clues for the game Codenames.
We specify three sets of words:
For simplicity, we write
To score a candidate clue word
where
The score function
Run python main.py
(or python main.py | less
when the output is long) to generate clues targeting different subsets of the specified set of team words.
Example output:
Team words:
['india', 'flower', 'bowl', 'beer', 'surf']
Enemy words:
['cast', 'engine', 'bee', 'death', 'stick']
Assassin word:
knife
Bystander words:
['pine', 'hit', 'princess', 'car']
1 target subsets for "cashew":
2 1.817 ['india', 'flower']
3 target subsets for "bermuda":
2 1.758 ['india', 'bowl']
3 1.758 ['india', 'bowl', 'surf']
4 2.069 ['india', 'flower', 'bowl', 'surf']
1 target subsets for "chutney":
2 1.844 ['india', 'beer']
1 target subsets for "australia":
2 1.591 ['india', 'surf']
2 target subsets for "tangerine":
2 1.565 ['flower', 'bowl']
3 1.901 ['flower', 'bowl', 'surf']
2 target subsets for "tea":
2 1.515 ['flower', 'beer']
4 2.064 ['india', 'flower', 'bowl', 'beer']
...
As of now, the sets of words are specified directly in main.py
.