relate
relate asks a bounded question about text and returns an answered, not-sure or failed result.
thinkthen relate \ --rule person organization works_for message.txtOutput
Morgan --works_for--> Example Group
Morgan works for Example Group.Please refund my order.message=$'Morgan works for Example Group.\nPlease refund my order.'
thinkthen relate \ --text "$message" --rule person organization works_for --json | jq -r ' if .status == "failed" then "failed: \(.error.code): \(.error.message)" else .answer[] | "\(.source.text) \(.relation) \(.target.text)" end'A rule is the kind it starts from, then the kind it points to, then the relation name. Each relation has source, target, relation, probability and either. The result's detail.names holds every name found, including names in no relation. Without --json, relate prints the relations on one line, as Morgan --works_for--> Example Group, with tabs between them.
Options
Section titled “Options”Options
| Option | What it does |
|---|---|
[FILE]... | Input files; default: standard input |
--name <NAME> | |
--text <TEXT> | |
--threshold <THRESHOLD> | |
--rule <SOURCE> <TARGET> <RELATION> | |
--either [=<EITHER>] | |
--column <COLUMN> | Field column; repeat; replaces a saved pointer |
--details [=<DETAILS>] | Add status, probability, error, detail and source columns |
--in-place [=<IN-PLACE>] | Replace source with backup |
--into <INTO> | Answer field for JSON Lines; column for tables |
--output <OUTPUT> | Destination path |
--sheet <SHEET> | Worksheet |