Calculate Word Frequency | MLPro

PHOTO EMBED

Mon Oct 18 2021 19:15:01 GMT+0000 (UTC)

Saved by @blurred_8216

import re
# Please do not change the below function name and parameters
def count_word_frequency(sentence,token):
    return re.split("\W" ,sentence.lower()).count(token.lower())
content_copyCOPY

Counting number of token in a text file

https://mlpro.io/problems/word-frequency/