报错:Segmentor: Model not loaded!
Postagger: Model not loaded!
Parser: Model not loaded!
Parser: Model not loaded!
SRL: Model not loaded!
import os
from pyltp import Segmentor, Postagger, Parser, NamedEntityRecognizer, SementicRoleLabeller,
class LtpParser:
def __init__(self):
LTP_DIR = "E:/shixixiangmu/Extraction/ltp_data"
cws_model_path = os.path.join(LTP_DIR, 'cws.model')
self.segmentor = Segmentor("cws.model")
pos_model_path = os.path.join(LTP_DIR, "pos.model")
self.postagger = Postagger("pos.model")
parser_model_path = os.path.join(LTP_DIR, "parser.model")
self.parser = Parser("parser.model")
ner_model_path = os.path.join(LTP_DIR, "ner.model")
self.recognizer = NamedEntityRecognizer("ner.model")
pisrl_win_model_path = os.path.join(LTP_DIR, 'pisrl_win.model')
self.labeller = SementicRoleLabeller('pisrl_win.model')