If you use the code or cite our work, please reference this one as follows :
@inproceedings{DBLP:conf/aaai/RingwaldGFMA24,
author = {Célian Ringwald and
Fabien Gandon and
Catherine Faron and
Franck Michel and
Hanna Abi Akl},
editor = {Michael J. Wooldridge and
Jennifer G. Dy and
Sriraam Natarajan},
title = {Well-Written Knowledge Graphs: Most Effective {RDF} Syntaxes for Triple
Linearization in End-to-End Extraction of Relations from Texts (Student
Abstract)},
booktitle = {Thirty-Eighth {AAAI} Conference on Artificial Intelligence, {AAAI}
2024, Thirty-Sixth Conference on Innovative Applications of Artificial
Intelligence, {IAAI} 2024, Fourteenth Symposium on Educational Advances
in Artificial Intelligence, {EAAI} 2014, February 20-27, 2024, Vancouver,
Canada},
pages = {23631--23632},
publisher = {{AAAI} Press},
year = {2024},
url = {https://doi.org/10.1609/aaai.v38i21.30502},
doi = {10.1609/AAAI.V38I21.30502},
}
How does the choice of a syntax impact the generation of triples using datatype properties?
For this purpose we finetuned the two version of the BART model (base/large) on a relation extraction on seven syntaxes. This experiment is limited to the objects of the class dbo:Person of the Enlish chapter of the DBpedia, by only focusing on the following relations : rdfs:label, dbo:birthDate, dbo:deathDate, dbo:birthYear, dbo:deathYear.
The seven syntaxes competed are the following :
- Basic syntaxes :
- list: are a triples are represented into a sequence as follow ((s1, p1, o1), (s2, p1, o2),...)
- taggs: where each element of the triple is proceeded by specials token: s1p1o1s2p1 o2...
- RDF syntaxes:
- Turtle: https://www.w3.org/TR/turtle/
- JSON-LD: https://www.w3.org/TR/json-ld11/
- Ntriples: https://www.w3.org/TR/n-triples/
- a homemade and simplified Light Turtle : based on the Turtle syntax where every namespace, XML Schema datatypes are deleted
A sample of the dataset represented with each syntaxes is available here
All the results of these experiments are available on weights & Biases
This code is based on a fork of REBEL. The majors updates made are the following :
- create_dataset/ dir. contains all scripts needed for creating the datasets
- conf/ dir.
- src/ dir. mainly score.py adapted for being able to parse each syntax
In order to set up the python interpreter we utilize conda , the script setup.sh creates a conda environment and install pytorch and the dependencies in "requirements.txt".
> conda activate MINICONDA_ENV
> export WANDB_API_KEY=API_KEY
> python ./src/train.py model=bart_base_model data=bart_turtle train=dbpedia_trainDue to a "version incompatibility regarding the use of hydra/omegaconf" "Ugly hack" from REBEL issues :
Must comment out the line File "/home//virtualenv/luke/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 157, in load_from_checkpoint checkpoint[cls.CHECKPOINT_HYPER_PARAMS_KEY].update(kwargs)
python ./src/test.py model=bart_base_model data=bart_turtle train=dbpedia_train do_predict=True checkpoint_path="path_to_checkpoint"