minnehwg commited on
Commit
0c350d4
1 Parent(s): 9234299

Update util.py

Browse files
Files changed (1) hide show
  1. util.py +5 -4
util.py CHANGED
@@ -120,9 +120,9 @@ def post_processing(text):
120
 
121
  def display(text):
122
  sentences = re.split(r'(?<=[.!?])\s*', text)
123
- uni = list(dict.fromkeys(sentences[:-1]))
124
- for sentence in uni:
125
- print(f"• {sentence}")
126
 
127
  def pipeline(url):
128
  trans, sub = get_subtitles(url)
@@ -137,5 +137,6 @@ def pipeline(url):
137
  sum = ''.join(sum_para)
138
  del sub, vie_sub, sum_para, chunks
139
  sum = post_processing(sum)
140
- display(sum)
 
141
 
 
120
 
121
  def display(text):
122
  sentences = re.split(r'(?<=[.!?])\s*', text)
123
+ unique_sentences = list(dict.fromkeys(sentences[:-1]))
124
+ formatted_sentences = [f"• {sentence}" for sentence in unique_sentences]
125
+ return formatted_sentences
126
 
127
  def pipeline(url):
128
  trans, sub = get_subtitles(url)
 
137
  sum = ''.join(sum_para)
138
  del sub, vie_sub, sum_para, chunks
139
  sum = post_processing(sum)
140
+ re = display(sum)
141
+ return re
142