HIT-SCIR / ltp

Language Technology Platform
http://ltp.ai
4.98k stars 1.04k forks source link

AttributeError: 'LTP' object has no attribute 'seg' #619

Closed godspirit00 closed 1 year ago

godspirit00 commented 1 year ago

您好,我在尝试命名实体识别,但是在seg, hidden = ltp.seg(["他叫汤姆去拿外衣。"])这步,提示错误AttributeError: 'LTP' object has no attribute 'seg',我是按照README里的方式pip install -U ltp ltp-core ltp-extension安装的。 请问应该怎么办? 谢谢您。

todochenxi commented 1 year ago

我也遇到了,重装好几回,还是报错

AlongWY commented 1 year ago
output = ltp.pipeline(["他叫汤姆去拿外衣。"], tasks=["cws", "pos", "ner", "srl", "dep", "sdp"])
# 如果仅仅需要ner结果的话
output = ltp.pipeline(["他叫汤姆去拿外衣。"], tasks=["cws", "ner"])
godspirit00 commented 1 year ago

@AlongWY 感谢回答 文档可能也需要更新一下~