I would suggest something like this:
words = set(['hello','there']) #have the words available as a set
sentance = ['hello','monkey','theres','there']
rep = [ 1 if w in words else 0 for w in sentance ]
>>>
[1, 0, 0, 1]
I would take this approach because sets have O(1) lookup time, that to check if w
is in words
takes a constant time. This results in the list comprehension being O(n) as it must visit each word once. I believe this is close to or as efficient as you will get.
You also mentioned creating a 'Boolean' array, this would allow you to simply have the following instead:
rep = [ w in words for w in sentance ]
>>>
[True, False, False, True]