Vadim212 commited on
Commit
e2ec042
·
verified ·
1 Parent(s): 9dfdb8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 is not "") or (product is not ""):
54
- product_line_filter = partial(filter_f, field = "product_line", value = product_line) if product_line is not "" else lambda x: True
55
- product_filter = partial(filter_f, field = "product", value = product) if product is not "" else lambda x: True
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))