#!/usr/bin/ python
# -*- coding: utf-8 -*-
import sys, os
from zhon.hanzi import punctuation
from zhon.hanzi import non_stops
from zhon.hanzi import stops
import logging
'''
ROOTDIR = os.path.join(os.path.dirname(__file__), os.pardir) # dirname(__file__)对应的是当前.py文件所在目录,os.pardir代表此文件所在目录的上级目录
sys.path = [os.path.join(ROOTDIR, "lib")] + sys.path
# Set your own model path
MODELDIR=os.path.join(ROOTDIR, "./ltp_data")
'''
zhon_char = punctuation + non_stops + stops
#from pyltp import SentenceSplitter, Segmentor, Postagger, Parser, NamedEntityRecognizer, SementicRoleLabeller
import pyltp
import gc
import re
# 从single_sents读句子也可以
def sentence_read():
# 0
#Input = open("./single_sents", "r", encoding="utf-8")
# 1 利用sentencesplitter再分一遍句子
with open("./article_corpus", 'r', encoding="utf-8") as fo:
pas
利用pyltp找说话人的SBV谓语动词
最新推荐文章于 2021-01-13 16:51:22 发布