Skip to content

Commit

Permalink
add jieba upgrade not in README.md and change import imp to import im…
Browse files Browse the repository at this point in the history
…portlib in _compat.py (fxsjy#794)
  • Loading branch information
JesseyXujin authored and fxsjy committed Dec 31, 2019
1 parent 2fdee89 commit 0b74b6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jieba
* 精确模式,试图将句子最精确地切开,适合文本分析;
* 全模式,把句子中所有的可以成词的词语都扫描出来, 速度非常快,但是不能解决歧义;
* 搜索引擎模式,在精确模式的基础上,对长词再次切分,提高召回率,适合用于搜索引擎分词。
* paddle模式,利用paddlepaddle深度学习框架,训练序列标注(双向GRU)网络模型实现分词。同时支持词性标注。如需使用,请先安装paddlepaddle-tiny,`pip install paddlepaddle-tiny==1.6.1` (www.paddlepaddle.org)
* paddle模式,利用paddlepaddle深度学习框架,训练序列标注(双向GRU)网络模型实现分词。同时支持词性标注。如需使用,请先安装paddlepaddle-tiny,`pip install paddlepaddle-tiny==1.6.1`目前paddle模式支持jieba v0.40及以上版本。jieba v0.40以下版本,请升级jieba,`pip install jieba --upgrade`(www.paddlepaddle.org)
* 支持繁体分词
* 支持自定义词典
* MIT 授权协议
Expand Down
4 changes: 2 additions & 2 deletions jieba/_compat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import os
import sys
import imp
import importlib
import logging

log_console = logging.StreamHandler(sys.stderr)
Expand Down Expand Up @@ -81,7 +81,7 @@ def check_paddle_install():
is_paddle_installed = False
try:
import paddle
if imp.find_module('paddle') and (paddle.__version__ >= '1.6.1' or paddle.__version__ >= u'1.6.1'):
if importlib.find_module('paddle') and (paddle.__version__ >= '1.6.1' or paddle.__version__ >= u'1.6.1'):
is_paddle_installed = True
elif paddle.__version__ < '1.6.1':
is_paddle_installed = False
Expand Down

0 comments on commit 0b74b6c

Please sign in to comment.