# Cloud AutoML V1 Client - Class TextExtractionAnnotation (2.1.3)

2.1.3 (latest) 2.1.2 2.0.5 1.6.5 1.5.4 1.4.17 Reference documentation and code samples for the Cloud AutoML V1 Client class TextExtractionAnnotation.

Annotation for identifying spans of text.

Generated from protobuf message `google.cloud.automl.v1.TextExtractionAnnotation`

## Namespace

Google \\ Cloud \\ AutoMl \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text_segment` | `https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.TextSegment` An entity annotation will set this, which is the part of the original text to which the annotation pertains. |
| `↳ score` | `float` Output only. A confidence estimate between 0.0 and 1.0. A higher value means greater confidence in correctness of the annotation. |

### getTextSegment

An entity annotation will set this, which is the part of the original
text to which the annotation pertains.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.TextSegment|null` |   |

### hasTextSegment

### setTextSegment

An entity annotation will set this, which is the part of the original
text to which the annotation pertains.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.TextSegment` |

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

### getScore

Output only. A confidence estimate between 0.0 and 1.0. A higher value
means greater confidence in correctness of the annotation.

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

### setScore

Output only. A confidence estimate between 0.0 and 1.0. A higher value
means greater confidence in correctness of the annotation.

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

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

### getAnnotation

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