Skip to main content

Unified data models and interfaces for syntactic and semantic frame ontologies

Project description

Glazing

PyPI version Python versions CI Documentation License DOI

Unified data models and interfaces for syntactic and semantic frame ontologies.

Features

  • 🚀 One-command setup: glazing init downloads and prepares all datasets
  • 📦 Type-safe models: Pydantic v2 validation for all data structures
  • 🔍 Unified search: Query across all datasets with consistent API
  • 🔗 Cross-references: Automatic mapping between resources
  • 💾 Efficient storage: JSON Lines format with streaming support
  • 🐍 Modern Python: Full type hints, Python 3.13+ support

Installation

pip install glazing

Quick Start

Initialize all datasets (one-time setup, ~54MB download):

glazing init

Then start using the data:

from glazing.search import UnifiedSearch

# Automatically uses default data directory after 'glazing init'
search = UnifiedSearch()
results = search.search("give")

for result in results[:5]:
    print(f"{result.dataset}: {result.name} - {result.description}")

CLI Usage

Search across datasets:

# Search all datasets
glazing search query "abandon"

# Search specific dataset
glazing search query "run" --dataset verbnet

# Find cross-references
glazing search cross-ref --source propbank --id "give.01" --target verbnet

Python API

Load and work with individual datasets:

from glazing.framenet.loader import FrameNetLoader
from glazing.verbnet.loader import VerbNetLoader

# Loaders automatically use default paths and load data after 'glazing init'
fn_loader = FrameNetLoader()  # Data is already loaded
frames = fn_loader.frames

vn_loader = VerbNetLoader()  # Data is already loaded
verb_classes = list(vn_loader.classes.values())

Cross-reference resolution:

from glazing.references.extractor import ReferenceExtractor
from glazing.verbnet.loader import VerbNetLoader
from glazing.propbank.loader import PropBankLoader

# Load datasets
vn_loader = VerbNetLoader()
pb_loader = PropBankLoader()

# Extract references
extractor = ReferenceExtractor()
extractor.extract_verbnet_references(list(vn_loader.classes.values()))
extractor.extract_propbank_references(list(pb_loader.framesets.values()))

# Access PropBank cross-references
if "give.01" in extractor.propbank_refs:
    refs = extractor.propbank_refs["give.01"]
    vn_classes = refs.get_verbnet_classes()
    print(f"VerbNet classes for give.01: {vn_classes}")

Supported Datasets

  • FrameNet 1.7: Semantic frames and frame elements
  • PropBank 3.4: Predicate-argument structures
  • VerbNet 3.4: Verb classes with thematic roles
  • WordNet 3.1: Synsets and lexical relations

Documentation

Full documentation available at https://glazing.readthedocs.io.

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

# Development setup
git clone https://github.com/aaronstevenwhite/glazing
cd glazing
pip install -e ".[dev]"

Citation

If you use Glazing in your research, please cite:

@software{glazing2025,
  author = {White, Aaron Steven},
  title = {Glazing: Unified Data Models and Interfaces for Syntactic and Semantic Frame Ontologies},
  year = {2025},
  url = {https://github.com/aaronstevenwhite/glazing},
  doi = {10.5281/zenodo.17185626}
}

License

This package is licensed under an MIT License. See LICENSE file for details.

Links

Acknowledgments

This project was funded by a National Science Foundation (BCS-2040831) and builds upon the foundational work of the FrameNet, PropBank, VerbNet, and WordNet teams.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glazing-0.1.1.tar.gz (172.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glazing-0.1.1-py3-none-any.whl (181.6 kB view details)

Uploaded Python 3

File details

Details for the file glazing-0.1.1.tar.gz.

File metadata

  • Download URL: glazing-0.1.1.tar.gz
  • Upload date:
  • Size: 172.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for glazing-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5dea792a9fa1ca28adfba89742e91f34e135d5de2a0d4572c639a5c09c778bf9
MD5 70e69d0d86b12b1fafa37a76f556ac3e
BLAKE2b-256 d7c1ff2a3907fa25671f93b0fd506e42b496061b53ee1d29a65ea0be5569c8f0

See more details on using hashes here.

File details

Details for the file glazing-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: glazing-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 181.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for glazing-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e02244ae57798f199e8fa2d4d9e61bd0fa01c6218ed0877ea99850fc6558bf09
MD5 089007408a10aecaaa94ab491a15f241
BLAKE2b-256 c98c2f3ed7f7667a6e508af3b02153a7b7bb74e323631fa17a3ada547ccb8236

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page