Spaces:
Sleeping
Sleeping
Ozgur Unlu
commited on
Commit
•
c8d49bd
1
Parent(s):
ebeacbc
first start 3
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def classify_product(ad_text):
|
|
27 |
"Healthcare", "Financial Services", "Entertainment",
|
28 |
"Home & Garden", "Automotive", "Education"
|
29 |
],
|
30 |
-
hypothesis_template="This is an advertisement for a product in the category
|
31 |
multi_label=False
|
32 |
)
|
33 |
|
@@ -39,7 +39,7 @@ def classify_product(ad_text):
|
|
39 |
"physical product", "digital product", "professional service",
|
40 |
"consumer device", "platform", "tool"
|
41 |
],
|
42 |
-
hypothesis_template="This is specifically a",
|
43 |
multi_label=False
|
44 |
)
|
45 |
|
@@ -59,7 +59,7 @@ def classify_product(ad_text):
|
|
59 |
product_name_result = classifier(
|
60 |
ad_text,
|
61 |
candidate_labels=["contains brand name", "does not contain brand name"],
|
62 |
-
hypothesis_template="This text",
|
63 |
multi_label=False
|
64 |
)
|
65 |
if product_name_result['labels'][0] == "contains brand name":
|
|
|
27 |
"Healthcare", "Financial Services", "Entertainment",
|
28 |
"Home & Garden", "Automotive", "Education"
|
29 |
],
|
30 |
+
hypothesis_template="This is an advertisement for a product in the {} category",
|
31 |
multi_label=False
|
32 |
)
|
33 |
|
|
|
39 |
"physical product", "digital product", "professional service",
|
40 |
"consumer device", "platform", "tool"
|
41 |
],
|
42 |
+
hypothesis_template="This is specifically a {}",
|
43 |
multi_label=False
|
44 |
)
|
45 |
|
|
|
59 |
product_name_result = classifier(
|
60 |
ad_text,
|
61 |
candidate_labels=["contains brand name", "does not contain brand name"],
|
62 |
+
hypothesis_template="This text {}",
|
63 |
multi_label=False
|
64 |
)
|
65 |
if product_name_result['labels'][0] == "contains brand name":
|