2022-03-04 20:43:49 +03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding:utf-8 -*-
|
|
|
|
|
|
|
|
import spacy
|
|
|
|
nlp = spacy.load("en_core_web_trf", disable=["tagger", "parser", "attribute_ruler", "lemmatizer"])
|
|
|
|
# nlp = spacy.load("en_core_web_md", disable=["tok2vec", "tagger", "parser", "attribute_ruler", "lemmatizer"])
|
|
|
|
|
2022-03-05 13:46:34 +03:00
|
|
|
# doc = nlp("Do you know Spotify? I live in Paris and I'm Matthieu")
|
|
|
|
doc = nlp("Hi, I'm louis and I'm from saint-claude. Today I live in Shenzhen China and I work at Alibaba")
|
2022-03-04 20:43:49 +03:00
|
|
|
|
|
|
|
for ent in doc.ents:
|
|
|
|
print(ent.text, ent.label_)
|