Spaces:
Sleeping
Sleeping
Download modules/qa.py from KamranX07/paperpilot: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/KamranX07/paperpilot/resolve/main/modules/qa.py
- Command line
-
hf download hf://spaces/KamranX07/paperpilot/modules/qa.py
-
curl -L -o qa.py https://huggingface.co/spaces/KamranX07/paperpilot/resolve/main/modules/qa.py
1.03 kB
| def answer_question( | |
| question, | |
| master_json | |
| ): | |
| question = question.lower() | |
| if "document" in question: | |
| docs = master_json.get( | |
| "documents", | |
| [] | |
| ) | |
| if not docs: | |
| return ( | |
| "No documents found." | |
| ) | |
| return ( | |
| "Required Documents:\n\n• " | |
| + "\n• ".join(docs) | |
| ) | |
| if "deadline" in question: | |
| return ( | |
| "Deadline: " | |
| + master_json.get( | |
| "deadline", | |
| "Not Found" | |
| ) | |
| ) | |
| if "eligibility" in question: | |
| return ( | |
| "Eligibility:\n\n" | |
| + master_json.get( | |
| "eligibility", | |
| "Not Found" | |
| ) | |
| ) | |
| if "form" in question: | |
| return ( | |
| "Form Name: " | |
| + master_json.get( | |
| "form_name", | |
| "Unknown" | |
| ) | |
| ) | |
| return ( | |
| "I don't know how to answer that yet." | |
| ) |