MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _paper_topic_tokens

Function _paper_topic_tokens

deployments/feishu/daily-push-agent/main.py:794–802  ·  view source on GitHub ↗
(paper: Dict)

Source from the content-addressed store, hash-verified

792 value = paper.get(key) or []
793 if isinstance(value, str):
794 tokens.append(value)
795 else:
796 tokens.extend(str(item) for item in value if str(item).strip())
797 return {str(token).strip().lower() for token in tokens if str(token).strip()}
798
799
800def _topic_jaccard_similarity(left: Dict, right: Dict) -> float:
801 left_tokens = _paper_topic_tokens(left)
802 right_tokens = _paper_topic_tokens(right)
803 if not left_tokens or not right_tokens:
804 return 0.0
805 return len(left_tokens & right_tokens) / len(left_tokens | right_tokens)

Callers 1

Calls 1

getMethod · 0.80

Tested by

no test coverage detected