vjain commited on
Commit
8c2e21c
·
1 Parent(s): 60200a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -22,9 +22,16 @@ 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
 
26
- df = pd.DataFrame(Bio_embeddings['train'])
27
-
 
 
28
  #df = pd.read_csv("TA_embeddings.csv")
29
  #df["embedding"]=df["embedding"].apply(eval).apply(np.array)
30
  def reply(input):
@@ -67,7 +74,7 @@ text_output = gr.outputs.Textbox(label="Answer")
67
  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."
68
 
69
  ui = gr.Interface(fn=reply,
70
- inputs=input_text,
71
  outputs=[text_output],
72
  title="Scholar Bot",
73
  description=description,
 
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
 
31
+ dataframes = {
32
+ "Bio_embeddings": df1,
33
+ "TA_embeddings": df2
34
+ }
35
  #df = pd.read_csv("TA_embeddings.csv")
36
  #df["embedding"]=df["embedding"].apply(eval).apply(np.array)
37
  def reply(input):
 
74
  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."
75
 
76
  ui = gr.Interface(fn=reply,
77
+ inputs=[input_text, csv_dropdown],
78
  outputs=[text_output],
79
  title="Scholar Bot",
80
  description=description,