This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_top_n_words(corpus, n=None): | |
""" | |
List the top n words in a vocabulary according to occurrence in a text corpus. | |
get_top_n_words(["I love Python", "Python is a language programming", "Hello world", "I love the world"]) -> | |
[('python', 2), | |
('world', 2), | |
('love', 2), | |
('hello', 1), | |
('is', 1), |
OlderNewer