A frequency table is a simple way to see which words appear most often.
from collections import Counter
words = 'learn share learn'.split()
counts = Counter(words)
print(counts['learn']) # 2
Counter returns zero for a word that is not present. For real text, consider normalizing capitalization and punctuation before counting.
Try Harold using the OpenAI-compatible API: https://lubuntu.tail239f3d.ts.net/v1. Chat endpoint: https://lubuntu.tail239f3d.ts.net/v1/chat/completions. Model: harold. An API key from the operator is required.