Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,8 +82,11 @@ df=pd.DataFrame({"Title":dataset['train']['Title'],"Plot":dataset['train']['Over
|
|
| 82 |
def getOutput(text, size=1000):
|
| 83 |
sentences=get_pre_processed_data(int(size))
|
| 84 |
np_array=getSimilarity(sentences,[text])
|
| 85 |
-
return df.iloc[get_top_k_matches(np_array,5,sentences)]
|
| 86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
iface = gr.Interface(fn=getOutput,
|
| 88 |
inputs=[gr.inputs.Textbox(label="Text")],
|
| 89 |
outputs=[Label() for i in range(5)],
|
|
|
|
| 82 |
def getOutput(text, size=1000):
|
| 83 |
sentences=get_pre_processed_data(int(size))
|
| 84 |
np_array=getSimilarity(sentences,[text])
|
|
|
|
| 85 |
|
| 86 |
+
output=[]
|
| 87 |
+
for movie in df.iloc[get_top_k_matches(np_array,5,sentences)]:
|
| 88 |
+
output.append(movie['Title']+'\n'+movie['Plot'])
|
| 89 |
+
return output
|
| 90 |
iface = gr.Interface(fn=getOutput,
|
| 91 |
inputs=[gr.inputs.Textbox(label="Text")],
|
| 92 |
outputs=[Label() for i in range(5)],
|