Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,22 @@
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# Gradio App
|
6 |
with gr.Blocks() as iface:
|
|
|
1 |
+
import gradio as gr
|
2 |
|
3 |
+
def process_keywords_and_video(url, excel_file):
|
4 |
+
metadata, error = fetch_video_metadata(url)
|
5 |
+
if error:
|
6 |
+
return error, None
|
7 |
|
8 |
+
transcript, error = fetch_transcript(url)
|
9 |
+
if error:
|
10 |
+
return error, None
|
11 |
|
12 |
+
sentences = split_long_sentences(transcript)
|
13 |
+
keywords, attributes = read_keywords(excel_file)
|
14 |
+
matched_keywords = match_keywords_in_sentences(sentences, keywords)
|
15 |
+
sentiment_results = analyze_sentiment_for_keywords(matched_keywords, sentences)
|
16 |
+
wordclouds = generate_word_clouds(matched_keywords)
|
17 |
+
pdf_file = generate_pdf_with_sections(metadata, sentiment_results, wordclouds)
|
18 |
+
|
19 |
+
return "Processing completed successfully!", pdf_file
|
20 |
|
21 |
# Gradio App
|
22 |
with gr.Blocks() as iface:
|