singhvaibhav924 commited on
Commit
c83f530
·
1 Parent(s): 77e70e4

Prompts Updated

Browse files
Files changed (2) hide show
  1. app.py +23 -2
  2. helper.py +1 -0
app.py CHANGED
@@ -23,8 +23,29 @@ class ResponseData(BaseModel):
23
  summary: str
24
  ids: List[str]
25
 
26
- base_prompt = "You will be provided with an abstract of a scientific document and other references papers in triple quotes. Your task is to write the related work section of the document using only the provided abstracts and other references papers. Please write the related work section creating a cohesive storyline by doing a critical analysis of prior work comparing the strengths and weaknesses while also motivating the proposed approach. You are also provided a sentence plan mentioning the total number of lines and the citations to refer in different lines. You should cite all the other related documents as [#] whenever you are referring it in the related work. Do not cite abstract. Do not include any extra notes or newline characters at the end. Do not copy the abstracts of reference papers directly but compare and contrast to the main work concisely. Do not provide the output in bullet points. Do not provide references at the end. Please cite all the provided reference papers. Please follow the plan when generating sentences, especially the number of lines to generate."
27
- sentence_plan = "1. Introduction sentence\n2. Overview of relevant studies\n3. Detailed discussion on key papers\n4. Summary of related work\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  @app.post("/generateLiteratureSurvey/", response_model=ResponseData)
30
  async def generate_literature_survey(request_data: RequestData):
 
23
  summary: str
24
  ids: List[str]
25
 
26
+ base_prompt = """
27
+ Write a related work section for a scientific paper based on the following abstract and references. Your output should:
28
+
29
+ 1. Introduce the topic (1 sentence)
30
+ 2. Summarize key related works (3-4 sentences)
31
+ 3. Compare and contrast approaches (2-3 sentences)
32
+ 4. Connect to the proposed work (1-2 sentences)
33
+
34
+ Use [1], [2], etc. to cite references. Do not copy text directly. Be concise and coherent.
35
+
36
+ Abstract: {abstract}
37
+
38
+ References:
39
+ {references}
40
+
41
+ Write the related work section:
42
+ """
43
+ sentence_plan = """
44
+ 1. Introduction sentence (1 sentence)
45
+ 2. Overview of relevant studies (2-3 sentences, cite [1], [2])
46
+ 3. Detailed discussion on key papers (4-5 sentences, cite [3], [4], [5], if present)
47
+ 4. Summary of related work and connection to proposed approach (2 sentences, cite remaining papers, if present)
48
+ """
49
 
50
  @app.post("/generateLiteratureSurvey/", response_model=ResponseData)
51
  async def generate_literature_survey(request_data: RequestData):
helper.py CHANGED
@@ -112,6 +112,7 @@ def generate_related_work(query_abstract, ranked_papers, base_prompt, sentence_p
112
  "parameters": {
113
  "max_new_tokens": n_words,
114
  "temperature": 0.01,
 
115
  "do_sample": False
116
  }
117
  }
 
112
  "parameters": {
113
  "max_new_tokens": n_words,
114
  "temperature": 0.01,
115
+ "return_full_text": False,
116
  "do_sample": False
117
  }
118
  }