首页 > 代码库 > NLP笔记
NLP笔记
词性标注器
>>> 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()
NLP笔记
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。