Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,4 @@
|
|
| 1 |
-
# app.py
|
| 2 |
-
|
| 3 |
import gradio as gr
|
| 4 |
-
from backend import fetch_video_metadata, fetch_transcript, split_long_sentences, match_keywords_in_sentences, read_keywords
|
| 5 |
-
from backend import analyze_sentiment_for_keywords, generate_word_clouds, generate_pdf_with_sections
|
| 6 |
-
import os
|
| 7 |
|
| 8 |
def process_keywords_and_video(url, excel_file):
|
| 9 |
metadata, error = fetch_video_metadata(url)
|
|
@@ -15,7 +10,7 @@ def process_keywords_and_video(url, excel_file):
|
|
| 15 |
return error, None
|
| 16 |
|
| 17 |
sentences = split_long_sentences(transcript)
|
| 18 |
-
keywords, attributes = read_keywords(excel_file
|
| 19 |
matched_keywords = match_keywords_in_sentences(sentences, keywords)
|
| 20 |
sentiment_results = analyze_sentiment_for_keywords(matched_keywords, sentences)
|
| 21 |
wordclouds = generate_word_clouds(matched_keywords)
|
|
@@ -38,4 +33,4 @@ with gr.Blocks() as iface:
|
|
| 38 |
outputs=[processing_status, pdf_output]
|
| 39 |
)
|
| 40 |
|
| 41 |
-
iface.launch(share=True)
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def process_keywords_and_video(url, excel_file):
|
| 4 |
metadata, error = fetch_video_metadata(url)
|
|
|
|
| 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)
|
|
|
|
| 33 |
outputs=[processing_status, pdf_output]
|
| 34 |
)
|
| 35 |
|
| 36 |
+
iface.launch(share=True)
|