A library for accessing the ACL Anthology
Project description
acl-anthology-py
This package accesses data from the ACL Anthology.
API documentation can already be generated locally (see below for instructions), more documentation (included a web-hosted version) is coming.
How to use
Install via pip
:
$ pip install acl-anthology-py
Clone the ACL Anthology repo to obtain the data files (there will be an option to automate this step in a future version):
$ git clone https://github.com/acl-org/acl-anthology
Afterwards, the library can be instantiated as follows:
from acl_anthology import Anthology
# "datadir" needs to point to the "data/" folder of the acl-anthology repo
anthology = Anthology(datadir="acl-anthology/data")
Some usage examples:
paper = anthology.get("C92-1025")
print(str(paper.title))
# Two-Level Morphology with Composition
print([author.name for author in paper.authors])
# [Name(first='Lauri', last='Karttunen'), Name(first='Ronald M.', last='Kaplan'), Name(first='Annie', last='Zaenen')]
from acl_anthology.people import Name
print(anthology.people.get_by_name(Name("Lauri", "Karttunen")))
# [Person(id='lauri-karttunen', names=[Name(first='Lauri', last='Karttunen')],
# item_ids={('C94', '2', '206'), ('W05', '12', '6'), ('C69', '70', '1'),
# ('J83', '2', '5'), ('C86', '1', '16'), ('C92', '1', '25'), ...})]
Developing
This package uses Python 3.10+ with the Poetry packaging system.
Cloning the repository and running make
will install all dependencies via
Poetry, run all style and type checks, run all tests, and generate the
documentation.
Install dependencies and pre-commit hooks
make setup
will install all package dependencies in development mode, as well
as install the pre-commit hooks that run on every attempted git commit.
If you only want the dependencies, but not the hooks, run make dependencies
.
Running checks
make check
will run black,
ruff, and some other pre-commit
hooks, as well as the
mypy type checker on all files in the repo.
Running tests
make test
will run Python unit tests and integration tests.
Running benchmarks
The benchmarks/
folder collects some benchmarks intended to be
run with the richbench tool:
poetry run richbench benchmarks/
Generating and writing documentation
make docs
(to generate insite/
)make docs-serve
(to serve locally)
Docstrings are written in Google style as this supports the most features with the mkdocstrings handler (particularly compared to Sphinx/reST).
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
Built Distribution
File details
Details for the file acl_anthology_py-0.4.0.tar.gz
.
File metadata
- Download URL: acl_anthology_py-0.4.0.tar.gz
- Upload date:
- Size: 96.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.5 Linux/6.5.5-200.fc38.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b07a96e42a537eaec6e4b285b5e457ac1330dc487eb953d48d9c358f17a1b2f1 |
|
MD5 | bfd4909e5e9eedd7a7033f6004ff7391 |
|
BLAKE2b-256 | c770237c47662832d5cef1098a3c0458e79b5d73fe7e2607d6d41a1805a4e529 |
File details
Details for the file acl_anthology_py-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: acl_anthology_py-0.4.0-py3-none-any.whl
- Upload date:
- Size: 116.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.5 Linux/6.5.5-200.fc38.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09f47d06c496d903b8db562bf008ae553fa91647c34b036bde56fda729bc0b7f |
|
MD5 | 1990e077882ae4d02952f700215e5cf8 |
|
BLAKE2b-256 | 9b47df1df59c40bfe237f96f1224fcb028924ed9fcdad39a76627608672cb7a7 |