will use a dictionary to count the number of times each word with length 2 or less appears in the string 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())