Benannte Entitäten im Kontext vorhersagen
Modelle sind statistisch und nicht immer korrekt. Ob ihre Vorhersagen stimmen, hängt von den Trainingsdaten und dem Text ab, den du verarbeitest. Schauen wir uns ein Beispiel an. Das kleine englische Modell ist als Variable nlp verfügbar.
Diese Übung ist Teil des Kurses
Fortgeschrittenes NLP mit spaCy
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
text = "New iPhone X release date leaked as Apple reveals pre-orders by mistake"
# Process the text
doc = ____
# Iterate over the entities
for ____ in ____.____:
# print the entity text and label
print(____.____, ____.____)