> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiddler.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# TextEmbedding

> Represents custom features derived from text embeddings with TF-IDF analysis.

Represents custom features derived from text embeddings with TF-IDF analysis.

TextEmbedding extends VectorFeature to handle text-based embeddings with additional
text-specific analysis capabilities. It combines vector clustering with TF-IDF
analysis to provide both semantic clustering and keyword extraction for text data.

The feature type is automatically set to CustomFeatureType.FROM\_TEXT\_EMBEDDING
and uses clustering combined with TF-IDF summarization for drift computation.

## Examples

```python theme={null}
# Creating a text embedding feature for review analysis:

text_feature = TextEmbedding(
    name="review_sentiment_clusters",
    column="review_embedding",
    source_column="review_text",
    n_clusters=8,
    n_tags=20
)

# Creating a feature for document classification:

doc_feature = TextEmbedding(
    name="document_topic_clusters",
    column="doc_embedding",
    source_column="document_content",
    n_clusters=12,
    n_tags=15
)
```

## type

## source\_column

## n\_tags

## tf\_idf

## *classmethod* validate\_n\_tags()

### Returns

`int`

## model\_config

Configuration for the model, should be a dictionary conforming to \[ConfigDict]\[pydantic.config.ConfigDict].
