def geomap_page(doc):
    geomap_html = ''
    if doc.ents:
        flag, in_xml = xml_geo_entities(doc)
        if flag == 1:
            geomap_html = geomap_cmd(in_xml)
    #return str(geomap_html)
    return geomap_html
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 {}
Beispiel #3
0
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):
    #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 {}