Étiquetage des parties du discours

Ingénierie des caractéristiques pour le NLP en Python

Rounak Banik

Data Scientist

Applications

  • Désambiguïsation du sens des mots
    • "The bear is a majestic animal"
    • "Please bear with me"
  • Analyse de sentiment
  • Réponse à des questions
  • Détection des fausses nouvelles et du pourriel d'opinion
Ingénierie des caractéristiques pour le NLP en Python

Étiquetage POS

  • Attribuer à chaque mot sa partie du discours.
    "Jane is an amazing guitarist."
    
  • Étiquetage POS :
    • Janenom propre
    • isverbe
    • andéterminant
    • amazingadjectif
    • guitaristnom
Ingénierie des caractéristiques pour le NLP en Python

Étiquetage POS avec spaCy

import spacy

# Load the en_core_web_sm model
nlp = spacy.load('en_core_web_sm')
# Initiliaze string
string = "Jane is an amazing guitarist"
# Create a Doc object
doc = nlp(string)
Ingénierie des caractéristiques pour le NLP en Python

Étiquetage POS avec spaCy

...
...
# Generate list of tokens and pos tags
pos = [(token.text, token.pos_) for token in doc]
print(pos)
[('Jane', 'PROPN'), 
 ('is', 'VERB'), 
 ('an', 'DET'), 
 ('amazing', 'ADJ'), 
 ('guitarist', 'NOUN')]
Ingénierie des caractéristiques pour le NLP en Python

Annotations POS dans spaCy

Documentation spaCy sur les annotations POS

Ingénierie des caractéristiques pour le NLP en Python

Passons à la pratique !

Ingénierie des caractéristiques pour le NLP en Python

Preparing Video For Download...