Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -69,7 +69,7 @@ def semantic_search(query, top_k=5):
|
|
69 |
results = []
|
70 |
for distance, idx in zip(distances[0], indices[0]):
|
71 |
similarity_score = 1 - distance / 2 # 將距離轉換為相似度分數
|
72 |
-
if similarity_score >= 0.
|
73 |
results.append({
|
74 |
'text': data[idx]['text'],
|
75 |
'entities': data[idx]['entities'],
|
|
|
69 |
results = []
|
70 |
for distance, idx in zip(distances[0], indices[0]):
|
71 |
similarity_score = 1 - distance / 2 # 將距離轉換為相似度分數
|
72 |
+
if similarity_score >= 0.1: # 只添加相似度大於等於0.45的結果
|
73 |
results.append({
|
74 |
'text': data[idx]['text'],
|
75 |
'entities': data[idx]['entities'],
|