llm_model
(str): Name of the LLM model to use (e.g., "openai::gpt-4o-mini"
).unknown_label
(str, optional): Label for unclear classifications (default: "unclear"
).temperature
(float, optional): Temperature for the LLM model (default: 0
)._deserialize_label_responses(responses)
: Deserialize LLM responses into a DataFrame._run_labeling_prompts(prompts, system_prompt, max_workers=100)
: Run prompts concurrently and collect LLM responses.texts
(List[str]): Texts to get the labels from.textsconfig
(Optional[List[Dict]], optional): Optional fields for the prompts in addition to the text.List[str]
: List of prompts for the labeling system.response
(str): The response from the LLM model as a raw string.dict
: Parsed dictionary with keys:
motivation
label
llm_model
(str): Name of the LLM model to use.label_prompt
(str, optional): Custom prompt for labeling (default: uses system prompt).unknown_label
(str, optional): Label for unclear classifications (default: "unclear"
).temperature
(float, optional): Temperature for the LLM model (default: 0
).get_labels(theme_labels, texts, max_workers=50)
: Label a list of texts with the provided theme labels.post_process_dataframe(df)
: Post-process the labeled DataFrame for export.texts
(List[str]): Texts to get the labels from.textsconfig
(Optional[List[Dict]], optional): Optional fields for the prompts in addition to the text.List[str]
: List of prompts for the labeling system.response
(str): The response from the LLM model as a raw string.dict
: Parsed dictionary with keys:
motivation
label
llm_model
(str): Name of the LLM model to use.label_prompt
(str, optional): Custom prompt for labeling (default: uses system prompt).unknown_label
(str, optional): Label for unclear classifications (default: "unclear"
).temperature
(float, optional): Temperature for the LLM model (default: 0
).get_labels(main_theme, labels, texts, max_workers=50)
: Label a list of texts with the provided main theme and labels.post_process_dataframe(df)
: Post-process the labeled DataFrame for export, including company/entity columns and placeholder replacement.texts
(List[str]): Texts to get the labels from.textsconfig
(Optional[List[Dict]], optional): Optional fields for the prompts in addition to the text.List[str]
: List of prompts for the labeling system.response
(str): The response from the LLM model as a raw string.dict
: Parsed dictionary with keys:
motivation
label