This repo contains the source code of paper: SERE: Structural Example Retrieval for Enhancing LLMs in Event Causality Identification, Findings of ACL 2026.
- Run
pip install -r requirements.txtto install the Python dependencies. - Prepare your OpenAI API key and add it to the
GPT_4O_MINI_KEYfield in theenv.envfile.
- Download the ConceptNet assertions from the ConceptNet official website.
- Run
utils/conceptnet/to_neo4j.pyto convert the assertions into a format suitable for importing into Neo4j, generatingnodes.csvandedges.csv. - Download Neo4j from the Neo4j official website, deploy it, and import
nodes.csvandedges.csvto construct ConceptNet. - Run
utils/conceptnet/vecdb.pyto generate embeddings for each node and build a vector database (make sure to set the relevant parameters and variables at the end of the Python script).
- Download the datasets:
- Preprocess the datasets by adding necessary fields required for subsequent steps. You can use
CPATT_dataset_format.ipynbto preprocess the CPATT dataset by specifying thesplitandsubset_typefor each dataset. (Gao’s dataset can be processed similarly; just ensure the fields are consistent.) - Run
utils/dataset_preprocess.pyto process the data (make sure to set the relevant parameters and variables at the beginning and end of the Python script).
Run sere.py to perform inference (make sure to set the relevant parameters and variables at the end of the script).