Spaces:
Runtime error
Runtime error
Update util.py
Browse files
util.py
CHANGED
@@ -120,9 +120,9 @@ def post_processing(text):
|
|
120 |
|
121 |
def display(text):
|
122 |
sentences = re.split(r'(?<=[.!?])\s*', text)
|
123 |
-
|
124 |
-
for sentence in
|
125 |
-
|
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 |
|