Skip to content

glazing.verbnet.gl_models

Generative Lexicon semantic models.

gl_models

VerbNet Generative Lexicon (GL) models.

This module implements VerbNet-GL extensions that enhance VerbNet with Generative Lexicon features including event structure, qualia, and opposition structures for deeper semantic representations.

CLASS DESCRIPTION
GLVerbClass

VerbNet class with Generative Lexicon features.

GLFrame

Frame with GL event structure and qualia.

Subcategorization

GL subcategorization with variable assignments.

SubcatMember

Subcategorization member with variable.

EventStructure

Temporal event decomposition.

Event

Single event in event structure.

Subevent

Subevent with temporal relations.

Qualia

Qualia structure for frame semantics.

Opposition

Semantic opposition structure.

State

State in opposition structure.

Examples:

>>> from glazing.verbnet.gl_models import GLVerbClass, GLFrame
>>> gl_class = GLVerbClass(
...     verb_class=verb_class,
...     gl_frames=[]
... )

Classes

Event pydantic-model

Bases: GlazingBaseModel

Single event in event structure.

ATTRIBUTE DESCRIPTION
id

Event identifier (e.g., "e1", "e2").

TYPE: str

type

Event type (e.g., "process", "state", "transition").

TYPE: EventType

participants

Mapping from roles to variables.

TYPE: dict[str, str]

Examples:

>>> event = Event(
...     id="e1",
...     type="process",
...     participants={"Agent": "x", "Theme": "y"}
... )

Fields:

  • id (str)
  • type (EventType)
  • participants (dict[str, str])

EventStructure pydantic-model

Bases: GlazingBaseModel

Temporal event decomposition.

ATTRIBUTE DESCRIPTION
events

List of events.

TYPE: list[Event]

subevents

List of subevents with temporal relations.

TYPE: list[Subevent], default=[]

Examples:

>>> event_structure = EventStructure(
...     events=[Event(id="e1", type="process", participants={})],
...     subevents=[]
... )

Fields:

GLFrame pydantic-model

Bases: GlazingBaseModel

Frame with GL event structure and qualia.

ATTRIBUTE DESCRIPTION
vn_frame

Base VerbNet frame.

TYPE: VNFrame

subcat

Subcategorization with variable assignments.

TYPE: Subcategorization

qualia

Qualia structure.

TYPE: Qualia | None, default=None

event_structure

Event structure decomposition.

TYPE: EventStructure

opposition

Opposition structure.

TYPE: Opposition | None, default=None

Examples:

>>> gl_frame = GLFrame(
...     vn_frame=vn_frame,
...     subcat=Subcategorization(members=[]),
...     event_structure=EventStructure(events=[]),
...     qualia=None,
...     opposition=None
... )

Fields:

GLVerbClass pydantic-model

Bases: GlazingBaseModel

VerbNet class with Generative Lexicon features.

ATTRIBUTE DESCRIPTION
verb_class

Base VerbNet class.

TYPE: VerbClass

gl_frames

List of GL frames.

TYPE: list[GLFrame]

METHOD DESCRIPTION
is_motion_class

Check if this is a motion verb class.

is_change_of_possession_class

Check if this involves possession transfer.

is_change_of_info_class

Check if this involves information transfer.

Examples:

>>> gl_class = GLVerbClass(
...     verb_class=verb_class,
...     gl_frames=[]
... )
>>> is_motion = gl_class.is_motion_class()

Fields:

Functions
is_change_of_info_class() -> bool

Check if this involves information transfer.

RETURNS DESCRIPTION
bool

True if frames involve information transfer.

Source code in src/glazing/verbnet/gl_models.py
def is_change_of_info_class(self) -> bool:
    """Check if this involves information transfer.

    Returns
    -------
    bool
        True if frames involve information transfer.
    """
    for frame in self.gl_frames:
        if frame.opposition and frame.opposition.type == "info_transfer":
            return True
        # Check qualia for communication-related telic
        if (
            frame.qualia
            and frame.qualia.telic
            and (
                "communicate" in frame.qualia.telic.lower()
                or "inform" in frame.qualia.telic.lower()
            )
        ):
            return True
    return False
is_change_of_possession_class() -> bool

Check if this involves possession transfer.

RETURNS DESCRIPTION
bool

True if frames involve possession transfer.

Source code in src/glazing/verbnet/gl_models.py
def is_change_of_possession_class(self) -> bool:
    """Check if this involves possession transfer.

    Returns
    -------
    bool
        True if frames involve possession transfer.
    """
    for frame in self.gl_frames:
        if frame.opposition and frame.opposition.type == "possession_transfer":
            return True
        # Check for possession-related roles
        if frame.subcat:
            roles = {m.role for m in frame.subcat.members}
            if "Recipient" in roles or "Beneficiary" in roles:
                return True
    return False
is_motion_class() -> bool

Check if this is a motion verb class.

RETURNS DESCRIPTION
bool

True if any frame has motion-related semantics or opposition.

Source code in src/glazing/verbnet/gl_models.py
def is_motion_class(self) -> bool:
    """Check if this is a motion verb class.

    Returns
    -------
    bool
        True if any frame has motion-related semantics or opposition.
    """
    for frame in self.gl_frames:
        # Check opposition type
        if frame.opposition and frame.opposition.type == "motion":
            return True
        # Check event types
        if frame.event_structure:
            for event in frame.event_structure.events:
                if event.type in ["process", "transition"] and (
                    "Source" in event.participants or "Goal" in event.participants
                ):
                    return True
    return False

Opposition pydantic-model

Bases: GlazingBaseModel

Semantic opposition structure.

ATTRIBUTE DESCRIPTION
type

Type of opposition (e.g., "motion", "state_change").

TYPE: OppositionType

initial_state

The initial state.

TYPE: State

final_state

The final state.

TYPE: State

Examples:

>>> opposition = Opposition(
...     type="motion",
...     initial_state=State(predicate="at_location", args=["x", "source"]),
...     final_state=State(predicate="at_location", args=["x", "goal"])
... )

Fields:

  • type (OppositionType)
  • initial_state (State)
  • final_state (State)

Qualia pydantic-model

Bases: GlazingBaseModel

Qualia structure for frame semantics.

ATTRIBUTE DESCRIPTION
formal

What type of thing it is.

TYPE: str | None, default=None

constitutive

What it's made of.

TYPE: str | None, default=None

telic

Purpose or function.

TYPE: str | None, default=None

agentive

How it comes about.

TYPE: str | None, default=None

Examples:

>>> qualia = Qualia(
...     formal="object",
...     constitutive="material",
...     telic="transport",
...     agentive="manufacture"
... )

Fields:

  • formal (str | None)
  • constitutive (str | None)
  • telic (str | None)
  • agentive (str | None)

State pydantic-model

Bases: GlazingBaseModel

State in opposition structure.

ATTRIBUTE DESCRIPTION
predicate

The state predicate.

TYPE: str

args

Arguments to the state predicate.

TYPE: list[str]

negated

Whether the state is negated.

TYPE: bool, default=False

Examples:

>>> state = State(
...     predicate="at_location",
...     args=["x", "y"],
...     negated=False
... )

Fields:

  • predicate (str)
  • args (list[str])
  • negated (bool)

SubcatMember pydantic-model

Bases: GlazingBaseModel

Subcategorization member with variable.

ATTRIBUTE DESCRIPTION
role

Thematic role name.

TYPE: ThematicRoleType

variable

Variable assignment (e.g., "x", "y", "z").

TYPE: GLVariable

pos

Part of speech.

TYPE: GLSubcatPOS

prep

Preposition for PP roles.

TYPE: PrepositionValue | None, default=None

Examples:

>>> member = SubcatMember(
...     role="Agent",
...     variable="x",
...     pos="NP"
... )

Fields:

  • role (ThematicRoleType)
  • variable (GLVariable)
  • pos (GLSubcatPOS)
  • prep (PrepositionValue | None)

Subcategorization pydantic-model

Bases: GlazingBaseModel

GL subcategorization with variable assignments.

ATTRIBUTE DESCRIPTION
members

List of subcategorization members.

TYPE: list[SubcatMember]

Examples:

>>> subcat = Subcategorization(members=[
...     SubcatMember(role="Agent", variable="x", pos="NP"),
...     SubcatMember(role="Theme", variable="y", pos="NP")
... ])

Fields:

Subevent pydantic-model

Bases: GlazingBaseModel

Subevent with temporal relations.

ATTRIBUTE DESCRIPTION
id

Subevent identifier.

TYPE: str

parent_event

Parent event identifier.

TYPE: str

relation

Temporal relation (e.g., "starts", "culminates", "results").

TYPE: GLTemporalRelation

predicate

Subevent predicate.

TYPE: str

args

Arguments to the subevent.

TYPE: list[str]

Examples:

>>> subevent = Subevent(
...     id="e1.1",
...     parent_event="e1",
...     relation="starts",
...     predicate="motion",
...     args=["x", "source", "goal"]
... )

Fields:

  • id (str)
  • parent_event (str)
  • relation (GLTemporalRelation)
  • predicate (str)
  • args (list[str])