Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -162,10 +162,12 @@ summarizer = pipeline("summarization")
|
|
162 |
|
163 |
|
164 |
def text_processing_for_domain(unsummarized_text):
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
|
|
|
|
169 |
|
170 |
# Text Cleaning
|
171 |
text = re.sub(r'[^\w\s]', '', text)
|
|
|
162 |
|
163 |
|
164 |
def text_processing_for_domain(unsummarized_text):
|
165 |
+
try:
|
166 |
+
# Summarization
|
167 |
+
text = summarizer(unsummarized_text, max_length=70, min_length=30, do_sample=False)[0]['summary_text']
|
168 |
+
except Exception as e:
|
169 |
+
print(f"Summarization failed: {e}")
|
170 |
+
text = unsummarized_text
|
171 |
|
172 |
# Text Cleaning
|
173 |
text = re.sub(r'[^\w\s]', '', text)
|