Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Identifies geo locations, based on the patterns loaded.


Operates On:  Lexical Items with TOKEN and possibly other flags as specified below.

Saga_is_recognizer

Include Page
Generic Configuration Parameters
Generic Configuration Parameters

Configuration Parameters

  • Parameter
    summarydescriptionList of characters to remove from each GeoNames.
    defaultcheese"_-‿⁀⁔︳︴﹍﹎﹏_"
    namecharList
  • Parameter
    • Explanation
Saga_config_stage
boundaryFlagstext block split
requiredFlagstoken, semantic tag
titleDefault Config
skipFlagsskip
"parameter": "something something"

Example Output

Description

  • summaryDictionary containing the GeoNames.
    default"saga-provider:saga_geonames"
    namedictionary
  • Parameter
    summaryTransforms all GeoNames to Lowercase.
    defaulttrue
    namelowercase
    typeboolean
  • Parameter
    summaryMinimum length for each GeoName.
    default3
    nameminimum
    typeinteger
  • Parameter
    summaryNormalize specials accents like ä and é to their normalized form: a and e.
    defaultfalse
    namenormalizeAccents
    typeboolean
  • Parameter
    summaryEnables character removal from GeoNames, according to the Character To Remove list below.
    defaultunchecked
    nameremoveChars
    typeboolean


Code Block
boundaryFlagstext block split
languagejs
"charList": "_-‿⁀⁔︳︴﹍﹎﹏_",
"dictionary": "saga-provider:saga_geonames",
"lowercase": true,
"minimum": 3,
"normalizeAccents": true
"removeChars": false

Example Output

Code Block
languagetext
V-
Saga_graph
V--------------[abrahamthis is lincolnCOSTA likesRICA macaroni!!! and Costa cheeseVerda]--------------------V 
^-[this]-V-[abrahamis]--V--[lincolnCOSTA]--V--[likesRICA]--V--[macaroni!!!]--V--[and]-V-[Costa]-V--[cheeseVerda]--^ 
                ^-[costa]--{place}--^-[rica]-^               ^-[costa]-^--{food}----[verda]-^ 
                ^---[{food_geoname_}]---^
^----------{person}---------^               ^-----------------{food}-----------[{_geoname_}]---^ 

Output Flags

Lex-Item Flags:

  • SEMANTIC_TAG - Identifies all lexical items that are semantic tags.
  • GEONAME - Identifies a geographical location name.
  • MISSPELL - Identifies tokens with errors or misspells.

Vertex Flags:

Info

No vertices are created in this stage

Resource Data

The dictionary tagger must have an "entity dictionary" (a string to JSON map) which is a list of JSON records, indexed by entity ID. In addition, there may also be a pattern map and a token index.

Entity Dictionary Format

The only file that is absolutely required is the entity geonames dictionary. It is a series of JSON records, typically indexed by entity ID.

Each JSON record represents an entity. The format is as follows:

Saga_jsoncode
TitleEntity Json Format
languagejs
"_id" : "KGAAJGsBemSwA0nZTLXA",
"id" : 3621815,
"display" : "Q28260San Juan",
"tagpatterns" :"{city}" [
  "San Juan"
],
"displaytag" : "LinconDDfO1HABPr3bu3tFxDT4",
"patternsfields" :[ {
  "Lincoln", "Lincoln, Nebraska", "Lincoln, NE"
],
"fields": {
  "coord": [40.813639, -96.702611]
}
"confAdjust": 0.95
. . . additional fields as needed go here . . . feature class" : "P",
  "feature code" : "PPL",
  "admin3 code" : "20203",
  "timezone" : "America/Costa_Rica",
  "country code" : "CR",
  "admin1 code" : "01",
  "location" : {
    "lon" : -84.4654,
    "lat" : 10.10676
  },
  "modification date" : "2016-09-07",
  "admin2 code" : "202",
  "dem" : 1093,
  "population" : 0
},
"confAdjust" : 1.0
Note
  • Multiple entries can have the same pattern. If the pattern is matched, then it will be tagged with multiple (ambiguous) entry IDs.
  • Additional fielded data can be added to the record; as needed by downstream processes.

Fields

  • Parameter
    summaryAn ID normally refering the ID of a database, a document, an API key, not necessary unique
    nameid
    requiredtrue
  • Parameter
    summaryTag which will identify any match in the graph, as an interpretation
    nametag
    requiredtrue

    • These will all be added to the interpretation graph with the SEMANTIC_TAG flag.

      Tip

      Tags are hierarchical representations of the same intent. For example, {city} → {administrative-area} → {geographical-area}

  • Parameter
    summaryA list of patterns to match in the content
    namepatterns
    typestring array
    requiredtrue
    • Patterns will be tokenized and there may be multiple variations which can match.

      Note

      Currently, tokens are separated on simple white-space and punctuation, and then reduced to lowercase.

  • Parameter
    summaryWhat to show the user when browsing this entity
    namedisplay

  • Parameter
    summaryFree space to add extra data in any format supported by JSON
    namefields
    typejson

Include Page
Generic Resource Fields
Generic Resource Fields

GeoName Index

To improve performance especially for every large databases of entities, the entity dictionary is inverted and indexed.

This currently happens in RAM inside the GeoName GeoNames stage. An off-line option for pre-inverting the dictionary will be provided in the future.