ShengbinYue/DISC-LawLLM

Model

This repository contains the DISC-LawLLM, version of Baichuan-13b-base as the base model.

42

stars

16

commits

1

linked in READMEs

Feb 10, 2025

updated

baichuan
custom_code
feature-extraction
legal
pytorch
transformers

README

This repository contains the DISC-LawLLM, version of Baichuan-13b-base as the base model.

Please note that due to the ongoing development of the project, the model weights in this repository may differ from those in our currently deployed demo.

DISC-LawLLM is a large language model specialized in Chinese legal domain, developed and open-sourced by Data Intelligence and Social Computing Lab of Fudan University (Fudan-DISC), to provide comprehensive intelligent legal services. The advtantages is:

  • Legal Texts Generic Processing Capability
  • Legal Thinking and Reasoning
  • Legal knowledge Retrieval Capacity

In addition, the contributions include:

  • High-quality SFT datasets and effective training paradigms
  • Chinese legal LLMs evaluation framework

Check our HOME for more information.

DISC-Law-SFT Dataset

we construct a high-quality supervised fine-tuning dataset, DISC-Law-SFT with two subsets, namely DISC-Law-SFT-Pair and DISC-Law-SFT-Triplet. Our dataset converge a range of legal tasks, including legal information extraction, judgment prediction, document summarization, and legal question answering, ensuring coverage of diverse scenarios.

DatasetTask/SourceSizeScenario
DISC-LawLLM-SFT-PairLegal information extraction32KLegal professional assistant
Legal event detection27K
Legal case classification20K
Legal judgement prediction11K
Legal case matching8K
Legal text summarization9K
Judicial public opinion summarization6K
Legal question answering93KLegal consultation services
Legal reading comprehension38KJudicial examination assistant
Judicial examination12K
DISC-LawLLM-SFT-TripleLegal judgement prediction16KLegal professional assistant
Legal question answering23KLegal consultation services
GeneralAlpaca-GPT448KGeneral scenarios
Firefly60K
Total403K

Using through hugging face transformers

>>>import torch
>>>>>>from transformers import AutoModelForCausalLM, AutoTokenizer
>>>from transformers.generation.utils import GenerationConfig
>>>tokenizer = AutoTokenizer.from_pretrained("ShengbinYue/DISC-LawLLM", use_fast=False, trust_remote_code=True)
>>>model = AutoModelForCausalLM.from_pretrained("ShengbinYue/DISC-LawLLM", device_map="auto", torch_dtype=torch.float16, trust_remote_code=True)
>>>model.generation_config = GenerationConfig.from_pretrained("ShengbinYue/DISC-LawLLM")
>>>messages = []
>>>messages.append({"role": "user", "content": "生产销售假冒伪劣商品罪如何判刑?"})
>>>response = model.chat(tokenizer, messages)
>>>print(response)

Disclaimer

DISC-LawLLM comes with issues and limitations that current LLMs have yet to overcome. While it can provide Chinese legal services in many a wide variety of tasks and scenarios, the model should be used for reference purposes only and cannot replace professional lawyers and legal experts. We encourage users of DISC-LawLLM to evaluate the model critically. We do not take responsibility for any issues, risks, or adverse consequences that may arise from the use of DISC-LawLLM.

Citation

If our work is helpful for your, please kindly cite our work as follows:

@misc{yue2023disclawllm,
    title={DISC-LawLLM: Fine-tuning Large Language Models for Intelligent Legal Services}, 
    author={Shengbin Yue and Wei Chen and Siyuan Wang and Bingxuan Li and Chenchen Shen and Shujun Liu and Yuxuan Zhou and Yao Xiao and Song Yun and Wei Lin and Xuanjing Huang and Zhongyu Wei},
    year={2023},
    eprint={2309.11325},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

@inproceedings{yue2024lawllm,
  title={LawLLM: Intelligent Legal System with Legal Reasoning and Verifiable Retrieval},
  author={Yue, Shengbin and Liu, Shujun and Zhou, Yuxuan and Shen, Chenchen and Wang, Siyuan and Xiao, Yao and Li, Bingxuan and Song, Yun and Shen, Xiaoyu and Chen, Wei and others},
  booktitle={International Conference on Database Systems for Advanced Applications},
  pages={304--321},
  year={2024},
  organization={Springer}
}

License

The use of the source code in this repository complies with the Apache 2.0 License.

Contributors

ShengbinYue

16 commits

ShengbinYue/DISC-LawLLM

Model

This repository contains the DISC-LawLLM, version of Baichuan-13b-base as the base model.

42

stars

16

commits

1

linked in READMEs

Feb 10, 2025

updated

baichuan
custom_code
feature-extraction
legal
pytorch
transformers

README

This repository contains the DISC-LawLLM, version of Baichuan-13b-base as the base model.

Please note that due to the ongoing development of the project, the model weights in this repository may differ from those in our currently deployed demo.

DISC-LawLLM is a large language model specialized in Chinese legal domain, developed and open-sourced by Data Intelligence and Social Computing Lab of Fudan University (Fudan-DISC), to provide comprehensive intelligent legal services. The advtantages is:

  • Legal Texts Generic Processing Capability
  • Legal Thinking and Reasoning
  • Legal knowledge Retrieval Capacity

In addition, the contributions include:

  • High-quality SFT datasets and effective training paradigms
  • Chinese legal LLMs evaluation framework

Check our HOME for more information.

DISC-Law-SFT Dataset

we construct a high-quality supervised fine-tuning dataset, DISC-Law-SFT with two subsets, namely DISC-Law-SFT-Pair and DISC-Law-SFT-Triplet. Our dataset converge a range of legal tasks, including legal information extraction, judgment prediction, document summarization, and legal question answering, ensuring coverage of diverse scenarios.

DatasetTask/SourceSizeScenario
DISC-LawLLM-SFT-PairLegal information extraction32KLegal professional assistant
Legal event detection27K
Legal case classification20K
Legal judgement prediction11K
Legal case matching8K
Legal text summarization9K
Judicial public opinion summarization6K
Legal question answering93KLegal consultation services
Legal reading comprehension38KJudicial examination assistant
Judicial examination12K
DISC-LawLLM-SFT-TripleLegal judgement prediction16KLegal professional assistant
Legal question answering23KLegal consultation services
GeneralAlpaca-GPT448KGeneral scenarios
Firefly60K
Total403K

Using through hugging face transformers

>>>import torch
>>>>>>from transformers import AutoModelForCausalLM, AutoTokenizer
>>>from transformers.generation.utils import GenerationConfig
>>>tokenizer = AutoTokenizer.from_pretrained("ShengbinYue/DISC-LawLLM", use_fast=False, trust_remote_code=True)
>>>model = AutoModelForCausalLM.from_pretrained("ShengbinYue/DISC-LawLLM", device_map="auto", torch_dtype=torch.float16, trust_remote_code=True)
>>>model.generation_config = GenerationConfig.from_pretrained("ShengbinYue/DISC-LawLLM")
>>>messages = []
>>>messages.append({"role": "user", "content": "生产销售假冒伪劣商品罪如何判刑?"})
>>>response = model.chat(tokenizer, messages)
>>>print(response)

Disclaimer

DISC-LawLLM comes with issues and limitations that current LLMs have yet to overcome. While it can provide Chinese legal services in many a wide variety of tasks and scenarios, the model should be used for reference purposes only and cannot replace professional lawyers and legal experts. We encourage users of DISC-LawLLM to evaluate the model critically. We do not take responsibility for any issues, risks, or adverse consequences that may arise from the use of DISC-LawLLM.

Citation

If our work is helpful for your, please kindly cite our work as follows:

@misc{yue2023disclawllm,
    title={DISC-LawLLM: Fine-tuning Large Language Models for Intelligent Legal Services}, 
    author={Shengbin Yue and Wei Chen and Siyuan Wang and Bingxuan Li and Chenchen Shen and Shujun Liu and Yuxuan Zhou and Yao Xiao and Song Yun and Wei Lin and Xuanjing Huang and Zhongyu Wei},
    year={2023},
    eprint={2309.11325},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

@inproceedings{yue2024lawllm,
  title={LawLLM: Intelligent Legal System with Legal Reasoning and Verifiable Retrieval},
  author={Yue, Shengbin and Liu, Shujun and Zhou, Yuxuan and Shen, Chenchen and Wang, Siyuan and Xiao, Yao and Li, Bingxuan and Song, Yun and Shen, Xiaoyu and Chen, Wei and others},
  booktitle={International Conference on Database Systems for Advanced Applications},
  pages={304--321},
  year={2024},
  organization={Springer}
}

License

The use of the source code in this repository complies with the Apache 2.0 License.

Contributors

ShengbinYue

16 commits