AMR to RDF translator
Project description
py_amr2fred
From Abstract Meaning Representation AMR (https://amr.isi.edu/) to RDF, according to the syntax of FRED (http://wit.istc.cnr.it/stlab-tools/fred/)
Python version of amr2fred's core functions
Install:
pip install py_amr2fred
Use:
from py_amr2fred import *
amr2fred = Amr2fred()
mode = Glossary.RdflibMode.N3
amr_text = """
(c / charge-05 :ARG1 (h / he) :ARG2 (a / and :op1 (i / intoxicate-01 :ARG1 h :location (p / public))
:op2 (r / resist-01 :ARG0 h :ARG1 (a2 / arrest-01 :ARG1 h))))
"""
print(amr2fred.translate(amr_text, serialize=True, mode=mode))
serialize=True returns a string
serialize=False returns a rdflib Graph
Possible formats:
- Glossary.RdflibMode.TURTLE
- Glossary.RdflibMode.NT
- Glossary.RdflibMode.XML
- Glossary.RdflibMode.N3
- Glossary.RdflibMode.JSON_LD
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
py_amr2fred-0.0.5.tar.gz
(1.3 MB
view details)
Built Distribution
File details
Details for the file py_amr2fred-0.0.5.tar.gz
.
File metadata
- Download URL: py_amr2fred-0.0.5.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6d4bdef2d7292e47a1c6f8e2ecf45efe5f918eaa95fd01abd65bca0673be517 |
|
MD5 | 550fdb8b2f023e4b0b42e599417c4c6e |
|
BLAKE2b-256 | 73edde41735a75f6aacc3eeeee76422b012ed55b95fdfe1a6dab0d92f041a5e2 |
File details
Details for the file py_amr2fred-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: py_amr2fred-0.0.5-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 625e80dee25578dc2681123e169c7be8331d9202bcbe1cea8836a24b5ca8c817 |
|
MD5 | 42d71b49047ab05585782e700434a25c |
|
BLAKE2b-256 | 92eb1204523d068d0d5e3e395ccf3c67e4563e3d0e6d20e6c43899bddf60d035 |