Sklearn TF-IDF Vectorizer icon

Sklearn TF-IDF Vectorizer

Convert text to TF-IDF feature vectors using scikit-learn

Fit Transform

AI-generated

Summary

Fit text data to a TF-IDF vectorizer and transform it into TF-IDF features.

Inputs

  • textColumn (required) — Name of the column containing raw text to be vectorized.
  • maxFeatures — Maximum number of features (vocabulary size) to keep.
  • ngramMin — Minimum n-gram length for tokenization.
  • ngramMax — Maximum n-gram length for tokenization.
  • stopWords — Stop words to remove; choose 'None' or 'English'.
  • lowercase — Whether to lowercase the text before vectorization.
  • pythonPath — Path to the Python executable that has scikit-learn installed.

Output shape

A list of items, each containing the TF-IDF matrix, feature names, vocabulary and metadata.

The operation appends computed fields to each input item; shape is a list, not a single record.

Examples

Example 1: Convert a column of product descriptions into TF-IDF vectors.

textColumn = description, maxFeatures = 200, ngramMin = 1, ngramMax = 2, stopWords = english, lowercase = true

Example 2: Transform existing TF-IDF vectors using a previously fitted model.

operation = transform, vectorizerData = JSON of fitted settings, transformTextColumn = description

Discussion