Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ner的输出结果与示例不符 #712

Open
ZXTFINAL opened this issue Sep 13, 2024 · 0 comments
Open

Ner的输出结果与示例不符 #712

ZXTFINAL opened this issue Sep 13, 2024 · 0 comments

Comments

@ZXTFINAL
Copy link

代码:

from ltp import StnSplit,LTP
sents = StnSplit().split("汤姆生病了。他去了医院。")
sents = StnSplit().batch_split(["他叫汤姆去拿外衣。", "汤姆生病了。他去了医院。"])
print(sents)
ltp = LTP("./LTP_model/base/")
cws, pos, ner = ltp.pipeline(["他叫汤姆去拿外衣。"], tasks=["cws", "pos", "ner"]).to_tuple()  # to tuple 可以自动转换为元组格式
# 使用元组格式作为返回结果
print(cws, pos, ner)

输出:

['他叫汤姆去拿外衣。', '汤姆生病了。', '他去了医院。']
Loading weights from local directory
[['他', '叫', '汤姆', '去', '拿', '外衣', '。']] [['r', 'v', 'nh', 'v', 'v', 'n', 'wp']] [[('Nh', '汤姆', 2, 2)]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant