Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

99 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains the code and data used in the experiments for the paper "Beyond Pairwise: Global Zero-shot Temporal Graph Generation".

Requirements

  • Python 3.10
  • Gurobi optimizer license https://www.gurobi.com
  • Install the requirements.txt packages using pip:
  • Create data and output directories in the root directory.
  • Create a .env file in the root directory and add your OpenAI/Gemini/Together API key/s:
OPENAI_API_KEY=your_openai_api_key
GOOGLE_API_KEY=your_google_api_key
TOGETHER_API_KEY=your_together_api_key

Data

Dataset we used in our experiments (in the needed format):

  1. OmniTemp: https://github.com/AlonEirew/event-relation-resources/tree/main/tre_datasets/OmniTemp
  2. MATRES: https://github.com/AlonEirew/event-relation-resources/tree/main/tre_datasets/MATRES/_in_OmniTemp_format
  3. TBD: https://github.com/AlonEirew/event-relation-resources/tree/main/tre_datasets/TimeBankDense/_In_OmniTemp_format
  4. NT_6: https://github.com/AlonEirew/event-relation-resources/tree/main/tre_datasets/NarrativeTime/_In_OmniTemp_format/exclude_overlap_rel_a1

Download the dataset folders and place them in the data directory as follows:

    OmniTemp/
        test/
        train/
    MATRES/
        test/
        test_all_pairs_chunked
        train/
    TBD/
        test/
        test_converted_allpairs_chunked
        train/
    NT-6/
        test/
        test_18ment
        train/

Zero-shot Temporal Graph Generation

python scripts/run/run_zsl_tre.py --test_db omni --instruct timeline --api gpt --model_name gpt-4o --output_folder output/omni_gpt4o_exp  --repeat 1

--test_db : omni, matres, tbd, nt --instruct : timeline, global --api : gpt, gemini, together --model_name : model name according to the api used (e.g., gpt-3.5-turbo, gpt-4o, gemini-1.5, deepseek-ai/DeepSeek-R1, etc.) --repeat : number of times to repeat the experiment (for selfConsistency/globalConsistency)

Evaluation

Self-Consistency

eval_self_consistency.py --test_ds omni --test_folder output/omni_gpt4o_exp

--test_ds : omni, matres, tbd, nt --test_folder : folder containing the files generated by run_zsl_tre.py

Global-Consistency

eval_global_consistency.py --test_ds omni --test_folder output/omni_gpt4o_exp

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages