Update app.py
Browse files
app.py
CHANGED
@@ -50,9 +50,9 @@ def filter_product(question, dataset):
|
|
50 |
for pr in ["web", "net", "js", "wpf", "php", "blazor", "angular", "java"]:
|
51 |
if re.search(f"{pr}\\b", question, re.IGNORECASE) is not None: product = pr
|
52 |
|
53 |
-
if (product_line
|
54 |
-
product_line_filter = partial(filter_f, field = "product_line", value = product_line) if product_line
|
55 |
-
product_filter = partial(filter_f, field = "product", value = product) if product
|
56 |
|
57 |
dataset.drop_index("embeddings")
|
58 |
dataset = dataset.filter(lambda x: product_line_filter(x) and product_filter(x))
|
|
|
50 |
for pr in ["web", "net", "js", "wpf", "php", "blazor", "angular", "java"]:
|
51 |
if re.search(f"{pr}\\b", question, re.IGNORECASE) is not None: product = pr
|
52 |
|
53 |
+
if (product_line != "") or (product != ""):
|
54 |
+
product_line_filter = partial(filter_f, field = "product_line", value = product_line) if product_line != "" else lambda x: True
|
55 |
+
product_filter = partial(filter_f, field = "product", value = product) if product != "" else lambda x: True
|
56 |
|
57 |
dataset.drop_index("embeddings")
|
58 |
dataset = dataset.filter(lambda x: product_line_filter(x) and product_filter(x))
|