Python中文分词 scseg

码农软件 · 软件分类 · 中文分词库 · 2019-08-29 06:57:37

软件介绍

scseg中文分词,是基于mmseg的简单分词组件

Feature

  • 支持pinyin分词
  • 支持用户自定义词典
  • 支持单位合并
  • 支持汉字数字识别

Install

  • pip install scseg
  • 通过import scseg来引用

Algorithm

  • 采用mmseg算法进行切分
  • 采用规则方式支持中文数字分词

功能 1):分词scseg.seg_text方法

  • scseg.seg_text函数接受3个参数:
  • text参数为需要分词的字符
  • ext_dict_words为用户自定义的扩展字典
  • use_combine代表是否需要合并处理

代码示例( 全功能分词 )

#encoding=utf-8
import genius

seg_list = scseg.seg_text(u'中国人民站起来了pinyin')
print '\n'.join(seg_list)

功能 2):面向索引的分词

  • scseg.seg_keywords为面向索引的切割方式
  • 其作用是枚举出所有可能的切割方式
  • text参数为需要分词的字符

代码示例( 全功能分词 )

#encoding=utf-8
import scseg

seg_list = scseg.seg_keywords(u'中国人民站起来了pinyin')
print '\n'.join(seg_list)

本文地址:https://www.codercto.com/soft/d/13400.html

Machine Learning

Machine Learning

Kevin Murphy / The MIT Press / 2012-9-18 / USD 90.00

Today's Web-enabled deluge of electronic data calls for automated methods of data analysis. Machine learning provides these, developing methods that can automatically detect patterns in data and then ......一起来看看 《Machine Learning》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具