Spaces:
Running
Running
Commit
·
69ba241
1
Parent(s):
52d2d60
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,9 +24,11 @@ def get_text(url):
|
|
| 24 |
|
| 25 |
def get_summary(article):
|
| 26 |
first_sentences = ' '.join(re.split(r'(?<=[.:;])\s', article)[:5])
|
|
|
|
| 27 |
print(first_sentences)
|
| 28 |
-
b = summarizer(first_sentences, min_length=20, max_length=
|
| 29 |
b = b[0]['summary_text']
|
|
|
|
| 30 |
return b
|
| 31 |
|
| 32 |
with gr.Blocks() as demo:
|
|
|
|
| 24 |
|
| 25 |
def get_summary(article):
|
| 26 |
first_sentences = ' '.join(re.split(r'(?<=[.:;])\s', article)[:5])
|
| 27 |
+
first_sentences = first_sentences.replace(' .', '.')
|
| 28 |
print(first_sentences)
|
| 29 |
+
b = summarizer(first_sentences, min_length = 20, max_length = 120, do_sample = False)
|
| 30 |
b = b[0]['summary_text']
|
| 31 |
+
|
| 32 |
return b
|
| 33 |
|
| 34 |
with gr.Blocks() as demo:
|