mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-13 13:17:06 +03:00
Merge branch 'master' into spacy.io
This commit is contained in:
commit
25a7a5fbdc
|
@ -851,7 +851,7 @@ pattern. The entity ruler accepts two types of patterns:
|
||||||
2. **Token patterns** with one dictionary describing one token (list).
|
2. **Token patterns** with one dictionary describing one token (list).
|
||||||
|
|
||||||
```python
|
```python
|
||||||
{"label": "GPE", "pattern": [{"lower": "san"}, {"lower": "francisco"}]}
|
{"label": "GPE", "pattern": [{"LOWER": "san"}, {"LOWER": "francisco"}]}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using the entity ruler {#entityruler-usage}
|
### Using the entity ruler {#entityruler-usage}
|
||||||
|
@ -869,7 +869,7 @@ from spacy.pipeline import EntityRuler
|
||||||
nlp = English()
|
nlp = English()
|
||||||
ruler = EntityRuler(nlp)
|
ruler = EntityRuler(nlp)
|
||||||
patterns = [{"label": "ORG", "pattern": "Apple"},
|
patterns = [{"label": "ORG", "pattern": "Apple"},
|
||||||
{"label": "GPE", "pattern": [{"lower": "san"}, {"lower": "francisco"}]}]
|
{"label": "GPE", "pattern": [{"LOWER": "san"}, {"LOWER": "francisco"}]}]
|
||||||
ruler.add_patterns(patterns)
|
ruler.add_patterns(patterns)
|
||||||
nlp.add_pipe(ruler)
|
nlp.add_pipe(ruler)
|
||||||
|
|
||||||
|
@ -911,7 +911,7 @@ line.
|
||||||
```json
|
```json
|
||||||
### patterns.jsonl
|
### patterns.jsonl
|
||||||
{"label": "ORG", "pattern": "Apple"}
|
{"label": "ORG", "pattern": "Apple"}
|
||||||
{"label": "GPE", "pattern": [{"lower": "san"}, {"lower": "francisco"}]}
|
{"label": "GPE", "pattern": [{"LOWER": "san"}, {"LOWER": "francisco"}]}
|
||||||
```
|
```
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
|
Loading…
Reference in New Issue
Block a user