Devaharibabu commited on
Commit
b42aedd
·
verified ·
1 Parent(s): 2b0f977

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +22 -0
  2. requirements.txt +5 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import arxiv
3
+
4
+ def search_arxiv(q):
5
+ search = arxiv.Search(query=q, max_results=5, sort_by=arxiv.SortCriterion.Relevance)
6
+ results = []
7
+ for result in search.results():
8
+ paper = f"**{result.title}**\n\n{result.summary}\n\n🔗 {result.entry_id}"
9
+ results.append(paper)
10
+ return "\n\n---\n\n".join(results)
11
+
12
+ # No __main__, directly create and launch the app
13
+ demo = gr.Interface(
14
+ fn=search_arxiv,
15
+ inputs=gr.Textbox(label="Enter your research topic or question"),
16
+ outputs=gr.Markdown(label="Search Results"),
17
+ title="Live arXiv Paper Search",
18
+ description="Ask about any research topic. Get the latest papers from arXiv instantly."
19
+ )
20
+
21
+ # 🚨 This MUST be here without __main__
22
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ gradio
2
+ arxiv
3
+ sentence-transformers
4
+ transformers
5
+ scikit-learn