Repository navigation
Add data center one-shot extraction plugin #608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
110cb11
32bbb2c
b715a60
ea2eec0
bb09c45
bef2e83
44582b0
2c2135f
64be1c2
c42fc75
34d713d
d64818c
e6bd7ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| """COMPASS data centers plugin""" | ||
|
|
||
| import importlib.resources | ||
|
|
||
| from compass.plugin import create_schema_based_one_shot_extraction_plugin | ||
|
|
||
|
|
||
| COMPASSDataCentersExtractor = create_schema_based_one_shot_extraction_plugin( | ||
| importlib.resources.files("compass.extraction.data_centers") | ||
| / "plugin_config.yaml", | ||
| tech="data_centers", | ||
| ) |
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New: the extraction schema for data center ordinances. A one-shot schema: the model returns a sparse table with one row per feature the ordinance addresses, plus Points worth reviewing:
|
Large diffs are not rendered by default.
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New: plugin configuration for data centers. Search query templates, website and heuristic keywords, and the extraction system prompt. The prompt names the jurisdiction ( No Python is needed for the plugin; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,184 @@ | ||
| schema: ./data_centers_schema.json | ||
|
|
||
| data_type_short_desc: data center ordinance | ||
|
|
||
| cache_llm_generated_content: true | ||
|
|
||
| query_templates: | ||
| - "{jurisdiction} data center ordinance" | ||
| # Recently adopted ordinances are often published only as a PDF on the | ||
| # jurisdiction's own site, before they are codified in a code library. | ||
| - "filetype:pdf {jurisdiction} data center ordinance" | ||
| - "site:{jurisdiction_website} data center" | ||
| - "{jurisdiction} zoning ordinance" | ||
|
|
||
| website_keywords: | ||
| pdf: 92160 | ||
| "data center": 46080 | ||
| datacenter: 46080 | ||
| ordinance: 23040 | ||
| zoning: 11520 | ||
| setback: 5760 | ||
| noise: 5760 | ||
| "conditional use": 2880 | ||
| "special use": 2880 | ||
| hyperscale: 1440 | ||
| colocation: 1440 | ||
| generator: 1440 | ||
| "code of ordinances": 1440 | ||
| "municipal code": 1440 | ||
| ecode360: 1440 | ||
| municode: 1440 | ||
| "zoning ordinance": 1440 | ||
| "unified development ordinance": 720 | ||
| "ordinance adopted": 720 | ||
| "land use code": 720 | ||
| "text amendment": 720 | ||
| "land development": 720 | ||
| cooling: 360 | ||
| screening: 360 | ||
| county: 360 | ||
| municipal: 360 | ||
| chapter: 180 | ||
| section: 180 | ||
| planning: 180 | ||
|
|
||
| heuristic_keywords: | ||
| # One mention of a data center term is enough for text to count, so | ||
| # every entry here must be specific to data centers. Generic zoning | ||
| # terms are left out: with a threshold of one they would let any | ||
| # zoning text through on their own. | ||
| min_matches: 1 | ||
| GOOD_TECH_KEYWORDS: | ||
| - datacenter | ||
| - hyperscale | ||
| - colocation | ||
| GOOD_TECH_PHRASES: | ||
| - data center | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. The heuristic counts distinct matching entries against a threshold of two. A plugin can now set |
||
| - data processing center | ||
| - data processing facility | ||
| - data center campus | ||
| - computer server | ||
| - server farm | ||
| - colocation facility | ||
| GOOD_TECH_ACRONYMS: | ||
| - PUE | ||
| - WUE | ||
| NOT_TECH_WORDS: | ||
| - community center | ||
| - recreation center | ||
| - civic center | ||
| - convention center | ||
| - shopping center | ||
| - medical center | ||
| - senior center | ||
| - visitor center | ||
| - town center | ||
| - detention center | ||
| - child care center | ||
| - call center | ||
| - distribution center | ||
| - service center | ||
| - data collection | ||
| - database | ||
|
|
||
| collection_prompts: true | ||
|
|
||
| extraction_system_prompt: |- | ||
| You are a legal scholar extracting structured data from local data | ||
| center siting ordinances. | ||
|
|
||
| Extract ONLY the following features: | ||
| - setbacks from residential and protected receptors, property lines, | ||
| roads, transit facilities, parks and natural areas, other data | ||
| centers, and setbacks that apply to mechanical equipment under a | ||
| standard separate from the building | ||
| - minimum lot size, maximum lot coverage, minimum vegetative cover, | ||
| maximum height, maximum building size, data center share of project | ||
| floor area, and parking | ||
| - primary, special, accessory, and prohibited use districts, and | ||
| jurisdiction-wide prohibitions or moratoria | ||
| - noise limits, low-frequency and tonal noise limits, noise | ||
| attenuation standards for enclosures and barriers, vibration, light | ||
| illumination at a receptor, and thermal impact | ||
| - buffer and landscaping standards, equipment screening and | ||
| enclosure, and perimeter fencing | ||
| - backup generator operating restrictions, on-site power technology, | ||
| and decommissioning | ||
| - cooling technology, water consumption limits, and reclaimed water | ||
| requirements | ||
|
|
||
| The jurisdiction is {jur_full_name}. Extract only requirements that | ||
| this jurisdiction has itself enacted. The text may be a meeting packet | ||
| or staff report rather than the code itself. Such a document often | ||
| attaches text labelled as a draft or proposal, or reproduces other | ||
| jurisdictions' regulations for comparison: emit no rows from either, | ||
| however detailed they are. If nothing else remains, return no rows | ||
| and say why in extraction_notes. | ||
|
|
||
| Markup alone does not make a text a draft. Ordinances that amend a | ||
| code are commonly published showing additions and strikethroughs. | ||
| Unless the text is labelled a draft or proposal, or says it was not | ||
| adopted, extract it as amended: keep the added wording and leave out | ||
| the struck wording. | ||
|
|
||
| Extract only enacted local requirements that explicitly govern data | ||
| centers, or that govern a use the ordinance defines as a data center, | ||
| such as a data processing center or a computer server facility. The | ||
| source may be a general zoning code, unified development ordinance, | ||
| municipal code, or a standalone adopted ordinance rather than a | ||
| technology-specific title. | ||
|
|
||
| Data center ordinances frequently regulate by facility size class. | ||
| Follow the ordinance's own structure, feature by feature. Where it | ||
| states a requirement separately for a size tier, emit a row for that | ||
| data_center_type. Where it states a requirement for data centers | ||
| generally, emit one row with a null data_center_type. Do not split a | ||
| general requirement into a row per tier, and do not merge separately | ||
| stated tier requirements into one row. One feature being stated per | ||
| tier does not make every feature tiered. | ||
|
|
||
| No two rows may share both feature and data_center_type: local | ||
| classes that map to the same type share a row, and a rule the text | ||
| states in more than one section is one row that cites each section. | ||
| Before answering, check the rows for a repeated feature and | ||
| data_center_type pair and merge any you find. | ||
|
|
||
| For a numeric feature, value is a single number: the most restrictive | ||
| value the ordinance sets for that feature and facility class, such as | ||
| the largest setback or the lowest noise limit. Do not combine several | ||
| numbers into one value. List every other value in summary with the | ||
| condition it applies under, such as the time period, receiving use, | ||
| zoning district, street class, or yard. Keep units to the unit alone. | ||
|
|
||
| data_center_type is a size tier from the schema's fixed list, or | ||
| Accessory Data Center. Map the jurisdiction's tier onto the list by | ||
| its name, such as Large Data Center for a Large-Scale or Major tier. | ||
| Set it to null when the requirement applies to data centers of any | ||
| size: generic labels such as Data Center, DATA CENTER, and Data | ||
| Processing Center are not size tiers. Any other distinction, such as | ||
| whether the site is part of a unified development plan, is a | ||
| condition rather than a type: take the most restrictive value and | ||
| list the others with their conditions in summary. Start summary with | ||
| the jurisdiction's own class name whenever data_center_type is not | ||
| null, and retain the complete source wording in ordinance_text. | ||
|
|
||
| Do not extract text focused only on office, warehouse, distribution, | ||
| telecommunications, or utility uses unless the same clause directly | ||
| applies to data centers. Do not extract from proposed, denied, or | ||
| superseded provisions. | ||
|
|
||
| For noise, ignore complaint-response and monitoring protocol details | ||
| unless the clause states an explicit numeric limit. | ||
|
|
||
| Follow schema feature definitions literally. Keep the jurisdiction's | ||
| own vocabulary exactly as written, except for the data_center_type | ||
| values above. Write units with the schema's canonical unit names, such | ||
| as feet, acres, sq ft, percent, and dBA, even where the ordinance | ||
| abbreviates them. Do not convert values into a different unit. Do not | ||
| invent values. | ||
|
|
||
| Write summary in your own words. Copy the supporting source passages | ||
| verbatim into ordinance_text, retaining the applicable facility class, | ||
| conditions, and exceptions. Use explanation to state how that evidence | ||
| supports the selected feature, facility class, value, and units. | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two changes to the shared one-shot components. Both apply to every one-shot plugin, not only data centers.
|
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That set lists features that do not, on their own, make a document count as an ordinance. A definitions chapter defines terms but regulates nothing, so a document yielding only definition rows is not accepted as the jurisdiction's ordinance and the pipeline moves on to the next document. Worth knowing: together with the district features already in this set, this means a document whose only rows are definitions and district lists is discarded. In a recent 22-jurisdiction run that dropped two jurisdictions whose adopted ordinance contains little else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registers the plugin.
Builds
COMPASSDataCentersExtractorfromplugin_config.yamlwith the existing one-shot factory, undertech="data_centers". The two one-line imports incompass/extraction/__init__.pyandcompass/__init__.pymake it load with the package, the same way the other bundled plugins do.