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

Function caption_label_key

scripts/common.py:2106–2111  ·  view source on GitHub ↗
(label: str)

Source from the content-addressed store, hash-verified

2104
2105
2106def caption_label_key(label: str) -> str:
2107 normalized = normalize_caption_label(label).lower()
2108 normalized = re.sub(r"\bfigure\b", "fig", normalized)
2109 normalized = re.sub(r"\bfig\.\s*", "fig ", normalized)
2110 normalized = re.sub(r"\btable\.\s*", "table ", normalized)
2111 return normalize_whitespace(normalized)
2112
2113
2114def caption_preference_score(label: str, caption: str) -> int:

Callers 3

caption_itemsFunction · 0.90
extract_caption_linesFunction · 0.85

Calls 2

normalize_caption_labelFunction · 0.85
normalize_whitespaceFunction · 0.85

Tested by

no test coverage detected