compass.extraction.wind.parse.StructuredWindPermittedUseDistrictsParser#
- class StructuredWindPermittedUseDistrictsParser(llm_service, usage_tracker=None, **kwargs)[source]#
Bases:
StructuredWindParser
LLM 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 multipleAsyncDecisionTree
instances to guide the extraction of individual values.
- Parameters:
llm_service (
compass.services.base.Service
) – LLM service used for queries.usage_tracker (
compass.services.usage.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_tracker
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:
pd.DataFrame
– DataFrame containing parsed-out allowed-use district names.