MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / classify_caption_kind

Function classify_caption_kind

scripts/plan_figures.py:37–148  ·  view source on GitHub ↗
(item_id: str, caption: str)

Source from the content-addressed store, hash-verified

35
36
37def classify_caption_kind(item_id: str, caption: str) -> tuple[str, str, str]:
38 text = f"{item_id} {caption}".lower()
39 if any(
40 token in text
41 for token in [
42 "accuracy",
43 "score",
44 "performance",
45 "comparison",
46 "win-rate",
47 "results",
48 "recall",
49 "latency",
50 "throughput",
51 "request rate",
52 "batched request",
53 "batch size",
54 "memory saving",
55 "ablation",
56 "ablated",
57 "overhead",
58 "microbenchmark",
59 "block size",
60 "single sequence generation",
61 "parallel generation",
62 ]
63 ) or re.search(
64 r"\b(?:model|system|architecture|method|approach)\s+"
65 r"(?:produces|achieves|outperforms|improves|reduces|increases)\b",
66 text,
67 ):
68 return "main_result", "关键结果", "这张图或表直接承载主结果,适合放在关键结果部分。"
69 if any(
70 token in text
71 for token in [
72 "prisma",
73 "literature flow",
74 "flow diagram",
75 "study selection",
76 "screening flow",
77 "screened records",
78 "records screened",
79 "identification of studies",
80 ]
81 ):
82 return "data_or_task_overview", "数据与任务定义", "这张图解释文献筛选或纳入流程;如果候选图质量足够,适合放在数据与任务定义部分帮助读者理解综述证据来源。"
83 if any(
84 token in text
85 for token in [
86 "pipeline",
87 "framework",
88 "overview",
89 "architecture",
90 "system",
91 "workflow",
92 "stage",
93 "procedure",
94 "process",

Callers 1

build_figure_itemsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected