Skip to main content

The package for docAMR

Project description

Setup

make an environment with python 3.7

activate environment

pip install -r requirements.txt

Create docAMR representation

Link to NAACL 2022 paper DOCAMR: Multi-Sentence AMR Representation and Evaluation

https://aclanthology.org/2022.naacl-main.256.pdf

To create docAMR representation from gold AMR3.0 data and the coref annotation in xml format:

python doc_amr.py 
--amr3-path <path to AMR3 data> 
--coref-fof <file-with-list-of-xml-annotations-files> 
--out-amr <output file> 
--rep <representation>

<path to AMR3 data> should point to uncompressed LDC data directory for LDC2020T02 with its original directory structure.

<file-with-list-of-xml-annotations-files> is one of the _coref.fof files included in this repository.

Default value for --rep is 'docAMR'. Other values can be: 'no-merge','merge-names','merge-all'. Use --help to read the descriptions of these representations.


To create docAMR representation from dcoument AMRs with no nodes merged

python doc_amr.py
       --in-doc-amr-unmerged <path to document-level AMRs un no-merge format>
       --rep <representation>
       --out-amr <output file>

To create docAMR representation from dcoument AMRs with pairwise edges between a representative node in the chain and the rest of the nodes in the chain:

python doc_amr.py
       --in-doc-amr-pairwise <path to document-level AMR with pairwise coref edges>
       --pairwise-coref-rel <relation label indicating coref edges>
       --rep <representation>
       --out-amr <output file>

default value for --pairwise-coref-rel is same-as

Evaluate docAMR (docSmatch)

Use docSmatch the same way as the standard Smatch.

python docSmatch/smatch.py -f <amr1> <amr2>

It assumes that :snt relations connect sentences to the root. Moreover, it assumes that the numeric suffix of :snt is the sentence number and that the matching sentence numbers in the two AMRs are aligned.

You can also get a detailed score breakdown for the accuracy of coreference prediction:

python docSmatch/smatch.py -f <amr1> <amr2> --coref-subscore

This will ouput the normal smatch score as 'Overall Score', as well as a 'Coref Score' indicating the quality of cross sentential edges and nodes.

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

docAMR-0.1.1.tar.gz (44.7 kB view details)

Uploaded Source

Built Distribution

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

docAMR-0.1.1-py3-none-any.whl (46.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: docAMR-0.1.1.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for docAMR-0.1.1.tar.gz
Algorithm Hash digest
SHA256 be887b4495a9c64b135094b82c1086ec4bb1cafb32b197ebe23a29772fa7a06f
MD5 d7d434d0ad034b0dbd13530531d8f1b2
BLAKE2b-256 7b222cd5a30110657f96305706fe4382f4e7e583b432bce7f2d07e97a693ce0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docAMR-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 46.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for docAMR-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a67e0f65954251cffb477c5c0e5921c36eb4b9f5ab80348c6a605c89faaf0ca
MD5 7eab8b5268c1c847abdd530e6c7bfa0e
BLAKE2b-256 ac271591c5dfda853442f0d18d4edc9ca6e96f808d447396a91c2ea9394bb68d

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