跳转至

AI分析指南

数据结构

案例JSON包含以下字段:

  • case_id: 案例ID
  • case_name: 案例名称
  • jurisdiction: 法域
  • case_type: 案件类型
  • summary: 摘要(facts, issues, holding, reasoning, result)
  • legal_analysis: 法律分析
  • remedy: 救济方式
  • significance: 案例意义
  • comparative_notes: 对比分析

检索示例

按法域检索

us_cases = [c for c in cases if c["jurisdiction"] == "US"]

按类型检索

breach_cases = [c for c in cases if c["case_type"] == "违约责任争议"]

按关键词检索

offer_cases = [c for c in cases if "要约" in c["keywords"]]

RAG问答

构建向量库

from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import Chroma

embeddings = OpenAIEmbeddings()
vectorstore = Chroma.from_documents(documents, embeddings)

问答

from langchain import OpenAI, VectorDBQA

qa = VectorDBQA.from_chain_type(
    llm=OpenAI(),
    vectorstore=vectorstore
)

answer = qa.run("美国电子合同中的自动系统地位")

对比分析

# 多法域对比
comparison = compare_jurisdictions(
    jurisdictions=["US", "EU", "JP"],
    topic="违约金条款"
)