Spaces:
Sleeping
Sleeping
summarize updated
Browse files
app.py
CHANGED
@@ -49,9 +49,9 @@ def generate_text_from_audio(audio):
|
|
49 |
audio_text_result = pipe(audio_data, generate_kwargs={"task": "translate", "forced_decoder_ids": [[1, None], [2, 50359]]})
|
50 |
return audio_text_result["text"]
|
51 |
|
52 |
-
def generate_summary_from_text(text
|
53 |
summarizer = pipeline("summarization", model="Falconsai/text_summarization")
|
54 |
-
return summarizer(text, max_length=
|
55 |
|
56 |
def text_classification(text):
|
57 |
classifier = pipeline(task="text-classification", model="SamLowe/roberta-base-go_emotions", top_k=None)
|
|
|
49 |
audio_text_result = pipe(audio_data, generate_kwargs={"task": "translate", "forced_decoder_ids": [[1, None], [2, 50359]]})
|
50 |
return audio_text_result["text"]
|
51 |
|
52 |
+
def generate_summary_from_text(text):
|
53 |
summarizer = pipeline("summarization", model="Falconsai/text_summarization")
|
54 |
+
return summarizer(text, max_length=100, min_length=15, do_sample=False)
|
55 |
|
56 |
def text_classification(text):
|
57 |
classifier = pipeline(task="text-classification", model="SamLowe/roberta-base-go_emotions", top_k=None)
|