Skip to content

Commit 13b1012

Browse files
2 parents f99203a + 5c10590 commit 13b1012

File tree

127 files changed

+59212
-2009
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+59212
-2009
lines changed

.github/workflows/ci.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Cache pip packages
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install -e ".[dev]"
36+
37+
- name: Run tests with pytest (including slow tests)
38+
run: |
39+
pytest --runslow -v
40+
41+
lint:
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Set up Python 3.12
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: "3.12"
51+
52+
- name: Cache pip packages
53+
uses: actions/cache@v4
54+
with:
55+
path: ~/.cache/pip
56+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }}
57+
restore-keys: |
58+
${{ runner.os }}-pip-
59+
60+
- name: Install dependencies
61+
run: |
62+
python -m pip install --upgrade pip
63+
pip install -e ".[dev]"
64+
65+
- name: Run ruff
66+
run: |
67+
# Check only for errors (E) and critical failures (F), not style warnings
68+
# Exclude tests directory from linting
69+
ruff check . --select E,F --exclude tests/
70+
# Format check is optional - only fail on critical issues
71+
ruff format --check . || true
72+
73+
type-check:
74+
runs-on: ubuntu-latest
75+
76+
steps:
77+
- uses: actions/checkout@v4
78+
79+
- name: Set up Python 3.12
80+
uses: actions/setup-python@v5
81+
with:
82+
python-version: "3.12"
83+
84+
- name: Cache pip packages
85+
uses: actions/cache@v4
86+
with:
87+
path: ~/.cache/pip
88+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }}
89+
restore-keys: |
90+
${{ runner.os }}-pip-
91+
92+
- name: Install dependencies
93+
run: |
94+
python -m pip install --upgrade pip
95+
pip install -e ".[dev]"
96+
97+
- name: Run mypy
98+
run: |
99+
mypy decomp
100+
101+
docs:
102+
runs-on: ubuntu-latest
103+
104+
steps:
105+
- uses: actions/checkout@v4
106+
107+
- name: Set up Python 3.12
108+
uses: actions/setup-python@v5
109+
with:
110+
python-version: "3.12"
111+
112+
- name: Cache pip packages
113+
uses: actions/cache@v4
114+
with:
115+
path: ~/.cache/pip
116+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/pyproject.toml', '**/docs/requirements.txt') }}
117+
restore-keys: |
118+
${{ runner.os }}-pip-
119+
120+
- name: Install dependencies
121+
run: |
122+
python -m pip install --upgrade pip
123+
# Install the package first
124+
pip install -e .
125+
# Then install documentation dependencies
126+
pip install -r docs/requirements.txt
127+
128+
- name: Build documentation
129+
run: |
130+
cd docs
131+
make html

CHANGELOG.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Changelog
2+
3+
All notable changes to the Decomp project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.3.0] - 2025-07-30
9+
10+
### Added
11+
- **New PredPatt Integration**: Complete integration of PredPatt semantic role labeling functionality into `decomp.semantics.predpatt` module
12+
- **Modern Python Support**: Full Python 3.12+ compatibility with updated type hints using union syntax (`|`) and built-in generics
13+
- **Modern Packaging**: Migration from `setup.py` to `pyproject.toml` with modern build system
14+
15+
### Changed
16+
- **Type System Modernization**: All type hints updated to Python 3.12+ conventions using `|` union syntax and built-in generics
17+
- **Documentation**: Comprehensive documentation overhaul with detailed API references and usage examples
18+
- **Code Quality**: Implementation of ruff and mypy for consistent code formatting and static type checking
19+
- **Test Suite**: Complete pytest-based test suite with differential testing against original PredPatt implementation
20+
21+
### Technical Details
22+
- **Module Structure**: New modular architecture with `core`, `extraction`, `parsing`, `rules`, `filters`, and `utils` submodules
23+
- **Algorithm Fidelity**: Byte-for-byte identical output compatibility with original PredPatt implementation
24+
- **Dependencies**: Updated to modern versions while maintaining backward compatibility
25+
26+
## [0.2.2] - 2022-06-08
27+
28+
### Fixed
29+
- **Corpus Loading**: Fixed broken corpus load from JSON functionality
30+
- **UDS Annotations**: Corrected error in raw UDS-EventStructure annotations processing
31+
32+
### Notes
33+
- Final release of v0.2.x series before major modernization
34+
- Maintained compatibility with Universal Decompositional Semantics v2.0 dataset
35+
36+
## [0.2.1] - 2021-04-05
37+
38+
### Fixed
39+
- **Python 3.9 Compatibility**: Resolved compatibility issues with Python 3.9
40+
- **Dependency Updates**: Updated dependencies to support newer Python versions
41+
42+
### Notes
43+
- Part of Universal Decompositional Semantics v2.0 release series
44+
- Improved cross-platform compatibility
45+
46+
## [0.2.0] - 2021-03-19
47+
48+
### Added
49+
- **Universal Decompositional Semantics v2.0**: First release supporting UDS 2.0 dataset
50+
- **Document-Level Graphs**: Support for document-level semantic graph structures
51+
- **Raw Annotations**: Access to raw annotation data alongside normalized annotations
52+
- **Advanced Metadata**: Enhanced metadata handling and processing capabilities
53+
- **Visualization Module**: New `decomp.vis` module for graph visualization and analysis
54+
- **Enhanced Graph Support**: Improved NetworkX and RDF graph representations
55+
56+
### Changed
57+
- **Major Version Bump**: Significant architectural changes to support UDS v2.0
58+
- **API Enhancements**: Extended API surface for document-level processing
59+
- **Data Format**: Support for both sentence-level and document-level annotation formats
60+
61+
### Technical Details
62+
- **Graph Structures**: Support for complex document-level semantic relationships
63+
- **Annotation Pipeline**: Enhanced pipeline for processing raw and normalized annotations
64+
- **Metadata Schema**: Advanced metadata schema for annotation provenance and confidence
65+
66+
## [0.1.3] - 2020-03-13
67+
68+
### Fixed
69+
- **RDF Cache**: Fixed RDF cache clearing error that could cause memory issues
70+
- **Document Attributes**: Added missing document and sentence ID attributes for better tracking
71+
72+
### Added
73+
- **Improved Tracking**: Better document and sentence identification in corpus processing
74+
75+
### Notes
76+
- Maintenance release improving stability and debugging capabilities
77+
- Enhanced corpus navigation and identification features
78+
79+
## [0.1.2] - 2020-01-17
80+
81+
### Fixed
82+
- **Corpus Construction**: Fixed corpus construction error when using split parameter
83+
- **Data Splitting**: Resolved issues with train/dev/test split functionality
84+
85+
### Technical Details
86+
- **Split Parameters**: Corrected handling of data split parameters in corpus initialization
87+
- **Error Handling**: Improved error messages for corpus construction failures
88+
89+
## [0.1.1] - 2019-10-19
90+
91+
### Fixed
92+
- **Genericity Annotations**: Fixed copular clause argument linking error in genericity annotations
93+
- **Argument Linking**: Corrected semantic role assignment for copular constructions
94+
95+
### Technical Details
96+
- **Linguistic Accuracy**: Improved handling of copular clause structures in semantic annotation
97+
- **Annotation Quality**: Enhanced accuracy of genericity property assignments
98+
99+
## [0.1.0] - 2019-10-01
100+
101+
### Added
102+
- **Initial Release**: First major release of the Decomp toolkit
103+
- **Universal Decompositional Semantics v1.0**: Complete support for UDS v1.0 dataset
104+
- **Core Framework**: Foundation classes for semantic graph processing
105+
- **Syntax Integration**: Universal Dependencies syntax integration
106+
- **Semantic Properties**: Support for multiple semantic annotation types:
107+
- Genericity annotations
108+
- Factuality annotations
109+
- Protorole annotations
110+
- Temporal annotations
111+
- Word sense annotations
112+
- **Graph Representations**: NetworkX and RDF graph format support
113+
- **Corpus Management**: Tools for loading, processing, and managing UDS corpora
114+
- **Documentation**: Comprehensive documentation and API reference
115+
116+
### Technical Foundation
117+
- **Graph Infrastructure**: Core graph processing and manipulation capabilities
118+
- **Annotation Framework**: Flexible annotation loading and processing system
119+
- **Type System**: Initial type definitions for semantic structures
120+
- **Testing Framework**: Basic test suite for core functionality
121+
122+
---
123+
124+
## Release Notes
125+
126+
### Dataset Compatibility
127+
- **v0.1.x**: Universal Decompositional Semantics v1.0
128+
- **v0.2.x**: Universal Decompositional Semantics v2.0
129+
- **v0.3.x**: Universal Decompositional Semantics v2.0 + PredPatt integration
130+
131+
### Python Version Support
132+
- **v0.1.x - v0.2.x**: Python 3.6+
133+
- **v0.3.x**: Python 3.12+ (modern type hints and language features)
134+
135+
### Breaking Changes
136+
- **v0.2.0**: API changes for document-level graph support
137+
- **v0.3.0**: Modernized type system, requires Python 3.12+, integrated PredPatt functionality
138+
139+
For detailed technical documentation, see the [Decomp Documentation](https://decomp.readthedocs.io/en/latest/).
140+
For issues and support, visit the [GitHub Repository](https://github.com/decompositional-semantics-initiative/decomp).

Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
FROM python:3.6
1+
FROM quay.io/jupyter/datascience-notebook:2024-11-19
22

3-
WORKDIR /usr/src/decomp
43

5-
COPY . .
4+
# set working directory
5+
WORKDIR "${HOME}/decomp"
66

7-
RUN pip install --no-cache-dir -r requirements.txt && \
8-
pip install --no-cache-dir . && \
9-
python -c "from decomp import UDSCorpus; UDSCorpus()"
7+
# copy the package files
8+
COPY --chown=${NB_UID}:${NB_GID} . .
9+
10+
# install the package and its dependencies
11+
RUN pip install --no-cache-dir -e ".[viz]" && \
12+
# pre-build the UDS corpus to cache it in the image
13+
python -c "from decomp import UDSCorpus; UDSCorpus()"
14+
15+
# set the default command to start Jupyter Lab
16+
CMD ["start-notebook.py", "--IdentityProvider.token=''", "--IdentityProvider.password=''"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Aaron Steven White
3+
Copyright (c) 2025 Aaron Steven White
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)