Use a collections.Counter()
object and split your words on whitespace. You probably want to lowercase your words as well, and remove punctuation:
from collections import Counter
counts = Counter()
for sentence in sequence_of_sentences:
counts.update(word.strip('.,?!"\'').lower() for word in sentence.split())
or perhaps use a regular expression that only matches word characters:
from collections import Counter
import re
counts = Counter()
words = re.compile(r'\w+')
for sentence in sequence_of_sentences:
counts.update(words.findall(sentence.lower()))
Now you have a counts
dictionary with per-word counts.
Demo:
>>> sequence_of_sentences = ['This is a sentence', 'This is another sentence']
>>> from collections import Counter
>>> counts = Counter()
>>> for sentence in sequence_of_sentences:
... counts.update(word.strip('.,?!"\'').lower() for word in sentence.split())
...
>>> counts
Counter({'this': 2, 'is': 2, 'sentence': 2, 'a': 1, 'another': 1})
>>> counts['sentence']
2