Commit 46519c30 authored by dmMaze's avatar dmMaze
Browse files

support spacy_pkuseg as an alternative for pkuseg

parent 2b4e782a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -187,7 +187,10 @@ def seg_ch_pkg(text: str):

    global CHSEG
    if CHSEG is None:
        try:
            import pkuseg
        except:
            import spacy_pkuseg as pkuseg
        if not osp.exists(pkuseg.config.pkuseg_home):
            pkuseg.config.pkuseg_home = 'data/models/pkuseg'
        CHSEG = pkuseg.pkuseg(postag=True)