LettRAGraph workspace for the LLMs4OL challenge. The repository runs an extraction pipeline that turns source texts into ontology triples, then measures quality against gold triples.
- Prepare consistent text inputs from challenge JSON.
- Optionally run Ontology Toolkit (OTK) (private repo) to generate auxiliary ontology files.
- Run text2graph (private repo) extraction with experiment-specific LLM settings.
- Normalize and clean graph triples into a comparable tuple format.
- Optionally ensemble multiple experiment outputs by intersection (precision-oriented).
- Evaluate final output with graph-level similarity metrics.
Run scripts in this order from repository root:
pre-process.pyot_sdk_usage.py(optional OTK step; sometimes referred to as "otk_sdk_usage")run.sh(orrun.pythroughrun.sh)post-process.pyensemble.py(optional, when combining two experiments)evaluate.py
- Python 3.11+ recommended
uvinstalled (used byrun.sh)- Dependencies from
requirements.txt - Install Ontology Toolkit (optional) and text2graph following the respective documentation
- Access to required model/provider endpoints configured in environment and YAML files
Install dependencies:
pip install -r requirements.txtThe dataset for the challenge can be found in the LLMs4OL repository.
Main files:
config.yml: base runtime configurationexperiments.yml: per-experiment overridesvar.env: environment variables (API keys, log level, default experiment) as perexample.env
Load environment variables before running:
set -a
source var.env
set +aBuilds input/*.txt from challenge JSON and computes property statistics.
python pre-process.pyUseful options:
python pre-process.py -i challenge-source/TaskA-Flagship/train_task_a.json -o inputGenerates auxiliary ontology TTL files in onto/ from input/.
Use this only if you want ontology-aware enrichment before extraction/post-processing.
python ot_sdk_usage.py --input-dir input --output ontoOptional concatenated mode:
python ot_sdk_usage.py --input-dir input --output onto --concatRecommended entrypoint:
./run.sh <experiment_name>Examples:
./run.sh gemma-4-31B
./run.sh qwen3.6-35BThis writes experiment-scoped outputs under:
experiments/<experiment_name>/graphsexperiments/<experiment_name>/cache
Converts generated TTL graphs into normalized tuple text files.
python post-process.pyCommon options:
python post-process.py --structure-only
python post-process.py --involve-onto
python post-process.py --submissionOutput location:
experiments/<experiment_name>/output/*.txt- optionally
experiments/<experiment_name>/output/submission.json
Intersects triples from two completed experiment outputs. Use when you want higher precision by keeping only triples confirmed by both runs.
python ensemble.py <exp_a> <exp_b>Example:
python ensemble.py gemma-4-31B-100e gemma-4-31B-100d --destination ensemble-gemmaIf you want to evaluate this ensemble next, set:
export EXPERIMENT_NAME=ensemble-gemmaComputes graph similarity metrics against the gold triples.
python evaluate.pyOptional flags:
python evaluate.py --structure-only
python evaluate.py --debugMain artifact:
experiments/<experiment_name>/evaluation_stats.json
python pre-process.py
./run.sh gemma-4-31B
python post-process.py
python evaluate.pypython pre-process.py
./run.sh expA
./run.sh expB
python post-process.py
python ensemble.py expA expB --destination ensemble-expA-expB
export EXPERIMENT_NAME=ensemble-expA-expB
python evaluate.pypre-process.py: creates input text files and property statsot_sdk_usage.py: optional Ontology Toolkit batch processingrun.sh: experiment launcher (loads env + runsrun.pywithuv)run.py: config-driven extraction execution per input filepost-process.py: graph normalization and filteringensemble.py: intersection-based ensembleevaluate.py: metric computation and summary exportexperiment_paths.py: experiment path and config resolution helpers
- Run commands from repository root so relative paths resolve correctly.
- If
run.shfails with permissions:
chmod +x run.sh- If evaluation shows no output files, verify
EXPERIMENT_NAMEpoints to an experiment that already hasoutput/*.txt. - Keep secrets out of version control; do not commit real API keys.