johnnyfivefingers commited on
Commit
1477c65
1 Parent(s): 9318d18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -8,13 +8,11 @@ model_id = "philschmid/bart-large-cnn-samsum"
8
  summarizer = pipeline("summarization", model=model_id)
9
 
10
  def summarize(text):
11
- #return "Summary: " + text
12
  text = str(text)
13
  if text == "showdata":
14
  lines = "(lines)"
15
  with open('input.csv',"r") as f:
16
  lines = f.readlines()
17
- #print(lines)
18
  return str(lines)
19
 
20
 
@@ -22,7 +20,7 @@ def summarize(text):
22
  generated_summary = summarizer(text, max_length=80, min_length=20)[0]['summary_text']
23
  generated_summary_long = summarizer(text, max_length=200, min_length=40)[0]['summary_text']
24
 
25
- fields = [text, generated_summary]
26
  with open('input.csv','a', newline='') as f:
27
  writer = csv.writer(f)
28
  writer.writerow(fields)
 
8
  summarizer = pipeline("summarization", model=model_id)
9
 
10
  def summarize(text):
 
11
  text = str(text)
12
  if text == "showdata":
13
  lines = "(lines)"
14
  with open('input.csv',"r") as f:
15
  lines = f.readlines()
 
16
  return str(lines)
17
 
18
 
 
20
  generated_summary = summarizer(text, max_length=80, min_length=20)[0]['summary_text']
21
  generated_summary_long = summarizer(text, max_length=200, min_length=40)[0]['summary_text']
22
 
23
+ fields = [str(text), str(generated_summary)]
24
  with open('input.csv','a', newline='') as f:
25
  writer = csv.writer(f)
26
  writer.writerow(fields)