【发布时间】:2017-10-03 04:21:25
【问题描述】:
我是 python 新手,需要一些帮助:
这只是一个示例:
我有一本字典(在列表中重复相同的键值:
list_dummy = [{'a': 1, 'b':"The house is great. I loved it.",'e':"loved,the"}, {'a': 3, 'b': "Building is white in colour. I liked it.",'e':"colour"}, {'a': 5, 'b': "She is looking pretty. She is in my college",'e':"pretty"}]
'b' - 由正文组成 'e' - 由单词组成(可以多个)
我想从“b”中提取句子,其中包含“e”中的一个或多个单词。
我需要先通过 sent_tokenize & 将文本分成句子而不是提取。 Sent_tokenize 仅将字符串作为输入。如何进行?
【问题讨论】: