commit from root
Browse files
README.md
CHANGED
@@ -10,106 +10,32 @@ This repository contains the DISC-FinLLM, version of Baichuan-13B-Chat as the ba
|
|
10 |
|
11 |
<div align="center">
|
12 |
|
13 |
-
[Demo](https://
|
14 |
</div>
|
15 |
|
16 |
**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.**
|
17 |
|
18 |
|
19 |
-
DISC-
|
20 |
-
* **Legal Texts Generic Processing Capability**
|
21 |
-
* **Legal Thinking and Reasoning**
|
22 |
-
* **Legal knowledge Retrieval Capacity**
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
* **
|
27 |
-
* **
|
28 |
|
29 |
-
Check our [HOME](https://github.com/FudanDISC/DISC-
|
30 |
-
|
31 |
-
# DISC-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
</tr>
|
43 |
-
<tr>
|
44 |
-
<td rowspan="10">DISC-LawLLM-SFT-Pair</td>
|
45 |
-
<td>Legal information extraction</td>
|
46 |
-
<td>32K</td>
|
47 |
-
<td rowspan="7">Legal professional assistant</td>
|
48 |
-
</tr>
|
49 |
-
<tr>
|
50 |
-
<td>Legal event detection</td>
|
51 |
-
<td>27K</td>
|
52 |
-
</tr>
|
53 |
-
<tr>
|
54 |
-
<td>Legal case classification</td>
|
55 |
-
<td>20K</td>
|
56 |
-
</tr>
|
57 |
-
<tr>
|
58 |
-
<td>Legal judgement prediction</td>
|
59 |
-
<td>11K</td>
|
60 |
-
</tr>
|
61 |
-
<tr>
|
62 |
-
<td>Legal case matching</td>
|
63 |
-
<td>8K</td>
|
64 |
-
</tr>
|
65 |
-
<tr>
|
66 |
-
<td>Legal text summarization</td>
|
67 |
-
<td>9K</td>
|
68 |
-
</tr>
|
69 |
-
<tr>
|
70 |
-
<td>Judicial public opinion summarization</td>
|
71 |
-
<td>6K</td>
|
72 |
-
</tr>
|
73 |
-
<tr>
|
74 |
-
<td>Legal question answering</td>
|
75 |
-
<td>93K</td>
|
76 |
-
<td>Legal consultation services</td>
|
77 |
-
</tr>
|
78 |
-
<tr>
|
79 |
-
<td>Legal reading comprehension</td>
|
80 |
-
<td>38K</td>
|
81 |
-
<td rowspan="2">Judicial examination assistant</td>
|
82 |
-
</tr>
|
83 |
-
<tr>
|
84 |
-
<td>Judicial examination</td>
|
85 |
-
<td>12K</td>
|
86 |
-
</tr>
|
87 |
-
<tr>
|
88 |
-
<td rowspan="2">DISC-LawLLM-SFT-Triple</td>
|
89 |
-
<td>Legal judgement prediction</td>
|
90 |
-
<td>16K</td>
|
91 |
-
<td>Legal professional assistant</td>
|
92 |
-
</tr>
|
93 |
-
<tr>
|
94 |
-
<td>Legal question answering</td>
|
95 |
-
<td>23K</td>
|
96 |
-
<td>Legal consultation services</td>
|
97 |
-
</tr>
|
98 |
-
<tr>
|
99 |
-
<td rowspan="2">General</td>
|
100 |
-
<td>Alpaca-GPT4</td>
|
101 |
-
<td>48K</td>
|
102 |
-
<td rowspan="2">General scenarios</td>
|
103 |
-
</tr>
|
104 |
-
<tr>
|
105 |
-
<td>Firefly</td>
|
106 |
-
<td>60K</td>
|
107 |
-
</tr>
|
108 |
-
<tr>
|
109 |
-
<td>Total</td>
|
110 |
-
<td colspan="3">403K</td>
|
111 |
-
</tr>
|
112 |
-
</table>
|
113 |
|
114 |
# Using through hugging face transformers
|
115 |
|
@@ -117,27 +43,27 @@ we construct a high-quality supervised fine-tuning dataset, DISC-Law-SFT with tw
|
|
117 |
>>>import torch
|
118 |
>>>>>>from transformers import AutoModelForCausalLM, AutoTokenizer
|
119 |
>>>from transformers.generation.utils import GenerationConfig
|
120 |
-
>>>tokenizer = AutoTokenizer.from_pretrained("
|
121 |
-
>>>model = AutoModelForCausalLM.from_pretrained("
|
122 |
-
>>>model.generation_config = GenerationConfig.from_pretrained("
|
123 |
>>>messages = []
|
124 |
-
>>>messages.append({"role": "user", "content": "
|
125 |
>>>response = model.chat(tokenizer, messages)
|
126 |
>>>print(response)
|
127 |
```
|
128 |
|
129 |
-
|
130 |
|
131 |
-
DISC-
|
132 |
|
133 |
-
|
134 |
|
135 |
-
If our
|
136 |
|
137 |
```
|
138 |
@misc{yue2023disclawllm,
|
139 |
title={DISC-LawLLM: Fine-tuning Large Language Models for Intelligent Legal Services},
|
140 |
-
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
|
141 |
year={2023},
|
142 |
eprint={2309.11325},
|
143 |
archivePrefix={arXiv},
|
@@ -145,6 +71,6 @@ If our work is helpful for your, please kindly cite our work as follows:
|
|
145 |
}
|
146 |
```
|
147 |
|
148 |
-
|
149 |
|
150 |
The use of the source code in this repository complies with the Apache 2.0 License.
|
|
|
10 |
|
11 |
<div align="center">
|
12 |
|
13 |
+
[Demo](https://finllm.fudan-disc.com) | [技术报告](https://arxiv.org/abs/2309.11325)
|
14 |
</div>
|
15 |
|
16 |
**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.**
|
17 |
|
18 |
|
19 |
+
DISC-FinLLM is a large model in the financial field specifically designed to provide users with professional, intelligent, and comprehensive **financial consulting services** in financial scenarios. It is developed by [Fudan University Data Intelligence and Social Computing Laboratory (Fudan-DISC)](http://fudan-disc.com) developed and open source. It is a multi-expert smart financial system composed of four modules for different financial scenarios: financial consulting, financial text analysis, financial calculation, and financial knowledge retrieval and question answering. These modules showed clear advantages in four evaluations including financial NLP tasks, human test questions, data analysis and current affairs analysis, proving that DISC-FinLLM can provide strong support for a wide range of financial fields. DISC-FinLLM can help in different application scenarios and can be used to implement different functions:
|
|
|
|
|
|
|
20 |
|
21 |
+
* **Financial Consultation:** This module can start multiple rounds of dialogue with users on financial topics in the Chinese financial context, or explain relevant knowledge of financial majors to users. It is composed of the financial consulting instructions part of the data set.
|
22 |
+
* **Financial Text Analysis:** This module can help users complete NLP tasks such as information extraction, sentiment analysis, text classification, and text generation on financial texts. It is trained by the financial task instructions in the data set.
|
23 |
+
* **Financial Calculation:** This module can help users complete tasks related to mathematical calculations. In addition to basic calculations such as interest rates and growth rates, it also supports statistical analysis and includes the Black-Scholes option pricing model and the EDF expected default probability model. Financial model calculations included. This module is partially trained from the financial computing instructions in the data set.
|
24 |
+
* **Financial Knowledge Retrieval Q&A:** This module can provide users with investment advice, current affairs analysis, and policy interpretation based on financial news, research reports, and related policy documents. It is partially trained from the retrieval-enhanced instructions in the dataset.
|
25 |
|
26 |
+
Check our [HOME](https://github.com/FudanDISC/DISC-FinLLM) for more information.
|
27 |
+
|
28 |
+
# DISC-Fin-SFT Dataset
|
29 |
+
|
30 |
+
DISC-FinLLM is a large financial model based on the high-quality financial data set DISC-Fin-SFT. We construct and fine-tuned the LoRA instruction on the general-domain Chinese large model Baichuan-13B-Chat. DISC-Fin-SFT contains a total of about 250,000 pieces of data, divided into four sub-data sets, which are financial consulting instructions, financial task instructions, financial computing instructions, and retrieval-enhanced instructions.
|
31 |
+
|
32 |
+
| Dataset | Samples | Input Length | Output Length |
|
33 |
+
|----------------:|----------------:|------------------------------------------------------------:|-----------------------------------------------------------:|
|
34 |
+
| Financial Consulting Instructions | 63k | 26 | 369 |
|
35 |
+
| Financial Task Instructions | 110k | 676 | 35 |
|
36 |
+
| Financial Computing Instructions | 57k | 73 | 190 |
|
37 |
+
| Retrieval-enhanced Instructions | 20k | 1031 | 521 |
|
38 |
+
| DISC-Fin-SFT | 246k | 351 | 198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
# Using through hugging face transformers
|
41 |
|
|
|
43 |
>>>import torch
|
44 |
>>>>>>from transformers import AutoModelForCausalLM, AutoTokenizer
|
45 |
>>>from transformers.generation.utils import GenerationConfig
|
46 |
+
>>>tokenizer = AutoTokenizer.from_pretrained("Go4miii/DISC-FinLLM", use_fast=False, trust_remote_code=True)
|
47 |
+
>>>model = AutoModelForCausalLM.from_pretrained("Go4miii/DISC-FinLLM", device_map="auto", torch_dtype=torch.float16, trust_remote_code=True)
|
48 |
+
>>>model.generation_config = GenerationConfig.from_pretrained("Go4miii/DISC-FinLLM")
|
49 |
>>>messages = []
|
50 |
+
>>>messages.append({"role": "user", "content": "请解释一下什么是银行不良资产?"})
|
51 |
>>>response = model.chat(tokenizer, messages)
|
52 |
>>>print(response)
|
53 |
```
|
54 |
|
55 |
+
## Disclaimer
|
56 |
|
57 |
+
DISC-FinLLM has problems and shortcomings that cannot be overcome by current large language models. Although it can provide services in the financial field on many tasks and scenarios, the model should be used for user reference only and cannot replace professional financial analysts and financial experts. , we hope that users of DISC-FinLLM will evaluate the model with a critical eye. We are not responsible for any problems, risks or adverse consequences arising from the use of DISC-FinLLM.
|
58 |
|
59 |
+
## Citation
|
60 |
|
61 |
+
If our project has been helpful for your research and work, please kindly cite our work as follows:
|
62 |
|
63 |
```
|
64 |
@misc{yue2023disclawllm,
|
65 |
title={DISC-LawLLM: Fine-tuning Large Language Models for Intelligent Legal Services},
|
66 |
+
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 Xuanjing Huang and Zhongyu Wei},
|
67 |
year={2023},
|
68 |
eprint={2309.11325},
|
69 |
archivePrefix={arXiv},
|
|
|
71 |
}
|
72 |
```
|
73 |
|
74 |
+
## License
|
75 |
|
76 |
The use of the source code in this repository complies with the Apache 2.0 License.
|