Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
|
| 4 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
def process_keywords_and_video(url, excel_file):
|
| 7 |
metadata, error = fetch_video_metadata(url)
|
|
@@ -13,7 +15,7 @@ def process_keywords_and_video(url, excel_file):
|
|
| 13 |
return error, None
|
| 14 |
|
| 15 |
sentences = split_long_sentences(transcript)
|
| 16 |
-
keywords, attributes = read_keywords(excel_file)
|
| 17 |
matched_keywords = match_keywords_in_sentences(sentences, keywords)
|
| 18 |
sentiment_results = analyze_sentiment_for_keywords(matched_keywords, sentences)
|
| 19 |
wordclouds = generate_word_clouds(matched_keywords)
|
|
|
|
| 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 |
return error, None
|
| 16 |
|
| 17 |
sentences = split_long_sentences(transcript)
|
| 18 |
+
keywords, attributes = read_keywords(excel_file.name) # Make sure to use `excel_file.name` for the file path
|
| 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)
|