Versions Compared

Key

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

Connects directly to the Python Bridge, to send text or sections of the interpretation graph to be process by ML algorithms in Python


Operates On:  Lexical Items with TOKEN and TEXT_BLOCK.

Saga_is_recognizer

Tip

The difference between this and the Python Model Recognizer Stage is that this stage requires a trigger flag to start processing the text.

Include Page
Generic Configuration Parameters
Generic Configuration Parameters

Configuration Parameters

  • Parameter
    summaryModel name registered in the python bridge
    namemodelName
    requiredtrue
  • Parameter
    summaryModel version registered in the python wrapper to query
    defaultlatest
    namemodelVersion
  • Parameter
    summaryModel method to call for the model
    namemodelMethod
    requiredtrue
  • Parameter
    summaryPython server communication hostname
    defaultlocalhost
    namehostname
  • Parameter
    summaryPython server communication port
    default5000
    nameport
  • Parameter
    summaryExpected content for this model are tokens
    defaultfalse
    namesendTokens
    typeboolean
  • Parameter
    summaryInclude text of tokens flagged as vertices
    defaultfalse
    nameincludeVertexText
    typeboolean


Saga_config_stage
boundaryFlagstext block split
"dependencyTags": [],
"modelName": "bert-base-nli-stsb-mean-tokens",
"modelVersion": "1",
"modelMethod": "predict",
"normalizeTags": false,
"hostname": "localhost",
"port": 5000,    

Example Output

The output of the Watcher Stage is at the metadata of the vertex flagged as the trigger, for this example it is the EOF but it could be configured to work with TEXT_BLOCK_SPLIT or any other flag.

Saga_graph
V--------------[abraham lincoln likes macaroni and cheese]--------------------V <=== EOF, at this vertex's metadata is the embedded vector
^--[abraham]--V--[lincoln]--V--[likes]--V--[macaroni]--V--[and]--V--[cheese]--^
              ^---{place}---^           ^----{food}----^         ^---{food}---^
^----------{person}---------^           ^-----------------{food}--------------^

Output Flags

Lex-Item Flags:

  • SEMANTIC_TAG - Identifies all lexical items which that are semantic tags.
  • PROCESSED - Placed on all the tokens which composed the semantic tag.
  • ALL_LOWER_CASE - All of the characters in the token are lower-case characters.
  • ALL_UPPER_CASE - All of the characters in the token are upper-case characters (for example, acronyms).
  • ALL_DIGITS - All of the characters in the token are digits (0-9)
  • TITLE_CASE - The first character is upper case, all of the other characters are lower case.
  • MIXED_CASE - Handles any mixed upper & lower case scenario not covered above.
  • TOKEN - All tokens produced are tagged as TOKEN 
  • CHAR_CHANGE -  Identifies the vertex as a change between character formats
  • HAS_DIGIT - Tokens produced with at least one digit character are tagged as HAS_DIGIT 
  • HAS_PUNCTUATION - Tokens produced with at least one punctuation character are tagged as HAS_PUNCTUATION. (ALL_PUNCTUATION will not be tagged as HAS_PUNCTUATION)
  • LEMMATIZE- All words retrieved will be marked as LEMMATIZE
  • NUMBER - Flagged on all tokens which are numbers according to the rules above.
  • ML_PREDICT- Result from a machine learning algorithm for prediction
  • ML_CLASSIFY- Result from a machine learning algorithm for classification
  • ML_REGRESS- Result from a machine learning algorithm for regression
  • TEXT_BLOCK - Flags all text blocks.
  • STOP_WORD- All matched stop words will be marked as STOP_WORD
  • WEIGHT_VECTOR - Identifies the tag as a weight vector representation of a sentence
  • BANK- Identifies a Bank account number.
  • ABA- Account number with ABA format.
  • BIC- Account number with BIC format.
  • IBAN- Account number with IBAN format.
  • ORIGINAL - Identifies that the Lex-Items produced by this stage are the original, as written, representation of every token (e.g. before normalization)
  • SSN - Identifies a Federal ID number
  • GEONAME - Identifies a geographical location name

Vertex Flags:

Info

No vertices are created in this stage

  • ALL_PUNCTUATION - Identifies the vertex as all token
    • The default flag if no "splitFlag" is present.
  • <splitFlag> - Defines an alternative flag to ALL_PUNCTUATION, if desired (see above)
  • CHAR_CHANGE -  Identifies the vertex as a change between character formats
  • TEXT_BLOCK_SPLIT - Identifies the vertex as a split between text blocks.
  • OVERFLOW_SPLIT - Identifies that an entire buffer was read without finding a split between text blocks.
    • The current maximum size of a text block is 64K characters.
    • Text blocks larger than this will be arbitrarily split, and the vertex will be marked with "OVERFLOW_SPLIT"\
  • ALL_WHITESPACE - Identifies that the characters spanned by the vertex are all whitespace characters (spaces, tabs, new-lines, carriage returns, etc.)

Resource Data

Description of resource.

Resource Format

Saga_json
TitleEntity Json Format
"_id" : "KGAAJGsBemSwA0nZTLXA",
"tag": "recipe",
"pattern": "("how many"|"how much") {ingredient} ",
"confAdjust": 0.95

. . . additional fields as needed go here . . . 
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
    summaryWhat to show the user when browsing this entity
    namedisplay
    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
    summaryPattern to match in the content
    namepattern
    requiredtrue

Include PageGeneric Resource Fields

Generic Resource Fields

  • WEIGHT_VECTOR - Identifies the text block related to this vertex as a weight vector representation