ltp icon indicating copy to clipboard operation
ltp copied to clipboard

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

Open humygithub opened this issue 1 year ago • 4 comments

我运行如下程序:

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

humygithub avatar Sep 29 '23 05:09 humygithub

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

RyanBin0126 avatar Oct 01 '23 07:10 RyanBin0126

相同的问题:

work_listing = StnSplit().split(works)

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

Gloridust avatar Feb 13 '24 15:02 Gloridust

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

Kris20xx avatar May 16 '24 12:05 Kris20xx

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

好像是这样的

Gloridust avatar May 19 '24 16:05 Gloridust