Skip to content

chandrahas316/LexChronos

Repository files navigation


LexChronos: An Agentic Framework for Structured Event Timeline Extraction in Indian Jurisprudence

LexChronos introduces a dual-agent architecture for iterative extraction of structured event timelines from Indian Supreme Court judgments. It employs LoRA-instruct-tuned LLMs and confidence-driven feedback loops to enhance downstream tasks like legal summarization.


Repository Structure

LexChronos/
├── Data/
│   └── dataset.xlsx        # Synthetic dataset
│
├── Dataset Creation/
│   └── dataset_creation.py        # Creates synthetic dataset using DeepSeek-R1 and GPT-4
│
├── Framework/
│   ├── framework.py               # Implements iterative agentic extraction of event timelines
│   └── framework_eval.py          # Evaluates extracted timelines using BERT-based Precision, Recall, F1
|
├── Instruct-tuned-model-adapters/    
│   ├── README.md               # Model adapters that are used while loading extraction agent
|
├── Instruct-Tuning/
│   └── ins-tuning.py        # Performs LoRA-based instruct-tuning of extraction agent
│
└── Summarization/
    ├── summarization_judgment.py  # Generates summaries from judgment text (unstructured)
    ├── summarization_timeline.py  # Generates summaries from structured event timelines
    └── summarization_eval.py      # Compares summaries using GPT-4 pairwise evaluation

How to run

  • Install all necessary packages,

    pip install -r requirements.txt
  • To run dataset creation code, Run the following command

   python Dataset Creation/dataset_creation.py
  • To run Instruct-tuning and its evaluation Run the following commands
   python Instruct-Tuning/ins-tuning.py --dataset_path Data/dataset.xlsx --extraction_model Llama-3.2-3B-Instruct --instructtuned_model_output_dir <path_to_where_the_adapters_need_to_be_saved> --run_instructtuning --run_evaluation
  • To run framework and its evaluation, Run the following commands
   python Framework/framework.py --dataset_path Data/dataset.xlsx --model_adapters_path <huggingface_model_adpater_id/path_to_where_the adapters_are_saved_locally> --feedback_model google/gemma-2-2b-it
   python Framework/framwork_eval.py
  • To run Summarization and its evaluation, Run the following commands
   python Summarization/summarization_judgment.py --dataset_path <path_to_dataset> --summary_model <huggingface_model_id>
   python Summarization/summarization_timeline.py --dataset_path <path_to_dataset> --summary_model <huggingface_model_id>
   python Summarization/summarization_eval.py

Hardware Infrastructure

  • All computational experiments are conducted on a GPU-enabled system with dedicated access to NVIDIA Tesla V100 GPU (32 GiB GPU memory), 9 vCPUs, and 60 GiB RAM.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages