Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PKU-YuanGroup/ChatLaw
ChatLaw:A Powerful LLM Tailored for Chinese Legal. 中文法律大模型
https://github.com/PKU-YuanGroup/ChatLaw
Last synced: about 2 months ago
JSON representation
ChatLaw:A Powerful LLM Tailored for Chinese Legal. 中文法律大模型
- Host: GitHub
- URL: https://github.com/PKU-YuanGroup/ChatLaw
- Owner: PKU-YuanGroup
- License: agpl-3.0
- Created: 2023-06-07T12:12:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-04T10:04:23.000Z (6 months ago)
- Last Synced: 2024-06-06T09:19:41.640Z (6 months ago)
- Homepage: https://chatlaw.cloud/
- Size: 11 MB
- Stars: 6,555
- Watchers: 37
- Forks: 511
- Open Issues: 55
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Domain-LLM - ChatLaw
- StarryDivineSky - PKU-YuanGroup/ChatLaw - 13B、Anima-33B,我们使用大量法律新闻、法律论坛、法条、司法解释、法律咨询、法考题、判决文书等原始文本来构造对话数据。 (A01_文本生成_文本对话 / 大语言对话模型及数据)
- AiTreasureBox - PKU-YuanGroup/ChatLaw - 12-07_6985_1](https://img.shields.io/github/stars/PKU-YuanGroup/ChatLaw.svg)|Chinese Legal Large Model| (Repos)
- awesome-llm-and-aigc - ChatLaw - YuanGroup/ChatLaw?style=social"/> : ChatLaw-法律大模型。[chatlaw.cloud/lawchat/](https://chatlaw.cloud/lawchat/) (Applications / 提示语(魔法))
- awesome-llm-and-aigc - ChatLaw - YuanGroup/ChatLaw?style=social"/> : ChatLaw-法律大模型。[chatlaw.cloud/lawchat/](https://chatlaw.cloud/lawchat/) (Applications / 提示语(魔法))
README
# Chatlaw: A Large Language Model-based Multi-Agent Legal Assistant Enhanced by Knowledge Graph and Mixture-of-Experts.
# ChatLaw Models
## ChatLaw2-MoE
- **Latest Version**: Based on the InternLM architecture with a 4x7B Mixture of Experts (MoE) design.
- **Specialization**: Tailored for Chinese legal language processing、
## ChatLaw-13B
- **Demo Version**: Built on the Ziya-LLaMA-13B-v1 model.
- **Performance**: Excels in general Chinese tasks but requires a larger model for complex legal QA.## ChatLaw-33B
- **Demo Version**: Utilizes the Anima-33B model.
- **Enhancements**: Improved logical reasoning over the 13B version.
- **Challenge**: Occasionally defaults to English responses due to limited Chinese training data in Anima.## ChatLaw-Text2Vec
- **Function**: A text similarity model trained on 93,000 court case decisions.
- **Capability**: Matches user queries to pertinent legal statutes, offering contextual relevance.
- **Example**: Connects questions about loan repayment to the appropriate sections of contract law.## Introduction
AI legal assistants, powered by Large Language Models (LLMs), offer accessible legal consulting. However, the risk of hallucination in AI responses is a concern. This paper introduces ChatLaw, an innovative assistant that employs a Mixture-of-Experts (MoE) model and a multi-agent system to enhance reliability and accuracy in AI legal services. By integrating knowledge graphs and artificial screening, we've created a high-quality legal dataset for training the MoE model. This model leverages various experts to address a range of legal issues, optimizing legal response accuracy. Standardized Operating Procedures (SOPs), inspired by law firm workflows, significantly minimize errors and hallucinations.
Our MoE model outperforms GPT-4 in the Lawbench and Unified Qualification Exam for Legal Professionals, achieving a 7.73% higher accuracy and an 11-point lead, respectively. It also surpasses other models in real-case consultations across multiple dimensions, showcasing robust legal consultation capabilities.
---
### Multi-Agents Collaboration Process and Legal Consultation Report
The diagram below illustrates the collaborative process of multiple agents in providing legal consultation services, exemplified by a divorce consultation. The process involves gathering information, legal research, comprehensive advice, and culminates in a detailed Legal Consultation Report.
# Dataset
For datasets, please visit:
- [Chinese Law Examples](https://huggingface.co/datasets/PandaVT/chinese_law_examples)
- [Chinese Verdict Examples](https://huggingface.co/datasets/PandaVT/chinese_verdict_examples)## Data Visualization and Performance Comparison
(a) Our legal dataset covers a diverse range of tasks, from case classification to public opinion analysis.
(b) ChatLaw demonstrates superior performance across multiple legal categories compared to other models.
(c) ChatLaw consistently outperforms other models in legal cognitive tasks, as shown in the Lawbench comparison.
(d) ChatLaw maintains high performance across five years on the Unified Qualification Exam for Legal Professionals.
# Experiments
## Evaluation of Legal Consultation Quality and Model Performance
(a) Legal consultation quality is assessed based on Completeness, Logic, Correctness, Language Quality, Guidance, and Authority.
(b) ChatLaw achieves the highest scores across all criteria, particularly excelling in Completeness, Guidance, and Authority.
(c) ChatLaw shows a higher win rate compared to other models, indicating superior capability in providing high-quality legal consultations.
## Truthful QA Evaluation
## Usage
Find the model at: [ChatLaw2-MoE](https://huggingface.co/PandaVT/ChatLaw2-MoE)
```
@misc{cui2024chatlaw,
title={Chatlaw: A Multi-Agent Collaborative Legal Assistant with Knowledge Graph Enhanced Mixture-of-Experts Large Language Model},
author={Jiaxi Cui and Munan Ning and Zongjian Li and Bohua Chen and Yang Yan and Hao Li and Bin Ling and Yonghong Tian and Li Yuan},
year={2024},
eprint={2306.16092},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@misc{ChatLaw,
author={Jiaxi Cui and Zongjian Li and Yang Yan and Bohua Chen and Li Yuan},
title={ChatLaw},
year={2023},
publisher={GitHub},
journal={GitHub repository},
howpublished={\url{https://github.com/PKU-YuanGroup/ChatLaw}},
}
```## Star History
[![Star History](https://api.star-history.com/svg?repos=PKU-YuanGroup/ChatLaw&type=Date)](https://star-history.com/#PKU-YuanGroup/ChatLaw&Date)
## Contributors