def _get_target(self, target_arg): target_str = str(target_arg) target_str = self.decode_description('<ekb>' + target_str + '</ekb>') tp = TripsProcessor(target_str) terms = tp.tree.findall('TERM') term_id = terms[0].attrib['id'] agent = tp._get_agent_by_id(term_id, None) return agent
def process_xml(xml_string): """Return a TripsProcessor by processing a TRIPS EKB XML string. Parameters ---------- xml_string : str A TRIPS extraction knowledge base (EKB) string to be processed. http://trips.ihmc.us/parser/api.html Returns ------- tp : TripsProcessor A TripsProcessor containing the extracted INDRA Statements in tp.statements. """ tp = TripsProcessor(xml_string) if tp.tree is None: return None tp.get_activations_causal() tp.get_activations_stimulate() tp.get_complexes() tp.get_modifications() tp.get_active_forms() tp.get_active_forms_state() tp.get_activations() tp.get_translocation() tp.get_regulate_amounts() tp.get_degradations() tp.get_syntheses() return tp
def process_xml(xml_string): """Return a TripsProcessor by processing a TRIPS EKB XML string. Parameters ---------- xml_string : str A TRIPS extraction knowledge base (EKB) string to be processed. http://trips.ihmc.us/parser/api.html Returns ------- tp : TripsProcessor A TripsProcessor containing the extracted INDRA Statements in tp.statements. """ tp = TripsProcessor(xml_string) if tp.tree is None: return None tp.get_activations_causal() tp.get_activations_stimulate() tp.get_complexes() tp.get_modifications() tp.get_active_forms() tp.get_active_forms_state() tp.get_activations() tp.get_translocation() tp.get_degradations() tp.get_syntheses() return tp