Calvin
commited on
Commit
•
ee79db1
1
Parent(s):
a5d7183
updated models
Browse files- DS_NLP_search_data/processed_offers.csv +78 -78
- DS_NLP_search_data/processed_offers.pkl +0 -3
- offer_pipeline.py +29 -62
- requirements.txt +2 -1
DS_NLP_search_data/processed_offers.csv
CHANGED
@@ -8,44 +8,44 @@ index,OFFER,CATEGORY
|
|
8 |
6,"Beyond Meat® Plant-Based products, spend $20",{'Plant-Based Meat'}
|
9 |
7,Good Humor Viennetta Frozen Vanilla Cake,{'Frozen Desserts'}
|
10 |
8,"Reese's Peanut Butter Bar, 6 count, at GIANT OR MARTIN’S",{'Frozen Desserts'}
|
11 |
-
9,"Butterball, select varieties, spend $10 at Dillons Food Store",{'Nut Butters & Jam'}
|
12 |
-
10,"Butterball, select varieties, spend $10 at Ralphs",{'Nut Butters & Jam'}
|
13 |
-
11,"Butterball, select varieties, Spend $10 at Ruler Foods",{'Nut Butters & Jam'}
|
14 |
-
12,"Butterball, select varieties, spend $10 at King Soopers",{'Nut Butters & Jam'}
|
15 |
-
13,"Butterball, select varieties, spend $10 at Fred Meyer",{'Nut Butters & Jam'}
|
16 |
-
14,"Butterball, select varieties, spend $10 at Kroger",{'Nut Butters & Jam'}
|
17 |
-
15,"Butterball, select varieties, spend $10 at Smith's",{'Nut Butters & Jam'}
|
18 |
-
16,"Butterball, select varieties, spend $10 at Food 4 Less",{'Nut Butters & Jam'}
|
19 |
-
17,"Butterball, select varieties, spend $10 at Fry's Food Store",{'Nut Butters & Jam'}
|
20 |
-
18,"Butterball, select varieties, spend $10 at QFC",{'Nut Butters & Jam'}
|
21 |
-
19,"Butterball, select varieties, spend $10 at Mariano's",{'Nut Butters & Jam'}
|
22 |
-
20,"Butterball, select varieties, spend $10 at Pick 'n Save OR Metro Market",{'Nut Butters & Jam'}
|
23 |
21,"GATORADE® Fast Twitch®, 12-ounce 12 pack, at Amazon Storefront*",{'Sports Drinks'}
|
24 |
-
22,"GATORLYTE® OR GATORADE™ Fit Single Serve Bottle, select varieties, buy 2",{'Sports Drinks'}
|
25 |
-
23,"GATORADE® Fast Twitch®, 12-ounce single serve, buy 2 at Kroger",{'
|
26 |
-
24,"GATORADE® Fast Twitch®, 12-ounce single serve",{'Meal Replacement Beverages'}
|
27 |
-
25,"GATORADE® Fast Twitch®, 12-ounce single serve, at Kroger",{'
|
28 |
-
26,"GATORLYTE® OR GATORADE™ Fit Single Serve Bottle, select varieties",{'Sports Drinks'}
|
29 |
27,Emmy's Organics® Cookies OR Brownie Snaps,{'Cookies'}
|
30 |
28,"Dr Pepper®, Regular OR Zero Sugar Strawberries and Cream 12 pack, at select retailers",{'Carbonated Soft Drinks'}
|
31 |
29,"Arnold, Brownberry, Oroweat® Small Slice bread, at Walmart",{'Bread'}
|
32 |
30,"Arnold, Brownberry, Oroweat® Keto bread, buy 2",{'Bread'}
|
33 |
-
31,Arnold® Grains Almighty,{'Prepared Meals'}
|
34 |
32,Barilla® Pesto Sauce,{'Pesto Sauce'}
|
35 |
-
33,"Barilla® Pasta, select varieties, buy 2",{'Red Pasta Sauce'}
|
36 |
-
34,"Barilla® pasta, select varieties, buy 3",{'Red Pasta Sauce'}
|
37 |
-
35,"Barilla® pasta, select varieties, buy 4",{'Red Pasta Sauce'}
|
38 |
-
36,"Barilla® pasta, select varieties, buy 2",{'Red Pasta Sauce'}
|
39 |
37,"Any General Mills™ products, buy 2
|
40 |
Good Rewards Members Only","{'Cereal, Granola, & Toaster Pastries'}"
|
41 |
38,"General Mills™ products, select brands, spend $35",{'Refrigerated Doughs'}
|
42 |
-
39,"General Mills™ products, select brands, spend $7 at Convenience Stores",{'
|
43 |
40,"General Mills™ products, select varieties, spend $12",{'Refrigerated Doughs'}
|
44 |
41,Egglife Egg White Wraps at Aldi,{'Eggs'}
|
45 |
42,"DOVE® Chocolate, select sizes, buy 1",{'Candy'}
|
46 |
43,"DOVE® chocolate, select varieties",{'Candy'}
|
47 |
44,Hellmann's® OR Best Foods® Garlic Aioli OR Spicy Mayonnaise,{'Condiments'}
|
48 |
-
45,Hellmann's® OR Best Foods® AND Sargento® Cheese Slices,{'Condiments'}
|
49 |
46,Hellmann's | Best Foods Vegan Dressing or Spread,{'Dressings'}
|
50 |
47,"M&M'S®, select sizes, buy 1",{'Candy'}
|
51 |
48,"M&M'S® chocolate candies, select varieties",{'Candy'}
|
@@ -60,52 +60,52 @@ Good Rewards Members Only","{'Cereal, Granola, & Toaster Pastries'}"
|
|
60 |
57,L'Oréal Paris Excellence Hair Color at Target,{'Hair Care'}
|
61 |
58,"L'Oréal Paris Hair color, select varieties, spend $25 at Target",{'Hair Care'}
|
62 |
59,"L'Oréal Paris Hair color, select varieties, spend $9 at Target",{'Hair Care'}
|
63 |
-
60,Simply Spiked™ Lemonade 12 pack+,"{'Hard Seltzers, Sodas, Waters, Lemonades & Teas'}"
|
64 |
-
61,"Simply Spiked™ Signature Peach 12-pack or larger, buy 2",{'Malt Beverages'}
|
65 |
-
62,Simply Spiked™ 12 pack+,"{'Hard Seltzers, Sodas, Waters, Lemonades & Teas'}"
|
66 |
-
63,Simply Spiked™ Signature Peach 12 pack+,{'Malt Beverages'}
|
67 |
-
64,"Gorton's, at select retailers",{'
|
68 |
-
65,"Gorton's Air Fried Butterfly Shrimp, at Walmart",{'Frozen Seafood'}
|
69 |
-
66,Gorton's at select retailers,{'
|
70 |
67,"Flonase Allergy Relief, at Walmart",{'Medicines & Treatments'}
|
71 |
68,"CESAR® Wet Dog Food, spend $20",{'Dog Supplies'}
|
72 |
69,CESAR® Wet Dog Food Singles,{'Dog Supplies'}
|
73 |
-
70,"TWIX®, select sizes",{'Candy'}
|
74 |
-
71,"TWIX®, select varieties",{'Candy'}
|
75 |
-
72,"Hidden Valley® Ranch Salad Dressing OR Secret Sauce, select varieties",{'Sauces & Marinades'}
|
76 |
-
73,"Hidden Valley® Ranch Seasoning Mix Packet, 1 count",{'Sauces & Marinades'}
|
77 |
-
74,"Hidden Valley® Ranch Seasoning, select varieties",{'Sauces & Marinades'}
|
78 |
-
75,Hidden Valley® Ranch Seasoning Shaker,{'Sauces & Marinades'}
|
79 |
-
76,"Hidden Valley® Ranch Night Seasoning Mix, 1 count",{'Cooking & Baking'}
|
80 |
77,"Cooked Perfect® Meatballs, at Walmart",{'Frozen Chicken'}
|
81 |
78,"Cooked Perfect® Meatballs, Homestyle OR Turkey, at Walmart",{'Frozen Chicken'}
|
82 |
79,"Perfect Keto Barista Blend Collagen & MCTs, online at Amazon",{'Medicines & Treatments'}
|
83 |
-
80,"Perfect Keto Beauty + Sleep Collagen, online at Amazon",{'Medicines & Treatments'}
|
84 |
-
81,"Perfect Keto Bars, online at Amazon",{'Nuts & Seeds'}
|
85 |
-
82,"Perfect Keto Collagen Peptides, online at Amazon",{'Medicines & Treatments'}
|
86 |
83,"Perfect Keto MCT Oil Powder, online at Amazon",{'Medicines & Treatments'}
|
87 |
-
84,"Perfect Keto Super Reds, online at Amazon",{'Medicines & Treatments'}
|
88 |
-
85,"Perfect Keto Exogenous Ketones Powder, online at Amazon",{'Medicines & Treatments'}
|
89 |
86,"Crunchmaster® Crackers, spend $4",{'Crackers'}
|
90 |
-
87,"Tyson Products, select varieties, spend $20 at Sam's Club",{'Packaged Meat'}
|
91 |
88,"L'Oréal Paris Makeup, spend $35 at Target",{'Makeup'}
|
92 |
89,"L'Oréal Paris Makeup, spend $30 at Target",{'Makeup'}
|
93 |
90,L'Oreal Paris True Match Foundation at Target,{'Makeup'}
|
94 |
91,L'Oréal Paris True Match Foundation at Target,{'Makeup'}
|
95 |
92,"Chosen Foods® Mayo, select varieties",{'Condiments'}
|
96 |
-
93,Chosen Foods® Dressings,{'Dressings'}
|
97 |
94,"Wine from TheBarrelRoom.com, spend $30",{'Wine'}
|
98 |
95,"PepsiCo® Beverage, 7.5-ounce 10 pack, select varieties, at Amazon Storefront*",{'Carbonated Soft Drinks'}
|
99 |
96,"PepsiCo® Variety Pack, select varieties, at Amazon Storefront*",{'Carbonated Soft Drinks'}
|
100 |
97,"Sara Lee® bread, select varieties, buy 2 at Walmart®",{'Bread'}
|
101 |
-
98,"Sara Lee® bread select varieties, buy 2",{'Bread'}
|
102 |
99,"Sara Lee® Delightful bread, buy 2",{'Bread'}
|
103 |
100,"Sara Lee® or Alfaros® Artesano bread, buy 5",{'Bread'}
|
104 |
-
101,"Sara Lee® or Alfaros® Artesano bread, spend $8",{'Bread'}
|
105 |
102,"Sara Lee® or Alfaros® Artesano bread, buy 2",{'Bread'}
|
106 |
-
103,"Sara Lee® or Alfaros® Artesano bread, spend $20",{'Bread'}
|
107 |
-
104,"Bai® Antioxidant, 6 pack, buy 2 at Walmart",{'Drink Mixes'}
|
108 |
-
105,"Bai® Antioxidant, 6 pack, at Walmart",{'Drink Mixes'}
|
109 |
106,"Reese's Chocolate Cones, 8 count at GIANT OR MARTIN’S",{'Frozen Desserts'}
|
110 |
107,"Klondike Cones, spend $10 at Walmart ",{'Frozen Desserts'}
|
111 |
108,Klondike Cones at Walmart ,{'Frozen Desserts'}
|
@@ -124,11 +124,11 @@ Good Rewards Members Only","{'Cereal, Granola, & Toaster Pastries'}"
|
|
124 |
121,"Back to the Roots Potting Mix, 1 cubic foot, at Lowe's Home Improvement",{'Packaged Meals & Sides'}
|
125 |
122,"Back to the Roots Organic 3-In-1 Seed Starting Mix 12 quart, at Walmart or Target",{'Packaged Meals & Sides'}
|
126 |
123,"Back to the Roots Soils, select varieties, at Walmart",{'Packaged Meals & Sides'}
|
127 |
-
124,"Dove Hand Wash, select varieties, buy 2 at Target",{'Bath & Body'}
|
128 |
-
125,"Dove Hand Wash, select varieties at Target",{'Bath & Body'}
|
129 |
126,"Frutero Ice Cream, 1 pint",{'Frozen Desserts'}
|
130 |
127,"Bio-Oil® Skincare Oil OR Gel, select varieties",{'Skin Care'}
|
131 |
-
128,"Bio-Oil® products, select varieties",{'Skin Care'}
|
132 |
129,"Welch's®Fruit Snacks, select varieties, buy 2",{'Fruit & Vegetable Snacks'}
|
133 |
130,"Welch's® Zero Sugar Fruity Bites, 6 pack+, online at Amazon",{'Fruit & Vegetable Snacks'}
|
134 |
131,"Welch's® Fruit Snacks, select varieties, 6 count+, buy 3",{'Fruit & Vegetable Snacks'}
|
@@ -141,15 +141,15 @@ Good Rewards Members Only","{'Cereal, Granola, & Toaster Pastries'}"
|
|
141 |
138,"Welch's® Juicefuls® Juicy Fruit Snacks, buy 2",{'Fruit & Vegetable Snacks'}
|
142 |
139,Talenti Mini Bars,{'Frozen Desserts'}
|
143 |
140,"Molson Coors®, select varieties, 12 pack+",{'Beer'}
|
144 |
-
141,"Marinela® sweet baked goods, buy 2",{'Cookies'}
|
145 |
-
142,"Coors Light®, Miller Lite® OR VIZZY™ 12 pack+",{'Malt Beverages'}
|
146 |
-
143,"Coors Light®, Miller Lite® OR VIZZY™ 12 packs+, buy 4",{'Malt Beverages'}
|
147 |
-
144,"Coors Light®, Miller Lite® OR VIZZY™ 12 packs+, buy 2",{'Malt Beverages'}
|
148 |
-
145,"Coors Light®, Miller Lite® OR VIZZY™ 12 packs+, buy 3",{'Malt Beverages'}
|
149 |
-
146,"Coors Light®, Miller Lite® OR VIZZY™ 12 packs+, buy 5",{'Malt Beverages'}
|
150 |
-
147,Little Bites® Spend $10 at Walmart®,{'Snack Cakes'}
|
151 |
-
148,Envy Apples pre-packed bags,{'Candy'}
|
152 |
-
149,"Envy Apples, pre-packed bags",{'Candy'}
|
153 |
150,"Ben & Jerry's Frozen Creme Brulee Non Dairy Dessert, 16 ounce",{'Frozen Desserts'}
|
154 |
151,"Ben & Jerry's® Doggie Desserts, 4 count",{'Frozen Desserts'}
|
155 |
152,"Ben & Jerry's Frozen Sugar Cookie Dough Chunks, 8 ounce",{'Frozen Desserts'}
|
@@ -161,8 +161,8 @@ Good Rewards Members Only","{'Cereal, Granola, & Toaster Pastries'}"
|
|
161 |
158,"Purex® laundry detergent, select varieties, at Walmart",{'Laundry Supplies'}
|
162 |
159,Sol® 6 pack+,{'Beer'}
|
163 |
160,"Michael Angelo's® OR Rao's® Frozen Entrees, spend $10",{'Frozen Meals'}
|
164 |
-
161,Rao's® Frozen Pizza,{'Frozen Meals'}
|
165 |
-
162,"Rao's®, Pasta OR Sauce, spend $10",{'
|
166 |
163,"Sargento Sliced Cheese, spend $25",{'Cheese'}
|
167 |
164,"Sargento Sliced Cheese, spend $12",{'Cheese'}
|
168 |
165,"Sargento® products, select varieties",{'Cheese'}
|
@@ -175,16 +175,16 @@ Good Rewards Members Only","{'Cereal, Granola, & Toaster Pastries'}"
|
|
175 |
172,"Aleve® products, select varieties, 80 count+ at Walmart",{'Medicines & Treatments'}
|
176 |
173,"Aleve® products AND AleveX™, select varieties, at Walmart",{'Medicines & Treatments'}
|
177 |
174,"Magnum Non-Dairy Hazelnut Crunch Ice Cream Bars, 3 count",{'Frozen Desserts'}
|
178 |
-
175,"Thomas'® Bagel Thins®, buy 2",{'Bakery'}
|
179 |
-
176,"Thomas'®, select varieties, spend $10",{'Bakery'}
|
180 |
-
177,Thomas'® Bagel Thins,{'Bakery'}
|
181 |
-
178,"Artesano® buns, buy 2 at Walmart®",{'Bread'}
|
182 |
-
179,"STARBURST®, select sizes, buy 1",{'Fruit & Vegetable Snacks'}
|
183 |
-
180,"STARBURST®, select varieties",{'Fruit & Vegetable Snacks'}
|
184 |
-
181,Fresh Step® Outstretch® Cat Litter,{'
|
185 |
182,"Burt's Bees Sensitive Lotions and Creams, select varieties, at Walmart",{'Skin Care'}
|
186 |
183,"Burt's Bee's® Facial Wipes, select varieties, 30 count at Walmart",{'Skin Care'}
|
187 |
-
184,"Burt's Bees® products, select varieties, at Walmart",{'Skin Care'}
|
188 |
185,"Burt's Bees® Sensitive Lotions and Creams, select varieties, at Walmart",{'Skin Care'}
|
189 |
186,"Durex® Massage & Play 2 in 1 Pleasure Gel, select varieties, at Walmart or Target",{'Sexual Health'}
|
190 |
187,LIFE SAVERS®,{'Candy'}
|
@@ -195,10 +195,10 @@ Good Rewards Members Only","{'Cereal, Granola, & Toaster Pastries'}"
|
|
195 |
192,"Bubbies Pickles, Sauerkraut, OR Condiments at Whole Foods or Sprouts",{'Prepared Meals'}
|
196 |
193,Michael Angelo's® Sauce at Walmart,{'Sauces & Marinades'}
|
197 |
194,"Beech-Nut snacks, select varieties",{'Nuts & Seeds'}
|
198 |
-
195,"Beech-Nut pouches, buy 8",{'Fruit & Vegetable Snacks'}
|
199 |
196,Brita® Pitcher AND Filter,{'Household Supplies'}
|
200 |
-
197,Brita® Standard OR Elite Filters,{'Household Supplies'}
|
201 |
-
198,Brita® Pitcher OR Dispenser,{'Household Supplies'}
|
202 |
199,"SNICKERS®, select sizes, buy 1",{'Candy'}
|
203 |
200,"SNICKERS® chocolate candy bar, select varieties",{'Candy'}
|
204 |
201,"Kodiak® products, select varieties, spend $10","{'Cereal, Granola, & Toaster Pastries'}"
|
@@ -277,7 +277,7 @@ Good Rewards Members Only","{'Cereal, Granola, & Toaster Pastries'}"
|
|
277 |
68,Spend $220 at Star Market,{'Cooking & Baking'}
|
278 |
69,Any Star Market receipt,{'Cooking & Baking'}
|
279 |
70,Blue Apron Meal Kits,{'Cooking & Baking'}
|
280 |
-
71,"Sign up for McAlister's Deli Rewards, tap for details","{'
|
281 |
-
72,Spend $10 at CVS,"{'
|
282 |
-
73,Spend $30 at CVS,"{'
|
283 |
74,Spend $15 at Burger King,{'Cooking & Baking'}
|
|
|
8 |
6,"Beyond Meat® Plant-Based products, spend $20",{'Plant-Based Meat'}
|
9 |
7,Good Humor Viennetta Frozen Vanilla Cake,{'Frozen Desserts'}
|
10 |
8,"Reese's Peanut Butter Bar, 6 count, at GIANT OR MARTIN’S",{'Frozen Desserts'}
|
11 |
+
9,"Butterball, select varieties, spend $10 at Dillons Food Store","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
12 |
+
10,"Butterball, select varieties, spend $10 at Ralphs","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
13 |
+
11,"Butterball, select varieties, Spend $10 at Ruler Foods","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
14 |
+
12,"Butterball, select varieties, spend $10 at King Soopers","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
15 |
+
13,"Butterball, select varieties, spend $10 at Fred Meyer","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
16 |
+
14,"Butterball, select varieties, spend $10 at Kroger","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
17 |
+
15,"Butterball, select varieties, spend $10 at Smith's","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
18 |
+
16,"Butterball, select varieties, spend $10 at Food 4 Less","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
19 |
+
17,"Butterball, select varieties, spend $10 at Fry's Food Store","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
20 |
+
18,"Butterball, select varieties, spend $10 at QFC","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
21 |
+
19,"Butterball, select varieties, spend $10 at Mariano's","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
22 |
+
20,"Butterball, select varieties, spend $10 at Pick 'n Save OR Metro Market","{'Nut Butters & Jam', 'Frozen Turkey'}"
|
23 |
21,"GATORADE® Fast Twitch®, 12-ounce 12 pack, at Amazon Storefront*",{'Sports Drinks'}
|
24 |
+
22,"GATORLYTE® OR GATORADE™ Fit Single Serve Bottle, select varieties, buy 2","{'Meal Replacement Beverages', 'Sports Drinks'}"
|
25 |
+
23,"GATORADE® Fast Twitch®, 12-ounce single serve, buy 2 at Kroger",{'Sports Drinks'}
|
26 |
+
24,"GATORADE® Fast Twitch®, 12-ounce single serve","{'Meal Replacement Beverages', 'Sports Drinks'}"
|
27 |
+
25,"GATORADE® Fast Twitch®, 12-ounce single serve, at Kroger",{'Sports Drinks'}
|
28 |
+
26,"GATORLYTE® OR GATORADE™ Fit Single Serve Bottle, select varieties","{'Meal Replacement Beverages', 'Sports Drinks'}"
|
29 |
27,Emmy's Organics® Cookies OR Brownie Snaps,{'Cookies'}
|
30 |
28,"Dr Pepper®, Regular OR Zero Sugar Strawberries and Cream 12 pack, at select retailers",{'Carbonated Soft Drinks'}
|
31 |
29,"Arnold, Brownberry, Oroweat® Small Slice bread, at Walmart",{'Bread'}
|
32 |
30,"Arnold, Brownberry, Oroweat® Keto bread, buy 2",{'Bread'}
|
33 |
+
31,Arnold® Grains Almighty,"{'Bakery', 'Prepared Meals', 'Bread'}"
|
34 |
32,Barilla® Pesto Sauce,{'Pesto Sauce'}
|
35 |
+
33,"Barilla® Pasta, select varieties, buy 2","{'Dry Pasta', 'Red Pasta Sauce'}"
|
36 |
+
34,"Barilla® pasta, select varieties, buy 3","{'Dry Pasta', 'Red Pasta Sauce'}"
|
37 |
+
35,"Barilla® pasta, select varieties, buy 4","{'Dry Pasta', 'Red Pasta Sauce'}"
|
38 |
+
36,"Barilla® pasta, select varieties, buy 2","{'Dry Pasta', 'Red Pasta Sauce'}"
|
39 |
37,"Any General Mills™ products, buy 2
|
40 |
Good Rewards Members Only","{'Cereal, Granola, & Toaster Pastries'}"
|
41 |
38,"General Mills™ products, select brands, spend $35",{'Refrigerated Doughs'}
|
42 |
+
39,"General Mills™ products, select brands, spend $7 at Convenience Stores","{'Cereal, Granola, & Toaster Pastries'}"
|
43 |
40,"General Mills™ products, select varieties, spend $12",{'Refrigerated Doughs'}
|
44 |
41,Egglife Egg White Wraps at Aldi,{'Eggs'}
|
45 |
42,"DOVE® Chocolate, select sizes, buy 1",{'Candy'}
|
46 |
43,"DOVE® chocolate, select varieties",{'Candy'}
|
47 |
44,Hellmann's® OR Best Foods® Garlic Aioli OR Spicy Mayonnaise,{'Condiments'}
|
48 |
+
45,Hellmann's® OR Best Foods® AND Sargento® Cheese Slices,"{'Condiments', 'Dressings'}"
|
49 |
46,Hellmann's | Best Foods Vegan Dressing or Spread,{'Dressings'}
|
50 |
47,"M&M'S®, select sizes, buy 1",{'Candy'}
|
51 |
48,"M&M'S® chocolate candies, select varieties",{'Candy'}
|
|
|
60 |
57,L'Oréal Paris Excellence Hair Color at Target,{'Hair Care'}
|
61 |
58,"L'Oréal Paris Hair color, select varieties, spend $25 at Target",{'Hair Care'}
|
62 |
59,"L'Oréal Paris Hair color, select varieties, spend $9 at Target",{'Hair Care'}
|
63 |
+
60,Simply Spiked™ Lemonade 12 pack+,"{'Hard Seltzers, Sodas, Waters, Lemonades & Teas', 'Malt Beverages'}"
|
64 |
+
61,"Simply Spiked™ Signature Peach 12-pack or larger, buy 2","{'Hard Seltzers, Sodas, Waters, Lemonades & Teas', 'Malt Beverages'}"
|
65 |
+
62,Simply Spiked™ 12 pack+,"{'Hard Seltzers, Sodas, Waters, Lemonades & Teas', 'Malt Beverages'}"
|
66 |
+
63,Simply Spiked™ Signature Peach 12 pack+,"{'Hard Seltzers, Sodas, Waters, Lemonades & Teas', 'Malt Beverages'}"
|
67 |
+
64,"Gorton's, at select retailers",{'Jerky & Dried Meat'}
|
68 |
+
65,"Gorton's Air Fried Butterfly Shrimp, at Walmart","{'Frozen Meals', 'Frozen Seafood'}"
|
69 |
+
66,Gorton's at select retailers,{'Jerky & Dried Meat'}
|
70 |
67,"Flonase Allergy Relief, at Walmart",{'Medicines & Treatments'}
|
71 |
68,"CESAR® Wet Dog Food, spend $20",{'Dog Supplies'}
|
72 |
69,CESAR® Wet Dog Food Singles,{'Dog Supplies'}
|
73 |
+
70,"TWIX®, select sizes","{'Candy', 'Cookies'}"
|
74 |
+
71,"TWIX®, select varieties","{'Candy', 'Cookies'}"
|
75 |
+
72,"Hidden Valley® Ranch Salad Dressing OR Secret Sauce, select varieties","{'Sauces & Marinades', 'Dips & Salsa'}"
|
76 |
+
73,"Hidden Valley® Ranch Seasoning Mix Packet, 1 count","{'Sauces & Marinades', 'Cooking & Baking', 'Dips & Salsa'}"
|
77 |
+
74,"Hidden Valley® Ranch Seasoning, select varieties","{'Sauces & Marinades', 'Cooking & Baking', 'Dips & Salsa'}"
|
78 |
+
75,Hidden Valley® Ranch Seasoning Shaker,"{'Sauces & Marinades', 'Cooking & Baking'}"
|
79 |
+
76,"Hidden Valley® Ranch Night Seasoning Mix, 1 count","{'Sauces & Marinades', 'Cooking & Baking', 'Dips & Salsa'}"
|
80 |
77,"Cooked Perfect® Meatballs, at Walmart",{'Frozen Chicken'}
|
81 |
78,"Cooked Perfect® Meatballs, Homestyle OR Turkey, at Walmart",{'Frozen Chicken'}
|
82 |
79,"Perfect Keto Barista Blend Collagen & MCTs, online at Amazon",{'Medicines & Treatments'}
|
83 |
+
80,"Perfect Keto Beauty + Sleep Collagen, online at Amazon","{'Medicines & Treatments', 'Nuts & Seeds'}"
|
84 |
+
81,"Perfect Keto Bars, online at Amazon","{'Medicines & Treatments', 'Nuts & Seeds'}"
|
85 |
+
82,"Perfect Keto Collagen Peptides, online at Amazon","{'Medicines & Treatments', 'Nuts & Seeds'}"
|
86 |
83,"Perfect Keto MCT Oil Powder, online at Amazon",{'Medicines & Treatments'}
|
87 |
+
84,"Perfect Keto Super Reds, online at Amazon","{'Medicines & Treatments', 'Nuts & Seeds'}"
|
88 |
+
85,"Perfect Keto Exogenous Ketones Powder, online at Amazon","{'Medicines & Treatments', 'Nuts & Seeds'}"
|
89 |
86,"Crunchmaster® Crackers, spend $4",{'Crackers'}
|
90 |
+
87,"Tyson Products, select varieties, spend $20 at Sam's Club","{'Frozen Beef', 'Packaged Meat'}"
|
91 |
88,"L'Oréal Paris Makeup, spend $35 at Target",{'Makeup'}
|
92 |
89,"L'Oréal Paris Makeup, spend $30 at Target",{'Makeup'}
|
93 |
90,L'Oreal Paris True Match Foundation at Target,{'Makeup'}
|
94 |
91,L'Oréal Paris True Match Foundation at Target,{'Makeup'}
|
95 |
92,"Chosen Foods® Mayo, select varieties",{'Condiments'}
|
96 |
+
93,Chosen Foods® Dressings,"{'Condiments', 'Dressings'}"
|
97 |
94,"Wine from TheBarrelRoom.com, spend $30",{'Wine'}
|
98 |
95,"PepsiCo® Beverage, 7.5-ounce 10 pack, select varieties, at Amazon Storefront*",{'Carbonated Soft Drinks'}
|
99 |
96,"PepsiCo® Variety Pack, select varieties, at Amazon Storefront*",{'Carbonated Soft Drinks'}
|
100 |
97,"Sara Lee® bread, select varieties, buy 2 at Walmart®",{'Bread'}
|
101 |
+
98,"Sara Lee® bread select varieties, buy 2","{'Bakery', 'Bread'}"
|
102 |
99,"Sara Lee® Delightful bread, buy 2",{'Bread'}
|
103 |
100,"Sara Lee® or Alfaros® Artesano bread, buy 5",{'Bread'}
|
104 |
+
101,"Sara Lee® or Alfaros® Artesano bread, spend $8","{'Bakery', 'Bread'}"
|
105 |
102,"Sara Lee® or Alfaros® Artesano bread, buy 2",{'Bread'}
|
106 |
+
103,"Sara Lee® or Alfaros® Artesano bread, spend $20","{'Bakery', 'Bread'}"
|
107 |
+
104,"Bai® Antioxidant, 6 pack, buy 2 at Walmart","{'Drink Mixes', 'Fruit Juices', 'Water'}"
|
108 |
+
105,"Bai® Antioxidant, 6 pack, at Walmart","{'Drink Mixes', 'Fruit Juices'}"
|
109 |
106,"Reese's Chocolate Cones, 8 count at GIANT OR MARTIN’S",{'Frozen Desserts'}
|
110 |
107,"Klondike Cones, spend $10 at Walmart ",{'Frozen Desserts'}
|
111 |
108,Klondike Cones at Walmart ,{'Frozen Desserts'}
|
|
|
124 |
121,"Back to the Roots Potting Mix, 1 cubic foot, at Lowe's Home Improvement",{'Packaged Meals & Sides'}
|
125 |
122,"Back to the Roots Organic 3-In-1 Seed Starting Mix 12 quart, at Walmart or Target",{'Packaged Meals & Sides'}
|
126 |
123,"Back to the Roots Soils, select varieties, at Walmart",{'Packaged Meals & Sides'}
|
127 |
+
124,"Dove Hand Wash, select varieties, buy 2 at Target","{'Bath & Body', 'Deodorant & Antiperspirant'}"
|
128 |
+
125,"Dove Hand Wash, select varieties at Target","{'Bath & Body', 'Deodorant & Antiperspirant'}"
|
129 |
126,"Frutero Ice Cream, 1 pint",{'Frozen Desserts'}
|
130 |
127,"Bio-Oil® Skincare Oil OR Gel, select varieties",{'Skin Care'}
|
131 |
+
128,"Bio-Oil® products, select varieties","{'Cooking & Baking', 'Skin Care'}"
|
132 |
129,"Welch's®Fruit Snacks, select varieties, buy 2",{'Fruit & Vegetable Snacks'}
|
133 |
130,"Welch's® Zero Sugar Fruity Bites, 6 pack+, online at Amazon",{'Fruit & Vegetable Snacks'}
|
134 |
131,"Welch's® Fruit Snacks, select varieties, 6 count+, buy 3",{'Fruit & Vegetable Snacks'}
|
|
|
141 |
138,"Welch's® Juicefuls® Juicy Fruit Snacks, buy 2",{'Fruit & Vegetable Snacks'}
|
142 |
139,Talenti Mini Bars,{'Frozen Desserts'}
|
143 |
140,"Molson Coors®, select varieties, 12 pack+",{'Beer'}
|
144 |
+
141,"Marinela® sweet baked goods, buy 2","{'Cookies', 'Snack Cakes'}"
|
145 |
+
142,"Coors Light®, Miller Lite® OR VIZZY™ 12 pack+","{'Hard Seltzers, Sodas, Waters, Lemonades & Teas', 'Malt Beverages'}"
|
146 |
+
143,"Coors Light®, Miller Lite® OR VIZZY™ 12 packs+, buy 4","{'Hard Seltzers, Sodas, Waters, Lemonades & Teas', 'Malt Beverages'}"
|
147 |
+
144,"Coors Light®, Miller Lite® OR VIZZY™ 12 packs+, buy 2","{'Hard Seltzers, Sodas, Waters, Lemonades & Teas', 'Malt Beverages'}"
|
148 |
+
145,"Coors Light®, Miller Lite® OR VIZZY™ 12 packs+, buy 3","{'Hard Seltzers, Sodas, Waters, Lemonades & Teas', 'Malt Beverages'}"
|
149 |
+
146,"Coors Light®, Miller Lite® OR VIZZY™ 12 packs+, buy 5","{'Hard Seltzers, Sodas, Waters, Lemonades & Teas', 'Malt Beverages'}"
|
150 |
+
147,Little Bites® Spend $10 at Walmart®,"{'Bakery', 'Snack Cakes'}"
|
151 |
+
148,Envy Apples pre-packed bags,"{'Candy', 'Sauces & Marinades'}"
|
152 |
+
149,"Envy Apples, pre-packed bags","{'Candy', 'Sauces & Marinades'}"
|
153 |
150,"Ben & Jerry's Frozen Creme Brulee Non Dairy Dessert, 16 ounce",{'Frozen Desserts'}
|
154 |
151,"Ben & Jerry's® Doggie Desserts, 4 count",{'Frozen Desserts'}
|
155 |
152,"Ben & Jerry's Frozen Sugar Cookie Dough Chunks, 8 ounce",{'Frozen Desserts'}
|
|
|
161 |
158,"Purex® laundry detergent, select varieties, at Walmart",{'Laundry Supplies'}
|
162 |
159,Sol® 6 pack+,{'Beer'}
|
163 |
160,"Michael Angelo's® OR Rao's® Frozen Entrees, spend $10",{'Frozen Meals'}
|
164 |
+
161,Rao's® Frozen Pizza,"{'Frozen Pizza & Pizza Snacks', 'Frozen Meals'}"
|
165 |
+
162,"Rao's®, Pasta OR Sauce, spend $10",{'Alfredo & White Pasta Sauce'}
|
166 |
163,"Sargento Sliced Cheese, spend $25",{'Cheese'}
|
167 |
164,"Sargento Sliced Cheese, spend $12",{'Cheese'}
|
168 |
165,"Sargento® products, select varieties",{'Cheese'}
|
|
|
175 |
172,"Aleve® products, select varieties, 80 count+ at Walmart",{'Medicines & Treatments'}
|
176 |
173,"Aleve® products AND AleveX™, select varieties, at Walmart",{'Medicines & Treatments'}
|
177 |
174,"Magnum Non-Dairy Hazelnut Crunch Ice Cream Bars, 3 count",{'Frozen Desserts'}
|
178 |
+
175,"Thomas'® Bagel Thins®, buy 2","{'Bakery', 'Bread'}"
|
179 |
+
176,"Thomas'®, select varieties, spend $10","{'Bakery', 'Bread', 'Frozen Breakfast'}"
|
180 |
+
177,Thomas'® Bagel Thins,"{'Bakery', 'Bread'}"
|
181 |
+
178,"Artesano® buns, buy 2 at Walmart®","{'Bakery', 'Bread'}"
|
182 |
+
179,"STARBURST®, select sizes, buy 1","{'Candy', 'Fruit & Vegetable Snacks', 'Gum'}"
|
183 |
+
180,"STARBURST®, select varieties","{'Candy', 'Fruit & Vegetable Snacks', 'Gum'}"
|
184 |
+
181,Fresh Step® Outstretch® Cat Litter,{'Bath & Body'}
|
185 |
182,"Burt's Bees Sensitive Lotions and Creams, select varieties, at Walmart",{'Skin Care'}
|
186 |
183,"Burt's Bee's® Facial Wipes, select varieties, 30 count at Walmart",{'Skin Care'}
|
187 |
+
184,"Burt's Bees® products, select varieties, at Walmart","{'Hair Removal', 'Skin Care'}"
|
188 |
185,"Burt's Bees® Sensitive Lotions and Creams, select varieties, at Walmart",{'Skin Care'}
|
189 |
186,"Durex® Massage & Play 2 in 1 Pleasure Gel, select varieties, at Walmart or Target",{'Sexual Health'}
|
190 |
187,LIFE SAVERS®,{'Candy'}
|
|
|
195 |
192,"Bubbies Pickles, Sauerkraut, OR Condiments at Whole Foods or Sprouts",{'Prepared Meals'}
|
196 |
193,Michael Angelo's® Sauce at Walmart,{'Sauces & Marinades'}
|
197 |
194,"Beech-Nut snacks, select varieties",{'Nuts & Seeds'}
|
198 |
+
195,"Beech-Nut pouches, buy 8","{'Fruit & Vegetable Snacks', 'Nuts & Seeds'}"
|
199 |
196,Brita® Pitcher AND Filter,{'Household Supplies'}
|
200 |
+
197,Brita® Standard OR Elite Filters,"{'Water', 'Household Supplies'}"
|
201 |
+
198,Brita® Pitcher OR Dispenser,"{'Water', 'Household Supplies'}"
|
202 |
199,"SNICKERS®, select sizes, buy 1",{'Candy'}
|
203 |
200,"SNICKERS® chocolate candy bar, select varieties",{'Candy'}
|
204 |
201,"Kodiak® products, select varieties, spend $10","{'Cereal, Granola, & Toaster Pastries'}"
|
|
|
277 |
68,Spend $220 at Star Market,{'Cooking & Baking'}
|
278 |
69,Any Star Market receipt,{'Cooking & Baking'}
|
279 |
70,Blue Apron Meal Kits,{'Cooking & Baking'}
|
280 |
+
71,"Sign up for McAlister's Deli Rewards, tap for details","{'Pasta & Noodles', 'Fruit & Vegetable Snacks', 'Wine', 'Bread', 'Cookies', 'Dips & Salsa', 'Packaged Meals & Sides', 'Dressings', 'Cooking & Baking', 'Fruit Juices', 'Cheese', 'Leafy Salads', 'Soup & Broth', 'Frozen Turkey', 'Bakery', 'Water', 'Coffee', 'Prepared Meals', 'Milk', 'Frozen Meals', 'Sauces & Marinades', 'Carbonated Soft Drinks', 'Chips', 'Frozen Chicken', 'Candy', 'Pickled Goods', 'Packaged Fruit & Applesauce', 'Tea'}"
|
281 |
+
72,Spend $10 at CVS,"{'Medicines & Treatments', 'Fruit Juices', 'Cooking & Baking', 'Skin Care'}"
|
282 |
+
73,Spend $30 at CVS,"{'Medicines & Treatments', 'Fruit Juices', 'Cooking & Baking', 'Skin Care'}"
|
283 |
74,Spend $15 at Burger King,{'Cooking & Baking'}
|
DS_NLP_search_data/processed_offers.pkl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:c6c6b5aa1a48ebfcb0a70501f48683ea1402d4c0ee81563fe75c758045155aa0
|
3 |
-
size 18741
|
|
|
|
|
|
|
|
offer_pipeline.py
CHANGED
@@ -3,10 +3,11 @@ from transformers import pipeline
|
|
3 |
import pickle
|
4 |
import os
|
5 |
import pandas as pd
|
6 |
-
import seaborn as sns
|
7 |
import ast
|
8 |
import string
|
9 |
import re
|
|
|
10 |
|
11 |
st.set_page_config(
|
12 |
page_title="Offer Recommender",
|
@@ -14,6 +15,8 @@ st.set_page_config(
|
|
14 |
)
|
15 |
|
16 |
pipe = pipeline(task="zero-shot-classification", model="facebook/bart-large-mnli")
|
|
|
|
|
17 |
dire = "DS_NLP_search_data"
|
18 |
|
19 |
@st.cache_data
|
@@ -40,35 +43,6 @@ def get_categories(cats_):
|
|
40 |
categories.remove(x)
|
41 |
return categories
|
42 |
|
43 |
-
def get_confidence_charts(results):
|
44 |
-
df = (
|
45 |
-
pd.DataFrame({"Category": results["labels"], "probability": results["scores"]})
|
46 |
-
.sort_values(by="probability", ascending=False)
|
47 |
-
.reset_index(drop=True)
|
48 |
-
)
|
49 |
-
|
50 |
-
df.index += 1
|
51 |
-
|
52 |
-
# Add styling
|
53 |
-
cmGreen = sns.light_palette("blue", as_cmap=True)
|
54 |
-
cmRed = sns.light_palette("red", as_cmap=True)
|
55 |
-
df = df.style.background_gradient(
|
56 |
-
cmap=cmGreen,
|
57 |
-
subset=[
|
58 |
-
"probability",
|
59 |
-
],
|
60 |
-
)
|
61 |
-
|
62 |
-
|
63 |
-
format_dictionary = {
|
64 |
-
"Score": "{:.1%}",
|
65 |
-
}
|
66 |
-
|
67 |
-
df = df.format(format_dictionary)
|
68 |
-
|
69 |
-
return df
|
70 |
-
|
71 |
-
|
72 |
def check_in_offer(search_str, offer_rets):
|
73 |
offers = []
|
74 |
# print(offer_rets)
|
@@ -92,31 +66,6 @@ def is_retailer(search_str, threshold=0.5):
|
|
92 |
|
93 |
return labels["labels"][0] == "retailer" and labels["scores"][0] > threshold
|
94 |
|
95 |
-
@st.cache
|
96 |
-
def get_prod_categories():
|
97 |
-
retail_mapping = {}
|
98 |
-
for retailer in list(offer_rets["RETAILER"].unique()):
|
99 |
-
query_direct_retail = complete_df[complete_df["RETAILER"] == retailer]
|
100 |
-
prod_cats = query_direct_retail["PRODUCT_CATEGORY"].unique()
|
101 |
-
retail_mapping[retailer] = prod_cats
|
102 |
-
return retail_mapping
|
103 |
-
|
104 |
-
|
105 |
-
def get_most_overlap(retailer, offer_rets, retail_mapping, top_n=3):
|
106 |
-
overlaps = {}
|
107 |
-
|
108 |
-
for key, value in retail_mapping.items():
|
109 |
-
if key != retailer.upper():
|
110 |
-
overlap = set(value).intersection(set(retail_mapping[retailer.upper()]))
|
111 |
-
overlaps[key] = len(overlap)
|
112 |
-
|
113 |
-
sorted_overlaps = dict(sorted(overlaps.items(), key=lambda x:x[1], reverse=True))
|
114 |
-
|
115 |
-
related_retailers = list({k:sorted_overlaps[k] for k in list(sorted_overlaps)[:top_n]}.keys())
|
116 |
-
offers = list(offer_rets[offer_rets["RETAILER"].isin(related_retailers)]["OFFER"])
|
117 |
-
df = pd.DataFrame({"OFFERS": offers})
|
118 |
-
return df
|
119 |
-
|
120 |
def perform_cat_inference(search_str, categories, cats, processed_offers):
|
121 |
labels = pipe(search_str,
|
122 |
candidate_labels=categories,
|
@@ -137,6 +86,20 @@ def perform_cat_inference(search_str, categories, cats, processed_offers):
|
|
137 |
|
138 |
return offers, labels, labels_2
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
def main():
|
141 |
col_1, col_2, col_3 = st.columns(3)
|
142 |
search_str = col_2.text_input("Enter a retailer, brand, or category").capitalize()
|
@@ -149,21 +112,25 @@ def main():
|
|
149 |
if col_2.button("Search", type="primary"):
|
150 |
retail = is_retailer(search_str)
|
151 |
direct_offers = check_in_offer(search_str, offer_rets)
|
|
|
|
|
152 |
|
153 |
if retail:
|
154 |
-
|
155 |
-
# related_offers = get_most_overlap(retailer, offer_rets, retail_mapping, top_n=3)
|
156 |
-
# col_2.table(related_offers[~related_offers["OFFER"].isin(list(direct_offers["OFFER"]))])
|
157 |
-
|
158 |
else:
|
159 |
-
col_2.table(direct_offers)
|
160 |
related_offers, labels_1, labels_2 = perform_cat_inference(search_str, categories, cats, processed_offers)
|
161 |
-
|
162 |
-
|
163 |
col_2.table(pd.DataFrame({"labels": labels_1["labels"][:5], "scores": labels_1["scores"][:5]}))
|
164 |
col_2.table(pd.DataFrame({"labels": labels_2["labels"][:5], "scores": labels_2["scores"][:5]}))
|
|
|
|
|
165 |
# df = get_confidence_charts(labels_2)
|
166 |
# st.table(df)
|
|
|
|
|
|
|
|
|
167 |
if __name__ == "__main__":
|
168 |
|
169 |
main()
|
|
|
3 |
import pickle
|
4 |
import os
|
5 |
import pandas as pd
|
6 |
+
# import seaborn as sns
|
7 |
import ast
|
8 |
import string
|
9 |
import re
|
10 |
+
from sentence_transformers import SentenceTransformer, util
|
11 |
|
12 |
st.set_page_config(
|
13 |
page_title="Offer Recommender",
|
|
|
15 |
)
|
16 |
|
17 |
pipe = pipeline(task="zero-shot-classification", model="facebook/bart-large-mnli")
|
18 |
+
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
|
19 |
+
|
20 |
dire = "DS_NLP_search_data"
|
21 |
|
22 |
@st.cache_data
|
|
|
43 |
categories.remove(x)
|
44 |
return categories
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
def check_in_offer(search_str, offer_rets):
|
47 |
offers = []
|
48 |
# print(offer_rets)
|
|
|
66 |
|
67 |
return labels["labels"][0] == "retailer" and labels["scores"][0] > threshold
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
def perform_cat_inference(search_str, categories, cats, processed_offers):
|
70 |
labels = pipe(search_str,
|
71 |
candidate_labels=categories,
|
|
|
86 |
|
87 |
return offers, labels, labels_2
|
88 |
|
89 |
+
def sort_by_similarity(search_str, related_offers):
|
90 |
+
temp_dict = {}
|
91 |
+
embedding_1 = model.encode(search_str, convert_to_tensor=True)
|
92 |
+
|
93 |
+
for offer in list(related_offers["OFFER"]):
|
94 |
+
embedding_2 = model.encode(offer, convert_to_tensor=True)
|
95 |
+
|
96 |
+
temp_dict[offer] = float(util.pytorch_cos_sim(embedding_1, embedding_2))
|
97 |
+
|
98 |
+
sorted_dict = dict(sorted(temp_dict.items(), key=lambda x : x[1], reverse=True))
|
99 |
+
# casted_scores = list(map(lambda x : int(x), ))
|
100 |
+
df = pd.DataFrame({"OFFER":list(sorted_dict.keys())[:20], "scores":list(sorted_dict.values())[:20]})
|
101 |
+
return df
|
102 |
+
|
103 |
def main():
|
104 |
col_1, col_2, col_3 = st.columns(3)
|
105 |
search_str = col_2.text_input("Enter a retailer, brand, or category").capitalize()
|
|
|
112 |
if col_2.button("Search", type="primary"):
|
113 |
retail = is_retailer(search_str)
|
114 |
direct_offers = check_in_offer(search_str, offer_rets)
|
115 |
+
col_2.write("Directly related offers")
|
116 |
+
col_2.table(direct_offers)
|
117 |
|
118 |
if retail:
|
119 |
+
related_offers = offer_rets[~offer_rets["OFFER"].isin(list(direct_offers["OFFER"]))]
|
|
|
|
|
|
|
120 |
else:
|
|
|
121 |
related_offers, labels_1, labels_2 = perform_cat_inference(search_str, categories, cats, processed_offers)
|
122 |
+
related_offers = related_offers[~related_offers["OFFER"].isin(list(direct_offers["OFFER"]))]
|
123 |
+
|
124 |
col_2.table(pd.DataFrame({"labels": labels_1["labels"][:5], "scores": labels_1["scores"][:5]}))
|
125 |
col_2.table(pd.DataFrame({"labels": labels_2["labels"][:5], "scores": labels_2["scores"][:5]}))
|
126 |
+
|
127 |
+
|
128 |
# df = get_confidence_charts(labels_2)
|
129 |
# st.table(df)
|
130 |
+
|
131 |
+
col_2.write("Other related offers")
|
132 |
+
sorted_offers = sort_by_similarity(search_str, related_offers)
|
133 |
+
col_2.table(sorted_offers)
|
134 |
if __name__ == "__main__":
|
135 |
|
136 |
main()
|
requirements.txt
CHANGED
@@ -2,4 +2,5 @@ streamlit
|
|
2 |
transformers
|
3 |
pandas
|
4 |
seaborn
|
5 |
-
torch
|
|
|
|
2 |
transformers
|
3 |
pandas
|
4 |
seaborn
|
5 |
+
torch
|
6 |
+
sentence-transformers
|