Spaces:
Sleeping
Sleeping
Delete text_summarization.py
Browse files- text_summarization.py +0 -9
text_summarization.py
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
from transformers import pipeline
|
2 |
-
|
3 |
-
class TextSummarizer:
|
4 |
-
def __init__(self):
|
5 |
-
self.summarizer = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
|
6 |
-
|
7 |
-
def summarize(self, text):
|
8 |
-
result = self.summarizer(text, max_length=120, min_length=30, do_sample=False)
|
9 |
-
return result[0]['summary_text']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|