# Google Cloud Contact Center Insights V1 Client - Class TranscriptSegment (2.4.2)

2.4.2 (latest) 2.4.1 2.3.3 2.2.1 2.1.1 2.0.1 1.9.5 1.8.0 1.7.1 1.6.2 1.5.0 1.4.1 1.3.0 1.2.1 1.1.0 1.0.3 Reference documentation and code samples for the Google Cloud Contact Center Insights V1 Client class TranscriptSegment.

A segment of a full transcript.

Generated from protobuf message `google.cloud.contactcenterinsights.v1.Conversation.Transcript.TranscriptSegment`

## Namespace

Google \\ Cloud \\ ContactCenterInsights \\ V1 \\ Conversation \\ Transcript

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ message_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` The time that the message occurred, if provided. |
| `↳ text` | `string` The text of this segment. |
| `↳ confidence` | `float` A confidence estimate between 0.0 and 1.0 of the fidelity of this segment. A default value of 0.0 indicates that the value is unset. |
| `↳ words` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.Conversation.Transcript.TranscriptSegment.WordInfo>` A list of the word-specific information for each word in the segment. |
| `↳ language_code` | `string` The language code of this segment as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US". |
| `↳ channel_tag` | `int` For conversations derived from multi-channel audio, this is the channel number corresponding to the audio from that channel. For audioChannelCount = N, its output values can range from '1' to 'N'. A channel tag of 0 indicates that the audio is mono. |
| `↳ segment_participant` | `https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.ConversationParticipant` The participant of this segment. |
| `↳ dialogflow_segment_metadata` | `https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.Conversation.Transcript.TranscriptSegment.DialogflowSegmentMetadata` CCAI metadata relating to the current transcript segment. |
| `↳ sentiment` | `https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.SentimentData` The sentiment for this transcript segment. |

### getMessageTime

The time that the message occurred, if provided.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasMessageTime

### clearMessageTime

### setMessageTime

The time that the message occurred, if provided.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getText

The text of this segment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setText

The text of this segment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConfidence

A confidence estimate between 0.0 and 1.0 of the fidelity of this
segment. A default value of 0.0 indicates that the value is unset.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setConfidence

A confidence estimate between 0.0 and 1.0 of the fidelity of this
segment. A default value of 0.0 indicates that the value is unset.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getWords

A list of the word-specific information for each word in the segment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.Conversation.Transcript.TranscriptSegment.WordInfo>` |   |

### setWords

A list of the word-specific information for each word in the segment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.Conversation.Transcript.TranscriptSegment.WordInfo>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLanguageCode

The language code of this segment as a
[BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.

Example: "en-US".

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setLanguageCode

The language code of this segment as a
[BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.

Example: "en-US".

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getChannelTag

For conversations derived from multi-channel audio, this is the channel
number corresponding to the audio from that channel. For
audioChannelCount = N, its output values can range from '1' to 'N'. A
channel tag of 0 indicates that the audio is mono.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setChannelTag

For conversations derived from multi-channel audio, this is the channel
number corresponding to the audio from that channel. For
audioChannelCount = N, its output values can range from '1' to 'N'. A
channel tag of 0 indicates that the audio is mono.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSegmentParticipant

The participant of this segment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.ConversationParticipant|null` |   |

### hasSegmentParticipant

### clearSegmentParticipant

### setSegmentParticipant

The participant of this segment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.ConversationParticipant` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDialogflowSegmentMetadata

CCAI metadata relating to the current transcript segment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.Conversation.Transcript.TranscriptSegment.DialogflowSegmentMetadata|null` |   |

### hasDialogflowSegmentMetadata

### clearDialogflowSegmentMetadata

### setDialogflowSegmentMetadata

CCAI metadata relating to the current transcript segment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.Conversation.Transcript.TranscriptSegment.DialogflowSegmentMetadata` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSentiment

The sentiment for this transcript segment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.SentimentData|null` |   |

### hasSentiment

### clearSentiment

### setSentiment

The sentiment for this transcript segment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-contact-center-insights/latest/V1.SentimentData` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |