python,from mrjob.job import MRJob,,class MRWordFrequencyCount(MRJob):,, def mapper(self, _, line):, for word in line.split():, yield word, 1,, def reducer(self, key, values):, yield key, sum(values),,if __name__ == '__main__':, MRWordFrequencyCount.run(),
``,,这段代码使用Python和mrjob库实现了一个简单的MapReduce程序,用于统计文本中每个单词的出现频率。