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.4.tar.gz
(1.3 MB
view details)
Built Distribution
File details
Details for the file py_amr2fred-0.0.4.tar.gz
.
File metadata
- Download URL: py_amr2fred-0.0.4.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 | f162dca0a332c4b7d8b9eef9b4246e472f5eea5c6feb56cd760fe48c3f83be83 |
|
MD5 | d01c816a2b0367149af458cfbb0a9378 |
|
BLAKE2b-256 | ba5a75682f0f1c8544e9d980393d880580ab71a07975cecedfb9004c0bf3c274 |
File details
Details for the file py_amr2fred-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: py_amr2fred-0.0.4-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 | b011d455a5e5eece13bb728c23b5c8c715b6539a542ba994ddc02933d333d141 |
|
MD5 | b7d969f662f3a05998fa13575c65b009 |
|
BLAKE2b-256 | ffe03bc3037997af45fdbfe7ad89faf5557f037ceef930f5bee200e461e28bed |