【发布时间】:2018-08-24 09:38:25
【问题描述】:
我有一个数据集的每个二元组的频率。我需要按降序对其进行排序并可视化前 n 个二元组。这是我与每个二元组相关的频率
{('best', 'price'): 95, ('price', 'range'): 190, ('range', 'got'): 5, ('got', 'diwali'): 2, ('diwali', 'sale'): 2, ('sale', 'simply'): 1, ('simply', 'amazed'): 1, ('amazed', 'performance'): 1, ('performance', 'camera'): 30, ('camera', 'clarity'): 35, ('clarity', 'device'): 1, ('device', 'speed'): 1, ('speed', 'looks'): 1, ('looks', 'display'): 1, ('display', 'everything'): 2, ('everything', 'nice'): 5, ('nice', 'heats'): 2, ('heats', 'lot'): 14, ('lot', 'u'): 2, ('u', 'using'): 3, ('using', 'months'): 20, ('months', 'no'): 10, ('no', 'problems'): 8, ('problems', 'whatsoever'): 1, ('whatsoever', 'great'): 1
谁能帮我想象一下这些二元组?
【问题讨论】:
-
你试过什么?你到底卡在哪里了?请提供相关代码作为 MCVE:stackoverflow.com/help/mcve
标签: python-3.x machine-learning nlp nltk