Skip to content

bwxing/amr-eager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

amr-preprocessing

Requirements

  • JAMR
  • CoreNLP

Preproceesing

Open preprocessing.sh and change the path for JAMR and CoreNLP. Run amr_preprocessing.sh <annotationfile> to extract the AMR graphs from the AMR annotations, run the aligner and the CoreNLP pipeline to extract tokens, pos tags, named entities, lemmas and dependency trees.

Data extraction

You can then use amrdata.py (relies on https://github.com/nschneid/amr-hackathon) to collect information for the annotated sentences:

from amrdata import *

data = AMRDataset("test.txt")
sentindex = 0 # first sentence at index 0
amr = data.getSent(sentindex)

print amr.tokens
print amr.lemmas
print amr.pos
print amr.nes

print amr.graph # the annotation
print amr.variables # dictionary mapping AMR variables to AMR concepts
print amr.relations # list of arcs between AMR variables

print amr.dependencies # list of arcs in the dependency trees
print amr.alignments # dictionary mapping tokens to AMR variables 

print amr.amr_api.contains_cycle() # amr_api is a wrapper for https://github.com/nschneid/amr-hackathon

About

Parser for Abstract Meaning Representation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 87.2%
  • Lua 11.6%
  • Shell 1.2%