python sorted function to sort the results by frequency. Iterate through the sorted list. Print only those words and their count that appear more than 5 times. 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())