aI want to make a new list that matches from a list of sentences against a list of keywords.
list = ['This sentence contains disclosure.', 'This sentence contains none declared.', 'This sentence contains competing interest.', 'This sentence contains authors declare.']
keywords = ['disclosure ', 'none declared', 'interest']
The new list should print should come out like this
matched_list = ['This sentence contains disclosure.', 'This sentence contains none declared.']
I have tried using
r = re.compile('.*disclosure')
newlist = list(filter(r.match, list))
However I have a very large list of keywords and it will be impossible to type it all out in the r = re.compile('.*keywords')
. Is there any other way to to match a list of sentences with a list of keywords.