Sözcük türü etiketleme

Python ile NLP için Özellik Mühendisliği

Rounak Banik

Data Scientist

Uygulamalar

  • Sözcük anlamı ayırt etme
    • "The bear is a majestic animal"
    • "Please bear with me"
  • Duygu analizi
  • Soru yanıtlama
  • Sahte haber ve görüş spam’i tespiti
Python ile NLP için Özellik Mühendisliği

POS etiketleme

  • Her sözcüğe ilgili sözcük türünü atamak.
    "Jane is an amazing guitarist."
    
  • POS Etiketleme:
    • Janeözel ad
    • isfiil
    • anbelirteç (determinant)
    • amazingsıfat
    • guitaristisim
Python ile NLP için Özellik Mühendisliği

spaCy ile POS etiketleme

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)
Python ile NLP için Özellik Mühendisliği

spaCy ile POS etiketleme

...
...
# 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')]
Python ile NLP için Özellik Mühendisliği

spaCy’de POS açıklamaları

POS açıklamaları için spaCy dokümantasyonu

Python ile NLP için Özellik Mühendisliği

Hadi pratik yapalım!

Python ile NLP için Özellik Mühendisliği

Preparing Video For Download...