elm.ords.validation.location.CountyJurisdictionValidator
- class CountyJurisdictionValidator(structured_llm_caller)[source]
Bases:
FixedMessageValidator
Validator that checks wether text applies at the county level.
- Parameters:
structured_llm_caller (
elm.ords.llm.StructuredLLMCaller
) – StructuredLLMCaller instance. Used for structured validation queries.
Methods
check
(content, **fmt_kwargs)Check if the content passes the validation.
Attributes
LLM system message describing validation task.
- SYSTEM_MESSAGE = "You extract structured data from legal text. Return your answer in JSON format. Your JSON file must include exactly three keys. The first key is 'x', which is a boolean that is set to `True` if the text excerpt explicitly mentions that the regulations within apply to a jurisdiction scope other than {county} County (i.e. they apply to a subdivision like a township or a city, or they apply more broadly, like to a state or the full country). `False` if the regulations in the text apply at the {county} County level, if the regulations in the text apply to all unincorporated areas of {county} County, or if there is not enough information to determine the answer. The second key is 'y', which is a boolean that is set to `True` if the text excerpt explicitly mentions that the regulations within apply to more than one county. `False` if the regulations in the text excerpt apply to a single county only or if there is not enough information to determine the answer. The third key is 'explanation', which is a string that contains a short explanation if you chose `True` for any answers above."
LLM system message describing validation task.
- async check(content, **fmt_kwargs)
Check if the content passes the validation.
The exact validation is outlined in the class SYSTEM_MESSAGE.
- Parameters:
content (str) – Document content to validate.
**fmt_kwargs – Keyword arguments to be passed to SYSTEM_MESSAGE.format().
- Returns:
bool –
True
if the content passes the validation check,False
otherwise.