Write a Python program to clean a text corpus, transforming it into a bag of words.
The cat in the hat.
corpus = "the cat in the hat"

words = corpus.lower().split()
bag_of_words = set(words)

print(bag_of_words)
# Output: {'the', 'in', 'cat', 'hat'}