Skip to content
 
 

Repository files navigation

Grex: Automatic Grammar Extraction

This is the maintained repository of Grex, a tool for the automatic extraction of grammatical rules from treebanks using machine learning.

It was conceived by Santiago Herrera, Caio Corro, Bruno Guillaume and Sylvain Kahane. A full description of the method can be found in the paper (the code is deprecated): https://arxiv.org/abs/2403.17534

Currently, the repository contains the code to use Grex as CLI tool.

If you use this software, please cite the following work:

@inproceedings{herrera-etal-2024-sparse,
    title = "Sparse Logistic Regression with High-order Features for Automatic Grammar Rule Extraction from Treebanks",
    author = "Herrera, Santiago  and Corro, Caio  and Kahane, Sylvain",
    editor = "Calzolari, Nicoletta  and Kan, Min-Yen  and Hoste, Veronique  and Lenci, Alessandro  and Sakti, Sakriani  andXue, Nianwen",
    booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)",
    month = may,
    year = "2024",
    address = "Torino, Italia",
    publisher = "ELRA and ICCL",
    url = "https://aclanthology.org/2024.lrec-main.1314/",
    pages = "15114--15125",
}

If you use Grex for contrastive studies, please cite the most pertinent of the following papers:

@inproceedings{herrera_et_al2024contrastive,
  author = {Santiago Herrera and Ioana-Madalina Silai and Caio Corro and Bruno Guillaume and Sylvain Kahane},
  title = {Building quantitative contrastive grammars from syntactic treebanks},
  booktitle = {Langues \& Langages à la croisée des Disciplines (LLcD)},
  year = {2024},
  address = {Paris}
@inproceedings{herrera-etal-2025-extraction,
    title = "Extraction of Contrastive Rules from Syntactic Treebanks: A Case Study in {R}omance Languages",
    author = "Herrera, Santiago  and Silai, Ioana-Madalina and Corro, Caio and Guillaume, Bruno  and Kahane, Sylvain",
    editor = "Chen, Xinying  and Wang, Yaqin",
    booktitle = "Proceedings of the Third Workshop on Quantitative Syntax (QUASY, SyntaxFest 2025)",
    month = aug,
    year = "2025",
    address = "Ljubljana, Slovenia",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2025.quasy-1.5/",
    pages = "26--38",
    ISBN = "979-8-89176-293-0"
    }

Documentation

The documentation is available here. Alternatively, it can be run locally by following the instructions provided in this repository.

Installation

Clone the project repository

git clone https://github.com/Autogramm/grex
cd grex

Create a virtual environment

python3 -m venv .venv
source .venv/bin/active

Install python packages

pip install -r requirements.txt

Grex use Grew, a rewriting graph library, which allows writing very flexible queries over graphs. Grew is implemented in Ocaml.

Troubleshooting

If you get an error caused by Cython, try installing the python3-dev package.

apt install python3-dev

distutils missing?

pip install setuptools

A missing dependency during Grew installation? Install it manually:

opam install dependency_missing

grewpy_backend is well installed but not in PATH? Try:

echo ‘eval $(opam env)>> ~/.bashrc

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages