original_docstring: Get text context for Adeft disambiguation
  
          If the INDRA database is available, attempts to get the fulltext from
          which the statement was extracted. If the fulltext is not available,
          the abstract is returned. If the indra database is not available, uses
          the pubmed client to get the abstract. If no abstract can be found,
          falls back on returning the evidence text for the statement.
  
          Parameters
          ----------
          stmt : py:class:`indra.statements.Statement`
              Statement with agent we seek to disambiguate.
  
          agent_text : str
             Agent text that needs to be disambiguated
  
          Returns
          -------
          text : str
              Text for Adeft disambiguation
          
docstring: Get text context for Adeft disambiguation
  If the INDRA database is available, attempts to get the fulltext from
  which the statement was extracted. If the fulltext is not available,
  the abstract is returned. If the indra database is not available, uses
  the pubmed client to get the abstract. If no abstract can be found,
  falls back on returning the evidence text for the statement.
  
  Parameters
  
  stmt : py:class:`indra.statements.Statement`
  Statement with agent we seek to disambiguate.
  
  agent_text : str
  Agent text that needs to be disambiguated
  
  Returns
  
  text : str
  Text for Adeft disambiguation
docstring_tokens: Get text context for Adeft disambiguation If the INDRA database is available attempts to get the fulltext from which the statement was extracted . If the fulltext is not available the abstract is returned . If the indra database is not available uses the pubmed client to get the abstract . If no abstract can be found falls back on returning the evidence text for the statement . Parameters stmt : py : class : ` indra . statements . Statement ` Statement with agent we seek to disambiguate . agent_text : str Agent text that needs to be disambiguated Returns text : str Text for Adeft disambiguation
code: def _get_text_for_grounding(self, stmt, agent_text):
          """Get text context for Adeft disambiguation
  
          If the INDRA database is available, attempts to get the fulltext from
          which the statement was extracted. If the fulltext is not available,
          the abstract is returned. If the indra database is not available, uses
          the pubmed client to get the abstract. If no abstract can be found,
          falls back on returning the evidence text for the statement.
  
          Parameters
          ----------
          stmt : py:class:`indra.statements.Statement`
              Statement with agent we seek to disambiguate.
  
          agent_text : str
             Agent text that needs to be disambiguated
  
          Returns
          -------
          text : str
              Text for Adeft disambiguation
          """
          text = None
          # First we will try to get content from the DB
          if self.__tc is not None:
              try:
                  from indra.literature.adeft_tools import universal_extract_text
                  refs = stmt.evidence[0].text_refs
                  # Prioritize the pmid attribute if given
                  if stmt.evidence[0].pmid:
                      refs['PMID'] = stmt.evidence[0].pmid
                  logger.debug('Obtaining text for disambiguation with refs: %s'
                               % refs)
                  content = self.__tc.get_text_content_from_text_refs(refs)
                  if not content:
                      raise ValueError('Text obtained from DB is empty')
                  text = universal_extract_text(content, contains=agent_text)
                  if text:
                      return text
              except Exception as e:
                  logger.info('Could not get text for disambiguation from DB: %s'
                              % e)
          # If that doesn't work, we try PubMed next
          if text is None:
              from indra.literature import pubmed_client
              pmid = stmt.evidence[0].pmid
              if pmid:
                  logger.debug('Obtaining abstract for disambiguation for PMID%s'
                               % pmid)
                  text = pubmed_client.get_abstract(pmid)
                  if text:
                      return text
          # Finally, falling back on the evidence sentence
          if text is None:
              logger.info('Falling back on sentence-based disambiguation')
              text = stmt.evidence[0].text
              return text
          return None
code_tokens: def _get_text_for_grounding ( self , stmt , agent_text ) : text = None if self . __tc is not None : try : from indra . literature . adeft_tools import universal_extract_text refs = stmt . evidence [ 0 ] . text_refs if stmt . evidence [ 0 ] . pmid : refs [ 'PMID' ] = stmt . evidence [ 0 ] . pmid logger . debug ( 'Obtaining text for disambiguation with refs: %s' % refs ) content = self . __tc . get_text_content_from_text_refs ( refs ) if not content : raise ValueError ( 'Text obtained from DB is empty' ) text = universal_extract_text ( content , contains = agent_text ) if text : return text except Exception as e : logger . info ( 'Could not get text for disambiguation from DB: %s' % e ) if text is None : from indra . literature import pubmed_client pmid = stmt . evidence [ 0 ] . pmid if pmid : logger . debug ( 'Obtaining abstract for disambiguation for PMID%s' % pmid ) text = pubmed_client . get_abstract ( pmid ) if text : return text if text is None : logger . info ( 'Falling back on sentence-based disambiguation' ) text = stmt . evidence [ 0 ] . text return text return None
short_docstring: Get text context for Adeft disambiguation
  If the INDRA database is available, attempts to get the fulltext from
  which the statement was extracted.
short_docstring_tokens: Get text context for Adeft disambiguation If the INDRA database is available attempts to get the fulltext from which the statement was extracted .
comment: """Get text context for Adeft disambiguation
  
          If the INDRA database is available, attempts to get the fulltext from
          which the statement was extracted. If the fulltext is not available,
          the abstract is returned. If the indra database is not available, uses
          the pubmed client to get the abstract. If no abstract can be found,
          falls back on returning the evidence text for the statement.
  
          Parameters
          ----------
          stmt : py:class:`indra.statements.Statement`
              Statement with agent we seek to disambiguate.
  
          agent_text : str
             Agent text that needs to be disambiguated
  
          Returns
          -------
          text : str
              Text for Adeft disambiguation
          """$SEP$# First we will try to get content from the DB$SEP$# Prioritize the pmid attribute if given$SEP$# If that doesn't work, we try PubMed next$SEP$# Finally, falling back on the evidence sentence