Spaces:
Runtime error
Runtime error
remove extra optimizer tab
Browse files
app.py
CHANGED
|
@@ -207,20 +207,20 @@ class GEOSEOApp:
|
|
| 207 |
"seo",
|
| 208 |
"competitive",
|
| 209 |
"voice_search",
|
| 210 |
-
"batch_optimize",
|
| 211 |
-
"content_variations",
|
| 212 |
"readability_analysis",
|
| 213 |
-
"entity_extraction"
|
| 214 |
],
|
| 215 |
format_func=lambda x: {
|
| 216 |
"standard": "π§ Standard Enhancement",
|
| 217 |
"seo": "π SEO-Focused Optimization",
|
| 218 |
"competitive": "π Competitive Analysis",
|
| 219 |
"voice_search": "π€ Voice Search Optimization",
|
| 220 |
-
"batch_optimize": "π¦ Batch Optimization",
|
| 221 |
-
"content_variations": "π Content Variations",
|
| 222 |
"readability_analysis": "π Readability Analysis",
|
| 223 |
-
"entity_extraction": "π·οΈ Entity Extraction"
|
| 224 |
}[x],
|
| 225 |
index=0,
|
| 226 |
help="Choose the type of optimization to apply to your content"
|
|
@@ -233,12 +233,12 @@ class GEOSEOApp:
|
|
| 233 |
include_keywords = st.checkbox("Include keyword suggestions", value=True)
|
| 234 |
elif optimization_type == "batch_optimize":
|
| 235 |
st.info("For batch optimization, separate multiple content pieces with '---' in the text area above")
|
| 236 |
-
elif optimization_type == "content_variations":
|
| 237 |
-
|
| 238 |
else:
|
| 239 |
analyze_only = False
|
| 240 |
include_keywords = True
|
| 241 |
-
num_variations = 3
|
| 242 |
|
| 243 |
# Show description based on optimization type
|
| 244 |
optimization_descriptions = {
|
|
@@ -246,10 +246,10 @@ class GEOSEOApp:
|
|
| 246 |
"seo": "SEO-focused optimization for AI search engines with semantic keyword analysis.",
|
| 247 |
"competitive": "Competitive analysis against AI search best practices with gap identification.",
|
| 248 |
"voice_search": "Optimization for voice search and conversational AI systems.",
|
| 249 |
-
"batch_optimize": "Process multiple content pieces simultaneously.",
|
| 250 |
-
"content_variations": "Generate multiple optimized variations of the same content.",
|
| 251 |
"readability_analysis": "Detailed readability analysis specifically for AI systems.",
|
| 252 |
-
"entity_extraction": "Extract key entities, topics, and concepts for optimization insights."
|
| 253 |
}
|
| 254 |
|
| 255 |
st.info(f"**{optimization_descriptions[optimization_type]}**")
|
|
@@ -288,26 +288,26 @@ class GEOSEOApp:
|
|
| 288 |
elif optimization_type == "voice_search":
|
| 289 |
result = self.content_optimizer.optimize_for_voice_search(input_text)
|
| 290 |
|
| 291 |
-
elif optimization_type == "batch_optimize":
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
|
| 300 |
-
elif optimization_type == "content_variations":
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
|
| 306 |
elif optimization_type == "readability_analysis":
|
| 307 |
result = self.content_optimizer.analyze_content_readability(input_text)
|
| 308 |
|
| 309 |
-
elif optimization_type == "entity_extraction":
|
| 310 |
-
|
| 311 |
|
| 312 |
if result.get("error"):
|
| 313 |
st.error(f"Processing failed: {result['error']}")
|
|
@@ -323,14 +323,14 @@ class GEOSEOApp:
|
|
| 323 |
"""Display results based on optimization type"""
|
| 324 |
st.success(f"{optimization_type.title()} optimization completed successfully!")
|
| 325 |
|
| 326 |
-
if optimization_type == "batch_optimize":
|
| 327 |
-
|
| 328 |
-
elif optimization_type == "content_variations":
|
| 329 |
-
|
| 330 |
elif optimization_type == "readability_analysis":
|
| 331 |
self.display_readability_results(result)
|
| 332 |
-
elif optimization_type == "entity_extraction":
|
| 333 |
-
|
| 334 |
elif optimization_type == "voice_search":
|
| 335 |
self.display_voice_search_results(result)
|
| 336 |
else:
|
|
|
|
| 207 |
"seo",
|
| 208 |
"competitive",
|
| 209 |
"voice_search",
|
| 210 |
+
# "batch_optimize",
|
| 211 |
+
# "content_variations",
|
| 212 |
"readability_analysis",
|
| 213 |
+
# "entity_extraction"
|
| 214 |
],
|
| 215 |
format_func=lambda x: {
|
| 216 |
"standard": "π§ Standard Enhancement",
|
| 217 |
"seo": "π SEO-Focused Optimization",
|
| 218 |
"competitive": "π Competitive Analysis",
|
| 219 |
"voice_search": "π€ Voice Search Optimization",
|
| 220 |
+
# "batch_optimize": "π¦ Batch Optimization",
|
| 221 |
+
# "content_variations": "π Content Variations",
|
| 222 |
"readability_analysis": "π Readability Analysis",
|
| 223 |
+
# "entity_extraction": "π·οΈ Entity Extraction"
|
| 224 |
}[x],
|
| 225 |
index=0,
|
| 226 |
help="Choose the type of optimization to apply to your content"
|
|
|
|
| 233 |
include_keywords = st.checkbox("Include keyword suggestions", value=True)
|
| 234 |
elif optimization_type == "batch_optimize":
|
| 235 |
st.info("For batch optimization, separate multiple content pieces with '---' in the text area above")
|
| 236 |
+
# elif optimization_type == "content_variations":
|
| 237 |
+
# num_variations = st.slider("Number of variations", min_value=1, max_value=5, value=3)
|
| 238 |
else:
|
| 239 |
analyze_only = False
|
| 240 |
include_keywords = True
|
| 241 |
+
# num_variations = 3
|
| 242 |
|
| 243 |
# Show description based on optimization type
|
| 244 |
optimization_descriptions = {
|
|
|
|
| 246 |
"seo": "SEO-focused optimization for AI search engines with semantic keyword analysis.",
|
| 247 |
"competitive": "Competitive analysis against AI search best practices with gap identification.",
|
| 248 |
"voice_search": "Optimization for voice search and conversational AI systems.",
|
| 249 |
+
# "batch_optimize": "Process multiple content pieces simultaneously.",
|
| 250 |
+
# "content_variations": "Generate multiple optimized variations of the same content.",
|
| 251 |
"readability_analysis": "Detailed readability analysis specifically for AI systems.",
|
| 252 |
+
# "entity_extraction": "Extract key entities, topics, and concepts for optimization insights."
|
| 253 |
}
|
| 254 |
|
| 255 |
st.info(f"**{optimization_descriptions[optimization_type]}**")
|
|
|
|
| 288 |
elif optimization_type == "voice_search":
|
| 289 |
result = self.content_optimizer.optimize_for_voice_search(input_text)
|
| 290 |
|
| 291 |
+
# elif optimization_type == "batch_optimize":
|
| 292 |
+
# # Split content by '---' separator
|
| 293 |
+
# content_pieces = [piece.strip() for piece in input_text.split('---') if piece.strip()]
|
| 294 |
+
# if len(content_pieces) > 1:
|
| 295 |
+
# result = self.content_optimizer.batch_optimize_content(content_pieces)
|
| 296 |
+
# else:
|
| 297 |
+
# st.warning("For batch optimization, please separate content pieces with '---'")
|
| 298 |
+
# return
|
| 299 |
|
| 300 |
+
# elif optimization_type == "content_variations":
|
| 301 |
+
# result = self.content_optimizer.generate_content_variations(
|
| 302 |
+
# input_text,
|
| 303 |
+
# num_variations=num_variations
|
| 304 |
+
# )
|
| 305 |
|
| 306 |
elif optimization_type == "readability_analysis":
|
| 307 |
result = self.content_optimizer.analyze_content_readability(input_text)
|
| 308 |
|
| 309 |
+
# elif optimization_type == "entity_extraction":
|
| 310 |
+
# result = self.content_optimizer.extract_key_entities(input_text)
|
| 311 |
|
| 312 |
if result.get("error"):
|
| 313 |
st.error(f"Processing failed: {result['error']}")
|
|
|
|
| 323 |
"""Display results based on optimization type"""
|
| 324 |
st.success(f"{optimization_type.title()} optimization completed successfully!")
|
| 325 |
|
| 326 |
+
# if optimization_type == "batch_optimize":
|
| 327 |
+
# self.display_batch_results(result)
|
| 328 |
+
# elif optimization_type == "content_variations":
|
| 329 |
+
# self.display_variation_results(result)
|
| 330 |
elif optimization_type == "readability_analysis":
|
| 331 |
self.display_readability_results(result)
|
| 332 |
+
# elif optimization_type == "entity_extraction":
|
| 333 |
+
# self.display_entity_results(result)
|
| 334 |
elif optimization_type == "voice_search":
|
| 335 |
self.display_voice_search_results(result)
|
| 336 |
else:
|