Giter Club home page Giter Club logo

caseencoder's Introduction

CaseEncoder

Accepted by EMNLP2023

CaseEncoder: A Knowledge-enhanced Pre-trained Model for Legal Case Encoding

Before Start

Please unzip all .blk.zip files in data

A few parameters in config/Caseformer.config need to be specified:

  • train_data_path, valid_data_path in config/Caseformer.config is the path of the pre-training and validation dataset, which is not included in this repo due to the space limit. But we provide exactly the same checkpoint of CaseEncoder reported in our paper here.
  • test_kara_dataset is the test dataset you would like to use. We provide three choices: lecard, cail-lcr21, and cail-lcr22.

Model Training

Training from the start:

torchrun --standalone --nnodes=1 --nproc_per_node=YOUR_GPU_NUMBER train.py --config config/Caseformer.config --gpu YOUR_GPU_LIST 2>&1 | tee -a log/Caseformer.log 

Training from a checkpoint:

torchrun --standalone --nnodes=1 --nproc_per_node=YOUR_GPU_NUMBER train.py --checkpoint YOUR_CHECKPOINT_PATH --config config/Caseformer.config --gpu YOUR_GPU_LIST 2>&1 | tee -a log/Caseformer.log 

Model Evaluation

To validate the checkpoint of CaseEncoder

torchrun --standalone --nnodes=1 --nproc_per_node=1 test.py --checkpoint YOUR_CHECKPOINT_PATH --config config/Caseformer.config --gpu 0 --result YOUR_RESULT_STORAGE_PATH
  • where YOUR_CHECKPOINT_PATH is the path of CaseEncoder checkpoint you download.

caseencoder's People

Contributors

myx666 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

thuir

caseencoder's Issues

query for the the processed training data

Hello, I am currently reading your paper. Could you provide the processed training data that includes 'xf_article' and 'fg_article_vector'? This data is used in the formatter/CaseformerFormatter.py file because I want to replicate the process described in section 4.1 of your paper. Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.