Update app.py
Browse files
app.py
CHANGED
|
@@ -60,6 +60,7 @@ def transcribe_audio(audio_file):
|
|
| 60 |
return "\n".join(subtitles), " ".join(plain_subtitles)
|
| 61 |
|
| 62 |
# Perform Embedding Search with Cosine Similarity
|
|
|
|
| 63 |
def search_word_with_embeddings(word, transcribed_text):
|
| 64 |
search_embedding = embedder.encode(word, convert_to_tensor=True)
|
| 65 |
data_texts = [str(item.get('text', '')) if isinstance(item, dict) else str(item) for item in subtitle_data]
|
|
@@ -103,6 +104,3 @@ with tab2:
|
|
| 103 |
st.write("### Top 5 Search Results")
|
| 104 |
for result in top_results:
|
| 105 |
st.info(result)
|
| 106 |
-
|
| 107 |
-
os.remove(temp_audio_path)
|
| 108 |
-
st.success("Process completed successfully!")
|
|
|
|
| 60 |
return "\n".join(subtitles), " ".join(plain_subtitles)
|
| 61 |
|
| 62 |
# Perform Embedding Search with Cosine Similarity
|
| 63 |
+
|
| 64 |
def search_word_with_embeddings(word, transcribed_text):
|
| 65 |
search_embedding = embedder.encode(word, convert_to_tensor=True)
|
| 66 |
data_texts = [str(item.get('text', '')) if isinstance(item, dict) else str(item) for item in subtitle_data]
|
|
|
|
| 104 |
st.write("### Top 5 Search Results")
|
| 105 |
for result in top_results:
|
| 106 |
st.info(result)
|
|
|
|
|
|
|
|
|