ThinkThen

Pick one, per word

recognize: find every name in the evidence and say what kind it is.

names.json, a file the examples read
{
  "version": 1,
  "recognize": {
    "kinds": {
      "person": null,
      "organization": null,
      "place": null
    },
    "relations": [
      {
        "name": "works_for",
        "source": "person",
        "target": "organization"
      },
      {
        "name": "based_in",
        "source": "organization",
        "target": "place"
      }
    ]
  }
}
recognize finds three names. Each comes back with its kind and its strength.
person="PER=Part of a person's name."
org="ORG=Part of the name of an organization:"
org+=" a company, band, team, agency, government"
org+=" body, or media outlet."
place="LOC=Part of the name of a place: a country,"
place+=" region, city, or geographic feature."
other="MISC=Part of another named entity: a"
other+=" nationality, an event, a product, or the"
other+=" name of a creative work."
text="Maria Chen joined Northwind Freight in Chicago"
text+=" last spring."
printf '%s' "$text" |
thinkthen recognize \
  --kind "$person" \
  --kind "$org" \
  --kind "$place" \
  --kind "$other" |
jq -c '.entities[] | [.text, .kind, .strength]'
Output
["Maria Chen","PER",0.9987]
["Northwind Freight","ORG",0.997]
["Chicago","LOC",1.0]
exit 0

You give it the evidence and the kinds of name you allow. You get back each name, its kind, where it sits, and a strength.

Read the answer

With kinds, the model picks each name's kind from them. A name that is not in the evidence cannot come back. The number on a name is its strength. ThinkThen computes it, and it is not a probability. Your threshold decides which names you keep.

Exit codeWhat it means
0the run finished
2usage or input error
4the backend failed or refused, as it does for evidence over the size limit
5a local failure
70a defect in the tool

Call it from your language

The Bash example opens this page.

Watch recognize answer questions about Beatles songs: recognize labels things it finds.