> For the complete documentation index, see [llms.txt](https://docs.natml.ai/unity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.natml.ai/unity/api/mlfeature/mltextfeature.md).

# MLStringFeature

This feature contains plain text. It is intended for use with natural language processing (NLP) models.

## Creating the Feature

### From Plain Text

```csharp
/// <summary>
/// Create a string feature.
/// </summary>
/// <param name="text">Text.</param>
MLStringFeature (string text);
```

The string feature can be created from a `string`.

### From a Cloud Feature

```csharp
/// <summary>
/// Create a string feature from a cloud feature.
/// </summary>
/// <param name="feature">Cloud feature. This MUST be an `string` feature.</param>
MLStringFeature (MLCloudFeature feature);
```

A string feature can be created from a Cloud feature. This constructor is useful for working with output prediction data from an [`MLCloudModel`](broken://pages/UPP68b3ajMw2Mk8Hqqar) when authoring a predictor:

```csharp
// Make a Cloud prediction
MLCloudModel model = ...;
MLCloudFeature[] outputFeatures = model.Predict(...);
// Create a text feature from a Cloud string feature
var feature = new MLStringFeature(outputFeatures[0]);
```

{% hint style="warning" %}
The cloud feature MUST be a `string` feature.
{% endhint %}

## Inspecting the String

```csharp
/// <summary>
/// Feature text.
/// </summary>
string text { get; }
```

The string feature exposes the enclosing `text` that it was created with.

## Type Conversions

```csharp
/// <summary>
/// Get the `string` contained in the string feature.
/// </summary>
static implicit operator string (MLStringFeature feature);
```

The feature type provides an implicit conversion to the `string` text which it contains.

## Creating Cloud Features

```csharp
/// <summary>
/// Create a Cloud ML feature that is ready for prediction with Cloud ML models.
/// </summary>
/// <param name="featureType">Optional feature type used to create the Cloud ML feature.</param>
/// <returns>Cloud ML feature.</returns>
MLCloudFeature IMLCloudFeature.Create (MLFeatureType featureType);
```

INCOMPLETE.
