Nvidia NIM Reranker
NVIDIA NIM Reranker Utility
rank_papers_by_query(self, query, config, top_k=5)
Rank papers by relevance to the query using NVIDIA's off-the-shelf re-ranker.
This function aggregates all chunks per paper, ranks them using the NVIDIA model, and returns the top-k papers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
str
|
The query string. |
required |
config
|
Any
|
Configuration containing reranker settings (model, api_key). |
required |
top_k
|
int
|
Number of top papers to return. |
5
|
Returns:
Type | Description |
---|---|
List[str]
|
List of tuples (paper_id, dummy_score) sorted by relevance. |
Source code in aiagents4pharma/talk2scholars/tools/pdf/utils/nvidia_nim_reranker.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|