Views
No views yet
1import spacy
2
3# Load the trained model
4nlp = spacy.load("path/to/model-best")
5
6# Process text
7text = "De werken aan de Korenmarkt 15-17, 9000 Gent worden uitgevoerd."
8doc = nlp(text)
9
10# Extract entities
11for ent in doc.ents:
12 print(f"{ent.text} -> {ent.label_}")
13
14# Output:
15# Korenmarkt -> STREET
16# 15-17 -> HOUSENUMBERS
17# 9000 -> POSTCODE
18# Gent -> CITYCITYSTREETROADINTERSECTIONHOUSENUMBERSPOSTCODEPROVINCEDOMAINBUILDINGDATETIMEPERSONORGMONEYPERCENTPRODUCTconfig.cfg: spaCy pipeline configurationmeta.json: Model metadata and informationvocab/: Vocabulary and vector dataner/: Named Entity Recognition componenttokenizer/: Text tokenization component