Try compiling EVALB in metric if it doesn't exist
This is necessary in order to get it to work on beaker, since otherwise the evaluation binary is never produced.
@@ -67,6 +67,11 @@ class EvalbBracketingScorer(Metric):
gold_trees : ``List[Tree]``
A list of gold NLTK Trees to use as a reference.
"""
+ if not os.path.exists(self._evalb_program_path):
+ # Try compiling EVALB
+ EvalbBracketingScorer.compile_evalb()
+
+ # If EVALB executable still doesn't exist, raise an error.
if not os.path.exists(self._evalb_program_path):
compile_command = ("python -c 'from allennlp.training.metrics import EvalbBracketingScorer; "
"EvalbBracketingScorer.compile_evalb()'")
