I have managed to create 2 lists from text documents. The first is my bi-gram list:
keywords = ['nike shoes','nike clothing', 'nike black', 'nike white']
and a list of stop words:
stops = ['clothing','black','white']
I want to remove the Stops from my Keywords list. Using the above example, the output I am after should look like this:
new_keywords = ['nike shoes','nike', 'nike', 'nike'] --> eventually I'd like to remove those dupes.
This is what I've done so far:
keywords = open("keywords.txt", "r")
new_keywords = keywords.read().split(",")
stops = open("stops.txt","r")
new_stops = stops.read().split(",")
[i for i in new_keywords if i not in new_stops]
The problem I am having is that it is looking for the 2 words combos rather than the single word stops....