Versions Compared

Key

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

This stage works in a similar way to the Dictionary Tagger stage in the sense that looks up sequences of tokens in a dictionary to match the text being processed. The difference is that it will also include in the matching text N tokens to the right and/or left of the original matched text. 


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
    summaryWhen true, the recognizer will create internal tags to tag the left part, the matched text and the right part
    defaultfalse
    namegroupTokens
    typeboolean
  • Parameter
    summaryInternal Tag name for the tokens at the left of the matched text
    default_leftTokens_
    nameleftGroupTagName
  • Parameter
    summaryInternal Tag name for the matched text portion
    default_matchedTokens_
    namematchGroupTagName
  • Parameter
    summaryInternal Tag name for the tokens at the right of the matched text
    default_rightTokens_
    namerightGroupTagName


Saga_config_stagecode
boundaryFlagstext block split
stageTokenMatcherRecognizer
languagejs
"dictionary": "dict-provider:token_matcher_patterns",
"groupTokens": false,
"leftGroupTagName": "_leftTokens_",
"matchGroupTagName": "_matchedTokens_",
"rightGroupTagName": "_rightTokens_"
ample

Example Output

saga_graph
Code Block
languagetext
 V-----------------[call 333-4444 for pizza]------------------V 
 ^------[call]------V-----[333-4444]------V-[for]-V--[pizza]--^ 
 ^-[{_leftTokens_}]-^---[{phonenumber}]---^-[{_rightTokens_}]-^ 
                    ^-[{_matchedTokens_}]-^                     
 ^----------------------[{pizza_phone}]-----------------------^ 

Output Flags

Lex-Item Flags:

  • SEMANTIC_TAG - Identifies all lexical items which are semantic tags.
  • TOKEN_MATCHER - Identifies a semantic tag that covers both the matched text and the tokens to the right and/or left
  • TOKEN_MATCHER_GROUP - Identifies the semantic tags used to cover the tokens grouped when using the "groupTokens" configuration

Vertex Flags:

Info

No vertices are created in this stage

Resource Data

Token matcher must have a dictionary of patterns which is a list of JSON records.

Resource Format

Saga_jsoncode
TitleEntity Json Format
languagejs
"_id" : "Nlp3kXYBOOvNPbzJXDcQ",
"tag": "qVRZi3YBvyJs83wnkfik",
"pattern": "{phonenumber}",
"confAdjust": 0.95,
"options" : {
	"maxTokensLeft": 1, 
	"maxTokensRight": 1
} 
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
    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
    summaryPattern to match in the content
    namepattern
    requiredtrue

  • Options
    • Parameter
      summaryNumber of tokens to take to the left of the matched text
      default0
      namemaxTokensLeft
      typeinteger
    • Parameter
      summary Number of tokens to take a the right of the matched text
      default3
      namemaxTokensRight
      typeinteger

Include Page
Generic Resource Fields
Generic Resource Fields