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
# 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)
Attributes
Literal['FROM_TEXT_EMBEDDING']
Type discriminator; fixed as CustomFeatureType.FROM_TEXT_EMBEDDING.
str
Name of the original text column that generated the embedding.
int | None
Number of tokens per cluster used for TF-IDF summarization (default 5).
Dict[str, List] | None
TF-IDF analysis results; populated during training.
classmethod validate_n_tags()
Returns
int
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.