From 198efc01fecce5345fa82433d56e10aab6e51b0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Feb 2022 20:29:08 +0000 Subject: [PATCH] Update mkdocs-material requirement from <8.2.0,>=5.5.0 to >=5.5.0,<8.3.0 (#321) * Update mkdocs-material requirement from <8.2.0,>=5.5.0 to >=5.5.0,<8.3.0 Updates the requirements on [mkdocs-material](https://github.com/squidfunk/mkdocs-material) to permit the latest version. - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/5.5.0...8.2.1) --- updated-dependencies: - dependency-name: mkdocs-material dependency-type: direct:development ... Signed-off-by: dependabot[bot] * Better error message when perl is missing * Unrelated formatting issue * Changelog * Update doc dependencies Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dirk Groeneveld --- CHANGELOG.md | 1 + .../structured_prediction/metrics/srl_eval_scorer.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b979ec28..7c6afdfb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Following a breaking change in the NLTK API, we now depend on the most recent version only. - Added Tensorboard callbacks to the RC models +- The error message you get when perl isn't installed is now more readable. ### Removed diff --git a/allennlp_models/structured_prediction/metrics/srl_eval_scorer.py b/allennlp_models/structured_prediction/metrics/srl_eval_scorer.py index 06ad0bdb5..672e51e3a 100644 --- a/allennlp_models/structured_prediction/metrics/srl_eval_scorer.py +++ b/allennlp_models/structured_prediction/metrics/srl_eval_scorer.py @@ -104,9 +104,14 @@ def __call__( gold_tag_sequence, ) perl_script_command = ["perl", self._srl_eval_path, gold_path, predicted_path] - completed_process = subprocess.run( - perl_script_command, stdout=subprocess.PIPE, universal_newlines=True, check=True - ) + try: + completed_process = subprocess.run( + perl_script_command, stdout=subprocess.PIPE, universal_newlines=True, check=True + ) + except FileNotFoundError: + raise FileNotFoundError( + "'File not found' while running the evaluation. Do you have perl installed?" + ) for line in completed_process.stdout.split("\n"): stripped = line.strip().split() if len(stripped) == 7: