google / categorybuilder

Apache License 2.0
96 stars 24 forks source link

Error using set-expansion evaluation #5

Closed danyaljj closed 5 years ago

danyaljj commented 5 years ago

@amahabal
Trying the evaluation script in Python 2.7 and getting the following error:

(env27) vagelos-ve504-0909:categorybuilder daniel$ python2.7 eval_set_expansion.py eval_data/cat_eval_data/break_verbs 
defaultdict(<type 'int'>, {'deform': 19, 'melts': 5, 'scratch': 6, 'degrades': 69, 'cuts': 43, 'rot': 4, 'tore': 15, 'shattered': 3, 'cut': 43, 'ruin': 34, 'torn': 15, 'fall off': 42, 'suffocate': 35, 'fade': 10, 'crack': 17, 'stain': 25, 'topple': 37, 'melting': 5, 'crumbling': 20, 'breaks': 1, 'shatter': 3, 'crushed': 7, 'break': 1, 'cutting': 43, 'crushes': 7, 'smash': 8, 'tear': 15, 'obliterate': 36, 'explode': 29, 'scorch': 38, 'broke up': 67, 'crushing': 7, 'breaks up': 11, 'tip over': 13, 'wear out': 50, 'smashes': 8, 'peel': 51, 'melt': 5, 'crush': 7, 'abrade': 59, 'broken up': 67, 'deforms': 19, 'blow': 48, 'ripped': 9, 'splinter': 14, 'disintegrated': 18, 'dry out': 44, 'burn': 21, 'smudge': 27, 'broken': 1, 'evaporate': 54, 'disintegrating': 18, 'implode': 55, 'chipped': 2, 'crumbles': 20, 'chop': 24, 'shred': 66, 'crumbled': 20, 'chipping': 2, 'sink': 57, 'chopped': 24, 'penatrate': 41, 'come off': 16, 'smashing': 8, 'break down': 68, 'pulverized': 40, 'ripping': 9, 'pulverize': 40, 'vaporize': 64, 'disintegrate': 18, 'splintered': 14, 'hitting': 47, 'broken down': 68, 'break up': 67, 'erode': 61, 'collapse': 70, 'hits': 47, 'warp': 52, 'shattering': 3, 'degrade': 69, 'broke': 1, 'tearing': 15, 'unhinge': 60, 'cracks': 17, 'annihilate': 71, 'deformed': 19, 'corrode': 32, 'harden': 58, 'melted': 5, 'smashed': 8, 'cracked': 17, 'dissolve': 22, 'chip': 2, 'sag': 65, 'rip': 9, 'crumble': 20, 'rips': 9, 'bend': 23, 'deforming': 19, 'delaminate': 63, 'hit': 47, 'tarnish': 28, 'breaking': 1, 'damage': 49, 'scrape': 56, 'trample': 33, 'split': 45, 'destroy': 26, 'shrink': 53, 'deteriorate': 46, 'deflate': 31, 'came off': 16, 'cracking': 17, 'shatters': 3, 'derail': 30, 'dissolves': 22, 'calcify': 62, 'wears out': 50, 'crumple': 39})
SEEDS TO SELECT FROM:  ['break', 'chip', 'shatter', 'rot', 'melt', 'scratch', 'crush', 'smash', 'rip', 'fade', 'break up', 'break down', 'tip over', 'splinter', 'tear', 'come off', 'crack', 'disintegrate', 'deform', 'crumble', 'burn', 'dissolve', 'bend', 'chop', 'stain', 'destroy', 'smudge', 'tarnish', 'explode', 'derail', 'deflate', 'corrode', 'trample', 'ruin', 'suffocate', 'obliterate', 'topple', 'scorch', 'crumple', 'pulverize', 'penatrate', 'fall off', 'cut', 'dry out', 'split', 'deteriorate', 'hit', 'blow', 'damage', 'wear out', 'peel', 'warp', 'shrink', 'evaporate', 'implode', 'scrape', 'sink', 'harden', 'abrade', 'unhinge', 'erode', 'calcify', 'delaminate', 'vaporize', 'sag', 'shred', 'break up', 'break down', 'degrade', 'collapse', 'annihilate']
Traceback (most recent call last):
  File "eval_set_expansion.py", line 105, in <module>
    map_n=flags.map_n, rho=flags.rho, n=flags.n)
  File "eval_set_expansion.py", line 73, in Eval
    expansion = GetExpansion(seeds, rho=rho, n=n)
  File "/Users/daniel/ideaProjects/categorybuilder/eval_util.py", line 41, in GetExpansion
    return GetExpansionCBGivenQuery(modified_seeds, rho, n)
  File "/Users/daniel/ideaProjects/categorybuilder/eval_util.py", line 35, in GetExpansionCBGivenQuery
    universal_newlines=True).strip().split(', ')
  File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['python', 'category_builder.py', '--cutpaste', '--n', '100', '--rho', '3.0', '--expansion_size', '500', 'ruin', 'sink', 'crumple']' returned non-zero exit status 1

The syntax looks good to me, but not sure why this is happening. If you have any ideas as to what could be the cause of this, please let me know.

danyaljj commented 5 years ago

I had to change 'python' to 'python2.7' in the code.