sIncerass / prag_generation

[NAACL 2019] code for "Pragmatically Informative Text Generation" https://arxiv.org/abs/1904.01301
47 stars 9 forks source link

issue during evalution #4

Open DebYogi opened 4 years ago

DebYogi commented 4 years ago

Hi ,

I am getting error as below. Could you please help ?

File "/home/ec2-user/SageMaker/prag_generation/e2e-incre/e2e-metrics/measure_scores.py", line 207 scores = {metric: score for metric, score in list(coco_eval.eval.items())} ^ SyntaxError: invalid syntax Traceback (most recent call last): File "run_experiment.py", line 82, in run(config_d) File "run_experiment.py", line 42, in run trainer.training_start(model, data) File "/home/ec2-user/SageMaker/prag_generation/e2e-incre/components/trainer/init.py", line 120, in training_start self.run_external_eval(dev_multi_ref_fn, pred_fn) File "/home/ec2-user/SageMaker/prag_generation/e2e-incre/components/trainer/init.py", line 57, in run_external_eval bleu, nist, meteor, rouge, cider = eval_output(ref_fn, pred_fn) File "/home/ec2-user/SageMaker/prag_generation/e2e-incre/components/evaluator/evaluation.py", line 21, in eval_output eval_out = _sh_eval(pred_fn, ref_fn) File "/home/ec2-user/SageMaker/prag_generation/e2e-incre/components/evaluator/evaluation.py", line 37, in _sh_eval out = subprocess.check_output([script_fname, ref_fn, pred_fn]) File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/subprocess.py", line 356, in check_output **kwargs).stdout File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/subprocess.py", line 438, in run output=stdout, stderr=stderr)

ranganathvaikuntham commented 4 years ago

I encountered the same issue, I think the problem lies with 'Check_output'. Can you try to use subprocess.run instead to replicate its function and get back to me?