dkirkby / CodeNames

AI for CodeNames
MIT License
18 stars 7 forks source link

evaluate.py trying to call WordEmbedding.get_clues() method that doesn't exist #9

Closed manurFR closed 7 years ago

manurFR commented 7 years ago
$ ./evaluate.py -i word2vec.dat.1 --top-singles 30 --top-pairs 30 --save-plots 1 

Traceback (most recent call last):
  File "./evaluate.py", line 88, in <module>
    main()
  File "./evaluate.py", line 39, in main
    clues = embedding.get_clues((word), (word))
AttributeError: 'WordEmbedding' object has no attribute 'get_clues'

Modifying the call from get_clues() to get_clue() doesn't work either because the number of arguments doesn't match.

dkirkby commented 7 years ago

Sorry, I changed the API without updating evaluate.py. This should be fixed now, but I will leave the issue open until you get a chance to confirm. I now get:

% ./evaluate.py --top-singles 20 --top-pairs 20 --save-plots eval
0.921 MARCH = april
0.829 GOLD = silver
0.819 DEGREE = bachelor
0.805 CHURCH = catholic
0.797 PIANO = violin
0.795 SHIP = vessel
0.795 WASHINGTON = d.c.
0.793 AUSTRALIA = zealand
0.788 COURT = supreme
0.781 WHALE = minke
0.781 MISSILE = ballistic
0.779 TOOTH = teeth
0.774 HOOD = robin
0.774 ROBIN = hood
0.765 UNDERTAKER = summerslam
0.765 FLUTE = clarinet
0.757 CZECH = slovak
0.752 ENGLAND = scotland
0.750 OIL = petroleum
0.745 APPLE = macintosh
0.696 UNDERTAKER + MATCH = wrestlemania
0.673 EUROPE + AFRICA = asia
0.660 PANTS + DRESS = trousers
0.649 GERMANY + FRANCE = belgium
0.636 NOVEL + COMIC = book
0.621 PIANO + FLUTE = violin
0.618 THUMB + HAND = fingers
0.609 EGYPT + AFRICA = sudan
0.597 MICROSCOPE + LASER = optical
0.595 FRANCE + BERLIN = germany
0.594 PLASTIC + COPPER = aluminum
0.592 ICE_CREAM + CHOCOLATE = vanilla
0.584 IRON + COPPER = zinc
0.582 MOON + JUPITER = mars
0.581 HIMALAYAS + ALPS = mountains
0.581 PIANO + ORGAN = hammond
0.581 INDIA + BEIJING = china
0.580 GERMANY + CZECH = poland
0.579 WEB + SERVER = browser
0.577 UNDERTAKER + TAG = wwf

The -save-plots option produces the following plots: eval_singles

eval_pairs

manurFR commented 7 years ago

Fixed, thanks. :)