Woordsoorttagging

Feature Engineering voor NLP in Python

Rounak Banik

Data Scientist

Toepassingen

  • Woordbetekenis-ontdubbeling
    • "The bear is a majestic animal"
    • "Please bear with me"
  • Sentimentanalyse
  • Vraagbeantwoording
  • Nepnieuws- en reviewspam-detectie
Feature Engineering voor NLP in Python

POS-tagging

  • Elke woordvorm een bijbehorende woordsoort geven.
    "Jane is an amazing guitarist."
    
  • POS-tagging:
    • Janeeigennaam
    • iswerkwoord
    • anlidwoord
    • amazingbijvoeglijk naamwoord
    • guitaristzelfstandig naamwoord
Feature Engineering voor NLP in Python

POS-tagging met 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 voor NLP in Python

POS-tagging met 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 voor NLP in Python

POS-annotaties in spaCy

spaCy-documentatie over POS-annotaties

Feature Engineering voor NLP in Python

Laten we oefenen!

Feature Engineering voor NLP in Python

Preparing Video For Download...