lvwerra HF Staff commited on
Commit
e62a82f
·
verified ·
1 Parent(s): 23109fa

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +9 -3
run.py CHANGED
@@ -66,7 +66,7 @@ def main():
66
  print(f"Create report...")
67
  df["article_summary"] = df.apply(format_summary, axis=1)
68
 
69
- sep = "\n" + "="*80 + "\n"
70
  overview = sep.join([f"Article: {i+1}\n{article}" for i, article in enumerate(df["article_summary"])])
71
  report = create_report(overview, client, MODEL, topic)
72
 
@@ -156,10 +156,14 @@ Article:
156
  def format_summary(row):
157
  """Format article summary"""
158
  summary = f"""\
159
- Title: {row['title']}
 
160
  Published: {row['publishedAt']}
 
161
  Description: {row['description']}
 
162
  URL: {row['url']}
 
163
  Summary:\n{row['summary_clean']}"""
164
  return summary
165
 
@@ -226,8 +230,10 @@ def postprocess_report(report, summaries, topic, num_articles, model):
226
  report_summary = f"""\
227
  # News Summary: {topic}
228
 
229
- **Period:** {(date.today() - timedelta(days=1)).strftime('%Y-%m-%d')}-{date.today().strftime('%Y-%m-%d')}
 
230
  **Processed articles:** {num_articles}
 
231
  **Model**: {model}
232
  """
233
 
 
66
  print(f"Create report...")
67
  df["article_summary"] = df.apply(format_summary, axis=1)
68
 
69
+ sep = "\n\n" + "-"*80 + "\n\n"
70
  overview = sep.join([f"Article: {i+1}\n{article}" for i, article in enumerate(df["article_summary"])])
71
  report = create_report(overview, client, MODEL, topic)
72
 
 
156
  def format_summary(row):
157
  """Format article summary"""
158
  summary = f"""\
159
+ Title: **{row['title']}**
160
+
161
  Published: {row['publishedAt']}
162
+
163
  Description: {row['description']}
164
+
165
  URL: {row['url']}
166
+
167
  Summary:\n{row['summary_clean']}"""
168
  return summary
169
 
 
230
  report_summary = f"""\
231
  # News Summary: {topic}
232
 
233
+ **Period:** {(date.today() - timedelta(days=1)).strftime('%Y-%m-%d')} to {date.today().strftime('%Y-%m-%d')}
234
+
235
  **Processed articles:** {num_articles}
236
+
237
  **Model**: {model}
238
  """
239