Spaces:
Sleeping
Sleeping
FrancoisHB
commited on
Commit
•
5f56b80
1
Parent(s):
a1d11c2
Commit Test SRT
Browse files
app.py
CHANGED
@@ -1,13 +1,15 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
|
|
4 |
# Function to extract text from SRT file
|
5 |
def extract_text_from_srt(srt_text):
|
6 |
lines = srt_text.strip().split("\n")
|
7 |
# Extract text content from SRT
|
8 |
-
texts = [line.split("\n")[2] for line in lines if not line.startswith("0")]
|
9 |
return " ".join(texts)
|
10 |
|
|
|
11 |
# Load summarization pipeline
|
12 |
summarizer = pipeline("summarization")
|
13 |
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
# Function to extract text from SRT file
|
5 |
# Function to extract text from SRT file
|
6 |
def extract_text_from_srt(srt_text):
|
7 |
lines = srt_text.strip().split("\n")
|
8 |
# Extract text content from SRT
|
9 |
+
texts = [line.split("\n")[2] for line in lines if len(line.split("\n")) > 2 and not line.startswith("0")]
|
10 |
return " ".join(texts)
|
11 |
|
12 |
+
|
13 |
# Load summarization pipeline
|
14 |
summarizer = pipeline("summarization")
|
15 |
|