...
...
...
Operates On: Lexical Items with TOKEN and possibly other flags as specified below.
Configuration
...
Include Page |
---|
| Generic Configuration Parameters |
---|
| Generic Configuration Parameters |
---|
|
Configuration Parameters
Parameter |
---|
summary | The dictionary resource that holds the names and that is to be located in the text |
---|
|
...
| name | dictionary |
---|
required | true |
---|
|
- This is specified as "provider:name" in the standard resource format
...
- A JSON array of strings, such as ["TOKEN", "ALL_LOWER_CASE"]
...
language | js |
---|
title | Example Configuration |
---|
...
Parameter |
---|
summary | Ignore matches with tags specified in the ignoreTags list |
---|
name | ignoreTags |
---|
type | string array |
---|
|
Parameter |
---|
summary | Name of the tag which indicates what entities should be process |
---|
name | entity |
---|
|
Parameter |
---|
summary | Removes accents and diacritics and generates a new pattern |
---|
default | false |
---|
name | normalizeAccents |
---|
|
Parameter |
---|
summary | Indicates if characters should be removed from the pattern using a list creating a new pattern |
---|
default | false |
---|
name | removeChars |
---|
type | boolean |
---|
|
Parameter |
---|
summary | List of characters to remove from the pattern |
---|
default | _-‿⁀⁔︳︴﹍﹎﹏_ |
---|
name | charsList |
---|
|
Info |
---|
In version 1.2.2 this parameter was added: Parameter |
---|
summary | Threshold use to filter when doing vector similarity |
---|
default | 0.7 |
---|
name | cosineSimThreshold |
---|
type | double |
---|
|
|
Saga_config_stage |
---|
boundaryFlags | text block split |
---|
stage | DictionaryTagger |
---|
requiredFlags | token, semantic tag |
---|
skipFlags | skip |
---|
|
"dictionary": "dict-provider:people-lowercase",
|
...
...
...
...
currency"],
"normalizeAccents": false,
"removeChars": false,
"charsList": "_-‿⁀⁔︳︴﹍﹎﹏_" |
"people-lowercase" resource must be in the format |
...
Example Output
In the following example, "abraham lincoln" is in the dictionary as a person, "lincoln" as a place, and "macaroni", "cheese" and "macaroni and cheese" are all specified as foods:
Saga_graph |
---|
V--------------[abraham lincoln likes macaroni and cheese]--------------------V |
...
^--[abraham]--V--[lincoln]--V--[likes]--V--[macaroni]--V--[and]--V--[cheese]--^ |
...
...
...
...
...
...
...
...
...
...
...
...
Output Flags
Lex-Item Flags
...
- SEMANTIC_TAG - Identifies all lexical items
...
- that are semantic tags.
- ENTITY - Identifies the token as an entity.
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.
The only file
...
that is absolutely required is the entity dictionary. It is a series of JSON records, typically indexed by entity ID.
Each JSON record represents an entity. The format is as follows:
...
...
...
...
"_id" : "KGAAJGsBemSwA0nZTLXA",
"id":"Q28260",
|
...
...
...
...
"display": "Lincon"
"patterns":[
|
...
"Lincoln", "Lincoln, Nebraska", "Lincoln, NE"
|
...
...
coord": [40.813639, -96.702611]
}
"confAdjust": 0.95 |
...
...
. . . additional fields as needed go here . . . |
...
...
...
- 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
...
- Typically this is an identifier with meaning to the larger application which is using the Language Processing Toolkit.
Parameter |
---|
summary | An ID normally refering the ID of a database, a document, an API key, not necessary unique |
---|
name | id |
---|
required | true |
---|
|
Parameter |
---|
summary | Tag which will identify any match in the graph, as an interpretation |
---|
name | tag |
---|
required | true |
---|
|
...
...
...
Tip |
---|
Tags are hierarchical representations of the same intent. For example, {city} → {administrative-area} → {geographical-area} |
Parameter |
---|
summary | A list of patterns to match in the content |
---|
|
...
| name | patterns |
---|
type | string array |
---|
required | true |
---|
|
...
Other, Optional Fields
...
Currently, tokens are separated on simple white-space and punctuation, and then reduced to lowercase. |
...
- This is the confidence of the entity, in comparison to all of the other entities. Essentially, the likelihood that this entity will be randomly encountered.
What to show the user when browsing this entity |
|
...
Parameter |
---|
summary | Free space to add extra data in any format supported by JSON |
---|
name | fields |
---|
type | json |
---|
|
Include Page |
---|
| Generic Resource Fields |
---|
| Generic Resource Fields |
---|
|
...
Dictionary 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 DictionaryTagger stage. An off-line option for pre-inverting the dictionary will be provided in the future.