All Projects → bjascob → amrlib

bjascob / amrlib

Licence: MIT License
A python library that makes AMR parsing, generation and visualization simple.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to amrlib

spaczz
Fuzzy matching and more functionality for spaCy.
Stars: ✭ 215 (+100.93%)
Mutual labels:  spacy, spacy-extension
hmrb
Python Rule Processing Engine 🏺
Stars: ✭ 65 (-39.25%)
Mutual labels:  spacy, spacy-extension
spring
SPRING is a seq2seq model for Text-to-AMR and AMR-to-Text (AAAI2021).
Stars: ✭ 103 (-3.74%)
Mutual labels:  amr, abstract-meaning-representation
Onnxt5
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.
Stars: ✭ 143 (+33.64%)
Mutual labels:  text-generation, transformer
spacy-iwnlp
German lemmatization with IWNLP as extension for spaCy
Stars: ✭ 22 (-79.44%)
Mutual labels:  spacy, spacy-extension
Gpt 2 Tensorflow2.0
OpenAI GPT2 pre-training and sequence prediction implementation in Tensorflow 2.0
Stars: ✭ 172 (+60.75%)
Mutual labels:  text-generation, transformer
amr
Cornell AMR Semantic Parser (Artzi et al., EMNLP 2015)
Stars: ✭ 23 (-78.5%)
Mutual labels:  amr, abstract-meaning-representation
Gpt2 Chinese
Chinese version of GPT2 training code, using BERT tokenizer.
Stars: ✭ 4,592 (+4191.59%)
Mutual labels:  text-generation, transformer
spacy conll
Pipeline component for spaCy (and other spaCy-wrapped parsers such as spacy-stanza and spacy-udpipe) that adds CoNLL-U properties to a Doc and its sentences and tokens. Can also be used as a command-line tool.
Stars: ✭ 60 (-43.93%)
Mutual labels:  spacy, spacy-extension
spacymoji
💙 Emoji handling and meta data for spaCy with custom extension attributes
Stars: ✭ 174 (+62.62%)
Mutual labels:  spacy, spacy-extension
Gpt2 Chitchat
GPT2 for Chinese chitchat/用于中文闲聊的GPT2模型(实现了DialoGPT的MMI思想)
Stars: ✭ 1,230 (+1049.53%)
Mutual labels:  text-generation, transformer
contextualSpellCheck
✔️Contextual word checker for better suggestions
Stars: ✭ 274 (+156.07%)
Mutual labels:  spacy, spacy-extension
Dialogpt
Large-scale pretraining for dialogue
Stars: ✭ 1,177 (+1000%)
Mutual labels:  text-generation, transformer
Gpt2 Newstitle
Chinese NewsTitle Generation Project by GPT2.带有超级详细注释的中文GPT2新闻标题生成项目。
Stars: ✭ 235 (+119.63%)
Mutual labels:  text-generation, transformer
Gpt2 French
GPT-2 French demo | Démo française de GPT-2
Stars: ✭ 47 (-56.07%)
Mutual labels:  text-generation, transformer
spacy-langdetect
A fully customisable language detection pipeline for spaCy
Stars: ✭ 86 (-19.63%)
Mutual labels:  spacy, spacy-extension
text-generation-transformer
text generation based on transformer
Stars: ✭ 36 (-66.36%)
Mutual labels:  text-generation, transformer
Gpt2client
✍🏻 gpt2-client: Easy-to-use TensorFlow Wrapper for GPT-2 117M, 345M, 774M, and 1.5B Transformer Models 🤖 📝
Stars: ✭ 322 (+200.93%)
Mutual labels:  text-generation, transformer
extractacy
Spacy pipeline object for extracting values that correspond to a named entity (e.g., birth dates, account numbers, laboratory results)
Stars: ✭ 47 (-56.07%)
Mutual labels:  spacy, spacy-extension
spacy hunspell
✏️ Hunspell extension for spaCy 2.0.
Stars: ✭ 94 (-12.15%)
Mutual labels:  spacy, spacy-extension

amrlib

A python library that makes AMR parsing, generation and visualization simple.

For the latest documentation, see ReadTheDocs.

!! Note: The models must be downloaded and installed separately. See the Installation Instructions.

About

amrlib is a python module designed to make processing for Abstract Meaning Representation (AMR) simple by providing the following functions

  • Sentence to Graph (StoG) parsing to create AMR graphs from English sentences.
  • Graph to Sentence (GtoS) generation for turning AMR graphs into English sentences.
  • A QT based GUI to facilitate conversion of sentences to graphs and back to sentences
  • Methods to plot AMR graphs in both the GUI and as library functions
  • Training and test code for both the StoG and GtoS models.
  • A SpaCy extension that allows direct conversion of SpaCy Docs and Spans to AMR graphs.
  • Sentence to Graph alignment routines
    • FAA_Aligner (Fast_Align Algorithm), based on the ISI aligner code detailed in this paper.
    • RBW_Aligner (Rule Based Word) for simple, single token to single node alignment
  • An evaluation metric API including including...
    • Smatch (multiprocessed with enhanced/detailed scores) for graph parsing
    • BLEU for sentence generation
    • Alignment scoring metrics detailing precision/recall
  • There is also a related co-referencing project/model at amr_coref.

AMR Models

The system includes different neural-network models for parsing and for generation. !! Note: Models must be downloaded and installed separately. See amrlib-models for all parse and generate model download links.

  • Parse (StoG) model_parse_xfm_bart_large gives an 83.7 SMATCH score with LDC2020T02.

  • Generation (GtoS) generate_t5wtense gives a 54 BLEU with tense tags or 44 BLEU with un-tagged LDC2020T02.

  • CoReference resolution at amr_coref achieves a 0.548 CoNLL-2012 average score.

AMR View

The GUI allows for simple viewing, conversion and plotting of AMR Graphs.

AMRView

Requirements and Installation

The project was built and tested under Python 3 and Ubuntu but should run on any Linux, Windows, Mac, etc.. system.

See Installation Instructions for details on setup.

Library Usage

To convert sentences to graphs

import amrlib
stog = amrlib.load_stog_model()
graphs = stog.parse_sents(['This is a test of the system.', 'This is a second sentence.'])
for graph in graphs:
    print(graph)

To convert graphs to sentences

import amrlib
gtos = amrlib.load_gtos_model()
sents, _ = gtos.generate(graphs)
for sent in sents:
    print(sent)

For a detailed description see the Model API.

Usage as a Spacy Extension

To use as an extension, you need spaCy version 2.0 or later. To setup the extension and use it do the following

import amrlib
import spacy
amrlib.setup_spacy_extension()
nlp = spacy.load('en_core_web_sm')
doc = nlp('This is a test of the SpaCy extension. The test has multiple sentences.')
graphs = doc._.to_amr()
for graph in graphs:
    print(graph)

For a detailed description see the Spacy API.

Paraphrasing

For an example of how to use the library to do paraphrasing, see the Paraphrasing section in the docs.

Issues

If you find a bug, please report it on the GitHub issues list. Additionally, if you have feature requests or questions, feel free to post there as well. I'm happy to consider suggestions and Pull Requests to enhance the functionality and usability of the module.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].