Read-only mirror of https://github.com/epfl-dlab/descartes — EPFL Data Science & AI Lab (dlab). Issues & pull requests at the source.
  • Python 93.9%
  • Jupyter Notebook 5.4%
  • Shell 0.4%
  • JavaScript 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2023-04-27 10:06:51 +02:00
scripts clean up 2023-03-21 16:01:25 +01:00
transformers clean up 2023-03-21 16:01:25 +01:00
.gitignore clean up 2023-03-21 16:01:25 +01:00
full_pipeline_script.sh clean up 2023-03-21 16:01:25 +01:00
LICENSE Create LICENSE 2023-03-21 15:37:51 +01:00
README.md Update README.md 2023-04-27 10:06:51 +02:00
requirements.yaml Create requirements.yaml 2023-03-21 16:43:49 +01:00
test_model.sh clean up 2023-03-21 16:01:25 +01:00
train_descartes.sh clean up 2023-03-21 16:01:25 +01:00
versions.txt add code 2022-10-14 09:18:12 +02:00

Descartes

This repository contains the PyTorch implementation for the experiments in Descartes: Generating Short Descriptions of Wikipedia Articles. The codebase was built upon huggingface transformers library.

@inproceedings{sakota2022descartes,
  title={Descartes: Generating short descriptions of Wikipedia articles},
  author={Šakota, Marija and Peyrard, Maxime and West, Robert},
  booktitle={Proceedings of The Web Conference (WWW)},
  year={2023}
}

Please consider citing our work, if you found the provided resources useful.

Setup instructions

Start by cloning the repository:

git clone https://github.com/epfl-dlab/descartes.git

Environment setup

We recomment creating a new conda virtual environment:

conda env create -n descartes --file=requirements.yaml
conda activate descartes

Install transformers from source:

cd transformers
pip install -e .

Then, install the remaining packages using:

pip install -r versions.txt

Usage

1. Training

To train the model, run the train_descartes.sh script. To specify the directory where data is located use --data_dir. For the directory where model checkpoints will be saved, specify --output_dir. If you want to use knowledge graph embeddings, use --use_graph_embds flag. If you want to use existing descriptions, specify the path of the model used to embed them with --bert_path (for example, bert-base-multilingual-uncased). For monolingual baselines, use --baseline tag.

2. Testing

To test the model, run the test_model.sh script. To specify the directory where data is located use --data_dir. For the directory where model was stored use --output_dir. For the directory where textual outputs will be saved, use --output_folder.

License

Distributed under the MIT License. See LICENSE for more information.