b1sheng commited on
Commit
e68686c
1 Parent(s): ba4fccf

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +54 -0
README.md CHANGED
@@ -1,3 +1,57 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ language:
4
+ - zh
5
+ tags:
6
+ - Court View
7
+ - Legal Judgment Prediction
8
+ - Explainable
9
+ - GPT2
10
  ---
11
+
12
+
13
+ # AI Judge
14
+ ----
15
+ ## Model Description
16
+ <p align = "justify"> The advent of ChatGPT and GPT-4 have brought groundbreaking progress in the realm of natural language processing, with its astonishing generative capabilities. Nevertheless, the training and deployment of such large-scale language models are exceedingly costly. Furthermore, experience has shown that these models struggle to deliver satisfactory performance in specific domains, such as knowledge-intensive scenarios like jurisprudence. Common limitations include knowledge hallucinations, inability to accurately apply legal provisions, and generating overly vague content. </p>
17
+
18
+ <p align = "justify">To alleviate the aforementioned challenges, we have trained a series of language models based on Chinese legal corpora, known as JurisLMs. These models have been further pre-trained on various types of legal documents, such as Chinese laws and regulations, consultations, and judgment document. AI Judge is one such model within the JurisLMs family, derived from the GPT-2 model that has further pre-training on legal judgment documents, combined with an article selection model (a BERT-based classifier) for fine-tuning, resulting in an explainable legal judgment model. Compared to existing models, AI Judge not only provides sentencing outcomes but also offers corresponding judicial perspectives. </p>
19
+
20
+ ## Model Usage
21
+ ```python
22
+ import torch
23
+ from transformers import BertTokenizer, GPT2LMHeadModel, TextGenerationPipeline
24
+
25
+ fact_description = "1、2013年6月25日9时许,被告人丁某某在平阴县中医院建筑工地工人宿舍,窃取被害人胡某(男,43岁)现金1500元,在逃离现场时被工地工人抓获,丁某某将窃取的现金返还被害人。2、2013年7月12日14时许,被告人丁某某在平阴县府前街文鼎嘉苑建筑工地工人宿舍,窃取被害人陈某(男,31岁)及王某(男,25岁)现金850元,在逃跑时被抓获,丁某某将盗窃现金返还被害人。本院认为,"
26
+
27
+ model_name = "openkg/aijudge"
28
+
29
+ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
30
+ tokenizer = BertTokenizer.from_pretrained(model_name)
31
+ model = GPT2LMHeadModel.from_pretrained(model_name).to(device)
32
+ generator = TextGenerationPipeline(model, tokenizer, device=0)
33
+ generator.tokenizer.pad_token_id = generator.model.config.eos_token_id
34
+ prediction = generator(fact_description,
35
+ max_length=1024,
36
+ num_beams=1,
37
+ top_p=0.7,
38
+ num_return_sequences=1,
39
+ eos_token_id=50256,
40
+ pad_token_id=generator.model.config.eos_token_id)
41
+
42
+ court_view = prediction[0]["generated_text"].replace(" ", "").split("。本院认为,")[1].split("<生成结束>")[0]
43
+ print(court_view)
44
+ ```
45
+
46
+ ## Comparison
47
+ For detailed comparisons, please refer to [(JurisLMs)](https://github.com/seudl/JurisLMs)
48
+
49
+ ## Acknowledged Limitations
50
+ Despite being significantly ameliorated through professional annotation and evaluation, JurisGPT2 inevitably retains certain limitations, including but not limited to:
51
+ - Potential oversight of crucial facts
52
+ - Possible logical errors in multiple parties
53
+ - Potential inaccuracies in conclusions
54
+ - Possibility of outdated legal provisions
55
+
56
+ ## Disclaimer
57
+ <p align = "justify">This project is strictly for academic research purposes and is prohibited for commercial use. When utilizing third-party technologies, adhere to the corresponding open-source licenses. The accuracy of the content generated by this project is subject to factors such as algorithms, randomness, and quantification precision, and therefore, cannot be guaranteed. The project assumes no legal liability for any content produced by the model and shall not be held responsible for any damages resulting from the use of related resources and output. Due to the time constraints of the R&D group, timely technical support is unfortunately not feasible.</p>