<prompt> Andika script kupata juu 10 maneno ya mara kwa mara katika corpus.  <response>: Here is a Python script that takes in a text corpus and returns the top 10 most frequent words:pythonfrom collections import Counterimport redef get_top_wordscorpus: Remove any non-word character including punctuation and split the words words re.findallrbwb, corpus.lower Count the frequency of each word word_freq Counterwords Get the 10 most common words most_common_words word0 for word in word_freq.most_common10 return most_common_wordsThis script can be used as follows:pythontext_corpus This is a sample text corpus containing several words, including repeated words like words and words. top_words get_top_wordstext_corpusprinttop_wordsThis function uses regular expression to identify words from the input corpus, and create a frequency distribution of the identified words using the Counter from the collections module. Once the frequency distribution is computed, the most_common method can then be called on this object to retrieve the n most frequent words, by parameter n. In this case, n is 10. 