Étiquetage grammatical

Feature Engineering pour le NLP en Python

Rounak Banik

Data Scientist

Applications

  • Désambiguïsation lexicale
    • "The bear is a majestic animal"
    • "Please bear with me"
  • Analyse de sentiments
  • Réponse à des questions
  • Détection des fausses nouvelles et du spam d'opinion
Feature Engineering pour le NLP en Python

Étiquetage POS

  • Attribuer à chaque mot sa catégorie grammaticale.
    "Jane is an amazing guitarist."
    
  • Étiquetage POS :
    • Jane → nom propre
    • is → verbe
    • an → déterminant
    • amazing → adjectif
    • guitarist → nom
Feature Engineering 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)
Feature Engineering 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')]
Feature Engineering pour le NLP en Python

Annotations POS dans spaCy

Documentation spaCy sur les annotations POS

Feature Engineering pour le NLP en Python

Passons à la pratique !

Feature Engineering pour le NLP en Python

Preparing Video For Download...