Ronio Jerico Roque commited on
Commit
4f561f7
·
1 Parent(s): 0a97c2a

Fix typos and improve questionnaire handling in Amazon, eBay, and Content classes

Browse files
Files changed (4) hide show
  1. classes/amazon.py +13 -9
  2. classes/content.py +97 -8
  3. classes/ebay.py +10 -6
  4. pages/home.py +4 -2
classes/amazon.py CHANGED
@@ -54,7 +54,7 @@ class Amazon:
54
  #product_description_amazon = ""
55
  amazon_marketplace_questionnaires = ""
56
 
57
- with st.spinner('Aamzon...', show_time=True):
58
  st.write('')
59
  # INITIALIZING SESSIONS
60
  #combined_text += f"Client Summary: {st.session_state.nature}\n"
@@ -117,10 +117,14 @@ class Amazon:
117
  collect_telemetry(debug_product_description_amazon)
118
  '''
119
  if self.amazon_marketplace_questionnaires:
120
- st.session_state['amazon_marketplace_questionnaires'] = 'uploaded'
121
- collect_telemetry(debug_amazon_marketplace_questionnaires)
 
 
 
 
 
122
 
123
-
124
  st.session_state['analyzing'] = False
125
  except AttributeError:
126
  st.info("Please upload CSV or PDF files first.")
@@ -131,10 +135,7 @@ class Amazon:
131
  #self.images_amazon = st.text_input("Images - Amazon:", placeholder='Enter Images')
132
  #self.bullet_points_amazon = st.text_input("Bullet Points - Amazon:", placeholder='Enter Bullet Points')
133
  #self.product_description_amazon = st.text_input("Product Description - Amazon:", placeholder='Enter Product Description')
134
-
135
- self.amazon_marketplace_questionnaires = st.text_area(
136
- "Marketplace Questionnaires - Amazon:",
137
- "Product Title:\n"
138
  "a. Does the product title include relevant keywords (e.g., Product Brand/Description + Product Line + Material or Key Ingredient + Color + Size + Quantity)?\n"
139
  "b. Is the title within Amazon’s recommended character limit (≤200 characters)?\n"
140
  "c. Other Remarks:\n\n"
@@ -156,7 +157,10 @@ class Amazon:
156
  "c. Does it include important product specifications (size, material, compatibility)?\n"
157
  "d. Are there any customer reviews or ratings?\n"
158
  "e. If yes, is the average rating above 4 stars?\n"
159
- "f. Other Remarks:",
 
 
 
160
  height=600
161
  )
162
  self.process()
 
54
  #product_description_amazon = ""
55
  amazon_marketplace_questionnaires = ""
56
 
57
+ with st.spinner('Amazon...', show_time=True):
58
  st.write('')
59
  # INITIALIZING SESSIONS
60
  #combined_text += f"Client Summary: {st.session_state.nature}\n"
 
117
  collect_telemetry(debug_product_description_amazon)
118
  '''
119
  if self.amazon_marketplace_questionnaires:
120
+ if self.amazon_marketplace_questionnaires != self.template:
121
+ st.session_state['amazon_marketplace_questionnaires'] = 'uploaded'
122
+ collect_telemetry(debug_amazon_marketplace_questionnaires)
123
+ print("no")
124
+ else:
125
+ print("yes")
126
+ pass
127
 
 
128
  st.session_state['analyzing'] = False
129
  except AttributeError:
130
  st.info("Please upload CSV or PDF files first.")
 
135
  #self.images_amazon = st.text_input("Images - Amazon:", placeholder='Enter Images')
136
  #self.bullet_points_amazon = st.text_input("Bullet Points - Amazon:", placeholder='Enter Bullet Points')
137
  #self.product_description_amazon = st.text_input("Product Description - Amazon:", placeholder='Enter Product Description')
138
+ self.template = ("Product Title:\n"
 
 
 
139
  "a. Does the product title include relevant keywords (e.g., Product Brand/Description + Product Line + Material or Key Ingredient + Color + Size + Quantity)?\n"
140
  "b. Is the title within Amazon’s recommended character limit (≤200 characters)?\n"
141
  "c. Other Remarks:\n\n"
 
157
  "c. Does it include important product specifications (size, material, compatibility)?\n"
158
  "d. Are there any customer reviews or ratings?\n"
159
  "e. If yes, is the average rating above 4 stars?\n"
160
+ "f. Other Remarks:")
161
+ self.amazon_marketplace_questionnaires = st.text_area(
162
+ "Marketplace Questionnaires - Amazon:",
163
+ value=self.template,
164
  height=600
165
  )
166
  self.process()
classes/content.py CHANGED
@@ -52,13 +52,18 @@ class Content:
52
  debug_info_content_outside_the_website = {'data_field' : 'Content outside the Website', 'result': content_outside_the_website}
53
 
54
  if self.content_in_the_website:
55
- st.session_state['content_in_the_website'] = 'uploaded'
56
- collect_telemetry(debug_info_content_in_the_website)
 
 
 
57
  if self.content_outside_the_website:
58
- st.session_state['content_outside_the_website'] = 'uploaded'
59
- collect_telemetry(debug_info_content_outside_the_website)
60
-
61
-
 
 
62
  #with st.expander("Debug information", icon="⚙"):
63
  # st.write(debug_info)
64
 
@@ -70,8 +75,92 @@ class Content:
70
  pass
71
 
72
  def row1(self):
73
- self.content_in_the_website = st.text_input("Content in the Website (Website Content)", placeholder='Enter Content in the Website')
74
- self.content_outside_the_website = st.text_input("Content outside the Website (Website Content)", placeholder='Enter Content outside the Website')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
  self.process()
77
 
 
52
  debug_info_content_outside_the_website = {'data_field' : 'Content outside the Website', 'result': content_outside_the_website}
53
 
54
  if self.content_in_the_website:
55
+ if self.content_in_the_website != self.template_content_in_the_website:
56
+ st.session_state['content_in_the_website'] = 'uploaded'
57
+ collect_telemetry(debug_info_content_in_the_website)
58
+ else:
59
+ pass
60
  if self.content_outside_the_website:
61
+ if self.content_outside_the_website != self.template_content_outside_the_website:
62
+ st.session_state['content_outside_the_website'] = 'uploaded'
63
+ collect_telemetry(debug_info_content_outside_the_website)
64
+ else:
65
+ pass
66
+
67
  #with st.expander("Debug information", icon="⚙"):
68
  # st.write(debug_info)
69
 
 
75
  pass
76
 
77
  def row1(self):
78
+ self.template_content_in_the_website = ("Content and Messaging:\n"
79
+ "a. Is the text easy to read and understand?\n"
80
+ "b. Does it clearly explain what the business offers?\n"
81
+ "c. Are the brand’s Unique Selling Propositions (USPs) clearly emphasized?\n"
82
+ "d. Other Remarks:\n\n"
83
+
84
+ "Call-to-Action (CTAs):\n"
85
+ "a. Are CTAs prominently placed and easy to find?\n"
86
+ "b. Are the CTAs strong and action-focused?\n"
87
+ "c. Do they appear in the right places?\n"
88
+ "d. Other Remarks:\n\n"
89
+
90
+ "Images and Videos:\n"
91
+ "a. Are the images and videos high quality?\n"
92
+ "b. Do they clearly show the product or service?\n"
93
+ "c. Are the videos easy to watch (no unnecessary clicks or extra steps)?\n"
94
+ "d. Are the visuals engaging upon first glance?\n"
95
+ "e. Other Remarks:\n\n"
96
+
97
+ "Blog and SEO:\n"
98
+ "a. Does the site have a blog section?\n"
99
+ "b. Is the blog updated regularly?\n"
100
+ "c. Are the articles helpful, relevant, and informative?\n"
101
+ "d. Are internal links used to guide users to related or deeper content?\n"
102
+ "e. Other Remarks:\n\n"
103
+
104
+ "User Experience (UX) and Navigation:\n"
105
+ "a. Is the site easy to navigate with clear menus and categories?\n"
106
+ "b. Can users quickly find important information?\n"
107
+ "c. Are any interactions creating unnecessary friction (e.g., signups to view content)?\n"
108
+ "d. Other Remarks:\n\n"
109
+
110
+ "Product or Services (For E-Commerce):\n"
111
+ "a. Does the site clearly explain the company’s products or services?\n"
112
+ "b. Are product or service details clear?\n"
113
+ "c. Are there enough pictures or videos?\n"
114
+ "d. Is there a sense of urgency or promotions to encourage action?\n"
115
+ "e. Other Remarks:")
116
+ self.template_content_outside_the_website = ("Backlinks and Referring Domains:\n"
117
+ "a. Are there backlinks from relevant and authoritative websites?\n"
118
+ "b. Do the referring sites belong to the same industry or niche?\n"
119
+ "c. Are there spammy or low-quality backlinks (e.g., thin directories)?\n"
120
+ "d. Are the backlinks helpful and align with Google’s Helpful Content guidelines?\n"
121
+ "e. Are there any guest posts or articles on other websites?\n"
122
+ "f. Other Remarks:\n\n"
123
+
124
+ "Community Engagement (Forums and Platforms):\n"
125
+ "a. Is the brand/product/company mentioned in online forums (e.g., Reddit, or Quora)?\n"
126
+ "b. Are the mentions from forums and platforms generally positive?\n"
127
+ "c. Are the mentions from forums and platforms generally negative?\n"
128
+ "d. Is it actively participating or present in these communities?\n"
129
+ "e. Is there a strategy for using personas or ambassadors to represent the client’s company/brand/product?\n"
130
+ "f. Other Remarks:\n\n"
131
+
132
+ "Online Reviews and Reputation Management:\n"
133
+ "a. Are there recent reviews on platforms like Google, Trustpilot, or Yelp?\n"
134
+ "b. Are the reviews mostly positive?\n"
135
+ "c. Are the reviews mostly negative?\n"
136
+ "d. Is the client responding to reviews, especially complaints or fake ones?\n"
137
+ "e. Do the reviews mention recurring issues (e.g., poor support, unsolicited emails)?\n"
138
+ "f. Other Remarks:\n\n"
139
+
140
+ "Public Relations and Media Coverage:\n"
141
+ "a. Has the client’s company been featured in news sites or magazines?\n"
142
+ "b. Are the articles helpful and recent?\n"
143
+ "c. Are PR opportunities being used to boost awareness?\n"
144
+ "d. Other Remarks:\n\n"
145
+
146
+ "Branded Blog Networks:\n"
147
+ "a. Are there any off-page blog sites created by the client’s company?\n"
148
+ "b. Is the content unique, helpful, and adding SEO value?\n"
149
+ "c. Can the content be moved or consolidated into the main site?\n"
150
+ "d. Other Remarks:\n\n"
151
+
152
+ "Email Marketing & CRM Engagement:\n"
153
+ "a. Is email being used to follow up with customers or leads (e.g., newsletters, cart recovery)?\n"
154
+ "b. Are they sending follow-up emails?\n"
155
+ "c. Are emails building relationships and promoting content or reviews?\n"
156
+ "d. Other Remarks:")
157
+
158
+ self.content_in_the_website = st.text_area("Content in the Website:",
159
+ value=self.template_content_in_the_website,
160
+ height=600)
161
+ self.content_outside_the_website = st.text_area("Content outside the Website:",
162
+ value=self.template_content_outside_the_website,
163
+ height=600)
164
 
165
  self.process()
166
 
classes/ebay.py CHANGED
@@ -118,8 +118,11 @@ class eBay:
118
  collect_telemetry(debug_product_description_ebay)
119
  '''
120
  if self.ebay_marketplace_questionnaires:
121
- st.session_state['ebay_marketplace_questionnaires'] = 'uploaded'
122
- collect_telemetry(debug_ebay_marketplace_questionnaires)
 
 
 
123
 
124
  st.session_state['analyzing'] = False
125
  except AttributeError:
@@ -132,9 +135,7 @@ class eBay:
132
  #self.images_ebay = st.text_input("Bullet Points - eBay:", placeholder='Enter Bullet Points')
133
  #self.product_description_ebay = st.text_input("Product Description - eBay:", placeholder='Enter Product Description')
134
 
135
- self.ebay_marketplace_questionnaires = st.text_area(
136
- "Marketplace Questionnaires - eBay:",
137
- "Product Title:\n"
138
  "a. Is the title within the 80-character limit?\n"
139
  "b. Does the title include important details (e.g., brand, color, quantity, compatibility)?\n"
140
  "c. Are search keywords used effectively in the title?\n"
@@ -153,7 +154,10 @@ class eBay:
153
  "c. Are there images embedded in the description?\n"
154
  "d. Are there any technical issues (e.g., broken images, loading errors)?\n"
155
  "e. Is there consistent keyword usage in the description?\n"
156
- "f. Other Remarks:",
 
 
 
157
  height=600
158
  )
159
  self.process()
 
118
  collect_telemetry(debug_product_description_ebay)
119
  '''
120
  if self.ebay_marketplace_questionnaires:
121
+ if self.ebay_marketplace_questionnaires != self.template:
122
+ st.session_state['ebay_marketplace_questionnaires'] = 'uploaded'
123
+ collect_telemetry(debug_ebay_marketplace_questionnaires)
124
+ else:
125
+ pass
126
 
127
  st.session_state['analyzing'] = False
128
  except AttributeError:
 
135
  #self.images_ebay = st.text_input("Bullet Points - eBay:", placeholder='Enter Bullet Points')
136
  #self.product_description_ebay = st.text_input("Product Description - eBay:", placeholder='Enter Product Description')
137
 
138
+ self.template = ("Product Title:\n"
 
 
139
  "a. Is the title within the 80-character limit?\n"
140
  "b. Does the title include important details (e.g., brand, color, quantity, compatibility)?\n"
141
  "c. Are search keywords used effectively in the title?\n"
 
154
  "c. Are there images embedded in the description?\n"
155
  "d. Are there any technical issues (e.g., broken images, loading errors)?\n"
156
  "e. Is there consistent keyword usage in the description?\n"
157
+ "f. Other Remarks:")
158
+ self.ebay_marketplace_questionnaires = st.text_area(
159
+ "Marketplace Questionnaires - eBay:",
160
+ value=self.template,
161
  height=600
162
  )
163
  self.process()
pages/home.py CHANGED
@@ -101,7 +101,6 @@ class DigitalFootprintDashboard:
101
  self.website_and_tools = WebsiteAndTools(os.getenv('MODEL_On_Page_Analyst'))
102
  self.lld_pm_ln = LLD_PM_LN(os.getenv('Model_LLD_PM_LN_ANALYST'))
103
  self.pull_through_offers = PullThroughOffers(os.getenv('Model_Pull_Through_Offers_Analyst'))
104
- self.content = Content(os.getenv('Model_Content'))
105
 
106
  return col1, col2, col3, col4, col5
107
 
@@ -118,7 +117,10 @@ class DigitalFootprintDashboard:
118
  with col3:
119
  st.write("## eBay")
120
  self.ebay = eBay(os.getenv('Model_SEM_PPC_Analyst'))
121
- return col1, col2, col3
 
 
 
122
 
123
  async def run_analysis(self):
124
  result = await asyncio.gather(
 
101
  self.website_and_tools = WebsiteAndTools(os.getenv('MODEL_On_Page_Analyst'))
102
  self.lld_pm_ln = LLD_PM_LN(os.getenv('Model_LLD_PM_LN_ANALYST'))
103
  self.pull_through_offers = PullThroughOffers(os.getenv('Model_Pull_Through_Offers_Analyst'))
 
104
 
105
  return col1, col2, col3, col4, col5
106
 
 
117
  with col3:
118
  st.write("## eBay")
119
  self.ebay = eBay(os.getenv('Model_SEM_PPC_Analyst'))
120
+ with col4:
121
+ st.write("## Website Content")
122
+ self.content = Content(os.getenv('Model_Content'))
123
+ return col1, col2, col3, col4
124
 
125
  async def run_analysis(self):
126
  result = await asyncio.gather(