We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
代码:
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)]]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
代码:
输出:
The text was updated successfully, but these errors were encountered: