tdfs4ds.agent.attributes_skill¶
tdfs4ds.agent.attributes_skill
¶
Attributes of features in the consumer agent (0.3.7.22).
A dataset whose entity is FEATURE_NAME gives each feature attributes (an exclusion flag and its
reason, an owner...); see :mod:tdfs4ds.feature_attrs. Two uses, both written by code (no LLM):
- a DEFINITION of a feature carries one fixed line with its attributes;
- "which features are excluded and why" / "quelles features sont exclues" is answered from the attribute frame: the flag-like column the question names (or a column holding a value the question names), the matching features, and the reason columns when the question asks why.
Nothing here runs unless the store has an attribute dataset: the frame comes from the turn
snapshot (no extra read to find out) and every entry point returns None / "" without one,
so the routing, the prompts and the answers of any other store are unchanged.
_GENERIC_COLUMN_WORDS
module-attribute
¶
_GENERIC_COLUMN_WORDS = {'flag', 'is', 'has', 'id', 'name', 'code', 'value', 'type', 'the', 'of', 'by', 'ind', 'indicator'}
_TEXT_COLUMN_RE
module-attribute
¶
_FEATURE_WORD_RE
module-attribute
¶
_WHY_RE
module-attribute
¶
_NEGATION_RE
module-attribute
¶
_stem_match
¶
Same word, or the same first five letters ("excluded" / "exclusion" / "exclues").
attribute_frame
¶
The feature-attribute frame of the turn, or None when the store has no attribute dataset.
Detected from the turn snapshot's dataset catalog and entity frames (no extra read); read once
per turn through _turn_cached. Never raises.
attribute_request
¶
The attribute request a question makes, or None. Pure.
{"filters": [{"column", "kind": "flag"|"value", "negative", "value"}], "text_columns": [...],
"why": bool, "features": [names the question names]}. A question counts only when it speaks of
features (or names one) AND names an attribute column (a flag-like one) or a value of a column.
select_features
¶
The rows of the attribute frame the request selects. Pure.
render_attribute_answer
¶
The answer, written by code (EN / FR).
skill_attributes
¶
The answer to an attribute question as a skill result, or None when the question is not
one (or the store has no attribute dataset). Never raises.
attribute_line
¶
attribute_line(feature_name: str, entity_name: str = '', data_domain: str = '', fr: bool = False, frame: Optional[DataFrame] = None) -> str
One fixed line with a feature's attributes ("Attributes (from DS_RULES): EXCLUDED = Y, ..."),
"" when the store has no attribute dataset or the feature has no attribute row. Never raises.