glazing.references.models¶
Reference data models.
models
¶
Cross-reference models for mapping between linguistic datasets.
This module provides models for managing cross-references between FrameNet, PropBank, VerbNet, and WordNet. It includes confidence scoring, transitive mapping resolution, and unified representations across datasets.
| CLASS | DESCRIPTION |
|---|---|
MappingMetadata |
Metadata for cross-dataset mappings. |
MappingConfidence |
Confidence scoring for mappings. |
CrossReference |
Base mapping between entities in different datasets. |
MultiMapping |
One-to-many mapping with ranked alternatives. |
TransitiveMapping |
Indirect mapping through intermediate resources. |
VerbNetFrameNetMapping |
VerbNet to FrameNet mapping with confidence. |
VerbNetFrameNetRoleMapping |
Role-level mapping between VerbNet and FrameNet. |
VerbNetCrossRefs |
VerbNet member cross-references. |
PropBankCrossRefs |
PropBank roleset cross-references with confidence. |
PropBankRoleMapping |
PropBank role to other dataset role mapping. |
UnifiedRoleMapping |
Complete role mapping across all datasets. |
UnifiedLemma |
A lemma with all its representations across datasets. |
ConceptAlignment |
Alignment of semantic concepts across datasets. |
RoleMappingTable |
Maps roles across different datasets. |
FEAlignment |
Cross-dataset FE alignment with full metadata. |
FEInheritanceChain |
Tracks FE inheritance through frame hierarchy. |
MappingConflict |
Represents a conflict in cross-dataset mappings. |
MappingIndex |
Bidirectional index for fast mapping lookups. |
Notes
All confidence scores are normalized to 0.0-1.0 range. Transitive mappings propagate confidence through the chain.
Classes¶
ConceptAlignment
pydantic-model
¶
Bases: BaseModel
Alignment of semantic concepts across datasets.
| ATTRIBUTE | DESCRIPTION |
|---|---|
concept_name |
Name of the semantic concept.
TYPE:
|
concept_type |
Type of concept (e.g., "frame", "event").
TYPE:
|
framenet_frames |
Related FrameNet frames.
TYPE:
|
propbank_rolesets |
Related PropBank rolesets.
TYPE:
|
verbnet_classes |
Related VerbNet classes.
TYPE:
|
wordnet_synsets |
Related WordNet synsets.
TYPE:
|
confidence |
Overall alignment confidence.
TYPE:
|
alignment_method |
Method used for alignment.
TYPE:
|
alignment_criteria |
Criteria used for alignment.
TYPE:
|
Fields:
-
concept_name(str) -
concept_type(str) -
framenet_frames(list[str]) -
propbank_rolesets(list[str]) -
verbnet_classes(list[str]) -
wordnet_synsets(list[SynsetOffset]) -
confidence(float | None) -
alignment_method(str) -
alignment_criteria(list[str])
CrossReference
pydantic-model
¶
Bases: BaseModel
Cross-dataset reference with full metadata.
| ATTRIBUTE | DESCRIPTION |
|---|---|
source_dataset |
Source dataset name.
TYPE:
|
source_id |
Identifier in source dataset.
TYPE:
|
source_version |
Version of source dataset.
TYPE:
|
target_dataset |
Target dataset name.
TYPE:
|
target_id |
Identifier(s) in target dataset.
TYPE:
|
mapping_type |
Type of mapping relationship.
TYPE:
|
confidence |
Confidence scoring for the mapping.
TYPE:
|
metadata |
Metadata about the mapping.
TYPE:
|
inherited_from |
For mappings inherited from parent classes.
TYPE:
|
Fields:
-
source_dataset(DatasetType) -
source_id(str) -
source_version(str) -
target_dataset(DatasetType) -
target_id(str | list[str]) -
mapping_type(MappingType) -
confidence(MappingConfidence | None) -
metadata(MappingMetadata) -
inherited_from(str | None)
FEAlignment
pydantic-model
¶
Bases: BaseModel
Cross-dataset FE alignment with full metadata.
| ATTRIBUTE | DESCRIPTION |
|---|---|
source_frame |
FrameNet frame name.
TYPE:
|
source_fe |
FrameNet FE name.
TYPE:
|
target_dataset |
Target dataset.
TYPE:
|
target_role |
Target role/arg name.
TYPE:
|
alignment_type |
Type of alignment.
TYPE:
|
confidence |
Confidence scoring.
TYPE:
|
evidence |
Supporting evidence for alignment.
TYPE:
|
Fields:
-
source_frame(str) -
source_fe(str) -
target_dataset(DatasetType) -
target_role(str) -
alignment_type(AlignmentType) -
confidence(MappingConfidence) -
evidence(list[str])
Functions¶
get_combined_score() -> float
¶
Get combined alignment score.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Adjusted confidence score based on alignment type. |
Source code in src/glazing/references/models.py
FEInheritanceChain
pydantic-model
¶
Bases: BaseModel
Tracks FE inheritance through frame hierarchy.
| ATTRIBUTE | DESCRIPTION |
|---|---|
fe_name |
Frame element name.
TYPE:
|
frame_chain |
Frames from child to parent.
TYPE:
|
inheritance_path |
Chain of FE relations.
TYPE:
|
final_mapping |
Final cross-dataset mapping.
TYPE:
|
Fields:
-
fe_name(str) -
frame_chain(list[str]) -
inheritance_path(list[FERelation]) -
final_mapping(FEAlignment | None)
FERelation
pydantic-model
¶
Bases: BaseModel
FE mapping between related frames with alignment metadata.
| ATTRIBUTE | DESCRIPTION |
|---|---|
sub_fe_id |
Sub-frame FE ID.
TYPE:
|
sub_fe_name |
Sub-frame FE name.
TYPE:
|
super_fe_id |
Super-frame FE ID.
TYPE:
|
super_fe_name |
Super-frame FE name.
TYPE:
|
relation_type |
Type of relation.
TYPE:
|
alignment_confidence |
Alignment confidence score.
TYPE:
|
semantic_similarity |
Semantic similarity score.
TYPE:
|
syntactic_similarity |
Syntactic similarity score.
TYPE:
|
mapping_notes |
Notes about the mapping.
TYPE:
|
Fields:
-
sub_fe_id(int | None) -
sub_fe_name(str | None) -
super_fe_id(int | None) -
super_fe_name(str | None) -
relation_type(str | None) -
alignment_confidence(float | None) -
semantic_similarity(float | None) -
syntactic_similarity(float | None) -
mapping_notes(str | None)
Validators:
-
validate_fe_names→sub_fe_name,super_fe_name
Functions¶
is_equivalence() -> bool
¶
Check if FEs are equivalent.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if relation type is equivalence. |
is_inheritance() -> bool
¶
Check if this is an inheritance relation.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if relation type is inheritance. |
validate_fe_names(v: str | None) -> str | None
pydantic-validator
¶
Validate FE name format.
| PARAMETER | DESCRIPTION |
|---|---|
v
|
FE name to validate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str | None
|
Validated FE name. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If FE name format is invalid. |
Source code in src/glazing/references/models.py
FrameNetLURef
pydantic-model
¶
Bases: BaseModel
Reference to a FrameNet lexical unit.
| ATTRIBUTE | DESCRIPTION |
|---|---|
lu_id |
Lexical unit ID.
TYPE:
|
frame_name |
Frame that contains this LU.
TYPE:
|
definition |
LU definition.
TYPE:
|
Fields:
-
lu_id(int) -
frame_name(str) -
definition(str)
MappingConfidence
pydantic-model
¶
Bases: BaseModel
Confidence scoring for mappings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
score |
Confidence score between 0.0 and 1.0.
TYPE:
|
method |
Method used to calculate confidence.
TYPE:
|
factors |
Component scores contributing to overall confidence.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If score is not between 0.0 and 1.0. |
Fields:
-
score(float) -
method(str) -
factors(dict[str, float])
Validators:
-
validate_score→score
Functions¶
validate_score(v: float) -> float
pydantic-validator
¶
Validate confidence score is in valid range.
| PARAMETER | DESCRIPTION |
|---|---|
v
|
Score to validate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Validated score. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If score is not between 0.0 and 1.0. |
Source code in src/glazing/references/models.py
MappingConflict
pydantic-model
¶
Bases: BaseModel
Represents a conflict in cross-dataset mappings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
conflict_type |
Type of conflict.
TYPE:
|
source_dataset |
Source dataset.
TYPE:
|
source_id |
Source identifier.
TYPE:
|
conflicting_mappings |
Conflicting mapping alternatives.
TYPE:
|
resolution_strategy |
Strategy used to resolve conflict.
TYPE:
|
resolved_mapping |
Resolved mapping after conflict resolution.
TYPE:
|
Fields:
-
conflict_type(ConflictType) -
source_dataset(DatasetType) -
source_id(str) -
conflicting_mappings(list[CrossReference]) -
resolution_strategy(str | None) -
resolved_mapping(CrossReference | None)
Functions¶
resolve_by_confidence() -> CrossReference | None
¶
Resolve conflict by selecting highest confidence mapping.
| RETURNS | DESCRIPTION |
|---|---|
CrossReference | None
|
Highest confidence mapping or None. |
Source code in src/glazing/references/models.py
resolve_by_source(preferred_source: MappingSource) -> CrossReference | None
¶
Resolve by preferring specific mapping source.
| PARAMETER | DESCRIPTION |
|---|---|
preferred_source
|
Preferred source for resolution.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CrossReference | None
|
Mapping from preferred source or None. |
Source code in src/glazing/references/models.py
MappingIndex
pydantic-model
¶
Bases: BaseModel
Bidirectional index for fast mapping lookups.
| ATTRIBUTE | DESCRIPTION |
|---|---|
forward_index |
Source to target mappings.
TYPE:
|
reverse_index |
Target to source mappings.
TYPE:
|
transitive_cache |
Cached transitive mappings.
TYPE:
|
Fields:
-
forward_index(dict[str, list[CrossReference]]) -
reverse_index(dict[str, list[CrossReference]]) -
transitive_cache(dict[tuple[str, str, int], list[TransitiveMapping]])
Functions¶
add_mapping(mapping: CrossReference) -> None
¶
Add mapping to bidirectional index.
| PARAMETER | DESCRIPTION |
|---|---|
mapping
|
Mapping to add to index.
TYPE:
|
Source code in src/glazing/references/models.py
find_transitive_mappings(source: str, target_dataset: DatasetType, max_hops: int = 3) -> list[TransitiveMapping]
¶
Find indirect mappings through intermediate resources.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
Source identifier.
TYPE:
|
target_dataset
|
Target dataset.
TYPE:
|
max_hops
|
Maximum number of intermediate steps.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[TransitiveMapping]
|
Found transitive mappings. |
Source code in src/glazing/references/models.py
MappingMetadata
pydantic-model
¶
Bases: BaseModel
Metadata for cross-dataset mappings.
| ATTRIBUTE | DESCRIPTION |
|---|---|
created_date |
When the mapping was created.
TYPE:
|
created_by |
Person or system that created mapping.
TYPE:
|
modified_date |
When the mapping was last modified.
TYPE:
|
modified_by |
Person or system that last modified mapping.
TYPE:
|
version |
Dataset version this mapping was created for.
TYPE:
|
validation_status |
Current validation status of the mapping.
TYPE:
|
validation_method |
How the mapping was validated.
TYPE:
|
notes |
Additional notes about the mapping.
TYPE:
|
Fields:
-
created_date(datetime) -
created_by(str) -
modified_date(datetime | None) -
modified_by(str | None) -
version(str) -
validation_status(ValidationStatus) -
validation_method(str | None) -
notes(str | None)
MultiMapping
pydantic-model
¶
Bases: BaseModel
One-to-many mapping with ranked alternatives.
| ATTRIBUTE | DESCRIPTION |
|---|---|
source_dataset |
Source dataset name.
TYPE:
|
source_id |
Identifier in source dataset.
TYPE:
|
source_version |
Version of source dataset.
TYPE:
|
mappings |
Ordered list of mappings by confidence.
TYPE:
|
primary_mapping |
Highest confidence or manually selected mapping.
TYPE:
|
conflict_resolution |
How conflicts were resolved.
TYPE:
|
Fields:
-
source_dataset(DatasetType) -
source_id(str) -
source_version(str) -
mappings(list[CrossReference]) -
primary_mapping(CrossReference | None) -
conflict_resolution(str | None)
Functions¶
get_best_mapping(target_dataset: DatasetType) -> CrossReference | None
¶
Get highest confidence mapping to target dataset.
| PARAMETER | DESCRIPTION |
|---|---|
target_dataset
|
Target dataset to find mapping for.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CrossReference | None
|
Highest confidence mapping or None if not found. |
Source code in src/glazing/references/models.py
PropBankCrossRefs
pydantic-model
¶
Bases: BaseModel
PropBank roleset cross-references with confidence.
| ATTRIBUTE | DESCRIPTION |
|---|---|
roleset_id |
PropBank roleset identifier.
TYPE:
|
rolelinks |
Direct role-level mappings.
TYPE:
|
lexlinks |
Lexical links with confidence scores.
TYPE:
|
wn_mappings |
WordNet mappings if available.
TYPE:
|
Fields:
-
roleset_id(str) -
rolelinks(list[RoleLink]) -
lexlinks(list[LexLink]) -
wn_mappings(list[WordNetCrossRef])
Functions¶
get_verbnet_classes() -> list[tuple[str, float | None]]
¶
Get VerbNet classes with optional confidence.
| RETURNS | DESCRIPTION |
|---|---|
list[tuple[str, float | None]]
|
VerbNet class names with confidence scores. |
Source code in src/glazing/references/models.py
get_wordnet_senses() -> list[WordNetCrossRef]
¶
Get WordNet senses for this roleset.
| RETURNS | DESCRIPTION |
|---|---|
list[WordNetCrossRef]
|
WordNet cross-references. |
PropBankRoleMapping
pydantic-model
¶
Bases: BaseModel
PropBank role to other dataset role mapping.
| ATTRIBUTE | DESCRIPTION |
|---|---|
pb_arg |
PropBank argument (e.g., "ARG0").
TYPE:
|
target_dataset |
Target dataset name.
TYPE:
|
target_role |
Target role/FE name.
TYPE:
|
confidence |
Confidence scoring for the mapping.
TYPE:
|
mapping_source |
Source of the mapping.
TYPE:
|
Fields:
-
pb_arg(str) -
target_dataset(DatasetType) -
target_role(str) -
confidence(MappingConfidence | None) -
mapping_source(MappingSource)
PropBankRolesetRef
pydantic-model
¶
Bases: BaseModel
Reference to a PropBank roleset.
| ATTRIBUTE | DESCRIPTION |
|---|---|
roleset_id |
Roleset identifier.
TYPE:
|
name |
Descriptive name.
TYPE:
|
Fields:
-
roleset_id(str) -
name(str | None)
RoleMappingTable
pydantic-model
¶
Bases: BaseModel
Maps roles across different datasets.
| ATTRIBUTE | DESCRIPTION |
|---|---|
verbnet_role |
VerbNet thematic role.
TYPE:
|
framenet_fe |
Corresponding FrameNet FE.
TYPE:
|
propbank_arg |
Corresponding PropBank argument.
TYPE:
|
wordnet_semantic_role |
Inferred WordNet semantic role.
TYPE:
|
mapping_notes |
Notes about the mapping.
TYPE:
|
Fields:
-
verbnet_role(str) -
framenet_fe(str | None) -
propbank_arg(str | None) -
wordnet_semantic_role(str | None) -
mapping_notes(str)
Functions¶
is_agentive() -> bool
¶
Check if this represents an agentive role.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if role is agentive. |
Source code in src/glazing/references/models.py
TransitiveMapping
pydantic-model
¶
Bases: BaseModel
Indirect mapping through intermediate resource.
| ATTRIBUTE | DESCRIPTION |
|---|---|
source_dataset |
Source dataset name.
TYPE:
|
source_id |
Identifier in source dataset.
TYPE:
|
target_dataset |
Target dataset name.
TYPE:
|
target_id |
Identifier in target dataset.
TYPE:
|
path |
Chain of mappings from source to target.
TYPE:
|
combined_confidence |
Propagated confidence through chain.
TYPE:
|
Fields:
-
source_dataset(DatasetType) -
source_id(str) -
target_dataset(DatasetType) -
target_id(str) -
path(list[CrossReference]) -
combined_confidence(float)
Functions¶
calculate_confidence() -> float
¶
Calculate combined confidence through chain.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Combined confidence score. |
Source code in src/glazing/references/models.py
UnifiedLemma
pydantic-model
¶
Bases: BaseModel
A lemma with all its representations across datasets.
| ATTRIBUTE | DESCRIPTION |
|---|---|
lemma |
Base lemma form.
TYPE:
|
pos |
Unified part of speech.
TYPE:
|
framenet_lus |
FrameNet lexical units.
TYPE:
|
propbank_rolesets |
PropBank rolesets.
TYPE:
|
verbnet_members |
VerbNet members with class membership.
TYPE:
|
wordnet_senses |
WordNet senses.
TYPE:
|
Fields:
-
lemma(str) -
pos(Literal['n', 'v', 'a', 'r', 's']) -
framenet_lus(list[FrameNetLURef]) -
propbank_rolesets(list[PropBankRolesetRef]) -
verbnet_members(list[VerbNetMemberRef]) -
wordnet_senses(list[Sense])
Validators:
-
validate_lemma→lemma
Functions¶
validate_lemma(v: str) -> str
pydantic-validator
¶
Validate lemma format.
| PARAMETER | DESCRIPTION |
|---|---|
v
|
Lemma to validate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Validated lemma. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If lemma format is invalid. |
Source code in src/glazing/references/models.py
UnifiedRoleMapping
pydantic-model
¶
Bases: BaseModel
Complete role mapping across all datasets.
| ATTRIBUTE | DESCRIPTION |
|---|---|
concept |
Semantic concept (e.g., "agent", "patient").
TYPE:
|
verbnet_roles |
VerbNet (class_id, role) pairs.
TYPE:
|
framenet_fes |
FrameNet (frame, fe) pairs.
TYPE:
|
propbank_args |
PropBank (roleset, arg) pairs.
TYPE:
|
wordnet_restrictions |
Inferred semantic restrictions from WordNet.
TYPE:
|
confidence_matrix |
Pairwise confidence scores between mappings.
TYPE:
|
Fields:
-
concept(str) -
verbnet_roles(list[tuple[str, str]]) -
framenet_fes(list[tuple[str, str]]) -
propbank_args(list[tuple[str, str]]) -
wordnet_restrictions(list[str]) -
confidence_matrix(dict[str, dict[str, float]])
Functions¶
get_alignment_score() -> float
¶
Calculate overall alignment score.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Average confidence across all pairwise mappings. |
Source code in src/glazing/references/models.py
VerbNetCrossRefs
pydantic-model
¶
Bases: BaseModel
VerbNet member cross-references.
| ATTRIBUTE | DESCRIPTION |
|---|---|
verbnet_key |
Unique identifier for VerbNet member.
TYPE:
|
class_id |
VerbNet class this belongs to.
TYPE:
|
lemma |
Base form of the verb.
TYPE:
|
fn_mappings |
Multi-way FrameNet mappings with confidence.
TYPE:
|
pb_groupings |
PropBank senses.
TYPE:
|
wn_mappings |
WordNet mappings with metadata.
TYPE:
|
inherited_mappings |
Inherited mappings from parent classes.
TYPE:
|
Fields:
-
verbnet_key(str) -
class_id(str) -
lemma(str) -
fn_mappings(list[VerbNetFrameNetMapping]) -
pb_groupings(list[str]) -
wn_mappings(list[WordNetCrossRef]) -
inherited_mappings(list[CrossReference])
Functions¶
get_primary_framenet_mapping() -> VerbNetFrameNetMapping | None
¶
Get highest confidence FrameNet mapping.
| RETURNS | DESCRIPTION |
|---|---|
VerbNetFrameNetMapping | None
|
Highest confidence mapping or None if not found. |
Source code in src/glazing/references/models.py
has_conflicting_mappings() -> bool
¶
Check if there are conflicting FrameNet mappings.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if multiple high-confidence mappings exist. |
Source code in src/glazing/references/models.py
VerbNetFrameNetMapping
pydantic-model
¶
Bases: BaseModel
VerbNet to FrameNet mapping with confidence.
| ATTRIBUTE | DESCRIPTION |
|---|---|
frame_name |
FrameNet frame name.
TYPE:
|
confidence |
Confidence score for the mapping.
TYPE:
|
mapping_source |
Source of the mapping.
TYPE:
|
role_mappings |
Role-level mappings between VerbNet and FrameNet.
TYPE:
|
Fields:
-
frame_name(str) -
confidence(MappingConfidence | None) -
mapping_source(MappingSource) -
role_mappings(list[VerbNetFrameNetRoleMapping])
VerbNetFrameNetRoleMapping
pydantic-model
¶
Bases: BaseModel
Role-level mapping between VerbNet and FrameNet.
| ATTRIBUTE | DESCRIPTION |
|---|---|
vn_role |
VerbNet thematic role.
TYPE:
|
fn_fe |
FrameNet frame element.
TYPE:
|
confidence |
Confidence score for the role mapping.
TYPE:
|
notes |
Additional notes about the mapping.
TYPE:
|
Fields:
-
vn_role(str) -
fn_fe(str) -
confidence(float | None) -
notes(str | None)
VerbNetMemberRef
pydantic-model
¶
Bases: BaseModel
Reference to a VerbNet member.
| ATTRIBUTE | DESCRIPTION |
|---|---|
verbnet_key |
Unique member identifier.
TYPE:
|
class_id |
VerbNet class ID.
TYPE:
|
Fields:
-
verbnet_key(str) -
class_id(str)