ChienChung commited on
Commit
fcef35a
·
verified ·
1 Parent(s): 02ef84e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -234,13 +234,13 @@ def upload_and_chat(file, query):
234
 
235
  initial_prompt = PromptTemplate(
236
  input_variables=["text"],
237
- template="""
238
- You are a document summarisation expert. Read the following text and extract the most important ideas, conclusions, and key facts.
239
 
240
- Return a **concise, bullet-point summary** in **British English**.
241
- - Avoid markdown formatting like bold (**), italic (*), headers (##), or code symbols (`).
242
- - You may use simple list markers like "-" or "" to separate points.
243
- - Keep the tone professional and easy to read.
 
244
 
245
  --- Document ---
246
  {text}
@@ -250,15 +250,15 @@ Return a **concise, bullet-point summary** in **British English**.
250
  )
251
  refine_prompt = PromptTemplate(
252
  input_variables=["existing_answer", "text"],
253
- template="""
254
- You already have an existing summary:
255
  {existing_answer}
256
 
257
- Refine the summary based on the new content below. Add or update information only if it's relevant.
258
 
259
- - Maintain bullet-point format using "-" or "•" if needed.
260
- - Do not use markdown formatting like **bold**, *italic*, or code symbols.
261
- - Keep the tone concise, structured, and in British English.
 
262
 
263
  {text}
264
 
 
234
 
235
  initial_prompt = PromptTemplate(
236
  input_variables=["text"],
237
+ template="""You are a document summarisation expert.
 
238
 
239
+ Read the content below and produce a structured summary suitable for non-experts. Your summary must follow this format:
240
+ - Start with a 1–2 sentence overview of the whole document.
241
+ - Then present the most important 3–7 insights as a plain-text bullet list (use "- ", avoid Markdown formatting).
242
+ - Do not include background or filler content.
243
+ - Avoid using `*`, `**`, or heading symbols like `##`.
244
 
245
  --- Document ---
246
  {text}
 
250
  )
251
  refine_prompt = PromptTemplate(
252
  input_variables=["existing_answer", "text"],
253
+ template="""You already have an existing summary:
 
254
  {existing_answer}
255
 
256
+ Refine the summary based on the new content below. Add or update information only if it's relevant. Keep it concise.
257
 
258
+ Maintain the same style:
259
+ - Start with a 1–2 sentence overview (if applicable)
260
+ - Use plain text bullet points (with "- "), not Markdown symbols
261
+ - Avoid headings like `##`, `**`, `*`, or numbered lists.
262
 
263
  {text}
264