base_model: Qwen2-0.5B-Instruct
library_name: transformers
license: apache-2.0
pipeline_tag: text-generation
language: zh
datasets:
- TIM0927/CCVG
tags:
- peft
- lora
- chinese
- legal
- court-view-generation
ShiZhi: A Chinese Lightweight Large Language Model for Court View Generation
This repository contains ShiZhi (\u91ca\u4e4b), a lightweight large language model designed for Criminal Court View Generation (CVG) in Chinese, as presented in the paper ShiZhi: A Chinese Lightweight Large Language Model for Court View Generation.
Code: https://github.com/ZhitianHou/ShiZhi
中文 | 🤖modelscope
Its name comes from the historical figure Zhang Shizhi (\u5f20\u91ca\u4e4b), and in Chinese, \u201c\u91ca\u4e4b\u201d also conveys the meaning of \u201cexplaining\u201d or \u201cinterpreting,\u201d which is particularly suitable for generating the court view section in legal case documents.
Model Details
Model Description
This model is fine-tuned based on Qwen2-0.5B-Instruct, using a dataset of Chinese judicial documents from 1985 to 2021 that has been rigorously cleaned.
- Language(s) (NLP): Chinese/zh
- Finetuned from model: Qwen2-0.5B-Instruct
How to Get Started with the Model
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"事实描述:
{fact}
法院推理:
"}]),
]
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}')
Training Details
Training Data
The training data is a dataset of Chinese judicial documents from 1985 to 2021 that has been rigorously cleaned, CCVG.
Framework versions
- PEFT 0.12.0
Citation
If you find this project helpful, please consider citing our paper:
@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},
}
Model Disclaimer
- Usage Restriction: This model is developed and provided exclusively for academic research purposes , aiming to offer tool support for academic exploration, technical verification, and theoretical research in relevant fields. The use of this model for any commercial purposes (including but not limited to product development, commercial services, profit - making activities, etc.), illegal activities, or scenarios that violate laws, regulations, public order, and good customs is strictly prohibited.
- Statement on Result Validity: All content generated by this model (including texts, data, conclusions, etc.) has not undergone systematic manual verification and accuracy review. It may contain issues such as factual deviations, logical omissions, outdated information, or ambiguous expressions. The model cannot make any guarantees regarding the authenticity, completeness, reliability, or applicability of the generated content.
- Explanation on Preference Adaptation: The training data and optimization objectives of this model are not specifically designed to "conform to universal human preferences" or "meet the subjective needs of specific groups". The generated content may differ from the values, aesthetic preferences, and cognitive habits of different users. The model does not guarantee that the generated results will meet the subjective expectations of any individual or group.
- Liability Definition: For any subsequent actions (including academic citation, decision - making reference, content dissemination, etc.) based on the content generated by this model, the risks and responsibilities shall be borne solely by the person who carries out the actions. The model developer shall not be liable for any direct or indirect losses (including but not limited to academic errors, decision - making deviations, reputation damage, etc.) caused by the use of the content of this model.
- Usage Recommendation: It is recommended that users, when using the content generated by this model, conduct cross - verification with their own professional knowledge and reliable information sources, make independent judgments on the rationality and accuracy of the content, and avoid directly using the model output as the sole basis.