首页 > 技术文章 > NLP笔记

cppb 原文

词性标注器

>>> text = nltk.word_tokenize('what are your name?')
>>> text

>>> nltk.pos_tag(text)
[('what', 'WDT'), ('are', 'VBP'), ('your', 'PRP$'), ('name', 'NN'), ('?', '.')]

CC 并列连词

RB 副词

IN 连词

JJ 形容词

帮助文档使用

nltk.help.upenn_tagset( 'RB*')

text = nltk.Text(word.lower() for word in nltk.corpus.brown.words())

text.similar('woman')  #找出与woman相似的词

nltk.tag.str2tuple()  #已标记的词构建为列表

nltk.corpus.brown.tagged_words()  

nltk.corpus.nps_chat.tagged_words()

nltk.corpus.conll2000.tagged_words()

推荐阅读