pyflink.dataframe.ai.llm.LLMAccessor.ai_mask#
- LLMAccessor.ai_mask(input_col: str | Expression, entities: List[str], *, provider: str = None, model: str = None, config: Dict[str, str] = None) DataFrame[source]#
Mask sensitive information in text.
- Parameters:
input_col – Column name (str) or Expression for the input text.
entities – List of entity types to mask (e.g.
["name", "phone"]).provider – Provider name.
model – Model name.
config – Optional runtime config.
- Returns:
masked_text(STRING): text with sensitive info replaced.detected_entities(ARRAY<STRING>): list of detected entity types.
- Return type:
A new DataFrame with columns appended
Example:
>>> df.llm.ai_mask("text", ["name", "phone"], model="qwen-plus")