title: How to find bi-grams which include pre-defined words?
body: <p>I know it is possible to find bigrams which have a particular word from the example in the link below:</p>
  
  <pre><code>finder = BigramCollocationFinder.from_words(text.split())
  word_filter = lambda w1, w2: "man" not in (w1, w2)
  finder.apply_ngram_filter(word_filter)
  
  bigram_measures = nltk.collocations.BigramAssocMeasures()
  raw_freq_ranking = finder.nbest(bigram_measures.raw_freq, 10) #top-10
      &gt;&gt;&gt; 
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/49197667/nltk-how-to-get-bigrams-containing-a-specific-word">nltk: how to get bigrams containing a specific word</a></p>
  
  <p>But I am not sure how this can be applied if I need bigrams containing both words pre-defined.</p>
  
  <p>Example:</p>
  
  <p>My Sentence: <code>"hello, yesterday I have seen a man walking. On the other side there was another man yelling: "who are you, man?"</code></p>
  
  <p>Given a list:<code>["yesterday", "other", "I", "side"]</code> 
  How can I get a list of bi-grams with the given words. i.e:
  <code>[("yesterday", "I"), ("other", "side")]</code>?</p>