ragV98 commited on
Commit
9266b3d
·
1 Parent(s): 7200af5

prompt revision

Browse files
Files changed (1) hide show
  1. components/generators/daily_feed.py +25 -13
components/generators/daily_feed.py CHANGED
@@ -26,21 +26,33 @@ TOPICS = ["India news", "World news", "Tech news", "Finance news", "Sports news"
26
  # 🧠 Base summarization prompt (used for all topics)
27
  # 🧠 Define the base summarization prompt
28
  BASE_PROMPT = (
29
- "You are Nuse’s official news summarizer — insightful, punchy, and always on point.\n"
30
- "Your job is to scan the content below and extract the key news items. For each item, craft a crisp summary (15–20 words). Avoid using any emojis.\n"
31
- "List each summary on a new line starting with a dash (-) and no numbers. This is how Nuse keeps it clean and scannable.\n"
32
  "\n"
33
- "Example format:\n"
34
- "- India stuns Australia in a last-ball thriller at the World Cup finals\n"
35
- "- U.S. imposes sweeping tariffs on Chinese tech giants, rattling global markets\n"
36
- "- Ceasefire breakthrough: Netanyahu (Prime minister of Israel) bows to pressure after week-long escalation\n"
37
  "\n"
38
- "If you are mentioning a person, include their designation in brackets. For example: Jeff Bezos (Amazon CEO), Narendra Modi (Prime minister of India).\n"
39
- "If you're referencing a post like 'NATO Chief', also include the name of the person who holds the post.\n"
40
- "If you don't find anything useful, don't return anything for that news item.\n"
41
- "Skim through the content and write summaries that are compelling, include essential facts, and feel like strong hook lines.\n"
42
- "Be sharp. Be brief. No fluff. No preambles. Avoid source citations like (U.S. Security Council) or (The New York Times).\n"
43
- "Return only the summary block — no extra commentary, no prompt repetition."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  )
45
 
46
  def summarize_topic(docs: List[str], topic: str) -> List[Dict]:
 
26
  # 🧠 Base summarization prompt (used for all topics)
27
  # 🧠 Define the base summarization prompt
28
  BASE_PROMPT = (
29
+ "You are Nuse’s official news summarizer — fast, sharp, and never generic.\n"
30
+ "Your task is to read the following **collection of news excerpts** and extract the most important stories.\n"
 
31
  "\n"
32
+ "For each distinct news item you find, write a punchy summary — exactly one line, no more than 20 words. Aim for 15–20 words per summary.\n"
 
 
 
33
  "\n"
34
+ "Formatting rules:\n"
35
+ "- Each summary must begin with a dash (-)\n"
36
+ "- Do **not** number the summaries\n"
37
+ "- Do **not** include emojis or hashtags\n"
38
+ "- Do **not** add the source name or publication\n"
39
+ "\n"
40
+ "If a person is mentioned, include their designation in brackets. Examples:\n"
41
+ "- Jeff Bezos (Amazon founder)\n"
42
+ "- Narendra Modi (Prime Minister of India)\n"
43
+ "- NATO Chief Jens Stoltenberg\n"
44
+ "\n"
45
+ "✅ Good examples:\n"
46
+ "- India stuns Australia in last-ball World Cup thriller, secures spot in finals\n"
47
+ "- U.S. imposes tariffs on Chinese tech giants, shaking global investor confidence\n"
48
+ "- Ceasefire breakthrough as Netanyahu (Israeli PM) relents under diplomatic pressure\n"
49
+ "\n"
50
+ "❌ Avoid:\n"
51
+ "- Source mentions like (The New York Times), (Reuters)\n"
52
+ "- Introductory fluff or meta comments\n"
53
+ "- Repeating prompt instructions or context\n"
54
+ "\n"
55
+ "You are generating sharp, editorial-style headlines. Only output the summaries. Nothing else."
56
  )
57
 
58
  def summarize_topic(docs: List[str], topic: str) -> List[Dict]: