glazing.framenet.models¶
FrameNet core data models.
models
¶
FrameNet core data models.
This module implements the core FrameNet data models including Frame, FrameElement, and supporting models for annotated text processing. Models use Pydantic v2 for validation and support JSON Lines serialization.
| CLASS | DESCRIPTION |
|---|---|
TextAnnotation |
Represents an annotation span within text. |
AnnotatedText |
Text with embedded markup for frame elements and references. |
Frame |
A FrameNet frame representing a schematic situation. |
FrameElement |
A participant or prop in a frame. |
FrameRelation |
Relationship between frames. |
FERelation |
FE mapping between related frames. |
SemanticType |
Semantic type in the FrameNet type system. |
FrameIndexEntry |
Entry in the frame index file. |
Examples:
>>> from glazing.framenet.models import Frame, FrameElement
>>> frame = Frame(
... id=2031,
... name="Abandonment",
... definition=AnnotatedText.parse("An <fex>Agent</fex> leaves behind a <fex>Theme</fex>"),
... frame_elements=[]
... )
>>> print(frame.definition.plain_text)
'An Agent leaves behind a Theme'
Classes¶
AnnotatedText
pydantic-model
¶
Bases: GlazingBaseModel
Text with embedded markup for frame elements and other references.
This model parses FrameNet's embedded markup in definitions, extracting
annotations like
| ATTRIBUTE | DESCRIPTION |
|---|---|
raw_text |
Original text with markup.
TYPE:
|
plain_text |
Text with markup removed.
TYPE:
|
annotations |
List of annotations found in the text.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
parse |
Parse text with markup and create AnnotatedText instance. |
get_annotations_by_type |
Get all annotations of a specific type. |
get_fe_references |
Get all frame element references. |
get_targets |
Get all target annotations. |
Examples:
>>> text = "An <fex>Agent</fex> leaves behind a <fex name='Theme'>thing</fex>"
>>> annotated = AnnotatedText.parse(text)
>>> print(annotated.plain_text)
'An Agent leaves behind a thing'
>>> print(len(annotated.annotations))
2
Fields:
-
raw_text(str) -
plain_text(str) -
annotations(list[TextAnnotation])
Attributes¶
annotations: list[TextAnnotation]
pydantic-field
¶
Annotations found in text
plain_text: str
pydantic-field
¶
Text with markup removed
raw_text: str
pydantic-field
¶
Original text with markup
Functions¶
get_annotations_by_type(markup_type: MarkupType) -> list[TextAnnotation]
¶
Get all annotations of a specific type.
| PARAMETER | DESCRIPTION |
|---|---|
markup_type
|
The type of annotations to retrieve.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[TextAnnotation]
|
List of annotations of the specified type. |
Source code in src/glazing/framenet/models.py
get_fe_references() -> list[TextAnnotation]
¶
Get all frame element references.
| RETURNS | DESCRIPTION |
|---|---|
list[TextAnnotation]
|
List of fex and fen annotations. |
Source code in src/glazing/framenet/models.py
get_targets() -> list[TextAnnotation]
¶
Get all target annotations.
| RETURNS | DESCRIPTION |
|---|---|
list[TextAnnotation]
|
List of target annotations. |
parse(text: str) -> Self
classmethod
¶
Parse text with embedded markup.
Extracts FrameNet markup tags like:
-
| PARAMETER | DESCRIPTION |
|---|---|
text
|
Text containing markup.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Self
|
Parsed AnnotatedText instance. |
Examples:
>>> text = "The <fex>Agent</fex> leaves the <fex name='Theme'>car</fex>"
>>> parsed = AnnotatedText.parse(text)
>>> print(parsed.plain_text)
'The Agent leaves the car'
Source code in src/glazing/framenet/models.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
AnnotationLayer
pydantic-model
¶
Bases: GlazingBaseModel
A layer of annotation (FE, GF, PT, Target, etc.).
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Layer type name.
TYPE:
|
rank |
Layer rank/priority.
TYPE:
|
labels |
Labels in this layer.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_labels_by_name |
Get all labels with a specific name. |
has_overlapping_labels |
Check if any labels in this layer overlap. |
get_label_count |
Get the number of labels in this layer. |
Examples:
Fields:
Attributes¶
labels: list[Label]
pydantic-field
¶
Labels in this layer
name: LayerType
pydantic-field
¶
Layer type name
rank: int = 1
pydantic-field
¶
Layer rank/priority
Functions¶
get_label_count() -> int
¶
Get the number of labels in this layer.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Number of labels. |
get_labels_by_name(name: str) -> list[Label]
¶
Get all labels with a specific name.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The label name to search for.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[Label]
|
List of matching labels. |
Source code in src/glazing/framenet/models.py
has_overlapping_labels() -> bool
¶
Check if any labels in this layer overlap.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if any labels overlap. |
Source code in src/glazing/framenet/models.py
AnnotationSet
pydantic-model
¶
Bases: GlazingBaseModel
A set of annotations on a sentence.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Annotation set identifier.
TYPE:
|
status |
Annotation completion status.
TYPE:
|
sentence_id |
ID of the annotated sentence.
TYPE:
|
layers |
Annotation layers in this set.
TYPE:
|
created_by |
Creator username.
TYPE:
|
created_date |
Creation timestamp.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_layer_by_name |
Get annotation layer by name. |
get_fe_layer |
Get the frame element layer. |
get_target_layer |
Get the target layer. |
has_layer |
Check if a specific layer exists. |
Examples:
>>> anno_set = AnnotationSet(
... id=123,
... status="MANUAL",
... sentence_id=456,
... layers=[...]
... )
Fields:
-
id(AnnotationSetID) -
status(AnnotationStatus) -
sentence_id(SentenceID) -
layers(list[AnnotationLayer]) -
created_by(Username | None) -
created_date(datetime | None)
Validators:
Attributes¶
created_by: Username | None = None
pydantic-field
¶
Creator username
created_date: datetime | None = None
pydantic-field
¶
Creation timestamp
id: AnnotationSetID
pydantic-field
¶
Annotation set identifier
layers: list[AnnotationLayer]
pydantic-field
¶
Annotation layers
sentence_id: SentenceID
pydantic-field
¶
ID of the annotated sentence
status: AnnotationStatus
pydantic-field
¶
Annotation completion status
Functions¶
get_fe_layer() -> AnnotationLayer | None
¶
Get the frame element layer.
| RETURNS | DESCRIPTION |
|---|---|
AnnotationLayer | None
|
The FE layer, or None if not found. |
get_layer_by_name(name: LayerType) -> AnnotationLayer | None
¶
Get annotation layer by name.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The layer name to find.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AnnotationLayer | None
|
The layer, or None if not found. |
Source code in src/glazing/framenet/models.py
get_target_layer() -> AnnotationLayer | None
¶
Get the target layer.
| RETURNS | DESCRIPTION |
|---|---|
AnnotationLayer | None
|
The Target layer, or None if not found. |
has_layer(layer_name: LayerType) -> bool
¶
Check if a specific layer exists.
| PARAMETER | DESCRIPTION |
|---|---|
layer_name
|
The layer name to check.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the layer exists. |
Source code in src/glazing/framenet/models.py
validate_created_by(v: str | None) -> str | None
pydantic-validator
¶
Validate creator username format.
Source code in src/glazing/framenet/models.py
FEGroupRealization
pydantic-model
¶
Bases: GlazingBaseModel
Realization of grouped FEs in a pattern.
| ATTRIBUTE | DESCRIPTION |
|---|---|
fe_names |
Frame element names in this group.
TYPE:
|
grammatical_function |
Grammatical function for the group.
TYPE:
|
phrase_type |
Phrase type for the group.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
contains_fe |
Check if group contains a specific FE. |
get_fe_count |
Get number of FEs in group. |
Examples:
>>> group = FEGroupRealization(
... fe_names=["Agent", "Theme"],
... grammatical_function="Ext",
... phrase_type="NP"
... )
Fields:
-
fe_names(list[str]) -
grammatical_function(GrammaticalFunction) -
phrase_type(PhraseType)
Validators:
Attributes¶
fe_names: list[str]
pydantic-field
¶
FE names in group
grammatical_function: GrammaticalFunction
pydantic-field
¶
Grammatical function
phrase_type: PhraseType
pydantic-field
¶
Phrase type
Functions¶
contains_fe(fe_name: str) -> bool
¶
Check if group contains a specific FE.
| PARAMETER | DESCRIPTION |
|---|---|
fe_name
|
FE name to check.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if FE is in this group. |
Source code in src/glazing/framenet/models.py
get_fe_count() -> int
¶
validate_fe_names(v: list[str]) -> list[str]
pydantic-validator
¶
Validate FE names in group.
Source code in src/glazing/framenet/models.py
FERealization
pydantic-model
¶
Bases: GlazingBaseModel
How a frame element is realized syntactically.
| ATTRIBUTE | DESCRIPTION |
|---|---|
fe_name |
Frame element name.
TYPE:
|
total |
Total occurrences of this FE.
TYPE:
|
patterns |
Realization patterns for this FE.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_most_frequent_pattern |
Get the most frequent realization pattern. |
has_patterns |
Check if this FE has realization patterns. |
get_pattern_count |
Get number of realization patterns. |
Examples:
Fields:
-
fe_name(str) -
total(int) -
patterns(list[ValenceRealizationPattern])
Validators:
Attributes¶
fe_name: str
pydantic-field
¶
Frame element name
patterns: list[ValenceRealizationPattern]
pydantic-field
¶
Realization patterns
total: int
pydantic-field
¶
Total occurrences
Functions¶
get_most_frequent_pattern() -> ValenceRealizationPattern | None
¶
Get the most frequent realization pattern.
| RETURNS | DESCRIPTION |
|---|---|
ValenceRealizationPattern | None
|
Most frequent pattern, or None if no patterns. |
Source code in src/glazing/framenet/models.py
get_pattern_count() -> int
¶
Get number of realization patterns.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Number of patterns. |
has_patterns() -> bool
¶
Check if this FE has realization patterns.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if patterns exist. |
validate_fe_name(v: str) -> str
pydantic-validator
¶
FERelation
pydantic-model
¶
Bases: GlazingBaseModel
FE mapping between related frames with alignment metadata.
| ATTRIBUTE | DESCRIPTION |
|---|---|
sub_fe_id |
ID of the sub-frame FE.
TYPE:
|
sub_fe_name |
Name of the sub-frame FE.
TYPE:
|
super_fe_id |
ID of the super-frame FE.
TYPE:
|
super_fe_name |
Name of the super-frame FE.
TYPE:
|
relation_type |
Type of FE relation.
TYPE:
|
alignment_confidence |
Confidence in the alignment.
TYPE:
|
semantic_similarity |
Semantic similarity score.
TYPE:
|
syntactic_similarity |
Syntactic similarity score.
TYPE:
|
mapping_notes |
Notes about the mapping.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
is_inheritance |
Check if this is an inheritance relation. |
is_equivalence |
Check if FEs are equivalent. |
get_combined_score |
Get combined confidence score. |
Examples:
>>> fe_rel = FERelation(
... sub_fe_name="Giver",
... super_fe_name="Agent",
... relation_type="Inheritance",
... alignment_confidence=0.95
... )
>>> print(fe_rel.is_inheritance())
True
Fields:
-
sub_fe_id(int | None) -
sub_fe_name(FEName | None) -
super_fe_id(int | None) -
super_fe_name(FEName | None) -
relation_type(FrameRelationSubType | None) -
alignment_confidence(MappingConfidenceScore | None) -
semantic_similarity(MappingConfidenceScore | None) -
syntactic_similarity(MappingConfidenceScore | None) -
mapping_notes(str | None)
Validators:
Attributes¶
alignment_confidence: MappingConfidenceScore | None = None
pydantic-field
¶
Alignment confidence
mapping_notes: str | None = None
pydantic-field
¶
Mapping notes
relation_type: FrameRelationSubType | None = None
pydantic-field
¶
Relation type
semantic_similarity: MappingConfidenceScore | None = None
pydantic-field
¶
Semantic similarity score
sub_fe_id: int | None = None
pydantic-field
¶
Sub-frame FE ID
sub_fe_name: FEName | None = None
pydantic-field
¶
Sub-frame FE name
super_fe_id: int | None = None
pydantic-field
¶
Super-frame FE ID
super_fe_name: FEName | None = None
pydantic-field
¶
Super-frame FE name
syntactic_similarity: MappingConfidenceScore | None = None
pydantic-field
¶
Syntactic similarity score
Functions¶
get_combined_score() -> float
¶
Get combined confidence score.
Combines alignment confidence with similarity scores.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Combined confidence score (0.0-1.0). |
Source code in src/glazing/framenet/models.py
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.
Source code in src/glazing/framenet/models.py
validate_fe_relation() -> Self
pydantic-validator
¶
Validate FE relation completeness.
Source code in src/glazing/framenet/models.py
Frame
pydantic-model
¶
Bases: GlazingBaseModel
A FrameNet frame representing a schematic situation.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Unique frame identifier.
TYPE:
|
name |
Human-readable frame name.
TYPE:
|
definition |
Frame definition with embedded markup.
TYPE:
|
frame_elements |
Core and non-core frame elements.
TYPE:
|
created_by |
Username of frame creator.
TYPE:
|
created_date |
Frame creation timestamp.
TYPE:
|
modified_date |
Last modification timestamp.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_fe_by_name |
Get frame element by name. |
get_core_elements |
Get all core frame elements. |
get_peripheral_elements |
Get all peripheral frame elements. |
validate_fe_constraints |
Validate a set of FEs against constraints. |
Examples:
>>> frame = Frame(
... id=2031,
... name="Abandonment",
... definition=AnnotatedText.parse("An <fex>Agent</fex> leaves behind..."),
... frame_elements=[]
... )
>>> print(frame.name)
'Abandonment'
Fields:
-
id(FrameID) -
name(FrameName) -
definition(AnnotatedText) -
frame_elements(list[FrameElement]) -
lexical_units(list[LexicalUnit]) -
frame_relations(list[FrameRelation]) -
created_by(Username | None) -
created_date(datetime | None) -
modified_date(datetime | None)
Validators:
Attributes¶
created_by: Username | None = None
pydantic-field
¶
Frame creator username
created_date: datetime | None = None
pydantic-field
¶
Creation timestamp
definition: AnnotatedText
pydantic-field
¶
Frame definition with markup
frame_elements: list[FrameElement]
pydantic-field
¶
Frame elements
frame_relations: list[FrameRelation]
pydantic-field
¶
Relations to other frames
id: FrameID
pydantic-field
¶
Unique frame identifier
lexical_units: list[LexicalUnit]
pydantic-field
¶
Lexical units in this frame
modified_date: datetime | None = None
pydantic-field
¶
Modification timestamp
name: FrameName
pydantic-field
¶
Human-readable frame name
Functions¶
get_core_elements() -> list[FrameElement]
¶
Get all core frame elements.
| RETURNS | DESCRIPTION |
|---|---|
list[FrameElement]
|
Frame elements with core_type "Core" or "Core-Unexpressed". |
Source code in src/glazing/framenet/models.py
get_fe_by_name(name: str) -> FrameElement | None
¶
Get frame element by name.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Name of the frame element.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
FrameElement | None
|
The frame element, or None if not found. |
Source code in src/glazing/framenet/models.py
get_peripheral_elements() -> list[FrameElement]
¶
Get all peripheral frame elements.
| RETURNS | DESCRIPTION |
|---|---|
list[FrameElement]
|
Frame elements with core_type "Peripheral" or "Extra-Thematic". |
Source code in src/glazing/framenet/models.py
validate_created_by(v: str | None) -> str | None
pydantic-validator
¶
Validate creator username format.
validate_fe_constraints(fe_names: list[str]) -> dict[str, list[str]]
¶
Validate a set of FEs against dependency constraints.
| PARAMETER | DESCRIPTION |
|---|---|
fe_names
|
Names of FEs to validate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, list[str]]
|
Dictionary with 'errors' and 'warnings' keys containing lists of constraint violation messages. |
Source code in src/glazing/framenet/models.py
validate_frame_elements() -> Self
pydantic-validator
¶
Validate frame element consistency.
Source code in src/glazing/framenet/models.py
validate_frame_name(v: str) -> str
pydantic-validator
¶
FrameElement
pydantic-model
¶
Bases: GlazingBaseModel
A participant or prop in a frame.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Unique FE identifier.
TYPE:
|
name |
Frame element name (validated pattern).
TYPE:
|
abbrev |
FE abbreviation (validated pattern).
TYPE:
|
definition |
Definition with embedded markup.
TYPE:
|
core_type |
Core classification of this FE.
TYPE:
|
bg_color |
Background color (6-digit hex).
TYPE:
|
fg_color |
Foreground color (6-digit hex).
TYPE:
|
requires_fe |
FE names that this FE requires.
TYPE:
|
excludes_fe |
FE names that this FE excludes.
TYPE:
|
semtype_refs |
Semantic type references.
TYPE:
|
created_by |
Username of creator.
TYPE:
|
created_date |
Creation timestamp.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
has_dependencies |
Check if this FE has dependency constraints. |
is_core |
Check if this is a core frame element. |
conflicts_with |
Check if this FE conflicts with another. |
Examples:
>>> fe = FrameElement(
... id=123,
... name="Agent",
... abbrev="Agt",
... definition=AnnotatedText.parse("The entity that performs an action"),
... core_type="Core",
... bg_color="FF0000",
... fg_color="FFFFFF"
... )
>>> print(fe.is_core())
True
Fields:
-
id(int) -
name(FEName) -
abbrev(FEAbbrev) -
definition(AnnotatedText) -
core_type(CoreType) -
bg_color(str) -
fg_color(str) -
requires_fe(list[FEName]) -
excludes_fe(list[FEName]) -
semtype_refs(list[SemTypeID]) -
created_by(Username | None) -
created_date(datetime | None)
Validators:
-
validate_fe_name→name -
validate_abbrev→abbrev -
validate_color→bg_color,fg_color -
validate_created_by→created_by -
validate_fe_lists→requires_fe,excludes_fe -
validate_fe_constraints
Attributes¶
abbrev: FEAbbrev
pydantic-field
¶
FE abbreviation
bg_color: str
pydantic-field
¶
Background color (6-digit hex)
core_type: CoreType
pydantic-field
¶
Core classification
created_by: Username | None = None
pydantic-field
¶
Creator username
created_date: datetime | None = None
pydantic-field
¶
Creation timestamp
definition: AnnotatedText
pydantic-field
¶
Definition with markup
excludes_fe: list[FEName]
pydantic-field
¶
FE names this FE excludes
fg_color: str
pydantic-field
¶
Foreground color (6-digit hex)
id: int
pydantic-field
¶
Unique FE identifier
name: FEName
pydantic-field
¶
Frame element name
requires_fe: list[FEName]
pydantic-field
¶
FE names this FE requires
semtype_refs: list[SemTypeID]
pydantic-field
¶
Semantic type references
Functions¶
conflicts_with(other_fe_name: str) -> bool
¶
Check if this FE conflicts with another.
| PARAMETER | DESCRIPTION |
|---|---|
other_fe_name
|
Name of the other FE to check.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if this FE excludes the other FE. |
Source code in src/glazing/framenet/models.py
has_dependencies() -> bool
¶
Check if this FE has dependency constraints.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the FE has requires or excludes constraints. |
Source code in src/glazing/framenet/models.py
is_core() -> bool
¶
Check if this is a core frame element.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if core_type is "Core" or "Core-Unexpressed". |
validate_abbrev(v: str) -> str
pydantic-validator
¶
validate_color(v: str) -> str
pydantic-validator
¶
validate_created_by(v: str | None) -> str | None
pydantic-validator
¶
Validate creator username format.
validate_fe_constraints() -> Self
pydantic-validator
¶
Validate FE constraint consistency.
Source code in src/glazing/framenet/models.py
validate_fe_lists(v: list[str]) -> list[str]
pydantic-validator
¶
Validate FE name lists.
Source code in src/glazing/framenet/models.py
validate_fe_name(v: str) -> str
pydantic-validator
¶
FrameIndexEntry
pydantic-model
¶
Bases: GlazingBaseModel
Entry in the frame index file.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Frame identifier.
TYPE:
|
name |
Frame name.
TYPE:
|
modified_date |
Last modification date.
TYPE:
|
Examples:
>>> entry = FrameIndexEntry(
... id=2031,
... name="Abandonment",
... modified_date=datetime.now()
... )
>>> print(entry.name)
'Abandonment'
Fields:
-
id(FrameID) -
name(FrameName) -
modified_date(datetime)
Validators:
FrameRelation
pydantic-model
¶
Bases: GlazingBaseModel
Relationship between frames.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Relation identifier.
TYPE:
|
type |
Type of frame relation.
TYPE:
|
sub_frame_id |
ID of the sub-frame.
TYPE:
|
sub_frame_name |
Name of the sub-frame.
TYPE:
|
super_frame_id |
ID of the super-frame.
TYPE:
|
super_frame_name |
Name of the super-frame.
TYPE:
|
fe_relations |
FE-level mappings for this relation.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
is_inheritance |
Check if this is an inheritance relation. |
get_fe_mapping |
Get FE mapping for a sub-frame FE. |
Examples:
>>> frame_rel = FrameRelation(
... type="Inherits from",
... sub_frame_name="Giving",
... super_frame_name="Transfer",
... fe_relations=[]
... )
>>> print(frame_rel.is_inheritance())
True
Fields:
-
id(int | None) -
type(FrameRelationType) -
sub_frame_id(FrameID | None) -
sub_frame_name(FrameName | None) -
super_frame_id(FrameID | None) -
super_frame_name(FrameName | None) -
fe_relations(list[FERelation])
Validators:
Attributes¶
fe_relations: list[FERelation]
pydantic-field
¶
FE-level mappings
id: int | None = None
pydantic-field
¶
Relation identifier
sub_frame_id: FrameID | None = None
pydantic-field
¶
Sub-frame ID
sub_frame_name: FrameName | None = None
pydantic-field
¶
Sub-frame name
super_frame_id: FrameID | None = None
pydantic-field
¶
Super-frame ID
super_frame_name: FrameName | None = None
pydantic-field
¶
Super-frame name
type: FrameRelationType
pydantic-field
¶
Frame relation type
Functions¶
get_fe_mapping(sub_fe_name: str) -> FERelation | None
¶
Get FE mapping for a sub-frame FE.
| PARAMETER | DESCRIPTION |
|---|---|
sub_fe_name
|
Name of the sub-frame FE.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
FERelation | None
|
The FE relation, or None if not found. |
Source code in src/glazing/framenet/models.py
is_inheritance() -> bool
¶
Check if this is an inheritance relation.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if type is "Inherits from" or "Is Inherited by". |
validate_frame_names(v: str | None) -> str | None
pydantic-validator
¶
Validate frame name format.
Source code in src/glazing/framenet/models.py
Label
pydantic-model
¶
Bases: GlazingBaseModel
An annotation label on a text span.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Label identifier.
TYPE:
|
name |
Label name (FE name, GF type, PT type, etc.).
TYPE:
|
start |
Start position in sentence.
TYPE:
|
end |
End position in sentence.
TYPE:
|
fe_id |
Frame element ID for FE labels.
TYPE:
|
is_instantiated_null |
True for null instantiation labels.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_span_length |
Get the length of the labeled span. |
is_null_instantiation |
Check if this is a null instantiation. |
overlaps_with |
Check if this label overlaps with another. |
Examples:
Fields:
Validators:
Attributes¶
end: int
pydantic-field
¶
End position in sentence
fe_id: int | None = None
pydantic-field
¶
Frame element ID for FE labels
id: LabelID | None = None
pydantic-field
¶
Label identifier
is_instantiated_null: bool = False
pydantic-field
¶
Null instantiation flag
name: str
pydantic-field
¶
Label name
start: int
pydantic-field
¶
Start position in sentence
Functions¶
get_span_length() -> int
¶
Get the length of the labeled span.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Length of the span. |
is_null_instantiation() -> bool
¶
Check if this is a null instantiation.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if is_instantiated_null is True. |
overlaps_with(other: Label) -> bool
¶
Check if this label overlaps with another.
| PARAMETER | DESCRIPTION |
|---|---|
other
|
The other label to check.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the labels overlap. |
Source code in src/glazing/framenet/models.py
validate_positions() -> Self
pydantic-validator
¶
Validate that end position is at or after start position.
Source code in src/glazing/framenet/models.py
Lexeme
pydantic-model
¶
Bases: GlazingBaseModel
A lexical form in a lexical unit.
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
The word form (validated pattern).
TYPE:
|
pos |
Part of speech tag.
TYPE:
|
headword |
True if this is the head word of the LU.
TYPE:
|
break_before |
True if there should be a break before this lexeme.
TYPE:
|
order |
Order position in multi-word LUs.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
is_headword |
Check if this is the headword. |
Examples:
Fields:
-
name(str) -
pos(FrameNetPOS) -
headword(bool) -
break_before(bool) -
order(int)
Validators:
Attributes¶
break_before: bool = False
pydantic-field
¶
Break before this lexeme
headword: bool = False
pydantic-field
¶
True if this is the head word
name: str
pydantic-field
¶
The word form
order: int = 1
pydantic-field
¶
Order position in multi-word LUs
pos: FrameNetPOS
pydantic-field
¶
Part of speech
Functions¶
is_headword() -> bool
¶
Check if this is the headword.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if this lexeme is marked as headword. |
validate_lexeme_name(v: str) -> str
pydantic-validator
¶
Validate lexeme name (individual word form).
LexicalUnit
pydantic-model
¶
Bases: GlazingBaseModel
A word or phrase that evokes a frame.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Unique lexical unit identifier.
TYPE:
|
lemma_id |
Lemma identifier.
TYPE:
|
name |
LU name in lemma.pos format (validated).
TYPE:
|
pos |
Part of speech tag.
TYPE:
|
definition |
LU definition (may have COD: or FN: prefix).
TYPE:
|
annotation_status |
Annotation completion status.
TYPE:
|
total_annotated |
Total number of annotated instances.
TYPE:
|
has_annotated_examples |
Whether this LU has annotated examples.
TYPE:
|
frame_id |
ID of the frame this LU evokes.
TYPE:
|
frame_name |
Name of the frame this LU evokes.
TYPE:
|
sentence_count |
Sentence frequency information.
TYPE:
|
lexemes |
Individual word forms in this LU.
TYPE:
|
semtypes |
Semantic type references.
TYPE:
|
valence_patterns |
Syntactic valence patterns.
TYPE:
|
annotation_sets |
Annotation sets for this LU.
TYPE:
|
created_by |
Creator username.
TYPE:
|
created_date |
Creation timestamp.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_headword_lexeme |
Get the headword lexeme. |
has_valence_patterns |
Check if LU has valence patterns. |
get_annotation_rate |
Get sentence annotation completion rate. |
is_multi_word |
Check if this is a multi-word LU. |
get_most_frequent_valence |
Get most frequent valence pattern. |
Examples:
>>> lu = LexicalUnit(
... id=1234,
... name="abandon.v",
... pos="V",
... definition="To leave behind permanently",
... frame_id=2031,
... frame_name="Abandonment",
... sentence_count=SentenceCount(annotated=50, total=100),
... lexemes=[Lexeme(name="abandon", pos="V", headword=True)]
... )
>>> print(lu.get_annotation_rate())
0.5
Fields:
-
id(LexicalUnitID) -
lemma_id(int | None) -
name(LexicalUnitName) -
pos(FrameNetPOS) -
definition(str) -
annotation_status(AnnotationStatus | None) -
total_annotated(int | None) -
has_annotated_examples(bool) -
frame_id(FrameID) -
frame_name(FrameName) -
sentence_count(SentenceCount) -
lexemes(list[Lexeme]) -
semtypes(list[SemTypeRef]) -
valence_patterns(list[ValencePattern]) -
annotation_sets(list[AnnotationSet]) -
created_by(Username | None) -
created_date(datetime | None)
Validators:
-
validate_lu_name→name -
validate_definition→definition -
validate_frame_name→frame_name -
validate_created_by→created_by -
validate_lu_consistency
Attributes¶
annotation_sets: list[AnnotationSet]
pydantic-field
¶
Annotation sets
annotation_status: AnnotationStatus | None = None
pydantic-field
¶
Annotation completion status
created_by: Username | None = None
pydantic-field
¶
Creator username
created_date: datetime | None = None
pydantic-field
¶
Creation timestamp
definition: str
pydantic-field
¶
LU definition
frame_id: FrameID
pydantic-field
¶
Frame ID this LU evokes
frame_name: FrameName
pydantic-field
¶
Frame name this LU evokes
has_annotated_examples: bool = False
pydantic-field
¶
Whether this LU has annotated examples
id: LexicalUnitID
pydantic-field
¶
Unique lexical unit identifier
lemma_id: int | None = None
pydantic-field
¶
Lemma identifier
lexemes: list[Lexeme]
pydantic-field
¶
Individual word forms
name: LexicalUnitName
pydantic-field
¶
LU name (lemma.pos format)
pos: FrameNetPOS
pydantic-field
¶
Part of speech tag
semtypes: list[SemTypeRef]
pydantic-field
¶
Semantic type references
sentence_count: SentenceCount
pydantic-field
¶
Sentence frequency information
total_annotated: int | None = None
pydantic-field
¶
Total annotated instances
valence_patterns: list[ValencePattern]
pydantic-field
¶
Syntactic valence patterns
Functions¶
get_annotation_rate() -> float
¶
Get sentence annotation completion rate.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Annotation rate from sentence count (0.0-1.0). |
get_annotation_set_by_id(anno_id: AnnotationSetID) -> AnnotationSet | None
¶
Get annotation set by ID.
| PARAMETER | DESCRIPTION |
|---|---|
anno_id
|
Annotation set ID to find.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AnnotationSet | None
|
The annotation set, or None if not found. |
Source code in src/glazing/framenet/models.py
get_headword_lexeme() -> Lexeme | None
¶
Get the headword lexeme.
| RETURNS | DESCRIPTION |
|---|---|
Lexeme | None
|
The headword lexeme, or None if none found. |
Source code in src/glazing/framenet/models.py
get_most_frequent_valence() -> ValencePattern | None
¶
Get most frequent valence pattern.
| RETURNS | DESCRIPTION |
|---|---|
ValencePattern | None
|
Most frequent pattern, or None if no patterns. |
Source code in src/glazing/framenet/models.py
has_valence_patterns() -> bool
¶
Check if LU has valence patterns.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if valence patterns exist. |
is_multi_word() -> bool
¶
Check if this is a multi-word LU.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if LU contains multiple lexemes. |
validate_created_by(v: str | None) -> str | None
pydantic-validator
¶
Validate creator username format.
Source code in src/glazing/framenet/models.py
validate_definition(v: str) -> str
pydantic-validator
¶
Parse and validate definition with optional prefix.
Source code in src/glazing/framenet/models.py
validate_frame_name(v: str) -> str
pydantic-validator
¶
validate_lu_consistency() -> Self
pydantic-validator
¶
Validate lexical unit consistency.
Source code in src/glazing/framenet/models.py
validate_lu_name(v: str) -> str
pydantic-validator
¶
Validate LU name format (e.g., 'abandon.v', 'give_up.v').
SemTypeRef
pydantic-model
¶
Bases: GlazingBaseModel
Reference to a semantic type with name and ID.
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Semantic type name.
TYPE:
|
id |
Semantic type ID.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
is_valid_name |
Check if the name follows semantic type naming conventions. |
Examples:
Fields:
Validators:
Attributes¶
id: SemTypeID
pydantic-field
¶
Semantic type ID
name: str
pydantic-field
¶
Semantic type name
Functions¶
is_valid_name() -> bool
¶
Check if the name follows standard semantic type naming conventions.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if name follows standard pattern. |
Source code in src/glazing/framenet/models.py
validate_name(v: str) -> str
pydantic-validator
¶
Validate semantic type name format.
Source code in src/glazing/framenet/models.py
SemanticType
pydantic-model
¶
Bases: GlazingBaseModel
Semantic type in the FrameNet type system.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Semantic type identifier.
TYPE:
|
name |
Type name.
TYPE:
|
abbrev |
Type abbreviation.
TYPE:
|
definition |
Type definition.
TYPE:
|
super_type_id |
Parent type ID.
TYPE:
|
super_type_name |
Parent type name.
TYPE:
|
root_type_id |
Root type ID.
TYPE:
|
root_type_name |
Root type name.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
is_root_type |
Check if this is a root semantic type. |
get_depth |
Get depth in the type hierarchy. |
Examples:
>>> sem_type = SemanticType(
... id=123,
... name="Sentient",
... abbrev="sent",
... definition="Capable of perception and feeling"
... )
>>> print(sem_type.is_root_type())
True
Fields:
-
id(SemTypeID) -
name(str) -
abbrev(str) -
definition(str) -
super_type_id(SemTypeID | None) -
super_type_name(str | None) -
root_type_id(SemTypeID | None) -
root_type_name(str | None)
Validators:
Attributes¶
abbrev: str
pydantic-field
¶
Type abbreviation
definition: str
pydantic-field
¶
Type definition
id: SemTypeID
pydantic-field
¶
Semantic type identifier
name: str
pydantic-field
¶
Type name
root_type_id: SemTypeID | None = None
pydantic-field
¶
Root type ID
root_type_name: str | None = None
pydantic-field
¶
Root type name
super_type_id: SemTypeID | None = None
pydantic-field
¶
Parent type ID
super_type_name: str | None = None
pydantic-field
¶
Parent type name
Functions¶
get_depth() -> int
¶
Get depth in the type hierarchy.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Depth (0 for root types, 1 for direct children, etc.). |
Source code in src/glazing/framenet/models.py
is_root_type() -> bool
¶
Check if this is a root semantic type.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if this type has no super type. |
validate_type_hierarchy() -> Self
pydantic-validator
¶
Validate semantic type hierarchy consistency.
Source code in src/glazing/framenet/models.py
Sentence
pydantic-model
¶
Bases: GlazingBaseModel
A sentence with its annotations.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Sentence identifier.
TYPE:
|
text |
The sentence text.
TYPE:
|
paragraph_no |
Paragraph number in document.
TYPE:
|
sentence_no |
Sentence number in paragraph.
TYPE:
|
doc_id |
Document identifier.
TYPE:
|
corpus_id |
Corpus identifier.
TYPE:
|
apos |
Absolute position in document.
TYPE:
|
annotation_sets |
Annotation sets for this sentence.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_annotation_set_by_id |
Get annotation set by ID. |
has_annotations |
Check if sentence has any annotations. |
get_annotation_count |
Get number of annotation sets. |
Examples:
>>> sentence = Sentence(
... id=123,
... text="John abandoned the car.",
... paragraph_no=1,
... sentence_no=1
... )
Fields:
-
id(SentenceID) -
text(str) -
paragraph_no(int | None) -
sentence_no(int | None) -
doc_id(DocumentID | None) -
corpus_id(CorpusID | None) -
apos(int | None) -
annotation_sets(list[AnnotationSet])
Attributes¶
annotation_sets: list[AnnotationSet]
pydantic-field
¶
Annotation sets
apos: int | None = None
pydantic-field
¶
Absolute position in document
corpus_id: CorpusID | None = None
pydantic-field
¶
Corpus identifier
doc_id: DocumentID | None = None
pydantic-field
¶
Document identifier
id: SentenceID
pydantic-field
¶
Sentence identifier
paragraph_no: int | None = None
pydantic-field
¶
Paragraph number
sentence_no: int | None = None
pydantic-field
¶
Sentence number
text: str
pydantic-field
¶
The sentence text
Functions¶
get_annotation_count() -> int
¶
Get number of annotation sets.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Number of annotation sets. |
get_annotation_set_by_id(anno_id: AnnotationSetID) -> AnnotationSet | None
¶
Get annotation set by ID.
| PARAMETER | DESCRIPTION |
|---|---|
anno_id
|
The annotation set ID to find.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
AnnotationSet | None
|
The annotation set, or None if not found. |
Source code in src/glazing/framenet/models.py
has_annotations() -> bool
¶
Check if sentence has any annotations.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if there are annotation sets. |
SentenceCount
pydantic-model
¶
Bases: GlazingBaseModel
Frequency counts for annotated sentences.
| ATTRIBUTE | DESCRIPTION |
|---|---|
annotated |
Number of annotated sentences.
TYPE:
|
total |
Total number of sentences.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_annotation_rate |
Calculate the annotation completion rate. |
has_annotations |
Check if any sentences are annotated. |
Examples:
Fields:
Validators:
Attributes¶
annotated: int = 0
pydantic-field
¶
Number of annotated sentences
total: int = 0
pydantic-field
¶
Total number of sentences
Functions¶
get_annotation_rate() -> float
¶
Calculate the annotation completion rate.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Completion rate (0.0-1.0), or 0.0 if no total sentences. |
Source code in src/glazing/framenet/models.py
has_annotations() -> bool
¶
Check if any sentences are annotated.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if annotated count > 0. |
validate_counts() -> Self
pydantic-validator
¶
Validate that annotated count doesn't exceed total.
Source code in src/glazing/framenet/models.py
TextAnnotation
pydantic-model
¶
Bases: GlazingBaseModel
An annotation within text (FE reference, target, example, etc.).
| ATTRIBUTE | DESCRIPTION |
|---|---|
start |
Start position in plain text (0-based).
TYPE:
|
end |
End position in plain text (exclusive).
TYPE:
|
type |
Type of annotation markup.
TYPE:
|
name |
For FE references - validated as alphanumeric + underscore.
TYPE:
|
ref_id |
ID of referenced element.
TYPE:
|
text |
The annotated text span.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_length |
Get the length of the annotation span. |
overlaps_with |
Check if this annotation overlaps with another. |
Examples:
>>> annotation = TextAnnotation(
... start=3, end=8, type="fex", name="Agent", text="Agent"
... )
>>> print(annotation.get_length())
5
Fields:
Validators:
Attributes¶
end: int
pydantic-field
¶
End position in plain text
name: str | None = None
pydantic-field
¶
FE name for fex/fen annotations
ref_id: int | None = None
pydantic-field
¶
ID of referenced element
start: int
pydantic-field
¶
Start position in plain text
text: str
pydantic-field
¶
The annotated text span
Functions¶
get_length() -> int
¶
Get the length of the annotation span.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Length of the text span. |
overlaps_with(other: TextAnnotation) -> bool
¶
Check if this annotation overlaps with another.
| PARAMETER | DESCRIPTION |
|---|---|
other
|
The other annotation to check.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the annotations overlap. |
Source code in src/glazing/framenet/models.py
validate_annotation_requirements() -> Self
pydantic-validator
¶
Validate annotation type-specific requirements.
Source code in src/glazing/framenet/models.py
validate_name(v: str | None) -> str | None
pydantic-validator
¶
Validate FE reference names.
Source code in src/glazing/framenet/models.py
validate_positions() -> Self
pydantic-validator
¶
Validate that end position is at or after start position.
Source code in src/glazing/framenet/models.py
ValenceAnnotationPattern
pydantic-model
¶
Bases: GlazingBaseModel
A specific valence pattern with annotated examples.
| ATTRIBUTE | DESCRIPTION |
|---|---|
anno_sets |
References to annotation sets.
TYPE:
|
pattern |
FE group realizations in this pattern.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_annotation_count |
Get number of annotation sets. |
get_fe_groups |
Get all FE groups in pattern. |
Examples:
>>> pattern = ValenceAnnotationPattern(
... anno_sets=[1, 2, 3],
... pattern=[FEGroupRealization(...)]
... )
Fields:
-
anno_sets(list[AnnotationSetID]) -
pattern(list[FEGroupRealization])
Attributes¶
anno_sets: list[AnnotationSetID]
pydantic-field
¶
Annotation set references
pattern: list[FEGroupRealization]
pydantic-field
¶
FE group realizations
Functions¶
get_annotation_count() -> int
¶
Get number of annotation sets.
| RETURNS | DESCRIPTION |
|---|---|
int
|
Number of annotation sets. |
get_fe_groups() -> list[FEGroupRealization]
¶
Get all FE groups in pattern.
| RETURNS | DESCRIPTION |
|---|---|
list[FEGroupRealization]
|
List of FE group realizations. |
ValencePattern
pydantic-model
¶
Bases: GlazingBaseModel
Syntactic valence pattern for a lexical unit.
| ATTRIBUTE | DESCRIPTION |
|---|---|
total_annotated |
Total number of annotated instances.
TYPE:
|
fe_realizations |
How frame elements are realized.
TYPE:
|
patterns |
Specific valence patterns with examples.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_fe_realization |
Get realization info for a specific FE. |
get_most_frequent_fe |
Get the most frequently realized FE. |
has_fe_realizations |
Check if FE realizations exist. |
Examples:
>>> valence = ValencePattern(
... total_annotated=100,
... fe_realizations=[...],
... patterns=[...]
... )
Fields:
-
total_annotated(int) -
fe_realizations(list[FERealization]) -
patterns(list[ValenceAnnotationPattern])
Attributes¶
fe_realizations: list[FERealization]
pydantic-field
¶
FE realizations
patterns: list[ValenceAnnotationPattern]
pydantic-field
¶
Valence annotation patterns
total_annotated: int
pydantic-field
¶
Total annotated instances
Functions¶
get_fe_realization(fe_name: str) -> FERealization | None
¶
Get realization info for a specific FE.
| PARAMETER | DESCRIPTION |
|---|---|
fe_name
|
Frame element name.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
FERealization | None
|
FE realization, or None if not found. |
Source code in src/glazing/framenet/models.py
get_most_frequent_fe() -> FERealization | None
¶
Get the most frequently realized FE.
| RETURNS | DESCRIPTION |
|---|---|
FERealization | None
|
Most frequent FE, or None if no realizations. |
Source code in src/glazing/framenet/models.py
has_fe_realizations() -> bool
¶
Check if FE realizations exist.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if there are FE realizations. |
ValenceRealizationPattern
pydantic-model
¶
Bases: GlazingBaseModel
A specific realization pattern for an FE.
| ATTRIBUTE | DESCRIPTION |
|---|---|
valence_units |
Valence units in this pattern.
TYPE:
|
anno_set_ids |
Annotation set IDs supporting this pattern.
TYPE:
|
total |
Frequency count for this pattern.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_pattern_signature |
Get a string signature for this pattern. |
has_null_instantiation |
Check if pattern includes null instantiation. |
Examples:
>>> pattern = ValenceRealizationPattern(
... valence_units=[ValenceUnit(gf="Ext", pt="NP", fe="Agent")],
... anno_set_ids=[1, 2, 3],
... total=3
... )
Fields:
-
valence_units(list[ValenceUnit]) -
anno_set_ids(list[int]) -
total(int)
Validators:
Attributes¶
anno_set_ids: list[int]
pydantic-field
¶
Supporting annotation set IDs
total: int
pydantic-field
¶
Frequency count
valence_units: list[ValenceUnit]
pydantic-field
¶
Valence units in pattern
Functions¶
get_pattern_signature() -> str
¶
Get a string signature for this pattern.
| RETURNS | DESCRIPTION |
|---|---|
str
|
Pattern signature like "Ext:NP:Agent|Obj:NP:Theme". |
Source code in src/glazing/framenet/models.py
has_null_instantiation() -> bool
¶
Check if pattern includes null instantiation.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if any valence unit is null instantiation. |
Source code in src/glazing/framenet/models.py
validate_consistency() -> Self
pydantic-validator
¶
Validate pattern consistency.
ValenceUnit
pydantic-model
¶
Bases: GlazingBaseModel
A valence unit in a realization pattern.
| ATTRIBUTE | DESCRIPTION |
|---|---|
gf |
Grammatical function (can be empty string or special values).
TYPE:
|
pt |
Phrase type or special values.
TYPE:
|
fe |
Frame element name.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
is_null_instantiation |
Check if this represents null instantiation. |
has_grammatical_function |
Check if a grammatical function is specified. |
Examples:
>>> unit = ValenceUnit(gf="Ext", pt="NP", fe="Agent")
>>> print(unit.has_grammatical_function())
True
Fields:
Validators:
-
validate_gf→gf -
validate_pt→pt
Attributes¶
fe: str
pydantic-field
¶
Frame element name
gf: GrammaticalFunction | str
pydantic-field
¶
Grammatical function
pt: PhraseType | str
pydantic-field
¶
Phrase type
Functions¶
has_grammatical_function() -> bool
¶
Check if a grammatical function is specified.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if GF is not empty. |
is_null_instantiation() -> bool
¶
Check if this represents null instantiation.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if this is a null instantiation pattern. |
validate_gf(v: str) -> str
pydantic-validator
¶
Validate grammatical function.
Source code in src/glazing/framenet/models.py
validate_pt(v: str) -> str
pydantic-validator
¶
Validate phrase type.