File size: 4,772 Bytes
018f7f7
 
1b963bb
6f19c99
 
 
 
 
018f7f7
 
 
 
6f19c99
b7ec8e5
018f7f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b7ec8e5
 
 
 
6f19c99
b7ec8e5
 
 
 
 
 
 
 
 
 
 
 
 
018f7f7
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
base_model: Qwen2-0.5B-Instruct
library_name: peft
pipeline_tag: text-generation
license: apache-2.0
language: zh
datasets: TIM0927/CCVG
tags: ['peft', 'lora', 'chinese', 'charge-prediction', 'legal', 'court-view-generation']
---

# ShiZhi

[English](README.md) | 🤗[huggingface](https://huggingface.co/TIM0927/ShiZhi) | 🤖 [modelscope](https://modelscope.cn/models/freshman8888/LegalReasoningModel) | 📄 [Arxiv](https://arxiv.org/abs/2510.09297) | 💻 [GitHub](https://github.com/ZhitianHou/ShiZhi)

ShiZhi(释之)是一个为中文刑事案件法院观点生成(Criminal Court View Generation, CVG)任务而设计的轻量级大语言模型。
其名称来源于历史人物张释之,在中文中,“释之”一词亦有“解释”“阐明”之意,非常契合法院文书中“法院认为”部分的生成任务。



## Model Details

### 模型描述

基于 Qwen2-0.5B-Instruct 微调的大模型。使用的数据是自建的经过严格清洗的 1985-2021 年的裁判文书数据。



- **语言:** 中文
- **许可证:** Apache License 2.0
- **微调的模型:** Qwen2-0.5B-Instruct



## 开始使用

```python
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'

from swift.llm import (
    PtEngine, RequestConfig, safe_snapshot_download, get_model_tokenizer, get_template, InferRequest
)
from swift.tuners import Swift
# 请调整下面几行
model = 'Qwen/Qwen2-0.5B-Instruct'
lora_checkpoint = safe_snapshot_download('TIM0927/ShiZhi')  # 修改成checkpoint_dir
template_type = None  # None: 使用对应模型默认的template_type
default_system = "你是一个法官,你需要根据裁判文书的事实部分,完成裁判文书的法院推理部分。"  # None: 使用对应模型默认的default_system
fact = "经审理查明,..."

# 加载模型和对话模板
model, tokenizer = get_model_tokenizer(model)
model = Swift.from_pretrained(model, lora_checkpoint)
template_type = template_type or model.model_meta.template
template = get_template(template_type, tokenizer, default_system=default_system)
engine = PtEngine.from_model_template(model, template, max_batch_size=2)
request_config = RequestConfig(max_tokens=512, temperature=0)

infer_requests = [
    InferRequest(messages=[{'role': 'user', 'content': f"事实描述:\n{fact}\n法院推理:\n"}]),
]
resp_list = engine.infer(infer_requests, request_config)
query0 = infer_requests[0].messages[0]['content']
print(f'response: {resp_list[0].choices[0].message.content}')
```



## 训练细节

### 训练数据

使用的数据是自建的经过严格清洗的 1985-2021 年的裁判文书数据,[CCVG](https://huggingface.co/datasets/TIM0927/CCVG)。



### 框架版本

- PEFT 0.12.0



## 引用

如果你觉得我们的文章对你有帮助,欢迎引用:

```bibtex
@misc{hou2025shizhichineselightweightlarge,
      title={ShiZhi: A Chinese Lightweight Large Language Model for Court View Generation}, 
      author={Zhitian Hou and Kun Zeng},
      year={2025},
      eprint={2510.09297},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2510.09297}, 
}
```



## 模型免责声明

1. **用途限制**:本模型的开发与提供仅面向**学术研究场景**,旨在为相关领域的学术探索、技术验证及理论研究提供工具支持。严禁将本模型用于任何商业用途(包括但不限于产品开发、商业服务、盈利性活动等)、非法活动或违反法律法规与公序良俗的场景。
2. **结果有效性声明**:本模型生成的所有内容(包括文本、数据、结论等)均未经过系统性的人工校验与准确性审核,可能存在事实偏差、逻辑疏漏、信息滞后或表述歧义等问题。模型无法对生成内容的真实性、完整性、可靠性及适用性作出任何保证。
3. **偏好适配说明**:本模型的训练数据与优化目标未针对 “符合人类普遍偏好” 或 “满足特定群体主观需求” 进行专项设计,生成内容可能与不同用户的价值观、审美偏好、认知习惯存在差异,模型不保证生成结果符合任何个人或群体的主观预期。
4. **责任界定**:任何基于本模型生成内容所开展的后续行为(包括学术引用、决策参考、内容传播等),其风险与责任均由行为实施者自行承担。模型开发方不对因使用本模型内容而导致的任何直接或间接损失(包括但不限于学术失误、决策偏差、名誉损害等)承担责任。
5. **使用建议**:建议使用者在利用本模型生成内容时,结合自身专业知识与可靠信息源进行交叉验证,对内容的合理性、准确性进行独立判断,避免直接将模型输出作为唯一依据。