Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
updated pfdr readme
Browse files
app.py
CHANGED
@@ -8,7 +8,6 @@ import numpy as np
|
|
8 |
from abc import ABC, abstractmethod
|
9 |
from typing import List, Dict, Any, Tuple
|
10 |
from collections import defaultdict
|
11 |
-
from tqdm import tqdm
|
12 |
import pandas as pd
|
13 |
from datetime import datetime, date
|
14 |
from datasets import load_dataset, load_from_disk
|
@@ -300,28 +299,64 @@ st.image('local_files/pathfinder_logo.png')
|
|
300 |
|
301 |
st.expander("What is Pathfinder / How do I use it?", expanded=False).write(
|
302 |
"""
|
303 |
-
|
304 |
-
sensitivity from modern large language models (LLMs) to better parse patterns in paper contexts.
|
305 |
|
306 |
-
|
307 |
|
308 |
-
|
309 |
|
310 |
-
|
311 |
-
|
312 |
|
313 |
-
This is not meant to be a replacement to existing tools like the
|
314 |
-
[ADS](https://ui.adsabs.harvard.edu/),
|
315 |
-
[arxivsorter](https://www.arxivsorter.org/), semantic search or google scholar, but rather a supplement to find papers
|
316 |
-
that otherwise might be missed during a literature survey.
|
317 |
-
It is trained on astro-ph (astrophysics of galaxies) papers up to last-year-ish mined from arxiv and supplemented with ADS metadata,
|
318 |
-
if you are interested in extending it please reach out!
|
319 |
|
320 |
-
|
321 |
|
322 |
-
|
323 |
-
|
324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
"""
|
326 |
)
|
327 |
|
@@ -433,7 +468,8 @@ def run_agent_qa(query):
|
|
433 |
st.session_state.agent = agent
|
434 |
|
435 |
if 'agent_executor' not in st.session_state:
|
436 |
-
agent_executor = AgentExecutor(agent=st.session_state.agent, tools=st.session_state.tools, verbose=True, handle_parsing_errors=True, callbacks=CallbackManager([file_handler]))
|
|
|
437 |
st.session_state.agent_executor = agent_executor
|
438 |
|
439 |
answer = st.session_state.agent_executor.invoke({"input": query,})
|
|
|
8 |
from abc import ABC, abstractmethod
|
9 |
from typing import List, Dict, Any, Tuple
|
10 |
from collections import defaultdict
|
|
|
11 |
import pandas as pd
|
12 |
from datetime import datetime, date
|
13 |
from datasets import load_dataset, load_from_disk
|
|
|
299 |
|
300 |
st.expander("What is Pathfinder / How do I use it?", expanded=False).write(
|
301 |
"""
|
302 |
+
# Welcome to Pathfinder
|
|
|
303 |
|
304 |
+
## Discover the Universe Through AI-Powered Astronomy ReSearch
|
305 |
|
306 |
+
### What is Pathfinder?
|
307 |
|
308 |
+
Pathfinder (https://pfdr.app) harnesses the power of modern large language models (LLMs) in combination with papers on the [arXiv](https://arxiv.org/) and [ADS](https://ui.adsabs.harvard.edu/) to navigate the vast expanse of astronomy literature.
|
309 |
+
Our tool empowers researchers, students, and astronomy enthusiasts to get started on their journeys to find answers to complex research questions quickly and efficiently.
|
310 |
|
311 |
+
This is not meant to be a replacement to existing tools like the [ADS](https://ui.adsabs.harvard.edu/), [arxivsorter](https://www.arxivsorter.org/), semantic search or google scholar, but rather a supplement to find papers that otherwise might be missed during a literature survey. It is trained on astro-ph papers up to July 2024.
|
|
|
|
|
|
|
|
|
|
|
312 |
|
313 |
+
### How to Use Pathfinder
|
314 |
|
315 |
+
You can use pathfinder to find papers of interest with natural-language questions, and generate basic answers to questions using the retrieved papers. Try asking it questions like
|
316 |
+
|
317 |
+
- What is the value of the Hubble Constant?
|
318 |
+
- Are there open source radiative transfer codes for planetary atmospheres?
|
319 |
+
- Can I predict a galaxy spectrum from an image cutout? Please reply in Hindi.
|
320 |
+
- How would galaxy evolution differ in a universe with no dark matter?
|
321 |
+
|
322 |
+
**👈 Use the sidebar to tweak the search parameters to get better results**. Changing the number of retrieved papers (**top-k**), weighting by keywords, time, or citations, or changing the prompt type might help better refine the paper search and synthesized answers for your specific question.
|
323 |
+
|
324 |
+
1. **Enter Your Query**: Type your astronomy question in the search bar & hit `run pathfinder`.
|
325 |
+
2. **Review Results**: Pathfinder will analyze relevant literature and present you with a concise answer.
|
326 |
+
3. **Explore Further**: Click on provided links to delve deeper into the source material on ADS.
|
327 |
+
4. **Refine Your Search**: Use our advanced filters to narrow down results by date, author, or topic.
|
328 |
+
5. **Download results:** You can download the results of your query as a json file.
|
329 |
+
|
330 |
+
### Why Use Pathfinder?
|
331 |
+
|
332 |
+
- **Time-Saving**: Get started finding answers that would take hours of manual research.
|
333 |
+
- **Comprehensive**: Access information from papers across a large database of astronomy literature.
|
334 |
+
- **User-Friendly**: Intuitive interface designed for researchers at all levels.
|
335 |
+
- **Constantly Updated**: Our database is regularly refreshed with the latest publications.
|
336 |
+
|
337 |
+
### Learn More
|
338 |
+
|
339 |
+
- Read our paper on [arXiv](https://arxiv.org/abs/2408.01556) to understand the technology behind Pathfinder.
|
340 |
+
- Discover how Pathfinder was developed in collaboration with [UniverseTBD](https://www.universetbd.org) on its mission is to democratise science for everyone, and [JSALT](https://www.clsp.jhu.edu/2024-jelinek-summer-workshop-on-speech-and-language-technology/).
|
341 |
+
|
342 |
+
---
|
343 |
+
|
344 |
+
### Copyright and Terms of Use
|
345 |
+
|
346 |
+
© 2024 Pathfinder. All rights reserved.
|
347 |
+
|
348 |
+
Pathfinder is provided "as is" without warranty of any kind. By using this service, you agree to our [Terms of Service] and [Privacy Policy].
|
349 |
+
|
350 |
+
### Contact Us
|
351 |
+
|
352 |
+
Have questions or feedback? We'd love to hear from you!
|
353 |
+
- Email: [email protected]
|
354 |
+
- Twitter: [@universe_tbd](https://twitter.com/universe_tbd)
|
355 |
+
- Huggingface: [https://huggingface.co/spaces/kiyer/pathfinder/](https://huggingface.co/spaces/kiyer/pathfinder/)
|
356 |
+
|
357 |
+
---
|
358 |
+
|
359 |
+
*Empowering astronomical discoveries, one query at a time.*
|
360 |
"""
|
361 |
)
|
362 |
|
|
|
468 |
st.session_state.agent = agent
|
469 |
|
470 |
if 'agent_executor' not in st.session_state:
|
471 |
+
# agent_executor = AgentExecutor(agent=st.session_state.agent, tools=st.session_state.tools, verbose=True, handle_parsing_errors=True, callbacks=CallbackManager([file_handler]))
|
472 |
+
agent_executor = AgentExecutor(agent=st.session_state.agent, tools=st.session_state.tools, handle_parsing_errors=True, callbacks=CallbackManager([file_handler]))
|
473 |
st.session_state.agent_executor = agent_executor
|
474 |
|
475 |
answer = st.session_state.agent_executor.invoke({"input": query,})
|