vjain commited on
Commit
86e6300
·
1 Parent(s): 3fbc177

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -22,9 +22,10 @@ def generate_embeddings(texts, model_id, hf_token):
22
  embeddings = response.json()
23
  return embeddings
24
  Bio_embeddings = load_dataset('vjain/biology_AP_embeddings')
25
- Physics_embeddings = load_dataset('vjain/AP_physics_embeddings')
26
  df1 = pd.DataFrame(Bio_embeddings['train'])
27
  df1["similarity"] = 0
 
 
28
  df2 = pd.DataFrame(Physics_embeddings['train'])
29
  df2["similarity"] = 0
30
 
@@ -70,7 +71,7 @@ def reply(input, dataframe_name):
70
  input_text = gr.inputs.Textbox(label="Enter your questions here", placeholder="E.g. What is DNA?")
71
  text_output = gr.outputs.Textbox(label="Answer")
72
  csv_dropdown = gr.inputs.Dropdown(
73
- label="Select CSV file",
74
  choices=["AP Bio", "AP Physics"]
75
  )
76
  description = "Scholar Bot is a question answering system designed to provide accurate and relevant answers to questions from this book hosted by OpenStax https://openstax.org/details/books/biology-ap-courses. Simply enter your question in the text box above and Scholar Bot will use advanced natural language processing algorithms to search a large corpus of biology text to find the best answer for you. Scholar Bot uses the Sentence Transformers model to generate embeddings of text, and OpenAI's GPT-3 language model to provide answers to your questions."
 
22
  embeddings = response.json()
23
  return embeddings
24
  Bio_embeddings = load_dataset('vjain/biology_AP_embeddings')
 
25
  df1 = pd.DataFrame(Bio_embeddings['train'])
26
  df1["similarity"] = 0
27
+
28
+ Physics_embeddings = load_dataset('vjain/AP_physics_embeddings')
29
  df2 = pd.DataFrame(Physics_embeddings['train'])
30
  df2["similarity"] = 0
31
 
 
71
  input_text = gr.inputs.Textbox(label="Enter your questions here", placeholder="E.g. What is DNA?")
72
  text_output = gr.outputs.Textbox(label="Answer")
73
  csv_dropdown = gr.inputs.Dropdown(
74
+ label="Select the Book",
75
  choices=["AP Bio", "AP Physics"]
76
  )
77
  description = "Scholar Bot is a question answering system designed to provide accurate and relevant answers to questions from this book hosted by OpenStax https://openstax.org/details/books/biology-ap-courses. Simply enter your question in the text box above and Scholar Bot will use advanced natural language processing algorithms to search a large corpus of biology text to find the best answer for you. Scholar Bot uses the Sentence Transformers model to generate embeddings of text, and OpenAI's GPT-3 language model to provide answers to your questions."