class_docstr: Main data class: encapsulate list of utterances, mentions and speakers
  Process utterances to extract mentions and pre-compute mentions features
docstr: Yield tuples of mentions, dictionnary of candidate antecedents for the mention
  
  Arg:
      mentions: an iterator over mention indexes (as returned by get_candidate_mentions)
      max_mention_distance : max distance between a mention and its antecedent
      max_mention_distance_string_match : max distance between a mention and
          its antecedent when there is a proper noun match
docstr_tok: ["Yield","tuples","of","mentions",",","dictionnary","of","candidate","antecedents","for","the","mention","Arg",":","mentions",":","an","iterator","over","mention","indexes","(","as","returned","by","get_candidate_mentions",")","max_mention_distance",":","max","distance","between","a","mention","and","its","antecedent","max_mention_distance_string_match",":","max","distance","between","a","mention","and","its","antecedent","when","there","is","a","proper","noun","match"]
code: def get_candidate_pairs(
      self,
      mentions=None,
      max_distance=50,
      max_distance_with_match=500,
      debug=False,
  ):
      """
      Yield tuples of mentions, dictionnary of candidate antecedents for the mention
  
      Arg:
          mentions: an iterator over mention indexes (as returned by get_candidate_mentions)
          max_mention_distance : max distance between a mention and its antecedent
          max_mention_distance_string_match : max distance between a mention and
              its antecedent when there is a proper noun match
      """
      if mentions is None:
          mentions = range(len(self.mentions))
      if debug:
          print("get_candidate_pairs: mentions", mentions)
  
      if max_distance_with_match is not None:
          word_to_mentions = {}
          for i in mentions:
              for tok in self.mentions[i].content_words:
                  if not tok in word_to_mentions:
                      word_to_mentions[tok] = [i]
                  else:
                      word_to_mentions[tok].append(i)
  
      for i in mentions:
          antecedents = (
              set(range(i))
              if max_distance is None
              else set(range(max(0, i - max_distance), i))
          )
          if debug:
              print("antecedents", antecedents)
          if max_distance_with_match is not None:
              for tok in self.mentions[i].content_words:
                  with_string_match = word_to_mentions.get(tok, None)
                  for match_idx in with_string_match:
                      if (
                          match_idx < i
                          and match_idx >= i - max_distance_with_match
                      ):
                          antecedents.add(match_idx)
          yield i, antecedents
  
imports: import re
  import io
  from six import string_types, integer_types
  from spacy.tokens import Span, Token
  from neuralcoref.train.compat import unicode_
  from neuralcoref.train.utils import encode_distance, parallel_process
  import spacy
  import numpy
label_desc: Use image node_id 14 for calling the Document obj's underlying member method code with example usage: obj.get_candidate_pairs(mentions, max_distance, max_distance_with_match, debug) without return types