Working with Chat Interactions
SpeechMiner supports numerous metadata for chat interactions.
This page describes the required system specifications for the successful implementation of chat interactions.
Supported Formats for SpeechMiner 8.5 and Above
- Text File
- Chat XML file (.chtx)
Chat File Format Specifications
Text File
A chat interaction in a text file format only requires a subject and the conversation. The file does not require information about the participants.
The first line in the text file should be the subject. The second line in the text files should be empty. The remaining lines should contain the chat conversation.
For example:
Billing Issue
How can I help you today?
I want to change my billing address.
May I have your account number please?
...
It's been my pleasure to assist you today
Chat XML File (.chtx)
When using an XML file (.chtx format), the chat interactions should be configured as follows:<textFormat>XML</textFormat>
Additional information can be added as meta data in the interaction XML file.
A chat conversation in .chtx format can contain one subject, multiple conversation messages and a description of the parties in the conversation. The subject and each message is not limited to one line (they can contain multiple lines).
Each message element can contain the following:
- Time stamp - the time format is ISO_8601. For example: '2013-12-04T18:26:46'
- Display name - the display name of the message sender.
- Party ID - the string identifier of the sender/party id. The party ID can be described in two places, in both cases the ID will be used to match the party/speaker type. If the party ID cannot be found in one of these places it will be ignored and identified as a different party in the call.
- In the 'speakers' element in the meta data xml file
- In the 'parties' element in the chtx file (see below)
Messages without a party ID or messages with a party ID that were not found, will be treated as one party. This configuration is similar to the channels speakers configuration in dual channel calls
Each party element can contain the following:
- Party ID - used to match the id from each 'message' element
- Party type - used to identify the type of the party/speaker when you configure categories with speakers or limit the search in the web to specific speakers.
If one of these attributes are missing this party configuration will be ignored.
The order of the messages in the file must be in the original order. Since it's not mandatory, the system does not sort the messages according to the time stamp value.
If the sender name is not specified in the message, the system will not use the speaker name from the speakers configuration (the UI will not show any name).File Format Examples
Example 1:
<?xml version="1.0" encoding="us-ascii"?>
<chat>
<parties>
<party partyId="FIRST SPEAKER ID" partyType="FIRST SPEAKER TYPE" />
<party partyId="SECOND SPEAKER ID" partyType="SECOND SPEAKER TYPE" />
...
</parties>
<subject>SUBJECT LINE</subject>
<message time="FIRST MESSAGE DATE AND TIME" partyId="FIRST MESSAGE
SPEAKER ID" displayName="FIRST MESSAGE SENDER NAME">
FIRST MESSAGE CONTENT
</message>
<message time="SECOND MESSAGE DATE AND TIME" partyId="SECOND MESSAGE
SPEAKER ID" displayName="SECOND MESSAGE SENDER NAME">
SECOND MESSAGE CONTENT
</message>
...
</chat>
Example 2:
<?xml version="1.0" encoding="us-ascii"?>
<chat>
<parties>
<party partyId="customer" partyType="customer" />
</parties>
<subject>Billing issue</subject>
<message time="2013-04-18T12:10:42" partyId="agent"
displayName="Agent 1"> How can I help you today?
</message>
<message time="2013-04-18T12:10:51" partyId="customer"
displayName="Customer 1"> I want to change my billing address
</message>
<message time="2013-04-18T12:10:58" partyId="agent"
displayName="Agent 1"> May I have your account number please?
</message>
...
<message time="2013-04-18T12:15:23" partyId="agent"
displayName="Agent 1"> It's been my pleasure to assist you today
</message>
</chat>
PartyID Configuration
PartyID can be configured in two places:
- In the chat meta xml file, in the speakers element. The speakers element in the meta xml file is used for mapping the interaction to an agent and work group. Since speakerType is defined in the meta xml file, the file is used as part of the parties configuration.
- In the parties element in the chtx file. The parties element contains parties that are not linked to the interaction as agents or work group (for example, a customer).
The chtx fetcher will search for each PartyID used in the message in the speakers configuration. If the PartyID does not exist in the speakers element, the chtx fetcher will check the parties element. If the PartyID is not defined in both places the PartyID will be ignored.
Example 1: 2 Parties (Agent + Customer)
In this example, the agent is defined as the speaker and the customer is defined in the parties element.
Meta XML File:
<?xml version="1.0" encoding="us-ascii" ?>
<callInformation>
<mediaType>Chat</mediaType>
<textFormat>XML</textFormat>
<textTime>2014-01-07T10:54:04</textTime>
<programID>english</programID>
<speakers>
<speaker id="ag1" speakerType="agent">
<workgroup>/W1/W2</workgroup>
</speaker>
</speakers>
</callInformation>
CHTX File:
<?xml version="1.0" encoding="us-ascii"?>
<chat>
<parties>
<party partyId="customer1" partyType="customer" />
</parties>
<subject>Billing issue</subject>
<message time="2013-04-18T12:10:42" partyId="ag1"
displayName="Agent 1"> How can I help you today?
</message>
<message time="2013-04-18T12:10:51" partyId="customer1"
displayName="Customer 1"> I want to change my billing address
</message>
<message time="2013-04-18T12:10:58" partyId="ag1"
displayName="Agent 1"> May I have your account number please?
</message>
</chat>
As shown in the above example the agent with ag1 ID is configured in the speakers element, in the meta xml file and the customer with the customer1 ID is configured under parties in the chtx file.
Example 2: 3 parties - agent, supervisor and customer
In this scenario there are two options. You can configure the supervisor as a speaker (the common scenario) or as the party in the chat. When configured as the party a link to an agent or work group is not possible.
Option 1: Supervisor as a speaker - Meta XML File
<?xml version="1.0" encoding="us-ascii" ?>
<callInformation>
<mediaType>Chat</mediaType>
<textFormat>XML</textFormat>
<textTime>2014-01-07T10:54:04</textTime>
<programID>english</programID>
<speakers>
<speaker id="ag1" speakerType="agent">
<workgroup>/W1/W2</workgroup>
</speaker>
<speaker id="sup1" speakerType="supervisor">
<workgroup>/W1/Sup1</workgroup>
</speaker>
</speakers>
</callInformation>
Option 1: Supervisor as a speaker - CHTX File
<?xml version="1.0" encoding="us-ascii"?>
<chat>
<parties>
<party partyId="customer1" partyType="customer" />
</parties>
<subject>Billing issue</subject>
<message time="2013-04-18T12:10:42" partyId="ag1"
displayName="Agent 1"> How can I help you today?
</message>
<message time="2013-04-18T12:10:51" partyId="customer1"
displayName="Customer 1"> I want to change my billing address
</message>
<message time="2013-04-18T12:10:58" partyId="ag1"
displayName="Agent 1"> May I have your account number please?
</message>
<message time="2013-04-18T12:11:02" partyId="customer1"
displayName="Customer 1"> I want to talk to supervisor!
</message>
<message time="2013-04-18T12:11:03" partyId="sup1"
displayName="Supervisor A"> I'm the supervisor, how can I help you?
</message>
</chat>
Option 2: Supervisor is not a speaker - Meta XML File
<?xml version="1.0" encoding="us-ascii" ?>
<callInformation>
<mediaType>Chat</mediaType>
<textFormat>XML</textFormat>
<textTime>2014-01-07T10:54:04</textTime>
<programID>english</programID>
<speakers>
<speaker id="ag1" speakerType="agent">
<workgroup>/W1/W2</workgroup>
</speaker>
</speakers>
</callInformation>
Option 2: Supervisor is not a speaker - CHTX File
<?xml version="1.0" encoding="us-ascii"?>
<chat>
<parties>
<party partyId="customer1" partyType="customer" />
<party partyId="sup1" partyType="supervisor" />
</parties>
<subject>Billing issue</subject>
<message time="2013-04-18T12:10:42" partyId="ag1"
displayName="Agent 1"> How can I help you today?
</message>
<message time="2013-04-18T12:10:51" partyId="customer1"
displayName="Customer 1"> I want to change my billing address
</message>
<message time="2013-04-18T12:10:58" partyId="ag1"
displayName="Agent 1"> May I have your account number please?
</message>
<message time="2013-04-18T12:11:02" partyId="customer1"
displayName="Customer 1"> I want to talk to supervisor!
</message>
<message time="2013-04-18T12:11:03" partyId="sup1"
displayName="Supervisor A"> I'm the supervisor, how can I help you?
</message>
</chat>