title: Forming Bigrams of words in list of sentences and counting bigrams using python
body: <p>I need:
  1. to form bigram pairs and store them in list 
  2. find sum of id in which there аrе top 3 bigram with highest frequency </p>
  
  <p>I have a list of sentences:</p>
  
  <pre><code>[['22574999', 'your message communication sent']
  , ['22582857', 'your message be delivered']
  , ['22585166', 'message has be delivered']
  , ['22585424', 'message originated communication sent']]
  </code></pre>
  
  <p>Here is what I did:</p>
  
  <pre><code>for row in messages: 
      sstrm = list(row)
      bigrams=[b for l in sstrm for b in zip(l.split(" ")[:1], l.split(" ")[1:])]
      print(sstrm[0],bigrams)
  </code></pre>
  
  <p>which yields:</p>
  
  <pre><code>22574999 [('your', 'message')]
  22582857 [('[your', 'message')]
  22585166 [('message', 'has')]
  22585424 [('message', 'originated')]
  </code></pre>
  
  <p>What I want is:</p>
  
  <pre><code>22574999 [('your', 'message'),('communication','sent')]
  22582857 [('[your', 'message'),('be','delivered')]
  22585166 [('message', 'has'),('be','delivered')]
  22585424 [('message', 'originated'),('communication','sent')]
  </code></pre>
  
  <p>I would like to get the following result
  RESULT:</p>
  
  <p>top 3 bigrams with highest frequency:</p>
  
  <pre><code>('your', 'message') :2 
  ('communication','sent'):2    
  ('be','delivered'):2
  </code></pre>
  
  <p>sum of id in which there аре top 3 bigrams with highest frequency:</p>
  
  <pre><code>('your', 'message'):2           Is included (22574999,22582857)     
  ('communication','sent'):2      Is included(22574999,22585424)
  ('be','delivered'):2            Is included (22582857,22585166)
  </code></pre>
  
  <p>Thanks for your help!</p>