Spaces:
Sleeping
Sleeping
Commit
·
c83f530
1
Parent(s):
77e70e4
Prompts Updated
Browse files
app.py
CHANGED
|
@@ -23,8 +23,29 @@ class ResponseData(BaseModel):
|
|
| 23 |
summary: str
|
| 24 |
ids: List[str]
|
| 25 |
|
| 26 |
-
base_prompt = "
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
}
|