compass.extraction.wind.parse.StructuredWindPermittedUseDistrictsParser#
- class StructuredWindPermittedUseDistrictsParser(llm_service, usage_tracker=None, **kwargs)[source]#
Bases:
StructuredWindParserLLM permitted use districts scraping utility
- Purpose:
Extract structured ordinance data from text.
- Responsibilities:
Extract ordinance values into structured format by executing a decision-tree-based chain-of-thought prompt on the text for each value to be extracted.
- Key Relationships:
Uses a StructuredLLMCaller for LLM queries and multiple AsyncDecisionTree instances to guide the extraction of individual values.
- Parameters:
llm_service (
Service) – LLM service used for queries.usage_tracker (
UsageTracker, optional) – Optional tracker instance to monitor token usage during LLM calls. By default,None.**kwargs –
Keyword arguments to be passed to the underlying service processing function (i.e.
llm_service.call(**kwargs)). Should not contain the following keys:usage_sub_label
messages
These arguments are provided by this caller object.
Methods
parse(text)Parse text and extract permitted use districts data
- async parse(text)[source]#
Parse text and extract permitted use districts data
- Parameters:
text (
str) – Permitted use districts text which may or may not contain information about allowed uses in one or more districts.- Returns:
pandas.DataFrameorNone– DataFrame containing parsed-out allowed-use district names. Can also beNoneif a large wind energy system is not found in the text.