Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,10 +79,10 @@ def get_top_k_matches(np_array,k,sentences):
|
|
| 79 |
import pandas as pd
|
| 80 |
df=pd.DataFrame({"Title":dataset['train']['Title'],"Plot":dataset['train']['Overview']})
|
| 81 |
|
| 82 |
-
def getOutput(text, size):
|
| 83 |
sentences=get_pre_processed_data(int(size))
|
| 84 |
np_array=getSimilarity(sentences,[text])
|
| 85 |
return df.iloc[get_top_k_matches(np_array,2,sentences)]
|
| 86 |
|
| 87 |
-
iface = gr.Interface(fn=getOutput, inputs=[gr.inputs.Textbox(label="Text")
|
| 88 |
iface.launch(debug=True)
|
|
|
|
| 79 |
import pandas as pd
|
| 80 |
df=pd.DataFrame({"Title":dataset['train']['Title'],"Plot":dataset['train']['Overview']})
|
| 81 |
|
| 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,2,sentences)]
|
| 86 |
|
| 87 |
+
iface = gr.Interface(fn=getOutput, inputs=[gr.inputs.Textbox(label="Text")], outputs="text")
|
| 88 |
iface.launch(debug=True)
|