Spaces:
Running
Running
change to e5
Browse files
app.py
CHANGED
@@ -29,8 +29,8 @@ api = Api(AIRTABLE_API_KEY)
|
|
29 |
table = api.table(BASE_ID, TABLE_NAME)
|
30 |
|
31 |
# Load model
|
32 |
-
model = SentenceTransformer('
|
33 |
-
collection_name = "
|
34 |
|
35 |
# Load whitelist
|
36 |
with open("keyword_whitelist.pkl", "rb") as f:
|
@@ -110,7 +110,7 @@ def search_product(query):
|
|
110 |
|
111 |
result_summary, found = "", False
|
112 |
for res in result:
|
113 |
-
if res.score > 0.
|
114 |
found = True
|
115 |
name = res.payload.get("name", "ไม่ทราบชื่อสินค้า")
|
116 |
score = f"{res.score:.4f}"
|
|
|
29 |
table = api.table(BASE_ID, TABLE_NAME)
|
30 |
|
31 |
# Load model
|
32 |
+
model = SentenceTransformer('e5_finetuned')
|
33 |
+
collection_name = "product_E5_finetune"
|
34 |
|
35 |
# Load whitelist
|
36 |
with open("keyword_whitelist.pkl", "rb") as f:
|
|
|
110 |
|
111 |
result_summary, found = "", False
|
112 |
for res in result:
|
113 |
+
if res.score > 0.8:
|
114 |
found = True
|
115 |
name = res.payload.get("name", "ไม่ทราบชื่อสินค้า")
|
116 |
score = f"{res.score:.4f}"
|