maxframe.learn.contrib.llm.text.classify#

maxframe.learn.contrib.llm.text.classify(series, model: TextLLM, labels: List[str], description: str = None, examples: List[Dict[str, str]] = None, index=None)[source]#

Classify text content in a series with given labels.

Parameters:
  • series (pandas.Series) – A maxframe Series containing text data to be classified. Each element should be a text string.

  • model (TextLLM) – Language model instance used for text summarization.

  • labels (List[str]) – List of labels to classify the text.

  • description (str) – Description of the classification task.

  • examples (List[Dict[str, Dict[str, str]]]) – Examples of the classification task, like [{ “text”: “text…”, “label”:”A”, reason : “reason…”}], help LLM to better understand your rules.

  • index (array-like, optional) – Index for the output series, by default None, will generate new index.

Returns:

A pandas Series containing the generated classification results and success status.

Return type:

maxframe.Series

Notes

Preview: This API is in preview state and may be unstable. The interface may change in future releases.