Skip to content

Sophia NLU Engine - JSON Objects

Explore the precise structure of objects returned by the Sophia NLU engine, available as Rust structs from the shared library or JSON objects from the RPC daemon.

tokenize(input)

The tokenize(input) function breaks down input into tokens and multi-word entities, returning the following JSON object:

  • processing_time_ms - Time taken to process the input (in milliseconds)
  • total_tokens - Total number of tokens identified
  • tokens - Vector of individual word tokens (details below)
  • mwe - Vector of multi-word entity tokens

Individual Token

Category

interpret(input)

The interpret(input) function analyzes input for deeper understanding, returning this JSON object:

  • processing_time_ms - Processing duration (in milliseconds)
  • total_tokens - Total token count
  • tokens - Vector of individual word tokens (same as above)
  • mwe - Vector of multi-word entity tokens
  • phrases - Vector of chunked phrases (details below)
  • scores - Hashmap of classification scores (e.g., sentiment, politeness, humor, seriousness)
  • audit - Debug/audit text block

Phrase

Noun

Noun Modifier

Noun Sibling

Verb

Verb Modifier

Verb Sibling

Adjective