Process a paper completely Args: paper: Paper dictionary Returns: Processed paper dictionary
(paper: Dict)
| 206 | |
| 207 | |
| 208 | def process_paper(paper: Dict) -> Dict: |
| 209 | """ |
| 210 | Process a paper completely |
| 211 | |
| 212 | Args: |
| 213 | paper: Paper dictionary |
| 214 | |
| 215 | Returns: |
| 216 | Processed paper dictionary |
| 217 | """ |
| 218 | # Clean abstract |
| 219 | paper["cleaned_abstract"] = clean_abstract(paper.get("abstract", "")) |
| 220 | |
| 221 | # Extract keywords |
| 222 | paper["keywords"] = extract_keywords(paper["cleaned_abstract"], top_k=5) |
| 223 | |
| 224 | # Generate embedding |
| 225 | paper["embedding"] = generate_embedding(paper["cleaned_abstract"]) |
| 226 | paper["embedding_model"] = "text-embedding-3-small" |
| 227 | |
| 228 | return paper |
| 229 | |
| 230 | |
| 231 | def deduplicate_papers(papers: List[Dict]) -> List[Dict]: |
nothing calls this directly
no test coverage detected