Skip to content

glazing.framenet

FrameNet data models and utilities.

Overview

The FrameNet module provides models for semantic frames, frame elements, lexical units, and their relationships. It supports the complete FrameNet annotation model including multi-layer annotations and valence patterns.

Modules

  • Models - Core data models (Frame, FrameElement, etc.)
  • Loader - Loading FrameNet data from JSON Lines
  • Converter - Converting from FrameNet XML format
  • Search - Searching FrameNet data

Quick Example

from glazing.framenet.loader import FrameNetLoader
from pathlib import Path

loader = FrameNetLoader()
frames = loader.load_frames(Path("data/framenet.jsonl"))

# Find a specific frame
giving_frame = next(
    (f for f in frames if f.name == "Giving"),
    None
)

framenet

FrameNet data models and utilities.

This module provides models for FrameNet semantic frames, frame elements, lexical units, and their relationships. It supports the complete FrameNet annotation model including multi-layer annotations and valence patterns.

CLASS DESCRIPTION
Frame

A semantic frame representing a schematic situation.

FrameElement

A participant or prop in a frame.

LexicalUnit

A word or phrase that evokes a frame.

FrameRelation

Relationships between frames.

FUNCTION DESCRIPTION
load

Load FrameNet data from JSON Lines.

Examples:

>>> from frames.framenet import load
>>> fn = load("data/framenet.jsonl")
>>> frame = fn.get_frame("Giving")
>>> print(frame.definition)