Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • Data Types
    • User Defined Functions
    • Configuration
    • Catalog
    • GPU Support
    • AI / LLM
  • PyFlink Multimodal
  • PyFlink DataStream
  • PyFlink Common

pyflink.dataframe.ai.llm.LLMAccessor.ai_mask#

LLMAccessor.ai_mask(input_col: Union[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")

previous

pyflink.dataframe.ai.llm.LLMAccessor.ai_summarize

next

pyflink.dataframe.ai.llm.LLMAccessor.ai_embed

Show Source

Created using Sphinx 4.5.0.