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

请问新版的 ltp-4.2.13 是不是取消了句子切分的功能? #667

Open
humygithub opened this issue Sep 29, 2023 · 4 comments
Open

Comments

@humygithub
Copy link

我运行如下程序:

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的正确的断句方法是什么?

@RyanBin0126
Copy link

from ltp import LTP, StnSplit
sents_list = StnSplit().split(text)

@Gloridust
Copy link

相同的问题:

work_listing = StnSplit().split(works)

其中split在编辑器中显示为白色,明显没有识别到;

@Kris20xx
Copy link

请问,是不是4.2之后的没有seg这个函数了啊

@Gloridust
Copy link

请问,是不是4.2之后的没有seg这个函数了啊

好像是这样的

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

4 participants