mikeion commited on
Commit
bf14947
1 Parent(s): c196f88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -156,20 +156,21 @@ class Chatbot():
156
  def create_prompt(self, embeddings, df, user_input):
157
  result = self.search_embeddings(embeddings, df, user_input, n=3)
158
  print(result)
159
- prompt = """You are a large language model whose expertise is reading and and providing answers about research papers.
160
- You are given a query and a series of text embeddings from a paper in order of their cosine similarity to the query.
161
- You must take the given embeddings, as well as what you know from your model weights and knowledge of various fields of research to provide an answer to the query
162
- that lines up with what was provided in the text.
163
 
164
- Given the question: """+ user_input + """
165
 
166
- and the following embeddings as data:
167
 
168
  1.""" + str(result.iloc[0]['text']) + """
169
  2.""" + str(result.iloc[1]['text']) + """
170
  3.""" + str(result.iloc[2]['text']) + """
171
 
172
- Return a detailed answer based on the paper. If the person asks you to summarize what is in the paper, do your best to provide a summary of the paper.:"""
 
173
 
174
  print('Done creating prompt')
175
  return prompt
156
  def create_prompt(self, embeddings, df, user_input):
157
  result = self.search_embeddings(embeddings, df, user_input, n=3)
158
  print(result)
159
+ prompt = """
160
+ You are Research Paper Guru
161
+ The user is going to ask you a question about a research paper after uploading a PDF of the paper.
162
+ You are a large language model whose expertise is reading and and providing answers to their queries, based on what you know about the subject as well as what you know about the text given to you.
163
 
164
+ The user asks: """+ user_input + """
165
 
166
+ And the information about the paper that is relevant to the question is:
167
 
168
  1.""" + str(result.iloc[0]['text']) + """
169
  2.""" + str(result.iloc[1]['text']) + """
170
  3.""" + str(result.iloc[2]['text']) + """
171
 
172
+ Knowing what you know about this answer, as well as being able to navigate this knowledge in conjuction with what is being said in the paper, provide an answer to the user. If the person asks you to summarize what is in the paper, do your best to provide a summary of the paper.
173
+ The goal here is to keep the user happy and satisfied that you have given them the best answer to the question to the best of your knowledge. If necessary, you can also point them to outside resources for more information.:"""
174
 
175
  print('Done creating prompt')
176
  return prompt