Excerpt |
---|
Connects directly to the Python Bridge, to send text or sections of the interpretation graph to be process processed by ML algorithms in Python |
Operates On: Lexical Items with TOKEN and TEXT_BLOCK, EOF, others.
The Python Classification Watcher Stage is an implementation of the abstract class called Watcher Stage, this Stage is used to classify large blocks of texts as for example: complete paragraphs or whole documents. The Watcher saves the classification paths for every text block and then verifies the vertices to look for triggers which mark the end of the saving cycle and start to process the saved data, then returns a weight vector that would be the classification of the 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 | ||||
---|---|---|---|---|
|
Parameter | ||||||
---|---|---|---|---|---|---|
|
Parameter | ||||||
---|---|---|---|---|---|---|
|
Parameter | ||||||
---|---|---|---|---|---|---|
|
Parameter | ||||||
---|---|---|---|---|---|---|
|
Parameter | ||||||
---|---|---|---|---|---|---|
|
Parameter | ||||||||
---|---|---|---|---|---|---|---|---|
|
Parameter | ||||||||
---|---|---|---|---|---|---|---|---|
|
Parameter | ||||||||
---|---|---|---|---|---|---|---|---|
|
Parameter | ||||||||
---|---|---|---|---|---|---|---|---|
|
Code Block | ||
---|---|---|
Saga_config_stage | ||
| ||
"dependencyTags": [],
"modelName": "bert-base-nli-stsb-mean-tokens",
"modelVersion": "1",
"modelMethod": "predict",
"normalizeTags": false,
"hostname": "localhost",
"port": 5000,
"sendTextBlockList": true,
"sendTokens": true,
"sendOriginalText": true, |
The settings "sendTextBlockList", "sendTokens" and "sendOriginalText" are independent to each other. This means that if the original input is:
"This is a good test
This is a bad test"
And we have a normalization tag called "sentiment" that matches "good" and "bad", the payloads will look as follows:
sendTextBlockList | sendTokens | sendOriginalText | Request Payload | ||
---|---|---|---|---|---|
True | True | True |
| ||
True | True | False |
| ||
True | False | True |
| ||
True | False | False |
| ||
False | True | True |
| ||
False | True | False |
| ||
False |
False | True |
| |||
False | False | False |
|
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.
Code Blocksaga_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}--------------^ |
Info |
---|
No vertices are created in this stage |
Description of resource.
Saga_json | ||
---|---|---|
| ||
"_id" : "KGAAJGsBemSwA0nZTLXA",
"tag": "recipe",
"pattern": "("how many"|"how much") {ingredient} ",
"confAdjust": 0.95
. . . additional fields as needed go here . . . |
Note |
---|
|
Parameter | ||||||
---|---|---|---|---|---|---|
|
Parameter | ||||||
---|---|---|---|---|---|---|
|
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 | ||||||
---|---|---|---|---|---|---|
|