Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -323,9 +323,23 @@ from transformers import pipeline
|
|
323 |
# GPT Summarization Pipeline
|
324 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
325 |
|
326 |
-
@tool
|
327 |
def fetch_latest_arxiv_papers(keywords: list, num_results: int = 5) -> list:
|
328 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
try:
|
330 |
query = "+AND+".join([f"all:{kw}" for kw in keywords])
|
331 |
query_encoded = urllib.parse.quote(query)
|
|
|
323 |
# GPT Summarization Pipeline
|
324 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
325 |
|
326 |
+
@tool
|
327 |
def fetch_latest_arxiv_papers(keywords: list, num_results: int = 5) -> list:
|
328 |
+
"""
|
329 |
+
Fetches and ranks research papers from ArXiv using TF-IDF and Cosine Similarity.
|
330 |
+
|
331 |
+
Args:
|
332 |
+
keywords (list): A list of keywords to search for relevant research papers.
|
333 |
+
num_results (int): The number of top-ranked papers to return.
|
334 |
+
|
335 |
+
Returns:
|
336 |
+
list: A list of dictionaries containing:
|
337 |
+
- "title": The title of the paper.
|
338 |
+
- "authors": Authors of the paper.
|
339 |
+
- "year": Year of publication.
|
340 |
+
- "abstract": Short summary of the paper.
|
341 |
+
- "link": URL to the full paper.
|
342 |
+
"""
|
343 |
try:
|
344 |
query = "+AND+".join([f"all:{kw}" for kw in keywords])
|
345 |
query_encoded = urllib.parse.quote(query)
|