|
@@ -58,14 +58,17 @@ def get_license_list():
|
|
|
records = license_dao.get_records_by_query({"BrandName":"李宁"})
|
|
records = license_dao.get_records_by_query({"BrandName":"李宁"})
|
|
|
for record in records:
|
|
for record in records:
|
|
|
if "ProductSeries" not in record.keys():
|
|
if "ProductSeries" not in record.keys():
|
|
|
- record["ProductSeries"] = "无"
|
|
|
|
|
- license_list.append(
|
|
|
|
|
- {
|
|
|
|
|
- "产品名称":record["ProductTitle"],
|
|
|
|
|
- "产品分类":record["Category"],
|
|
|
|
|
- "产品系列":record["ProductSeries"]
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ record["ProductSeries"] = ""
|
|
|
|
|
+ # license_list.append(
|
|
|
|
|
+ # {
|
|
|
|
|
+ # "产品名称":record["ProductTitle"],
|
|
|
|
|
+ # "产品分类":record["Category"],
|
|
|
|
|
+ # "产品系列":record["ProductSeries"]
|
|
|
|
|
+ # }
|
|
|
|
|
+ # )
|
|
|
|
|
+ product = f"{record['ProductSeries']} {record['Category']}"
|
|
|
|
|
+ if product not in license_list:
|
|
|
|
|
+ license_list.append(product)
|
|
|
return license_list
|
|
return license_list
|
|
|
|
|
|
|
|
|
|
|
|
@@ -80,8 +83,10 @@ def check_infringement(title, brandname):
|
|
|
key_word_falg = False
|
|
key_word_falg = False
|
|
|
|
|
|
|
|
key_word_judgement = json.loads(agent.brand_key_word_judgement(brandname, title))
|
|
key_word_judgement = json.loads(agent.brand_key_word_judgement(brandname, title))
|
|
|
- print(type(agent.license_product_judgement(title, license_list)))
|
|
|
|
|
- license_judgement = json.loads(agent.license_product_judgement(title, license_list))
|
|
|
|
|
|
|
+
|
|
|
|
|
+ res = agent.license_product_judgement(title, license_list_str)
|
|
|
|
|
+ print(res)
|
|
|
|
|
+ license_judgement = json.loads(res)
|
|
|
key_word_falg = key_word_judgement["key_word_flag"]
|
|
key_word_falg = key_word_judgement["key_word_flag"]
|
|
|
license_judgement_flag = license_judgement["in_list"]
|
|
license_judgement_flag = license_judgement["in_list"]
|
|
|
# license_flag = license_judgement["in_list"]
|
|
# license_flag = license_judgement["in_list"]
|
|
@@ -107,7 +112,9 @@ default_merchant = merchant_list_titles[0] if merchant_list_titles else None
|
|
|
default_cust_info, default_image = get_cust_info(default_merchant)
|
|
default_cust_info, default_image = get_cust_info(default_merchant)
|
|
|
|
|
|
|
|
license_list = get_license_list()
|
|
license_list = get_license_list()
|
|
|
-# print(license_list)
|
|
|
|
|
|
|
+license_list_str = ""
|
|
|
|
|
+for product in license_list:
|
|
|
|
|
+ license_list_str += f"{product}\n"
|
|
|
with gr.Blocks() as demo:
|
|
with gr.Blocks() as demo:
|
|
|
gr.Markdown("## 侵权识别系统", elem_id="header")
|
|
gr.Markdown("## 侵权识别系统", elem_id="header")
|
|
|
|
|
|