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

Function build_paper_text

skills/embedding/scripts/embed.py:176–190  ·  view source on GitHub ↗

Build the text payload used for paper embeddings.

(paper: Dict[str, Any])

Source from the content-addressed store, hash-verified

174
175
176def build_paper_text(paper: Dict[str, Any]) -> str:
177 """Build the text payload used for paper embeddings."""
178 title = str(paper.get("title") or "").strip()
179 abstract = str(paper.get("abstract") or paper.get("cleaned_abstract") or "").strip()
180 keywords = paper.get("keywords") or []
181
182 blocks = []
183 if title:
184 blocks.append(title)
185 if abstract:
186 blocks.append(abstract)
187 if keywords:
188 blocks.append("Keywords: " + ", ".join(str(keyword).strip() for keyword in keywords if str(keyword).strip()))
189
190 return "\n\n".join(block for block in blocks if block).strip()
191
192
193def _requires_trust_remote_code(model_name: str) -> bool:

Callers 1

prepare_paper_featuresFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected