版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012300744/article/details/80706956
from collections import Counter
def bag_of_words(text):
# TODO: Implement bag of words
return Counter(text.split())
test_text = 'the quick brown fox jumps over the lazy dog'
print(bag_of_words(test_text))