I need help with a program that identifies individual words in a sentence, stores these in a list and replaces each word in the original sentence with the position of that w
Instead of the OrderedDict you could just use a set.
refined = list(set(FilteredSentence))
than you can check each word against the list.
index_list = [] for word in FilteredSentence: index_list.append(refined.index(word) +1)
index_list is the result you asked for