zoukankan      html  css  js  c++  java
  • 使用hanlp获取法人名称以及企业名称

    一:首先要装第三方库

     1 pip install pyhanlp 

    二:复制粘贴以下代码:

     1 from pyhanlp import *
     2 
     3 if __name__ == '__main__':
     4     text1 = "1998年11月11日,马化腾和同学张志东在广东省深圳市正式注册成立“深圳市腾讯计算机系统有限公司”," 
     5             "之后许晨晔、陈一丹、曾李青相继加入。当时公司的业务是拓展无线网络寻呼系统,为寻呼台建立网上寻呼系统," 
     6             "这种针对企业或单位的软件开发工程是所有中小型网络服务公司的最佳选择。"
     7     CRFnewSegment=HanLP.newSegment("crf")
     8 
     9     term_list=CRFnewSegment.seg(text1)
    10     print(term_list)
    11 
    12     rmlist=[]
    13     compliist=[]
    14     for term in term_list:
    15         nature=str(term.nature)
    16         if(nature=="nr"):
    17             rmlist.append(term.word)
    18             print(term)
    19         if(nature=='nt'):
    20             compliist.append(term.word)
    21     print(rmlist)
    22     print(compliist)
  • 相关阅读:
    AWR报告生成
    ios-html-get/post差额,简而言之(MS)CheckST
    2015第33周一
    2015第32周日
    2015第32周六
    2015第32周五
    2015第32周四
    2015第32周三
    2015第32周二
    2015第32周一
  • 原文地址:https://www.cnblogs.com/smartisn/p/13822651.html
Copyright © 2011-2022 走看看