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_extract#

LLMAccessor.ai_extract(input_col: Union[str, Expression], schema: str, *, provider: str = None, model: str = None, config: Dict[str, str] = None) → DataFrame[source]#

Extract structured information from text.

Parameters
  • input_col – Column name (str) or Expression for the input text.

  • schema – JSON schema string describing the fields to extract, e.g. '{"name":"STRING", "phone":"STRING"}'.

  • provider – Provider name.

  • model – Model name.

  • config – Optional runtime config.

Returns

  • extracted_json (STRING): extracted fields as a JSON string.

Return type

A new DataFrame with a column appended

Example::
>>> df.llm.ai_extract("text",
...     '{"name":"STRING", "phone":"STRING"}', model="qwen-plus")

previous

pyflink.dataframe.ai.llm.LLMAccessor.ai_sentiment

next

pyflink.dataframe.ai.llm.LLMAccessor.ai_translate

Show Source

Created using Sphinx 4.5.0.