docstr: Extract Relation between two mentions according to Wikipedia knowledge
  
  Args:
      method (optional): WikipediaSearchMethod.{ONLINE/OFFLINE/ELASTIC} run against wiki
          site a sub-set of wiki or on a local elastic database (default = ONLINE)
      wiki_file (required on OFFLINE mode): str Location of Wikipedia file to work with
      host (required on Elastic mode): str the Elastic search host name
      port (required on Elastic mode): int the Elastic search port number
      index (required on Elastic mode): int the Elastic search index name
docstr_tok: ["Extract","Relation","between","two","mentions","according","to","Wikipedia","knowledge","Args",":","method","(","optional",")",":","WikipediaSearchMethod",".","{","ONLINE\/OFFLINE\/ELASTIC","}","run","against","wiki","site","a","sub-set","of","wiki","or","on","a","local","elastic","database","(","default","=","ONLINE",")","wiki_file","(","required","on","OFFLINE","mode",")",":","str","Location","of","Wikipedia","file","to","work","with","host","(","required","on","Elastic","mode",")",":","str","the","Elastic","search","host","name","port","(","required","on","Elastic","mode",")",":","int","the","Elastic","search","port","number","index","(","required","on","Elastic","mode",")",":","int","the","Elastic","search","index","name"]
code: def __init__(
      self,
      method: WikipediaSearchMethod = WikipediaSearchMethod.ONLINE,
      wiki_file: str = None,
      host: str = None,
      port: int = None,
      index: str = None,
      filter_pronouns: bool = True,
      filter_time_data: bool = True,
  ) -> None:
      """
      Extract Relation between two mentions according to Wikipedia knowledge
  
      Args:
          method (optional): WikipediaSearchMethod.{ONLINE/OFFLINE/ELASTIC} run against wiki
              site a sub-set of wiki or on a local elastic database (default = ONLINE)
          wiki_file (required on OFFLINE mode): str Location of Wikipedia file to work with
          host (required on Elastic mode): str the Elastic search host name
          port (required on Elastic mode): int the Elastic search port number
          index (required on Elastic mode): int the Elastic search index name
      """
      logger.info("Loading Wikipedia module")
      self.filter_pronouns = filter_pronouns
      self.filter_time_data = filter_time_data
      connectivity = method
      if connectivity == WikipediaSearchMethod.ONLINE:
          self.pywiki_impl = WikiOnline()
      elif connectivity == WikipediaSearchMethod.OFFLINE:
          if wiki_file is not None and os.path.isdir(wiki_file):
              self.pywiki_impl = WikiOffline(wiki_file)
          else:
              raise FileNotFoundError(
                  "Wikipedia resource file not found or not in path, "
                  "create it or change the initialization method"
              )
      elif connectivity == WikipediaSearchMethod.ELASTIC:
          self.pywiki_impl = WikiElastic(host, port, index)
  
      logger.info("Wikipedia module lead successfully")
      super(WikipediaRelationExtraction, self).__init__()
  
imports: from __future__ import division
  import logging
  import os
  from typing import Set, List
  from nlp_architect.common.cdc.mention_data import MentionDataLight
  from nlp_architect.data.cdc_resources.data_types.wiki.wikipedia_pages import WikipediaPages
  from nlp_architect.data.cdc_resources.relations.relation_extraction import RelationExtraction
  from nlp_architect.data.cdc_resources.relations.relation_types_enums import RelationType, WikipediaSearchMethod
  from nlp_architect.data.cdc_resources.wikipedia.wiki_elastic import WikiElastic
  from nlp_architect.data.cdc_resources.wikipedia.wiki_offline import WikiOffline
  from nlp_architect.data.cdc_resources.wikipedia.wiki_online import WikiOnline
  from nlp_architect.utils.string_utils import StringUtils
label_desc: Use image node_id 1 to create a new WikipediaRelationExtraction object from inherited base classes: RelationExtraction with example: obj = WikipediaRelationExtraction(method, wiki_file, host, port, index, filter_pronouns, filter_time_data)