Make a function that creates a dictionary of counts for each of the words. For this you will: Remove all punctuation (.,") Convert all words to lowercase Split the string on spaces Iterate over the set of words to make the dictionary. code example
Example: calculate term frequency python
from collections import Counter
# Counter token frequency from a sentence
sentence = "Texas A&M University is located in Texas"
term_frequencies = Counter(sentence.split())