SpacyEntityRecognizer
Bases: EntityRecognizer
Create an EntityRecognizer from a spaCy Langauge instance
Source code in recon/recognizer.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
labels: List[str]
property
¶
Return List of spaCy ner labels
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: List of labels from spaCy ner pipe |
__init__(nlp)
¶
Initialize a SpacyEntityRecognizer
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nlp |
Language
|
spaCy Language instance that can sets doc.ents |
required |
Source code in recon/recognizer.py
87 88 89 90 91 92 93 94 |
|
predict(texts)
¶
Run spaCy nlp.pipe on a batch of raw texts.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
texts |
Iterable[str]
|
Raw text examples |
required |
Yields:
Type | Description |
---|---|
Example
|
Iterator[Example]: Examples constructed from spaCy Model predictions |
Source code in recon/recognizer.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|