Skip to content

named_entity_recognition message

The entities of a final, right after it (receive_realtime_processing_events).

Delivery

On the WebSocket with messages_config.receive_realtime_processing_events; to your callback as live.named_entity_recognition with callback_config.receive_realtime_processing_events.

Fields

  • session_id string required

    Identifier of the session.

  • created_at string required

    When the message was sent (ISO 8601, UTC).

  • type "named_entity_recognition" required
  • error object

    default: null

    1 fields
    • message string required
  • data object required
    3 fields
    • utterance_id string required
    • utterance object required

      A piece of speech between two pauses, on one channel.

      14 fields
      • text string required

        The transcript. With PII redaction on, it carries its inline elements (<pii:email id="1"/>); named entities are written inline (<ner:name id="1">…</ner:name>) only with inline_tags: true.

      • start number required

        Start, in seconds from the start of the audio.

      • end number required

        End, in seconds from the start of the audio.

      • language string required

        Language spoken (ISO 639-1).

      • confidence number required

        Confidence, from 0 to 1.

      • channel integer required

        Audio channel the utterance was heard on, from 0.

      • speaker integer

        Speaker number, with diarization.

        default: null

      • committed_text string

        On a partial, with messages_config.receive_committed_text: its first words, those the model will no longer change. It trails text by about one decoding step.

        default: null

      • words array of object required

        The words with their timestamps.

        5 fields
        • word string required

          The word, with its leading space when it follows another.

        • start number required

          Start of the word, in seconds from the start of the audio.

        • end number required

          End of the word, in seconds from the start of the audio.

        • confidence number required

          Confidence, from 0 to 1.

        • speaker integer

          Speaker of the word, with diarization.

          default: null

      • text_raw string

        The transcript without inline elements (with named entity recognition; never with PII redaction).

        default: null

      • entities array of object

        The entities of the utterance, with named entity recognition or PII redaction.

        default: null

        7 fields
        • label string

          Entity type, for example name, phone_number, location_city.

          default: null

        • id integer

          The entity's number in the session, per type: the same person is always the same number.

          default: null

        • action string

          ner: tagged; otherwise how the personal data was redacted.

          default: null

        • score number

          Confidence, from 0 to 1.

          default: null

        • text string

          The entity as heard (never sent for masked personal data unless pii.return_entities).

          default: null

        • start integer

          Offset of the entity's element in text, in characters.

          default: null

        • end integer

          End offset of the entity's element in text, in characters.

          default: null

      • language_supported false

        false when the language heard is one the model does not transcribe (with the language detected): the text is then unreliable. Absent otherwise.

        default: null

      • forced "max_duration"

        Set when the utterance was closed by maximum_duration_without_endpointing rather than by a pause.

        default: null

      • speculation object

        With end_of_turn.speculation, on the final that closes a turn: the verdict of the speculative LLM turn (the speculation message holds the same).

        default: null

        7 fields
        • eager_text string

          The text of end_of_turn.data.text, the one compared. Absent on a session that masks PII (pii in a mode other than tag): the partial it went out on is not masked.

          default: null

        • eager_end number

          Seconds of audio when the turn ended.

          default: null

        • similarity number

          How close the final is to eager_text, from 0 (nothing in common) to 1 (the same). The score recommendation is decided on.

          default: null

        • lexical_similarity number

          The same, on the words alone.

          default: null

        • recommendation string required

          keep: the LLM call started on end_of_turn still answers what was said; discard: cancel it and answer the final.

          one of: keep, discard

        • reason string

          Why: same_text and similar keep; text_changed, caller_went_on and new_entity discard (caller_went_on: the speaker kept talking after the end of turn, so the turn was not over; new_entity: the final names an entity the eager text lacked, see new_entities). The engine may add values, read it as a label.

          default: null

        • new_entities array of object

          With named_entity_recognition or pii on: the entities of the final whose words are not in eager_text; [] when there is none; null when not checked (neither add-on on, or entities: false).

          default: null

          3 fields
          • entity_type string required
          • score number required
          • text string

            The entity's words. Absent on a session that masks PII.

            default: null

    • results array of object required
      11 fields
      • entity_type string required

        The entity's type, for example name.

      • text string required

        The entity as heard.

      • start number required

        Start, in seconds.

      • end number required

        End, in seconds.

      • id integer

        The entity's number in the session: the same person is always the same number.

        default: null

      • score number

        Confidence, from 0 to 1.

        default: null

      • char_start integer

        Offset of the entity's element in the final's text.

        default: null

      • char_end integer

        End offset of the entity's element in the final's text.

        default: null

      • probability number

        With alternative_names, on a name: how likely the name as heard is right.

        default: null

      • census object

        With alternative_names.census: the heard name's census row, absent for a full name or a name the census does not know.

        default: null

        4 fields
        • frequency integer required

          How many people carry the name in the census.

        • share number required

          Its frequency over every name of the census, 0 to 1.

        • rank integer

          Its rank by frequency in the census, 1 the most common.

          default: null

        • gender string

          First names only: m, f or u (unisex).

          default: null · one of: m, f, u

      • alternatives array of object

        With alternative_names, on a name: the names that sound like it, the most probable first. Absent when the utterance's language has no census.

        default: null

        4 fields
        • name string required

          A name that sounds like the one heard, as the census spells it.

        • probability number required

          How likely this is the right name, 0 to 1: its similarity weighed by how common it is. The heard name and its alternatives sum to 1.

        • similarity number required

          How close it sounds to the heard name, 0 to 1.

        • census object

          With census on.

          default: null

          4 fields
          • frequency integer required

            How many people carry the name in the census.

          • share number required

            Its frequency over every name of the census, 0 to 1.

          • rank integer

            Its rank by frequency in the census, 1 the most common.

            default: null

          • gender string

            First names only: m, f or u (unisex).

            default: null · one of: m, f, u

Example

{
"session_id": "string",
"created_at": "string",
"type": "named_entity_recognition",
"error": {
"message": "string"
},
"data": {
"utterance_id": "string",
"utterance": {
"text": "Hello, how can I help you?",
"start": 0.5,
"end": 0.5,
"language": "en",
"confidence": 0.5,
"channel": 0,
"speaker": 0,
"committed_text": "I would like to book",
"words": [
{
"word": " hello",
"start": 0.5,
"end": 0.5,
"confidence": 0.5,
"speaker": 0
}
],
"text_raw": "string",
"entities": [
{
"label": "string",
"id": 0,
"action": "string",
"score": 0.5,
"text": "string",
"start": 0,
"end": 0
}
],
"language_supported": false,
"forced": "max_duration",
"speculation": {
"eager_text": "string",
"eager_end": 0.5,
"similarity": 0.5,
"lexical_similarity": 0.5,
"recommendation": "keep",
"reason": "string",
"new_entities": [
{
"entity_type": "string",
"score": 0.5,
"text": "string"
}
]
}
},
"results": [
{
"entity_type": "string",
"text": "string",
"start": 0.5,
"end": 0.5,
"id": 0,
"score": 0.5,
"char_start": 0,
"char_end": 0,
"probability": 0.5,
"census": {
"frequency": 0,
"share": 0.5,
"rank": 0,
"gender": "m"
},
"alternatives": [
{
"name": "string",
"probability": 0.5,
"similarity": 0.5,
"census": {}
}
]
}
]
}
}