Skip to main content

Usage

The following example shows how the step can be used in a recipe.

Examples

Extract positive and negative aspects from a text column
infer_aspect_polarity(ds.texts, {
    "integration": "open-ai-1",
    "model": "openai/gpt-4.1",
}) -> (ds.positive_aspects, ds.negative_aspects)

Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally columns (ds.first_name), datasets (ds or ds[["first_name", "last_name"]]) or models (referenced by name e.g. "churn-clf").
texts
column[category|text]
required
Column containing the texts to extract aspect polarity from.
positive_aspects
column[list[category]]
required
List of entities mentioned with positive sentiment.
negative_aspects
column[list[category]]
required
List of entities mentioned with negative sentiment.

Configuration

The following parameters can be used to configure the behaviour of the step by including them in a json object as the last “input” to the step, i.e. step(..., {"param": "value", ...}) -> (output).

Parameters

integration
string
required
Associated integration.
model
string
default:"openai/gpt-4.1"
AI Model. AI model used for aspect-based polarity extraction. Each text is processed individually to identify entities and classify them as positive or negative.Values must be one of the following:openai/gpt-4.1 openai/gpt-4.1-mini openai/gpt-4.1-nano openai/gpt-5 openai/gpt-5-mini openai/gpt-5-nano openai/gpt-5.1 openai/gpt-5.2
instructions
string
default:""
Additional Instructions. Additional instructions to guide the polarity extraction process. Use this to provide domain-specific guidance or to focus on particular types of entities.
params
object
API Parameters. Additional parameters passed to the responses API.