zoukankan      html  css  js  c++  java
  • nltk的pos_tag

    链接:python自然语言处理——NLTK——词性标签(pos_tag)

     主要是看不懂词性。

    词性列表:

    CC     coordinatingconjunction 并列连词
    CD     cardinaldigit  纯数  基数
    DT     determiner  限定词(置于名词前起限定作用,如 the、some、my 等)
    EX     existentialthere (like:"there is"... think of it like "thereexists")   存在句;存现句
    FW     foreignword  外来语;外来词;外文原词
    IN     preposition/subordinating conjunction介词/从属连词;主从连词;从属连接词
    JJ     adjective    'big'  形容词
    JJR    adjective, comparative 'bigger' (形容词或副词的)比较级形式
    JJS    adjective, superlative 'biggest'  (形容词或副词的)最高级
    LS     listmarker  1)
    MD     modal (could, will) 形态的,形式的 , 语气的;情态的
    NN     noun, singular 'desk' 名词单数形式
    NNS    nounplural  'desks'  名词复数形式
    NNP    propernoun, singular     'Harrison' 专有名词
    NNPS  proper noun, plural 'Americans'  专有名词复数形式
    PDT    predeterminer      'all the kids'  前位限定词
    POS    possessiveending  parent's   属有词  结束语
    PRP    personalpronoun   I, he, she  人称代词
    PRP$  possessive pronoun my, his, hers  物主代词
    RB     adverb very, silently, 副词    非常  静静地
    RBR    adverb,comparative better   (形容词或副词的)比较级形式
    RBS    adverb,superlative best    (形容词或副词的)最高级
    RP     particle     give up 小品词(与动词构成短语动词的副词或介词)
    TO     to    go 'to' the store.
    UH     interjection errrrrrrrm  感叹词;感叹语
    VB     verb, baseform    take   动词
    VBD    verb, pasttense   took   动词   过去时;过去式
    VBG    verb,gerund/present participle taking 动词  动名词/现在分词
    VBN    verb, pastparticiple     taken 动词  过去分词
    VBP    verb,sing. present, non-3d     take 动词  现在
    VBZ    verb, 3rdperson sing. present  takes   动词  第三人称
    WDT    wh-determiner      which 限定词(置于名词前起限定作用,如 the、some、my 等)
    WP     wh-pronoun   who, what 代词(代替名词或名词词组的单词)
    WP$    possessivewh-pronoun     whose  所有格;属有词
    WRB    wh-abverb    where, when 副词
    (https://wenku.baidu.com/view/c63bec3b366baf1ffc4ffe4733687e21af45ffab.html)

    使用代码:

    def word_pos_tags(word_stopped):
        # 词性标注,返回以单词+词性标注为元组的list: pos_tags
        pos_tags = nltk.pos_tag(word_stopped)
        path_word_tokenize_stopped_pos_tag = 
            'H:PythonCodeBrowserPrecessingwords_atheism_word_tokenize_Stopped_postag.txt'
        # 存放词性标注处理结果的文本路径
        with open(path_word_tokenize_stopped_pos_tag, 'w', encoding='utf-8') as f:
            f.write(str(pos_tags))
        print('Pos_tags written.')
        return pos_tags
  • 相关阅读:
    JQ和Js获取span标签的内容
    JS获取子节点、父节点和兄弟节点的方法实例总结
    JS实现系统时间(自动)
    CSS font-family 属性
    网页中导入特殊字体@font-face属性详解
    ****HTML模板资源汇总
    ***XAMPP:报错 Unable to load dynamic library的解决方法
    2016年宜昌楼市将迎来史上最激烈一战
    北大资源重磅来宜--宜昌未来商业中心将诞生
    HTML5调用传感器的资料汇总
  • 原文地址:https://www.cnblogs.com/whcai/p/14708284.html
Copyright © 2011-2022 走看看