From 10616da3f5335808353aaa0e0c35a2543b5cef2c Mon Sep 17 00:00:00 2001 From: beader Date: Tue, 28 May 2019 17:19:13 +0800 Subject: [PATCH] fix displacy KeyError: settings bug #6 (#7) [Displacy producing KeyError: 'settings' #3531](https://github.com/explosion/spaCy/issues/3531) Add `settings = {}` to `Sentence._repr_html_` --- data_utils/data_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_utils/data_utils.py b/data_utils/data_utils.py index 82a37f1..d783c46 100644 --- a/data_utils/data_utils.py +++ b/data_utils/data_utils.py @@ -57,7 +57,7 @@ def _repr_html_(self): ents.append({'start': ent.start_pos, 'end': ent.end_pos, 'label': ent.category}) - ex = {'text': self.text, 'ents': ents, 'title': None} + ex = {'text': self.text, 'ents': ents, 'title': None, 'settings': {}} return displacy.render(ex, style='ent', options={'colors': COLOR_MAP},