第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用python將已編號列表的段落標(biāo)記為多個句子?

如何使用python將已編號列表的段落標(biāo)記為多個句子?

繁華開滿天機(jī) 2021-07-09 14:01:47
我打算將段落分成多個句子。本段包含編號的句子,如下所示:Hello, How are you? Hope everything is good. I'm fine. 1.Hello World. 2.Good Morning John. Product is good but the managemnt is very lazy very bad. I dont like company service. They are giving fake promises. Next time i will not take any product. For Amazon service i will give 5 star dey give awsome service. But for sony company i will give 0 star... 1. Doesn't support all file formats when you connect USB 2. No other apps than YouTube and Netflix (requires subscription) 3. Screen mirroring is not up to the mark ( getting connected after once in 10 attempts 4. Good screen quality 5. Audio is very good 6. Bulky compared to other similar range 7. Price bit high due to brand value 8. its 1/4 smart TV. Not a full smart TV 9. Bad customer support 10. Remote control is very horrible to operate. it might be good for non smart TV 11. See the exchange value on amazon itself. LG gets 2ooo/- more than TV's 12. Also it was mentioned like 1+1 year warranty. But either support or Amazon support aren't clear about it. 13. Product information isn't up to 30% at least.There no installation. While I contact costumer Care.我用下面的代碼來分解句子:import nltktokenizer = nltk.tokenize.punkt.PunktSentenceTokenizer()fp = open("/Users/Desktop/sample.txt", encoding='utf-8')data = fp.read()with open("/Users/Desktop/output.txt", 'a', encoding='utf-8' ) as f:            f.write(''.join(tokenizer.tokenize(data)))            f.close()此代碼基于句號拆分段落。但是編號的句子正在產(chǎn)生問題。由于這些數(shù)字后面有句號,所以它以不正確的方式分裂。有人可以建議我嗎?
查看完整描述

2 回答

?
夢里花落0921

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超6個贊

你需要sent_tokenize:


from nltk.tokenize import sent_tokenize


text = "Hello, How are you? Hope everything is good. I'm fine. 1.Hello World. 2.Good Morning John."


print(sent_tokenize(text))

輸出


['Hello, How are you?', 'Hope everything is good.', "I'm fine.", '1.Hello World.', '2.Good Morning John.']



查看完整回答
反對 回復(fù) 2021-07-21
  • 2 回答
  • 0 關(guān)注
  • 263 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號