Skip to content

Commit 46e80a1

Browse files
Code for ACL2024-findings
0 parents  commit 46e80a1

File tree

192 files changed

+12973
-0
lines changed

Some content is hidden

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

192 files changed

+12973
-0
lines changed

.env.example

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# example of file for storing private and user specific environment variables, like keys or system paths
2+
# rename it to ".env" (excluded from version control by default)
3+
# .env is loaded by train.py automatically
4+
# hydra allows you to reference variables in .yaml configs with special syntax: ${oc.env:MY_VAR}
5+
6+
MY_VAR="/home/user/my/system/path"

.gitignore

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.venv
106+
env/
107+
venv/
108+
ENV/
109+
env.bak/
110+
venv.bak/
111+
112+
# Spyder project settings
113+
.spyderproject
114+
.spyproject
115+
116+
# Rope project settings
117+
.ropeproject
118+
119+
# mkdocs documentation
120+
/site
121+
122+
# mypy
123+
.mypy_cache/
124+
.dmypy.json
125+
dmypy.json
126+
127+
# Pyre type checker
128+
.pyre/
129+
130+
### VisualStudioCode
131+
.vscode/*
132+
!.vscode/settings.json
133+
!.vscode/tasks.json
134+
!.vscode/launch.json
135+
!.vscode/extensions.json
136+
*.code-workspace
137+
**/.vscode
138+
139+
# JetBrains
140+
.idea/
141+
142+
# Data & Models
143+
*.h5
144+
*.tar
145+
*.tar.gz
146+
147+
# Lightning-Hydra-Template
148+
configs/local/default.yaml
149+
data/
150+
logs/
151+
.env
152+
.autoenv

.pre-commit-config.yaml

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
default_language_version:
2+
python: python3
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.3.0
7+
hooks:
8+
# list of supported hooks: https://pre-commit.com/hooks.html
9+
- id: trailing-whitespace
10+
- id: end-of-file-fixer
11+
- id: check-docstring-first
12+
- id: check-yaml
13+
- id: debug-statements
14+
- id: detect-private-key
15+
- id: check-executables-have-shebangs
16+
- id: check-toml
17+
- id: check-case-conflict
18+
- id: check-added-large-files
19+
20+
# python code formatting
21+
- repo: https://github.com/psf/black
22+
rev: 22.6.0
23+
hooks:
24+
- id: black
25+
args: [--line-length, "99"]
26+
27+
# python import sorting
28+
- repo: https://github.com/PyCQA/isort
29+
rev: 5.12.0
30+
hooks:
31+
- id: isort
32+
args: ["--profile", "black", "--filter-files"]
33+
34+
# python upgrading syntax to newer version
35+
- repo: https://github.com/asottile/pyupgrade
36+
rev: v2.32.1
37+
hooks:
38+
- id: pyupgrade
39+
args: [--py38-plus]
40+
41+
# python docstring formatting
42+
- repo: https://github.com/myint/docformatter
43+
rev: v1.4
44+
hooks:
45+
- id: docformatter
46+
args: [--in-place, --wrap-summaries=99, --wrap-descriptions=99]
47+
48+
# python check (PEP8), programming errors and code complexity
49+
- repo: https://github.com/PyCQA/flake8
50+
rev: 4.0.1
51+
hooks:
52+
- id: flake8
53+
args:
54+
[
55+
"--extend-ignore",
56+
"E203,E402,E501,F401,F841",
57+
"--exclude",
58+
"logs/*,data/*",
59+
]
60+
61+
# python security linter
62+
- repo: https://github.com/PyCQA/bandit
63+
rev: "1.7.1"
64+
hooks:
65+
- id: bandit
66+
args: ["-s", "B101"]
67+
68+
# yaml formatting
69+
- repo: https://github.com/pre-commit/mirrors-prettier
70+
rev: v2.7.1
71+
hooks:
72+
- id: prettier
73+
types: [yaml]
74+
exclude: "environment.yaml"
75+
76+
# shell scripts linter
77+
- repo: https://github.com/shellcheck-py/shellcheck-py
78+
rev: v0.8.0.4
79+
hooks:
80+
- id: shellcheck
81+
82+
# md formatting
83+
- repo: https://github.com/executablebooks/mdformat
84+
rev: 0.7.14
85+
hooks:
86+
- id: mdformat
87+
args: ["--number"]
88+
additional_dependencies:
89+
- mdformat-gfm
90+
- mdformat-tables
91+
- mdformat_frontmatter
92+
# - mdformat-toc
93+
# - mdformat-black
94+
95+
# word spelling linter
96+
- repo: https://github.com/codespell-project/codespell
97+
rev: v2.1.0
98+
hooks:
99+
- id: codespell
100+
args:
101+
- --skip=logs/**,data/**,*.ipynb
102+
# - --ignore-words-list=abc,def
103+
104+
# jupyter notebook cell output clearing
105+
- repo: https://github.com/kynan/nbstripout
106+
rev: 0.5.0
107+
hooks:
108+
- id: nbstripout
109+
110+
# jupyter notebook linting
111+
- repo: https://github.com/nbQA-dev/nbQA
112+
rev: 1.4.0
113+
hooks:
114+
- id: nbqa-black
115+
args: ["--line-length=99"]
116+
- id: nbqa-isort
117+
args: ["--profile=black"]
118+
- id: nbqa-flake8
119+
args:
120+
[
121+
"--extend-ignore=E203,E402,E501,F401,F841",
122+
"--exclude=logs/*,data/*",
123+
]

Makefile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
help: ## Show help
3+
@grep -E '^[.a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
4+
5+
clean: ## Clean autogenerated files
6+
rm -rf dist
7+
find . -type f -name "*.DS_Store" -ls -delete
8+
find . | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf
9+
find . | grep -E ".pytest_cache" | xargs rm -rf
10+
find . | grep -E ".ipynb_checkpoints" | xargs rm -rf
11+
rm -f .coverage
12+
13+
clean-logs: ## Clean logs
14+
rm -rf logs/**
15+
16+
format: ## Run pre-commit hooks
17+
pre-commit run -a
18+
19+
sync: ## Merge changes from main branch to your current branch
20+
git pull
21+
git pull origin main
22+
23+
test: ## Run not slow tests
24+
pytest -k "not slow"
25+
26+
test-full: ## Run all tests
27+
pytest
28+
29+
train: ## Train the model
30+
python src/train.py

0 commit comments

Comments
 (0)