Cümle ve kelime tokenizasyonu
Tokenizasyon, NLP'de önemli bir ilk adımdır. Metni, dil verileriyle çalışmanın anahtarı olan belirteçler (token) adı verilen daha küçük birimlere ayırmayı içerir. Görevin, bir haber makalesinden bir parçayı hem cümlelere hem de kelimelere ayırmaktır.
Bu egzersiz
Python ile Natural Language Processing (NLP)
kursunun bir parçasıdırUygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# Import nltk
____
# Download the punkt_tab package
____
text = """
The stock market saw a significant dip today. Experts believe the downturn may continue.
However, many investors are optimistic about future growth.
"""
# Tokenize the text into sentences
sentences = ____
print(sentences)