Skip to content

Commit

Permalink
Use consistent casing for entity ruler patterns (see explosion#4063) …
Browse files Browse the repository at this point in the history
…[ci skip]
  • Loading branch information
ines authored and polm committed Aug 18, 2019
1 parent 427d18b commit d63cc30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/docs/usage/rule-based-matching.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d63cc30

Please sign in to comment.