{"id":13486141,"url":"https://github.com/bjascob/amrlib","last_synced_at":"2025-04-05T09:09:13.533Z","repository":{"id":39983196,"uuid":"292369897","full_name":"bjascob/amrlib","owner":"bjascob","description":"A python library that makes AMR parsing, generation and visualization simple.","archived":false,"fork":false,"pushed_at":"2024-01-22T01:47:46.000Z","size":974,"stargazers_count":236,"open_issues_count":3,"forks_count":34,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T08:08:08.677Z","etag":null,"topics":["abstract-meaning-representation","amr","amr-graphs","amr-parser","amr-parsing","neural-network","python","pytorch","spacy","spacy-extension","text-generation","transformer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bjascob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-02T18:59:49.000Z","updated_at":"2025-03-18T07:08:59.000Z","dependencies_parsed_at":"2024-06-18T22:57:58.159Z","dependency_job_id":"64215fa8-a72a-496e-b5f6-653ce83634b6","html_url":"https://github.com/bjascob/amrlib","commit_stats":{"total_commits":170,"total_committers":1,"mean_commits":170.0,"dds":0.0,"last_synced_commit":"8fedde5bb211ddafd3dee46e4a209ff5c279d2d3"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjascob%2Famrlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjascob%2Famrlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjascob%2Famrlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjascob%2Famrlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjascob","download_url":"https://codeload.github.com/bjascob/amrlib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312082,"owners_count":20918344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abstract-meaning-representation","amr","amr-graphs","amr-parser","amr-parsing","neural-network","python","pytorch","spacy","spacy-extension","text-generation","transformer"],"created_at":"2024-07-31T18:00:40.342Z","updated_at":"2025-04-05T09:09:13.470Z","avatar_url":"https://github.com/bjascob.png","language":"Python","funding_links":[],"categories":["Tools","Utilities","Python"],"sub_categories":[],"readme":"#  amrlib\n\n**A python library that makes AMR parsing, generation and visualization simple.**\n\nFor the latest documentation, see **[ReadTheDocs](https://amrlib.readthedocs.io/en/latest/)**.\n\n**!! Note:** The models must be downloaded and installed separately.  See the [Installation Instructions](https://amrlib.readthedocs.io/en/latest/install).\n\n## About\namrlib is a python module designed to make processing for [Abstract Meaning Representation](https://amr.isi.edu/)\n (AMR) simple by providing the following functions\n* Sentence to Graph (StoG) parsing to create AMR graphs from English sentences.\n* Graph to Sentence (GtoS) generation for turning AMR graphs into English sentences.\n* A QT based GUI to facilitate conversion of sentences to graphs and back to sentences\n* Methods to plot AMR graphs in both the GUI and as library functions\n* Training and test code for both the StoG and GtoS models.\n* A [SpaCy](https://github.com/explosion/spaCy) extension that allows direct conversion of\n  SpaCy `Docs` and `Spans` to AMR graphs.\n* Sentence to Graph alignment routines\n  - FAA_Aligner (Fast_Align Algorithm), based on the ISI aligner code detailed in this\n    [paper](https://www.isi.edu/~damghani/papers/amr_eng_align.pdf).\n  - RBW_Aligner (Rule Based Word) for simple, single token to single node alignment\n* An evaluation metric API including including...\n  - Smatch (multiprocessed with enhanced/detailed scores) for graph parsing\n     \u003cbr\u003e *see note at the bottom about smatch scoring*\n  - BLEU for sentence generation\n  - Alignment scoring metrics detailing precision/recall\n\n\n\n## AMR Models\nThe system includes different neural-network models for parsing and for generation. **!! Note:** Models must be downloaded and installed separately.\nSee [amrlib-models](https://github.com/bjascob/amrlib-models) for all parse and generate model download links.\n\n* Parse (StoG) model_parse_xfm_bart_large gives an **83.7 SMATCH score** with LDC2020T02.\n  \u003cbr\u003e For a technical description of the parse model see its [wiki-page](https://github.com/bjascob/amrlib/wiki/The-parse_xfm-model)\n\n* Generation (GtoS) generate_t5wtense gives a **54 BLEU** with tense tags or **44 BLEU** with un-tagged LDC2020T02.\n\n\n## AMR View\nThe GUI allows for simple viewing, conversion and plotting of AMR Graphs.\n\n![AMRView](https://github.com/bjascob/amrlib/raw/master/docs/images/AMRView01.png)\n\u003c!--- docs/images/AMRView01.png ---\u003e\n\u003c!--- https://github.com/bjascob/amrlib/raw/master/docs/images/AMRView01.png ---\u003e\n\n\n## AMR CoReference Resolution\nThe library does not contain code for AMR co-reference resolution but there is a related project\nat [amr_coref](https://github.com/bjascob/amr_coref).\n\nThe following papers have GitHub projects/code that have similar or better scoring than the above..\n* [VGAE as Cheap Supervision for AMR Coreference Resolution](https://github.com/IreneZihuiLi/VG-AMRCoref)\n* [End-to-end AMR Coreference Resolution](https://github.com/Sean-Blank/AMRcoref)\n\n\n\n\n## Requirements and Installation\nThe project was built and tested under Python 3 and Ubuntu but should run on any Linux, Windows, Mac, etc.. system.\n\nSee [Installation Instructions](https://amrlib.readthedocs.io/en/latest/install) for details on setup.\n\n## Library Usage\nTo convert sentences to graphs\n```\nimport amrlib\nstog = amrlib.load_stog_model()\ngraphs = stog.parse_sents(['This is a test of the system.', 'This is a second sentence.'])\nfor graph in graphs:\n    print(graph)\n```\nTo convert graphs to sentences\n```\nimport amrlib\ngtos = amrlib.load_gtos_model()\nsents, _ = gtos.generate(graphs)\nfor sent in sents:\n    print(sent)\n```\nFor a detailed description see the [Model API](https://amrlib.readthedocs.io/en/latest/api_model/).\n\n\n## Usage as a Spacy Extension\nTo use as an extension, you need spaCy version 2.0 or later.  To setup the extension and use it do the following\n```\nimport amrlib\nimport spacy\namrlib.setup_spacy_extension()\nnlp = spacy.load('en_core_web_sm')\ndoc = nlp('This is a test of the SpaCy extension. The test has multiple sentences.')\ngraphs = doc._.to_amr()\nfor graph in graphs:\n    print(graph)\n```\nFor a detailed description see the [Spacy API](https://amrlib.readthedocs.io/en/latest/api_spacy/).\n\n\n## Paraphrasing\nFor an example of how to use the library to do paraphrasing, see the\n[Paraphrasing](https://amrlib.readthedocs.io/en/latest/paraphrase/) section in the docs.\n\n## SMATCH Scoring\namrlib uses the [smatch](https://github.com/snowblink14/smatch) library for scoring.\nThis is the library that is most commonly used for scoring AMR parsers and reporting results in literature.\nThere are some cases where the code may give inconsistant or erroneous results.\nYou may wish to look at [smatchpp](https://github.com/flipz357/smatchpp) for an improved scoring algorithm.\n\n## Issues\nIf you find a bug, please report it on the [GitHub issues list](https://github.com/bjascob/amrlib/issues).\nAdditionally, if you have feature requests or questions, feel free to post there as well.  I'm happy to\nconsider suggestions and Pull Requests to enhance the functionality and usability of the module.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjascob%2Famrlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjascob%2Famrlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjascob%2Famrlib/lists"}