imvladikon
commited on
Commit
·
a0b5201
1
Parent(s):
a760f3b
Update README.md
Browse files
README.md
CHANGED
@@ -107,6 +107,27 @@ entities = model.predict("יו\"ר ועדת ה נוער נתן סלובטיק א
|
|
107 |
entities
|
108 |
```
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
## Training Details
|
112 |
|
|
|
107 |
entities
|
108 |
```
|
109 |
|
110 |
+
### Using spacy
|
111 |
+
|
112 |
+
|
113 |
+
```bash
|
114 |
+
pip install spacy_udpipe
|
115 |
+
```
|
116 |
+
|
117 |
+
```python
|
118 |
+
import spacy
|
119 |
+
from spacy.lang.he import Hebrew
|
120 |
+
import spacy_udpipe
|
121 |
+
|
122 |
+
spacy_udpipe.download("he") # download public udpipe model, but possible to use any your spacy model
|
123 |
+
nlp = spacy_udpipe.load("he")
|
124 |
+
nlp.add_pipe("span_marker", config={"model": "iahlt/span-marker-alephbert-small-nemo-mt-he"})
|
125 |
+
|
126 |
+
text = "יו\"ר ועדת הנוער נתן סלובטיק אמר שהשחקנים של אנחנו לא משתלבים באירופה."
|
127 |
+
doc = nlp(text)
|
128 |
+
print([(entity, entity.label_) for entity in doc.ents])
|
129 |
+
# [(ועדת הנוער, 'ORG'), (נתן סלובטיק, 'PER'), (אירופה, 'GPE')]
|
130 |
+
```python
|
131 |
|
132 |
## Training Details
|
133 |
|