Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from rag_pipeline import generate_answer
|
3 |
+
from rag_pipeline import index, corpus_embeddings, corpus, embed_model
|
4 |
+
|
5 |
+
st.set_page_config(page_title="Medical QA Assistant 🧬", page_icon="🧠")
|
6 |
+
st.title("🧠 Medical QA Assistant")
|
7 |
+
st.write("Ask any medical question and get a science-based answer from PubMed!")
|
8 |
+
|
9 |
+
query = st.text_input("Enter your medical question:")
|
10 |
+
|
11 |
+
if st.button("Get Answer") and query:
|
12 |
+
answer = generate_answer(query, index, corpus_embeddings, corpus, embed_model)
|
13 |
+
st.success(answer)
|