compass.extraction.solar.parse.StructuredSolarOrdinanceParser#
- class StructuredSolarOrdinanceParser(llm_service, usage_tracker=None, **kwargs)[source]#
Bases:
StructuredSolarParserLLM ordinance document structured data 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 JSONFromTextLLMCaller 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 structure ordinance data
Attributes
Identifier for text ingested by this class
Identifier for structured ordinance data output by this class
ID to use for this extraction for linking with LLM configs
- IN_LABEL = 'cleaned_text_for_extraction'#
Identifier for text ingested by this class
- OUT_LABEL = 'ordinance_values'#
Identifier for structured ordinance data output by this class
- async parse(text)[source]#
Parse text and extract structure ordinance data
- Parameters:
text (
str) – Ordinance text which may or may not contain setbacks for one or more features (property lines, structure, roads, etc.). Text can also contain other supported regulations (noise, shadow-flicker, etc,) which will be extracted as well.- Returns:
pandas.DataFrameorNone– DataFrame containing parsed-out ordinance values. Can also beNoneif a large solar energy system is not found in the text.
- TASK_ID = 'data_extraction'#
ID to use for this extraction for linking with LLM configs