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

Function tokenize

experiments/baselines/knowledge_entity/runner.py:199–208  ·  view source on GitHub ↗
(text: Any)

Source from the content-addressed store, hash-verified

197
198
199def tokenize(text: Any) -> List[str]:
200 tokens: List[str] = []
201 for raw_token in TOKEN_RE.findall(str(text or "").casefold()):
202 token = raw_token.replace("_", "-")
203 if len(token) <= 1:
204 continue
205 tokens.append(token)
206 if "-" in token:
207 tokens.extend(part for part in token.split("-") if len(part) > 1)
208 return tokens
209
210
211def paper_text(row: Dict[str, Any]) -> str:

Callers 3

build_idf_from_textsFunction · 0.70
vectorize_textFunction · 0.70
candidate_entity_phrasesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected