I have a list of words and phrases:
words = ['hi', 'going on', 'go']
And I have a transcript:
transcript ="hi how are you. I am good. what's going on.".split('.')
I need to find matches in this transcript. For the example above, matches are in the first and third elements of the transcript.
I followed answers from here and I tried to use the following code:
for i in range(len(transcript)):
if any(word in transcript[i] for word in words):
print(i)
Its output is:
1
2
3
But it is not what I want. I want to exclude 'i am good' sentences from the output. The expected output is:
1
3