nickmuchi commited on
Commit
713fc75
1 Parent(s): b37e99f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -31,6 +31,15 @@ def display_df_as_table(model,top_k,score='score'):
31
 
32
  return df
33
 
 
 
 
 
 
 
 
 
 
34
  #function for generating similarity of query and netflix shows
35
  def semantic_search(query,top_k):
36
  '''Encode query and check similarity with embeddings'''
@@ -61,7 +70,7 @@ def semantic_search(query,top_k):
61
  return bi_df, cross_df
62
 
63
 
64
- title = """<h1 id="title">Netflix Shows Semantic Search</h1>"""
65
 
66
  description = """
67
  Semantic Search is a way to generate search results based on the actual meaning of the query instead of a standard keyword search. I believe this way of searching provides more meaning results when trying to find a good show to watch on Netflix. For example, one could search for "Success, rags to riches story" as provided in the example below to generate shows or movies with a description that is semantically similar to the query.
@@ -97,7 +106,7 @@ with demo:
97
 
98
 
99
  with gr.Row():
100
- query = gr.Textbox(lines=3,label='Describe the Netflix show or movie you would like to watch..')
101
 
102
  with gr.Row():
103
 
 
31
 
32
  return df
33
 
34
+ #load ASR model
35
+ def asr(audio):
36
+
37
+ asr_model = whisper.load_model("base")
38
+ results = loaded_model.transcribe(audio)
39
+ query = results['text']
40
+
41
+ return query
42
+
43
  #function for generating similarity of query and netflix shows
44
  def semantic_search(query,top_k):
45
  '''Encode query and check similarity with embeddings'''
 
70
  return bi_df, cross_df
71
 
72
 
73
+ title = """<h1 id="title">Voice Activated Netflix Shows Semantic Search</h1>"""
74
 
75
  description = """
76
  Semantic Search is a way to generate search results based on the actual meaning of the query instead of a standard keyword search. I believe this way of searching provides more meaning results when trying to find a good show to watch on Netflix. For example, one could search for "Success, rags to riches story" as provided in the example below to generate shows or movies with a description that is semantically similar to the query.
 
106
 
107
 
108
  with gr.Row():
109
+ query = gr.Audio(source='microphone',type='filepath',label='Describe the Netflix show or movie you would like to watch..')
110
 
111
  with gr.Row():
112