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 LTP path = r"small" txt = "小明吃苹果。小明打篮球。" ltp = LTP(path) output = ltp.pipeline(txt, tasks=["cws", "pos"]) print(output.cws) print(output.pos)
得到了如下结果: ['小明', '吃', '苹果', '。', '小明', '打', '篮球', '。'] ['nh', 'v', 'n', 'wp', 'nh', 'v', 'n', 'wp']
发现它没有断句,就尝试了如下措施,结果都报错了:
请问ltp的正确的断句方法是什么?
The text was updated successfully, but these errors were encountered:
from ltp import LTP, StnSplit sents_list = StnSplit().split(text)
Sorry, something went wrong.
相同的问题:
work_listing = StnSplit().split(works)
其中split在编辑器中显示为白色,明显没有识别到;
split
请问,是不是4.2之后的没有seg这个函数了啊
好像是这样的
No branches or pull requests
我运行如下程序:
from ltp import LTP
path = r"small"
txt = "小明吃苹果。小明打篮球。"
ltp = LTP(path)
output = ltp.pipeline(txt, tasks=["cws", "pos"])
print(output.cws)
print(output.pos)
得到了如下结果:
['小明', '吃', '苹果', '。', '小明', '打', '篮球', '。']
['nh', 'v', 'n', 'wp', 'nh', 'v', 'n', 'wp']
发现它没有断句,就尝试了如下措施,结果都报错了:
sents = ltp.sentsplit(txt) # 试图断句报错
sents = ltp.sent_split(txt) # 试图断句报错
sents = ltp.splitsent(txt) # 试图断句报错
sents = ltp.split_sent(txt) # 试图断句报错
请问ltp的正确的断句方法是什么?
The text was updated successfully, but these errors were encountered: