From 4ae320e5c27511cd196fa38d20c72c31aa57962e Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Tue, 6 Aug 2019 12:20:22 +0200 Subject: [PATCH] Use consistent casing for entity ruler patterns (see #4063) [ci skip] --- website/docs/usage/rule-based-matching.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/usage/rule-based-matching.md b/website/docs/usage/rule-based-matching.md index 3801f7b7a..16db191d1 100644 --- a/website/docs/usage/rule-based-matching.md +++ b/website/docs/usage/rule-based-matching.md @@ -851,7 +851,7 @@ pattern. The entity ruler accepts two types of patterns: 2. **Token patterns** with one dictionary describing one token (list). ```python - {"label": "GPE", "pattern": [{"lower": "san"}, {"lower": "francisco"}]} + {"label": "GPE", "pattern": [{"LOWER": "san"}, {"LOWER": "francisco"}]} ``` ### Using the entity ruler {#entityruler-usage} @@ -869,7 +869,7 @@ from spacy.pipeline import EntityRuler nlp = English() ruler = EntityRuler(nlp) patterns = [{"label": "ORG", "pattern": "Apple"}, - {"label": "GPE", "pattern": [{"lower": "san"}, {"lower": "francisco"}]}] + {"label": "GPE", "pattern": [{"LOWER": "san"}, {"LOWER": "francisco"}]}] ruler.add_patterns(patterns) nlp.add_pipe(ruler) @@ -911,7 +911,7 @@ line. ```json ### patterns.jsonl {"label": "ORG", "pattern": "Apple"} -{"label": "GPE", "pattern": [{"lower": "san"}, {"lower": "francisco"}]} +{"label": "GPE", "pattern": [{"LOWER": "san"}, {"LOWER": "francisco"}]} ``` ```python