ShengbinYue commited on
Commit
13a6615
1 Parent(s): 579f1bb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +142 -1
README.md CHANGED
@@ -4,4 +4,145 @@ language:
4
  - zh
5
  tags:
6
  - legal
7
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  - zh
5
  tags:
6
  - legal
7
+ ---
8
+
9
+ <div align="center">
10
+ <h1>DISC-LawLLM</h1>
11
+
12
+ [Technical Report](https://arxiv.org/abs/2309.11325)
13
+ </div>
14
+ This repository contains the DISC-LawLLM, version of Baichuan-13b-base as the base model.
15
+
16
+ DISC-LawLLM is a large language model specialized in Chinese legal domain, developed and open-sourced by [Fudan University Data Intelligence and Social Computing Laboratory (Fudan-DISC)](http://fudan-disc.com) with the aim of providing comprehensive intelligent legal services.It caters to different user groups and offers assistance in various scenarios, with the following main advantage :
17
+ * **Legal Texts Generic Processing Capability:**
18
+ * **Legal Thinking and Reasoning:**
19
+ * **Legal knowledge retrieval capacity:**
20
+
21
+ In addition, the contributions include:
22
+
23
+ * **High-Quality SFT datasets and effective training paradigms**
24
+ * **Chinese legal LLMS Evaluation Framework**
25
+
26
+ Check our [HOME](https://github.com/FudanDISC/DISC-LawLLM) for more information.
27
+
28
+ # DISC-Law-SFT Dataset
29
+
30
+ 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. We construct instruction samples converging a range of legal tasks, including legal information extraction, judgment prediction, document summarization, and legal question answering, ensuring coverage of diverse scenarios.
31
+ <img src="" alt="" width=""/>
32
+
33
+ <table>
34
+ <tr>
35
+ <th>Dataset</th>
36
+ <th>Task/Source</th>
37
+ <th>Size</th>
38
+ <th>Scenario</th>
39
+ </tr>
40
+ <tr>
41
+ <td rowspan="10">DISC-LawLLM-SFT-Pair</td>
42
+ <td>Legal information extraction</td>
43
+ <td>32K</td>
44
+ <td rowspan="7">Legal professional assistant</td>
45
+ </tr>
46
+ <tr>
47
+ <td>Legal event detection</td>
48
+ <td>27K</td>
49
+ </tr>
50
+ <tr>
51
+ <td>Legal case classification</td>
52
+ <td>20K</td>
53
+ </tr>
54
+ <tr>
55
+ <td>Legal judgement prediction</td>
56
+ <td>11K</td>
57
+ </tr>
58
+ <tr>
59
+ <td>Legal case matching</td>
60
+ <td>8K</td>
61
+ </tr>
62
+ <tr>
63
+ <td>Legal text summarization</td>
64
+ <td>9K</td>
65
+ </tr>
66
+ <tr>
67
+ <td>Judicial public opinion summarization</td>
68
+ <td>6K</td>
69
+ </tr>
70
+ <tr>
71
+ <td>Legal question answering</td>
72
+ <td>93K</td>
73
+ <td>Legal consultation services</td>
74
+ </tr>
75
+ <tr>
76
+ <td>Legal reading comprehension</td>
77
+ <td>38K</td>
78
+ <td rowspan="2">Judicial examination assistant</td>
79
+ </tr>
80
+ <tr>
81
+ <td>Judicial examination</td>
82
+ <td>12K</td>
83
+ </tr>
84
+ <tr>
85
+ <td rowspan="2">DISC-LawLLM-SFT-Triple</td>
86
+ <td>Legal judgement prediction</td>
87
+ <td>16K</td>
88
+ <td>Legal professional assistant</td>
89
+ </tr>
90
+ <tr>
91
+ <td>Legal question answering</td>
92
+ <td>23K</td>
93
+ <td>Legal consultation services</td>
94
+ </tr>
95
+ <tr>
96
+ <td rowspan="2">General</td>
97
+ <td>Alpaca-GPT4</td>
98
+ <td>48K</td>
99
+ <td rowspan="2">General scenarios</td>
100
+ </tr>
101
+ <tr>
102
+ <td>Firefly</td>
103
+ <td>60K</td>
104
+ </tr>
105
+ <tr>
106
+ <td>Total</td>
107
+ <td colspan="3">403K</td>
108
+ </tr>
109
+ </table>
110
+
111
+ # Using through hugging face transformers
112
+
113
+ ```python
114
+ >>>import torch
115
+ >>>>>>from transformers import AutoModelForCausalLM, AutoTokenizer
116
+ >>>from transformers.generation.utils import GenerationConfig
117
+ >>>tokenizer = AutoTokenizer.from_pretrained("ShengbinYue/DISC-LawLLM", use_fast=False, trust_remote_code=True)
118
+ >>>model = AutoModelForCausalLM.from_pretrained("ShengbinYue/DISC-LawLLM", device_map="auto", torch_dtype=torch.float16, trust_remote_code=True)
119
+ >>>model.generation_config = GenerationConfig.from_pretrained("ShengbinYue/DISC-LawLLM")
120
+ >>>messages = []
121
+ >>>messages.append({"role": "user", "content": "生产销售假冒伪劣商品罪如何判刑?"})
122
+ >>>response = model.chat(tokenizer, messages)
123
+ >>>print(response)
124
+ ```
125
+
126
+ ## Disclaimer
127
+
128
+ 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.
129
+
130
+ ## Citation
131
+
132
+ If our work is helpful for your, please kindly cite our work as follows:
133
+
134
+ ```
135
+ @misc{yue2023disclawllm,
136
+ title={DISC-LawLLM: Fine-tuning Large Language Models for Intelligent Legal Services},
137
+ 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},
138
+ year={2023},
139
+ eprint={2309.11325},
140
+ archivePrefix={arXiv},
141
+ primaryClass={cs.CL}
142
+ }
143
+ ```
144
+
145
+ ## License
146
+
147
+ DISC-LawLLM is available under the Apache License.
148
+