使用 Sentence Tokenizer 后从列表列表中选择子列表

Selecting a sublist from list of lists after using Sentence Tokenizer

所以我在列表中有一些句子:

some_list = ['Joe is travelling via train.' 
             'Joe waited for the train, but the train was late.'
             'Even after an hour, there was no sign of the 
              train. Joe then went to talk to station master about the 
              train's situation.']

然后我用了nltk的Sentence tokenizer,因为我想单独分析一个完整句子中的每个句子。所以现在 O/P 在列表列表格式中看起来像这样:

sent_tokenize_list = [['Joe is travelling via train.'],
                      ['Joe waited for the train,',
                       'but the train was late.'],
                      ['Even after an hour,',
                       'there was no sign of the 
                        train.',
                       'Joe then went to talk to station master about 
                        the train's situation.']]    

现在从这个列表列表中,我如何 select 包含超过 1 个句子的列表,即我示例中的第二和第三列表,并将它们放在仅列表格式为 单独列表。

即O/P应该是

['Joe waited for the train,','but the train was late.'] 
['Even after an hour,','there was no sign of the train.',
 'Joe then went to talk to station master about the train's situation.']         

您可以使用len查看列表中的句子数量。

例如:

sent_tokenize_list = [['Joe is travelling via train.'],
                      ['Joe waited for the train,',
                       'but the train was late.'],
                      ['Even after an hour,','there was no sign of the train.',"Joe then went to talk to station master about the train's situation."]]


print([i for i in sent_tokenize_list if len(i) >= 2]) 

输出:

[['Joe waited for the train,', 'but the train was late.'], ['Even after an hour,', 'there was no sign of the train.', "Joe then went to talk to station master about the train's situation."]]