Spaces:
Runtime error
Runtime error
Commit
·
a22415a
1
Parent(s):
ea78d12
Update app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,9 @@ def retrain(query, doc_id):
|
|
53 |
|
54 |
|
55 |
def search(query):
|
56 |
-
|
|
|
|
|
57 |
K = min(2*max_posts, len(scores) - 1)
|
58 |
sorted_post_ids = scores.argsort()[-K:][::-1]
|
59 |
print(sorted_post_ids)
|
|
|
53 |
|
54 |
|
55 |
def search(query):
|
56 |
+
query = query.lower()
|
57 |
+
query = ' '.join([query[i:i+4] for i in range(len(query)-3)])
|
58 |
+
scores = model.predict({"Name": query})
|
59 |
K = min(2*max_posts, len(scores) - 1)
|
60 |
sorted_post_ids = scores.argsort()[-K:][::-1]
|
61 |
print(sorted_post_ids)
|