Označování slovních druhů

Feature Engineering for NLP in Python

Rounak Banik

Data Scientist

Aplikace

  • Disambiguace slovního smyslu
    • "The bear is a majestic animal"
    • "Please bear with me"
  • Analýza sentimentu
  • Odpovídání na otázky
  • Detekce fake news a spamu názorů
Feature Engineering for NLP in Python

POS tagging

  • Přiřazení slovního druhu každému slovu.
    "Jane is an amazing guitarist."
    
  • POS Tagging:
    • Janevlastní podstatné jméno
    • issloveso
    • ančlen
    • amazingpřídavné jméno
    • guitaristpodstatné jméno
Feature Engineering for NLP in Python

POS tagging pomocí 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 for NLP in Python

POS tagging pomocí 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 for NLP in Python

POS anotace ve spaCy

Dokumentace spaCy k POS anotacím

Feature Engineering for NLP in Python

Pojďme si procvičit!

Feature Engineering for NLP in Python

Preparing Video For Download...