引用检测 API
检测 AI 生成的虚假/幻觉学术引文,并检查引用相关性。通过级联查询 CrossRef、Semantic Scholar、OpenAlex 验证引文真实性,通过 BM25、NLI 和 LLM 评估判断引用相关性。
POST
/v1/citation/verify引用验证
POST
/v1/citation/verify通过 CrossRef、Semantic Scholar 和 OpenAlex 验证一条或多条学术引用。检测 AI 生成的虚假/幻觉引文。支持单条和批量验证(最多 50 条引用)。
参数
请求体为 JSON 对象,包含 citations 数组(1-50 项)。每项包含:
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
citation_text | string | 可选 | 原始引用字符串(最少 10 字符)。citation_text 和 structured 至少需要提供一个。 |
structured | object | 可选 | 结构化元数据:title、authors、year、journal、doi 等 |
format_hint | string | 可选 (默认: auto) | 'apa'、'mla'、'chicago'、'ieee'、'gbt7714' 或 'auto' |
批量验证
在 citations 数组中传入多个条目,单次请求最多验证 50 条引用。响应包含汇总计数(verified_count、uncertain_count、fabricated_count)。
引用相关性
POST
/v1/citation/relevance检查被引论文是否与引用上下文真正相关。使用 BM25、NLI 和 LLM 评估的级联方法判断相关性。支持通过 DOI 自动获取摘要。
参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
citing_context | string | 必填 | 引用出现的句子或段落(最少 10 字符) |
cited_paper_title | string | 可选 | 被引论文标题 |
cited_paper_abstract | string | 可选 | 被引论文摘要(如提供 DOI 可自动获取) |
cited_doi | string | 可选 | 被引论文的 DOI(用于自动获取摘要) |
check_depth | string | 可选 (默认: auto) | 'fast'、'standard'、'deep' 或 'auto' |
cited_paper_title、cited_paper_abstract、cited_doi 至少需要提供其中一个。
响应
Response
{
"result": {
"relevance_verdict": "RELEVANT",
"relevance_score": 85.2,
"citation_intent": "supporting",
"nli_label": "entailment",
"explanation": "The cited paper directly introduces the transformer architecture...",
"tier_used": 2,
"processing_time_ms": 450.3
}
}判定类型
验证判定
VERIFIED — 引用与真实出版物高置信度匹配
UNCERTAIN — 部分匹配,建议人工复核
FABRICATED — 未找到匹配的出版物,可能为 AI 幻觉
相关性判定
RELEVANT — 被引论文与引用上下文明确相关
WEAKLY_RELEVANT — 主题有部分重叠但匹配度不高
IRRELEVANT — 与引用上下文无实质相关性
CONTRADICTORY — 被引论文与引用主张相矛盾
参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
citation_text | string | 可选 | 原始引用字符串(最少 10 字符)。citation_text 和 structured 至少需要提供一个。 |
structured | object | 可选 | 结构化引用元数据,包含字段:title、authors (string[])、year (int)、journal、volume、issue、pages、doi。 |
format_hint | string | 可选 (默认: auto) | 引用格式提示:'apa'、'mla'、'chicago'、'ieee'、'gbt7714' 或 'auto'(自动检测) |
响应
Response
{
"result": {
"parsed_metadata": {
"title": "Attention Is All You Need",
"authors": [
"Vaswani, A.",
"Shazeer, N.",
"Parmar, N."
],
"year": 2017,
"journal": "Advances in Neural Information Processing Systems",
"doi": null
},
"verdict": "VERIFIED",
"confidence": 92.5,
"best_match": {
"source": "crossref",
"title": "Attention is all you need",
"authors": [
"Vaswani, Ashish",
"Shazeer, Noam",
"Parmar, Niki"
],
"year": 2017,
"doi": "10.5555/3295222.3295349",
"overall_similarity": 100
},
"sources_queried": [
"crossref"
],
"hallucination_signals": [],
"processing_time_ms": 320.5
}
}示例
import requests
API_KEY = "your_api_key_here"
BASE_URL = "https://api.qinyanai.com"
# --- Verify a single citation ---
response = requests.post(
f"{BASE_URL}/v1/citation/verify",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"citations": [{
"citation_text": "Vaswani, A., Shazeer, N. et al. (2017). Attention Is All You Need. NeurIPS, 30."
}]
}
)
results = response.json()["results"]
for r in results:
print(f"Verdict: {r['verdict']} Confidence: {r['confidence']}%")
# --- Batch verification (up to 50) ---
response = requests.post(
f"{BASE_URL}/v1/citation/verify",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"citations": [
{"citation_text": "Vaswani, A. et al. (2017). Attention Is All You Need. NeurIPS."},
{"citation_text": "Devlin, J. et al. (2019). BERT: Pre-training of Deep Bidirectional Transformers. NAACL."},
]
}
)
batch = response.json()
print(f"Verified: {batch['verified_count']}, Fabricated: {batch['fabricated_count']}")
# --- Check citation relevance ---
response = requests.post(
f"{BASE_URL}/v1/citation/relevance",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"citing_context": "Transformer models have achieved state-of-the-art results in NLP tasks [1].",
"cited_paper_title": "Attention Is All You Need",
"check_depth": "auto"
}
)
result = response.json()["result"]
print(f"Relevance: {result['relevance_verdict']} Score: {result['relevance_score']}")