LegalEval-Q
收藏资源简介:
LegalEval-Q数据集由澳门城市大学和中国科学院深圳先进技术研究院的研究人员创建,旨在评估大型语言模型生成的法律文本的质量。数据集包含10000个法律问题,涵盖了刑法、民法和一般法律等领域。数据集的创建过程包括数据生成、模型结构和训练三个主要步骤。数据集的访问地址是https://github.com/lyxx3rd/LegalEval-Q。该数据集主要用于解决当前评估基准主要关注事实准确性而忽视语言质量方面的问题,如清晰度、连贯性和术语。该数据集可用于研究和开发高质量的文本质量评估方法,特别是在法律领域。
The LegalEval-Q dataset was developed by researchers from City University of Macau and the Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences, aiming to assess the quality of legal texts generated by large language models (LLMs). It contains 10,000 legal questions spanning criminal law, civil law and general law domains. The dataset construction process includes three core stages: data generation, model architecture design and model training. The official access link of the dataset is https://github.com/lyxx3rd/LegalEval-Q. This dataset addresses a key limitation of current evaluation benchmarks, which primarily focus on factual accuracy while neglecting important linguistic quality aspects such as clarity, coherence and appropriate terminology usage. It can be utilized for research and development of high-quality text quality evaluation methods, especially in the legal domain.
数据集概述
资源需求
- Python版本: 3.12.9
- 磁盘占用: 约17G
- 显存占用: 约18G
环境配置
bash pip install -r requirements.txt
模型下载
模型列表
- Qwen_7B_Review_Tuned_model: https://www.modelscope.cn/l424102993/LLM_TQ_Tuned_model.git
- Regression_model_base: https://www.modelscope.cn/iic/nlp_bert_backbone_base_std.git
- Regression_model_regression: https://www.modelscope.cn/l424102993/LLM_TQ_Regression_model.git
下载方式
Git下载
bash cd data/models git clone https://www.modelscope.cn/l424102993/LLM_TQ_Tuned_model.git git clone https://www.modelscope.cn/iic/nlp_bert_backbone_base_std git clone https://www.modelscope.cn/l424102993/LLM_TQ_Regression_model.git
魔塔SDK下载
python from modelscope import snapshot_download model_dir = snapshot_download(l424102993/LLM_TQ_Tuned_model, cache_dir = "./data/models/") model_dir = snapshot_download(iic/nlp_bert_backbone_base_std, cache_dir = "./data/models/") model_dir = snapshot_download(l424102993/LLM_TQ_Regression_model, cache_dir = "./data/models")
使用方式
1. 修改配置文件
- 修改文件: ./configs/config.ymal
- 修改内容: 模型目录和指定cuda号
2. 启动评分requests服务
直接启动
bash bash serve.py
手动启动
- 启动文件: ./src/evaluator_request.py
- 注意事项: 可能需要修改config.yaml的读取路径和模型路径
3. 添加API keys
- 文件: Evaluate_example.ipynb
- 操作: 添加Qwen的API Keys或修改相关代码
4. 模型测试
- 使用文件: Evaluate_example.ipynb
- 功能: 单个模型单次评分测试
批量评估
-
使用文件: /notebooks/Evaluate_batch.ipynb
- 功能: 调用api接口或本地模型进行多个模型的评分测试
-
使用文件: /notebooks/Generated_Result_Visualization_Analysis.ipynb
- 功能: 可视化查看并对比分析结果




