# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.natml.ai/unity/api/mlfeature/mltextfeature.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
