I want to search [a text file](https://drive.google.com/open?id=1vf8j94GNobOcdsg0lgUbMM7i55CPpLTq) for specific keywords, then create a dictionary with the absolute counts and relative frequency of each keyword. I'm using Counter() within a nested loop that should look up each keyword in my list and then count how often each appears in the document. But, while Counter correctly counts each keyword, it then multiplies this count by the total number of keywords. I think I am setting up my nested loop incorrectly.

```
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk import FreqDist
import io
from collections import Counter

with io.open('copy.txt','r', encoding='utf-8') as tempFile:
    rawText =  tempFile.read()
    rawText = rawText.lower()

cnt = Counter()

tokens = word_tokenize(rawText)

keywords = ['kingdom', 'phylum', 'class', 'status']

for keyword in keywords:
    for keyword in tokens:
        cnt[keyword] += 1

for keyword in keywords:
    d = {'Keyword': keyword, 'Count': cnt[keyword], 'Frequency':cnt[keyword]/float(len(tokens))}
    print(d)

```

I should see:

```
{'Count': 2, 'Frequency': 0.000882223202470225, 'Keyword': 'kingdom'}
{'Count': 6, 'Frequency': 0.002646669607410675, 'Keyword': 'phylum'}
{'Count': 14, 'Frequency': 0.0061755624172915745, 'Keyword': 'class'}
{'Count': 2, 'Frequency': 0.000882223202470225, 'Keyword': 'status'}

```

But instead I see:

```
{'Count': 8, 'Frequency': 0.000882223202470225, 'Keyword': 'kingdom'}
{'Count': 24, 'Frequency': 0.002646669607410675, 'Keyword': 'phylum'}
{'Count': 56, 'Frequency': 0.0061755624172915745, 'Keyword': 'class'}
{'Count': 8, 'Frequency': 0.000882223202470225, 'Keyword': 'status'}

```