Skip to main content

Uniphore Customer Portal

5. Sentiment Schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "NLP Output",
  "description": "Real Time NLP Output",
  "type": "object",
  "definitions": {
    "turn": {
      "type": "object",
      "properties": {
        "order": {
          "type": "integer"
        },
        "speaker": {
          "type": "string"
        },
        "entities": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "nerLabel": {
                "type": "string"
              },
              "uri": {
                "type": "string"
              },
              "confidence": {
                "type": "number"
              },
              "startChar": {
                "type": "integer"
              },
              "endChar": {
                "type": "integer"
              },
              "startOffset": {
                "type": "integer"
              },
              "endOffset": {
                "type": "integer"
              }
            },
            "required": [
              "text",
              "nerLabel",
              "confidence",
              "startChar",
              "endChar"
            ]
          }
        },
        "sentiment": {
          "type": "object",
          "properties": {
            "value": {
              "type": "string"
            },
            "confidence": {
              "type": "number"
            }
          },
          "required": [
            "value",
            "confidence"
          ]
        }
      },
      "required": [
        "order",
        "speaker"
      ]
    },
    "overall": {
      "type": "object",
      "properties": {
        "sentiment": {
          "type": "object",
          "properties": {
            "contactSentiment": {
              "type": "string"
            },
            "customerSentiment": {
              "type": "string"
            },
            "agentSentiment": {
              "type": "string"
            }
          },
          "required": [
            "contactSentiment",
            "customerSentiment",
            "agentSentiment"
          ]
        }
      }
    },
    "metaData": {
      "description": "contact level meta data.",
      "type": "object",
      "properties": {
        "agentId": {
          "description": "Agent identifier of a transcript.",
          "type": "string"
        },
        "customerId": {
          "description": "customer identifier of a transcript.",
          "type": "string"
        },
        "contactId": {
          "description": "Contact identifier of a transcript assinged by platform.",
          "type": "string"
        },
        "clientContactId": {
          "description": "Client contact identifier of a transcript.",
          "type": "string"
        },
        "journeyId": {
          "description": "Journey identifier of a transcript.",
          "type": "string"
        },
        "contactType": {
          "description": "Contact type of a transcript (voice, chat, email).",
          "type": "string"
        },
        "contactDuration": {
          "description": "Contact duration of a transcript",
          "type": "integer"
        },
        "audioType": {
          "description": "Audio type of voice contact (stereo, mono).",
          "type": "string"
        },
        "isDiarized": {
          "description": "True if the audio is diarized, false otherwise",
          "type": "boolean"
        },
        "tenantId": {
          "description": "Tenant identifier of a transcript.",
          "type": "string"
        },
        "organizationId": {
          "description": "organization identifier of a transcript.",
          "type": "string"
        },
        "categoryId": {
          "description": "Category (Business Process) identifier of a transcript.",
          "type": "string"
        },
        "type": {
          "description": "Type of a transcript (live or batch).",
          "type": "string"
        }
      },
      "required": [
        "agentId",
        "customerId",
        "clientContactId",
        "contactType",
        "contactDuration",
        "tenantId",
        "organizationId",
        "categoryId",
        "type"
      ]
    }
  },
  "properties": {
    "sessionId": {
      "type": "string"
    },
    "startTime": {
      "type": "integer"
    },
    "isChunk": {
      "type": "boolean"
    },
    "turns": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/turn"
      }
    },
    "overall": {
      "$ref": "#/definitions/overall"
    }
  },
  "required": [
    "sessionId",
    "startTime",
    "turns",
    "overall"
  ]
}