| 123456789101112131415 |
- import fr_core_news_md
- nlp = fr_core_news_md.load()
- def repond(message):
- doc = nlp(message)
- for token in doc:
- print(token.text, token.lemma_, token.pos_, token.tag_, token.dep_,
- token.shape_, token.is_alpha, token.is_stop)
- for ent in doc.ents:
- print(ent.text, ent.start_char, ent.end_char, ent.label_)
|