AnCast++ metric for evaluating UMR semantic graphs
Project description
Ancast
AnCast metric for evaluating UMR semantic graphs.
Install
ancast is currently available as a local, editable install only
$ pip install -e .
Usage
Consider sample AMR/UMR files in samples dir
CLI command
Currently, output file path is required and will contain analysis csv file.
$ ancast --help
usage: ancast++ Argparser [-h] -p PRED [PRED ...] [-pe PRED_EXT [PRED_EXT ...]] -g GOLD [GOLD ...] [-ge GOLD_EXT [GOLD_EXT ...]] [-o OUTPUT] [-s {snt,doc}] [-df {amr,umr}] [-c CNEIGHBOR] [-sc SENSE_COEFFICIENT] [--separate-1-and-2 [SEPARATE_1_AND_2]]
[--allow-reify [ALLOW_REIFY]] [--use-alignment [USE_ALIGNMENT]] [--use-smatch-top [USE_SMATCH_TOP]] [--weighted {snts,toks}] [--seed SEED] [--debug]
options:
-h, --help show this help message and exit
-p PRED [PRED ...], --pred PRED [PRED ...]
(required) path to prediction file or dir (if dir, same filenames must exist in `gold`)
-pe PRED_EXT [PRED_EXT ...], --pred-ext PRED_EXT [PRED_EXT ...]
if `args.pred` flag is a dir, which file extensions to consider
-g GOLD [GOLD ...], --gold GOLD [GOLD ...]
(required) path to gold file or dir (if dir, same filenames must exist in `pred`)
-ge GOLD_EXT [GOLD_EXT ...], --gold-ext GOLD_EXT [GOLD_EXT ...]
if `args.gold` flag is a dir, which file extensions to consider
-o OUTPUT, --output OUTPUT
(optional) path to output analysis files(if new dir, should not contain comma in the base dirname)
-s {snt,doc}, --scope {snt,doc}
whether to run ancast over AMR/UMR sentence-level graphs (`snt`) or to run ancast++ over UMR document-level graphs (`doc`)
-df {amr,umr}, --data-format {amr,umr}
whether the input data are AMR(s) or UMR(s) (automatically set to `umr` if `--scope` is `doc`)
-c CNEIGHBOR, --cneighbor CNEIGHBOR
coefficient for the importance of neighborhood information when broadcasting
-sc SENSE_COEFFICIENT, --sense-coefficient SENSE_COEFFICIENT
importance of sense ID when comparing two concepts
--separate-1-and-2 [SEPARATE_1_AND_2]
whether to combine one-hop and two-hop neighbors together
--allow-reify [ALLOW_REIFY]
whether to apply reification before comparing graphs
--use-alignment [USE_ALIGNMENT]
whether to use alignment information when establishing anchors
--use-smatch-top [USE_SMATCH_TOP]
whether to add (TOP :root `ROOT_NODE`) edge
--weighted {snts,toks}
whether to apply weighted average for ancast++ doc-level evaluation by (1) number of sentences or (2) number of tokens
--seed SEED random seed for reproducibility
--debug debug logging mode
Python API
evaluate accepts the same set of arguments described above.
from ancast import evaluate
pred_fpath = "./samples/umr_test.txt"
gold_fpath = "./samples/umr_gold.txt"
out_fpath = "./samples/outputs"
out = evaluate(
pred_fpath,
gold_fpath,
out_fpath,
scope="doc"
)
Cite
Please cite this paper for now:
@inproceedings{sun2024ancast,
title = "Anchor and Broadcast: An Efficient Concept Alignment Approach for Evaluation of Semantic Graphs",
author = "Sun, Haibo and Nianwen Xue ",
booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation",
month = may,
year = "2024",
}
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ancast-0.1.0.tar.gz.
File metadata
- Download URL: ancast-0.1.0.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
674966d25e28e2e2ad17c500f0204d3ea7298a76c218d3f6062ae7e1418f0f59
|
|
| MD5 |
8b324c61567254ce3e6a106fb510dcdb
|
|
| BLAKE2b-256 |
46f2c3ec35b75df5c2edc46d22c8629ee8c18d3c8469cf17b8abebfc0c4a0a78
|
Provenance
The following attestation bundles were made for ancast-0.1.0.tar.gz:
Publisher:
python-publish.yml on umr4nlp/ancast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ancast-0.1.0.tar.gz -
Subject digest:
674966d25e28e2e2ad17c500f0204d3ea7298a76c218d3f6062ae7e1418f0f59 - Sigstore transparency entry: 187341651
- Sigstore integration time:
-
Permalink:
umr4nlp/ancast@f4b4f0bcc9a35da3f297bad3024dba587401ad1a -
Branch / Tag:
refs/tags/v1.0 - Owner: https://github.com/umr4nlp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f4b4f0bcc9a35da3f297bad3024dba587401ad1a -
Trigger Event:
release
-
Statement type:
File details
Details for the file ancast-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ancast-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
105c8ec2d05cc481f72950489353060135e589d05cbd1e0e18e0770e01d238cc
|
|
| MD5 |
52d58d495519dd2ca6e82b26dadfbbc7
|
|
| BLAKE2b-256 |
9ea46b442895d9dfd22a7a82aa2ba6ab68e4d346d83462046cfc060cae73d6e9
|
Provenance
The following attestation bundles were made for ancast-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on umr4nlp/ancast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ancast-0.1.0-py3-none-any.whl -
Subject digest:
105c8ec2d05cc481f72950489353060135e589d05cbd1e0e18e0770e01d238cc - Sigstore transparency entry: 187341652
- Sigstore integration time:
-
Permalink:
umr4nlp/ancast@f4b4f0bcc9a35da3f297bad3024dba587401ad1a -
Branch / Tag:
refs/tags/v1.0 - Owner: https://github.com/umr4nlp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f4b4f0bcc9a35da3f297bad3024dba587401ad1a -
Trigger Event:
release
-
Statement type: