<jupyter_start><jupyter_text>Использование библиотеки TextBlob<jupyter_code>import nltk
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')
from textblob import TextBlob  
text = ("The quick brown fox jumps over the lazy dog")  
blob_object = TextBlob(text) 
print(blob_object.tags) 
text_ru = ("<NAME> по шоссе и сосала сушку")  
blob_object = TextBlob(text_ru) 
print(blob_object.tags)<jupyter_output>[('Шла', 'JJ'), ('Саша', 'NNP'), ('по', 'NNP'), ('шоссе', 'NNP'), ('и', 'NNP'), ('сосала', 'NNP'), ('сушку', 'NN')]<jupyter_text>nltk<jupyter_code>from nltk.tokenize import word_tokenize
text = word_tokenize("Hello welcome to the world of to learn Categorizing and POS Tagging with NLTK and Python")
nltk.pos_tag(text)
text_ru = word_tokenize("<NAME> по шоссе и сосала сушку")  
nltk.pos_tag(text_ru)<jupyter_output><empty_output><jupyter_text>spaCy<jupyter_code>import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("The quick brown fox jumps over the lazy dog")
for token in doc:
   print((token.text, token.pos_))<jupyter_output>('The', 'DET')
('quick', 'ADJ')
('brown', 'ADJ')
('fox', 'NOUN')
('jumps', 'VERB')
('over', 'ADP')
('the', 'DET')
('lazy', 'ADJ')
('dog', 'NOUN')<jupyter_text>Hunpos<jupyter_code>from os.path import expanduser
home = expanduser("~")
from nltk.tag.hunpos import HunposTagger
_path_to_bin = home + '/hunpos-1.0-linux/hunpos-tag'
_path_to_model = home + '/hunpos-1.0-linux/en_wsj.model'
ht = HunposTagger(path_to_model=_path_to_model, path_to_bin=_path_to_bin)
text = "The quick brown fox jumps over the lazy dog"
ht.tag(text.split())
from os.path import expanduser
home = expanduser("~")
from nltk.tag.stanford import POSTagger
_path_to_model = home + '/stanford-postagger/models/english-bidirectional-distsim.tagger'
_path_to_jar = home + '/stanford-postagger/stanford-postagger.jar'
st = POSTagger(path_to_model=_path_to_model, path_to_jar=_path_to_jar)
text = "The quick brown fox jumps over the lazy dog"
st.tag(text.split())<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup