Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

don't require that EVALB is compiled on instantiation #980

Merged
merged 1 commit into from
Mar 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions allennlp/training/metrics/evalb_bracketing_scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ def __init__(self, evalb_directory_path: str, evalb_param_filename: str = "COLLI
self._evalb_program_path = os.path.join(evalb_directory_path, "evalb")
self._evalb_param_path = os.path.join(evalb_directory_path, evalb_param_filename)

if not os.path.exists(self._evalb_program_path):
raise ConfigurationError("You must compile the EVALB scorer before using it."
" Run 'make' in the 'scripts/EVALB' directory.")

self._header_line = ['ID', 'Len.', 'Stat.', 'Recal', 'Prec.', 'Bracket',
'gold', 'test', 'Bracket', 'Words', 'Tags', 'Accracy']
Expand All @@ -64,6 +61,9 @@ def __call__(self, predicted_trees: List[Tree], gold_trees: List[Tree]) -> None:
gold_trees : ``List[Tree]``
A list of gold NLTK Trees to use as a reference.
"""
if not os.path.exists(self._evalb_program_path):
raise ConfigurationError("You must compile the EVALB scorer before using it."
" Run 'make' in the 'scripts/EVALB' directory.")
tempdir = tempfile.gettempdir()
gold_path = os.path.join(tempdir, "gold.txt")
predicted_path = os.path.join(tempdir, "predicted.txt")
Expand Down