BR-TaxQA-R
收藏资源简介:
BR-TaxQA-R 是一个针对巴西个人所得税法的问题回答数据集,包括案例法。该数据集包含 715 个问题,来自 2024 年巴西税务局发布的官方问答文档,并增加了 CARF 的法规和行政裁决。我们使用 OpenAI 嵌入进行搜索,使用 GPT-4o-mini 进行答案生成,并实现了检索增强生成 (RAG) 管道。我们比较了不同的文本分割策略,并使用 RAGAS-based 指标将我们的系统与 ChatGPT 和 Perplexity.ai 等商业工具进行了基准测试。结果表明,我们的自定义 RAG 管道在响应相关性方面优于商业系统,表明与用户查询的更强对齐,而商业模型在事实正确性和流畅性方面得分更高。这些发现突出了法律基础生成和语言流畅性之间的权衡。至关重要的是,我们认为在税收等高风险领域,人工专家评估对于确保 AI 生成的答案的法律有效性仍然至关重要。BR-TaxQA-R 公开可在 https://huggingface.co/datasets/unicamp-dl/BR-TaxQA-R 上获得。
BR-TaxQA-R is a question answering dataset targeting Brazilian Personal Income Tax Law, including case law. This dataset consists of 715 questions sourced from official Q&A documents published by the Brazilian Federal Revenue Service in 2024, with additional CARF regulations and administrative rulings included. We employed OpenAI embeddings for retrieval and GPT-4o-mini for answer generation, and constructed a Retrieval-Augmented Generation (RAG) pipeline. We compared various text splitting strategies, and benchmarked our system against commercial tools including ChatGPT and Perplexity.ai using RAGAS-based evaluation metrics. The results demonstrate that our custom RAG pipeline outperforms commercial systems in response relevance, indicating stronger alignment with user queries, while commercial models achieved higher scores in factual correctness and fluency. These findings highlight the trade-off between legally grounded generation and linguistic fluency. Most importantly, we contend that in high-risk domains such as taxation, manual expert evaluation remains essential to guaranteeing the legal validity of AI-generated answers. BR-TaxQA-R is publicly accessible at https://huggingface.co/datasets/unicamp-dl/BR-TaxQA-R.
BR-TaxQA-R 数据集概述
数据集基本信息
- 许可证: CC-BY-4.0
- 领域: 巴西税法(个人所得税领域)
- 数据来源: 巴西联邦税务局(RFB)2016-2024年发布的《问答文档》
数据集构成
核心数据文件
-
问题数据
- 文件:
questions_QA_2024_v1.0.json - 记录数: 715个问题
- 有效引用: 478个法律文档引用
- 无外部引用问题: 117个
- 文件:
-
法律文档
- 文件:
referred_legal_documents_QA_2024_v1.0.json - 文档数: 478个
- 格式: 单行文本数据
- 文件:
-
判例文档
- 文件:
acordaos_CARF_2023.json - 案例数: 7204个(2023年税务行政上诉案件)
- 文件:
数据结构说明
问题数据结构
json { "question_number": "问题编号", "question_summary": "问题摘要", "question_text": "完整问题文本", "answer": ["原始答案段落列表"], "answer_cleaned": "去除引用后的纯净答案", "references": "显式外部引用", "linked_questions": "关联问题引用", "formatted_references": "结构化显式引用", "embedded_references": "隐式嵌入引用", "formatted_embedded_references": "结构化隐式引用", "all_formated_references": "合并后的完整引用" }
法律文档结构
json { "filename": "法律文档文件名", "filedata": "文档全文(单行文本)" }
使用方式
python
加载问题数据
questions = datasets.load_dataset("unicamp-dl/rag-rfb")
加载法律文档
sources = datasets.load_dataset("unicamp-dl/rag-rfb", "2024.sources")
加载判例数据
caselaw = datasets.load_dataset("unicamp-dl/rag-rfb", "2024.caselaw")
注意事项
- 结构化引用字段(
formatted_*)在加载后会从字典列表转换为多列表字典格式 - 判例数据来自巴西税务上诉行政委员会(CARF)2023年裁决




