def georesolve_page(doc): if doc.ents: flag, in_xml = xml_geo_entities(doc) if flag == 1: geo_xml = georesolve_cmd(in_xml) dResolved_loc = coord_xml(geo_xml) return dResolved_loc else: return {} else: return {}
def georesolve_page_2(text, lang_model): nlp = spacy.load(lang_model) doc = nlp(text) if doc.ents: flag,in_xml = xml_geo_entities(doc) if flag == 1: geo_xml=georesolve_cmd(in_xml) dResolved_loc= coord_xml(geo_xml) return dResolved_loc else: return {} else: return {}
def georesolve_page_2(text, lang_model, defoe_path, gazetteer, bounding_box): nlp = spacy.load(lang_model) doc = nlp(text) if doc.ents: flag, in_xml, snippet = xml_geo_entities_snippet(doc) if flag == 1: geo_xml = georesolve_cmd(in_xml, defoe_path, gazetteer, bounding_box) dResolved_loc = coord_xml_snippet(geo_xml, snippet) return dResolved_loc else: return {} else: return {}
def georesolve_page_2(text, lang_model): #print("---> Clean_Text to analyse %s" %text) nlp = spacy.load(lang_model) doc = nlp(text) #print("---> DOC -NLP to analyse %s" %doc) if doc.ents: flag, in_xml = xml_geo_entities(doc) if flag == 1: geo_xml = georesolve_cmd(in_xml) dResolved_loc = coord_xml(geo_xml) #print("ROSA-3- My final result %s" % dResolved_loc) return dResolved_loc else: return {} else: return {}