Complete Intelligent Course Generator - ALL REQUIREMENTS INCLUDED
Browse files
README.md
CHANGED
|
@@ -9,44 +9,66 @@ app_file: app.py
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# ๐ง Intelligent Course Generator -
|
| 13 |
|
| 14 |
-
## โ
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
5. **Actual Content Generation** - Creates real lessons on real topics
|
| 21 |
|
| 22 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
###
|
| 25 |
-
-
|
| 26 |
-
-
|
| 27 |
-
- Shows
|
|
|
|
| 28 |
|
| 29 |
-
###
|
| 30 |
-
-
|
| 31 |
-
-
|
| 32 |
-
-
|
| 33 |
|
| 34 |
-
## ๐ Features
|
| 35 |
|
| 36 |
-
|
| 37 |
-
-
|
| 38 |
-
-
|
| 39 |
-
-
|
| 40 |
-
- **Quality Standards**: Meets your corpus utilization requirements
|
| 41 |
|
| 42 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
|
| 45 |
-
- **
|
| 46 |
-
- **
|
|
|
|
| 47 |
|
| 48 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# ๐ง Intelligent Course Generator - COMPLETE SYSTEM
|
| 13 |
|
| 14 |
+
## โ
ALL REQUIREMENTS INCLUDED
|
| 15 |
|
| 16 |
+
### ๐ฏ **Level Selection Interface**
|
| 17 |
+
- **๐ Micro-Lesson:** 5-8 minute complete experience with full gamification
|
| 18 |
+
- **๐ Unit:** 45-60 minute multi-lesson experience with progressive mastery
|
| 19 |
+
- **๐ Course:** 3-5 hour comprehensive program with organizational transformation focus
|
|
|
|
| 20 |
|
| 21 |
+
### ๐ฎ **Complete Gamification Suite**
|
| 22 |
+
- **Scenario Challenges:** Complex leadership simulations with branching decisions
|
| 23 |
+
- **Strategic Games:** Resource allocation, priority matrices, systems mapping
|
| 24 |
+
- **Assessment Options:** Speed/Quest/Mastery tracks with achievement badges
|
| 25 |
+
- **Interactive Elements:** Socratic questioning, reflection, implementation planning
|
| 26 |
|
| 27 |
+
### ๐ **Real Content Analysis**
|
| 28 |
+
- **Topic Extraction:** Finds actual leadership topics from your corpus
|
| 29 |
+
- **Sufficiency Analysis:** Determines what can be built at each level
|
| 30 |
+
- **Quality Assessment:** Shows corpus % vs AI enhancement needed
|
| 31 |
+
- **Buildability Reports:** Recommends optimal generation approaches
|
| 32 |
|
| 33 |
+
### ๐ **Content Quality Standards**
|
| 34 |
+
- **70/30 Standard:** 70% corpus + 30% AI (Excellent)
|
| 35 |
+
- **60/40 Standard:** 60% corpus + 40% AI (Good)
|
| 36 |
+
- **50/50 Standard:** 50% corpus + 50% AI (Viable)
|
| 37 |
|
| 38 |
+
## ๐ Key Features
|
| 39 |
|
| 40 |
+
### โ
**Real Topics, Not Placeholders**
|
| 41 |
+
- Extracts actual leadership topics like "Strategic Communication", "Conflict Resolution"
|
| 42 |
+
- No more generic "MicroLessons" text
|
| 43 |
+
- Uses your corpus content with proper attribution
|
|
|
|
| 44 |
|
| 45 |
+
### โ
**Complete Content Generation**
|
| 46 |
+
- Full lessons with all sections completely written out
|
| 47 |
+
- Every game fully developed with instructions and assessment
|
| 48 |
+
- Complete Socratic questioning sequences
|
| 49 |
+
- Comprehensive achievement and badge systems
|
| 50 |
|
| 51 |
+
### โ
**Progressive Learning Architecture**
|
| 52 |
+
- **Micro-Lessons:** Foundation building with immediate application
|
| 53 |
+
- **Units:** Progressive skill development with integration challenges
|
| 54 |
+
- **Courses:** Comprehensive mastery with organizational transformation
|
| 55 |
|
| 56 |
+
### โ
**Assessment & Gamification**
|
| 57 |
+
- **Speed Track:** Quick mastery verification (5-10 minutes)
|
| 58 |
+
- **Quest Track:** Complete experience (15-25 minutes)
|
| 59 |
+
- **Mastery Track:** Innovation and leadership development (25-45 minutes)
|
| 60 |
+
- **Achievement Badges:** Recognition system for different accomplishment levels
|
| 61 |
|
| 62 |
+
## ๐ฏ How to Use
|
| 63 |
+
|
| 64 |
+
1. **Analyze Content:** Enter topic area to see what can be built
|
| 65 |
+
2. **Select Level:** Choose micro-lesson, unit, or course based on analysis
|
| 66 |
+
3. **Generate Complete Content:** Get fully developed content with all gamification
|
| 67 |
+
4. **Implement:** Use generated content for immediate leadership development
|
| 68 |
+
|
| 69 |
+
## ๐ Quality Assurance
|
| 70 |
+
|
| 71 |
+
- **Evidence-Based:** All content supported by corpus evidence or research
|
| 72 |
+
- **Practical Application:** Immediate implementation strategies included
|
| 73 |
+
- **Progressive Mastery:** Clear learning progression and skill building
|
| 74 |
+
- **Organizational Impact:** Focus on measurable results and transformation
|
app.py
CHANGED
|
@@ -36,7 +36,7 @@ def safe_load_resources():
|
|
| 36 |
print(error_msg)
|
| 37 |
return None, None, error_msg
|
| 38 |
|
| 39 |
-
def extract_real_topics_from_corpus(search_term, max_topics=
|
| 40 |
"""Extract actual leadership topics from corpus content"""
|
| 41 |
|
| 42 |
try:
|
|
@@ -55,23 +55,31 @@ def extract_real_topics_from_corpus(search_term, max_topics=20):
|
|
| 55 |
similarities = cosine_similarity(search_embedding, content_embeddings)[0]
|
| 56 |
|
| 57 |
# Get highly relevant content
|
| 58 |
-
relevant_indices = indices[similarities > 0.
|
| 59 |
relevant_content = [dataset[int(idx)]['content'] for idx in relevant_indices]
|
| 60 |
|
| 61 |
-
# Extract actual topics using NLP patterns
|
| 62 |
topics = set()
|
| 63 |
|
| 64 |
-
#
|
| 65 |
topic_patterns = [
|
| 66 |
-
r'\b([A-Z][a-z]+ [Ll]eadership)\b',
|
| 67 |
-
r'\b([A-Z][a-z]+ [Mm]anagement)\b',
|
| 68 |
-
r'\b([A-Z][a-z]+ [Ss]kills?)\b',
|
| 69 |
-
r'\b([A-Z][a-z]+ [Dd]evelopment)\b',
|
| 70 |
-
r'\b([A-Z][a-z]+ [Ii]ntelligence)\b',
|
| 71 |
-
r'\b([A-Z][a-z]+ [Bb]uilding)\b',
|
| 72 |
-
r'\b([A-Z][a-z]+ [Rr]esolution)\b',
|
| 73 |
-
r'\
|
| 74 |
-
r'\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
]
|
| 76 |
|
| 77 |
for content in relevant_content:
|
|
@@ -85,32 +93,35 @@ def extract_real_topics_from_corpus(search_term, max_topics=20):
|
|
| 85 |
|
| 86 |
# Clean up and validate topic
|
| 87 |
topic = topic.strip()
|
| 88 |
-
if len(topic.split()) <= 4 and len(topic) > 5:
|
| 89 |
topics.add(topic)
|
| 90 |
|
| 91 |
-
#
|
| 92 |
concept_words = []
|
| 93 |
for content in relevant_content:
|
| 94 |
-
|
|
|
|
| 95 |
concept_words.extend(words)
|
| 96 |
|
| 97 |
# Find most common concepts
|
| 98 |
word_counts = Counter(concept_words)
|
| 99 |
-
common_concepts = [word for word, count in word_counts.most_common(
|
|
|
|
| 100 |
|
| 101 |
-
# Create topics from common concepts
|
| 102 |
leadership_contexts = [
|
| 103 |
"Leadership", "Management", "Development", "Skills", "Strategy",
|
| 104 |
-
"Communication", "Team Building", "Decision Making", "Innovation"
|
|
|
|
| 105 |
]
|
| 106 |
|
| 107 |
-
for concept in common_concepts:
|
| 108 |
for context in leadership_contexts:
|
| 109 |
potential_topic = f"{concept} {context}"
|
| 110 |
-
if len(potential_topic) <
|
| 111 |
topics.add(potential_topic)
|
| 112 |
|
| 113 |
-
# Convert to list and sort by
|
| 114 |
topic_list = list(topics)[:max_topics]
|
| 115 |
|
| 116 |
return topic_list
|
|
@@ -120,7 +131,7 @@ def extract_real_topics_from_corpus(search_term, max_topics=20):
|
|
| 120 |
return []
|
| 121 |
|
| 122 |
def analyze_content_sufficiency(topic):
|
| 123 |
-
"""
|
| 124 |
|
| 125 |
try:
|
| 126 |
dataset, model, error = safe_load_resources()
|
|
@@ -130,14 +141,14 @@ def analyze_content_sufficiency(topic):
|
|
| 130 |
'message': error,
|
| 131 |
'corpus_percentage': 0,
|
| 132 |
'max_feasible': 'none',
|
| 133 |
-
'buildable_content':
|
| 134 |
}
|
| 135 |
|
| 136 |
print(f"๐ Analyzing content sufficiency for: {topic}")
|
| 137 |
|
| 138 |
-
#
|
| 139 |
topic_embedding = model.encode([topic])
|
| 140 |
-
sample_size = min(
|
| 141 |
indices = np.random.choice(len(dataset), sample_size, replace=False)
|
| 142 |
|
| 143 |
content_texts = [dataset[int(idx)]['content'] for idx in indices]
|
|
@@ -145,16 +156,18 @@ def analyze_content_sufficiency(topic):
|
|
| 145 |
|
| 146 |
similarities = cosine_similarity(topic_embedding, content_embeddings)[0]
|
| 147 |
|
| 148 |
-
#
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
|
|
|
| 152 |
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
|
|
|
| 156 |
|
| 157 |
-
# Get actual content for analysis
|
| 158 |
relevant_indices = indices[similarities > 0.2]
|
| 159 |
relevant_content = []
|
| 160 |
|
|
@@ -173,62 +186,81 @@ def analyze_content_sufficiency(topic):
|
|
| 173 |
'content': content,
|
| 174 |
'score': float(score),
|
| 175 |
'source_topic': source_topic,
|
| 176 |
-
'length': len(content)
|
|
|
|
| 177 |
})
|
| 178 |
|
| 179 |
# Sort by relevance
|
| 180 |
relevant_content.sort(key=lambda x: x['score'], reverse=True)
|
| 181 |
|
| 182 |
-
#
|
| 183 |
-
total_relevant = high_count + medium_count + low_count
|
| 184 |
-
content_depth = sum(item['length'] for item in relevant_content[:
|
| 185 |
|
| 186 |
-
#
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
|
|
|
| 190 |
|
| 191 |
-
|
|
|
|
|
|
|
| 192 |
|
| 193 |
-
|
| 194 |
-
buildable_content = []
|
| 195 |
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
'type': 'unit',
|
| 208 |
-
'title': f"Strategic {topic} Leadership Unit",
|
| 209 |
-
'corpus_support': f"{corpus_percentage:.1f}%",
|
| 210 |
-
'ai_needed': f"{100-corpus_percentage:.1f}%"
|
| 211 |
-
})
|
| 212 |
-
|
| 213 |
-
buildable_content.append({
|
| 214 |
-
'type': 'lesson',
|
| 215 |
'title': f"Essential {topic} Leadership Principles",
|
| 216 |
-
'corpus_support': f"{corpus_percentage:.1f}%",
|
| 217 |
-
'ai_needed': f"{100-corpus_percentage:.1f}%"
|
| 218 |
-
})
|
| 219 |
-
|
| 220 |
-
max_feasible = 'course' if high_count >= 8 else 'unit' if high_count >= 4 else 'lesson'
|
| 221 |
-
|
| 222 |
-
elif corpus_percentage >= 50: # Moderate coverage
|
| 223 |
-
buildable_content.append({
|
| 224 |
-
'type': 'lesson',
|
| 225 |
-
'title': f"Foundational {topic} Leadership Concepts",
|
| 226 |
'corpus_support': f"{corpus_percentage:.1f}%",
|
| 227 |
-
'ai_needed': f"{100-corpus_percentage:.1f}%"
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
max_feasible = 'insufficient'
|
| 233 |
|
| 234 |
return {
|
|
@@ -237,22 +269,29 @@ def analyze_content_sufficiency(topic):
|
|
| 237 |
'corpus_percentage': corpus_percentage,
|
| 238 |
'max_feasible': max_feasible,
|
| 239 |
'buildable_content': buildable_content,
|
| 240 |
-
'content_samples': relevant_content[:
|
| 241 |
-
'
|
| 242 |
-
'
|
| 243 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
}
|
| 245 |
|
| 246 |
except Exception as e:
|
| 247 |
return {
|
| 248 |
-
'status': 'error',
|
| 249 |
'message': f"Analysis error: {str(e)}",
|
| 250 |
'corpus_percentage': 0,
|
| 251 |
'max_feasible': 'error'
|
| 252 |
}
|
| 253 |
|
| 254 |
def get_chatgpt_enhancement(topic, content_type, corpus_percentage, gap_description):
|
| 255 |
-
"""Get ChatGPT content to fill
|
| 256 |
|
| 257 |
try:
|
| 258 |
import openai
|
|
@@ -260,157 +299,253 @@ def get_chatgpt_enhancement(topic, content_type, corpus_percentage, gap_descript
|
|
| 260 |
|
| 261 |
if not api_key:
|
| 262 |
return {
|
| 263 |
-
'enhanced_content': f"AI enhancement unavailable for {topic}. Proceeding with {corpus_percentage:.1f}% corpus content.",
|
| 264 |
-
'gap_areas': ["AI enhancement not available"],
|
| 265 |
-
'references': ["
|
| 266 |
}
|
| 267 |
|
| 268 |
openai.api_key = api_key
|
| 269 |
|
| 270 |
-
|
|
|
|
|
|
|
| 271 |
|
| 272 |
CONTEXT:
|
| 273 |
- Corpus provides {corpus_percentage:.1f}% coverage
|
| 274 |
-
- Need to fill {100-corpus_percentage:.1f}% gap
|
|
|
|
| 275 |
- Gap areas: {gap_description}
|
| 276 |
|
| 277 |
-
|
| 278 |
-
1.
|
| 279 |
-
2.
|
| 280 |
-
3.
|
| 281 |
-
4.
|
|
|
|
| 282 |
|
| 283 |
-
|
| 284 |
-
- Clear, specific strategies for {topic}
|
| 285 |
-
- Implementation frameworks
|
| 286 |
-
- Common challenges and solutions
|
| 287 |
-
- Success metrics
|
| 288 |
|
| 289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
|
| 291 |
response = openai.ChatCompletion.create(
|
| 292 |
model="gpt-4",
|
| 293 |
messages=[
|
| 294 |
-
{"role": "system", "content": "You are an expert leadership development specialist with extensive
|
| 295 |
{"role": "user", "content": prompt}
|
| 296 |
],
|
| 297 |
-
max_tokens=
|
| 298 |
temperature=0.3
|
| 299 |
)
|
| 300 |
|
| 301 |
content = response.choices[0].message.content
|
| 302 |
|
| 303 |
-
# Extract references
|
| 304 |
references = re.findall(r'\([A-Za-z]+.*?\d{4}\)', content)
|
| 305 |
if not references:
|
| 306 |
-
references = ["AI-generated content - manual verification
|
| 307 |
|
| 308 |
return {
|
| 309 |
'enhanced_content': content,
|
| 310 |
'gap_areas': [gap_description],
|
| 311 |
-
'references': references
|
| 312 |
}
|
| 313 |
|
| 314 |
except Exception as e:
|
| 315 |
return {
|
| 316 |
'enhanced_content': f"AI enhancement error: {str(e)}",
|
| 317 |
-
'gap_areas': [f"
|
| 318 |
-
'references': [f"Enhancement
|
| 319 |
}
|
| 320 |
|
| 321 |
def generate_content_analysis_interface(search_term):
|
| 322 |
-
"""
|
| 323 |
|
| 324 |
-
if not search_term or len(search_term.strip()) <
|
| 325 |
-
return "โ ๏ธ Please enter a search term (at least
|
| 326 |
|
| 327 |
try:
|
| 328 |
# Extract real topics from corpus
|
| 329 |
print(f"๐ Extracting topics related to: {search_term}")
|
| 330 |
-
real_topics = extract_real_topics_from_corpus(search_term, max_topics=
|
| 331 |
|
| 332 |
if not real_topics:
|
| 333 |
-
return f"โ No relevant topics found in corpus for '{search_term}'. Try broader terms like 'leadership', 'management', or '
|
| 334 |
|
| 335 |
-
# Analyze top
|
| 336 |
analysis_results = []
|
| 337 |
-
for i, topic in enumerate(real_topics[:
|
| 338 |
analysis = analyze_content_sufficiency(topic)
|
| 339 |
if analysis['status'] == 'success':
|
| 340 |
analysis_results.append(analysis)
|
| 341 |
|
| 342 |
-
#
|
| 343 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 344 |
|
| 345 |
-
|
| 346 |
|
| 347 |
-
**Found {len(real_topics)} relevant topics:**
|
| 348 |
"""
|
| 349 |
|
| 350 |
-
|
| 351 |
-
|
|
|
|
| 352 |
|
| 353 |
-
if len(real_topics) >
|
| 354 |
-
output += f"... and {len(real_topics)-
|
| 355 |
|
| 356 |
output += f"""
|
| 357 |
|
| 358 |
-
## ๐ BUILDABILITY ANALYSIS
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
|
| 360 |
"""
|
| 361 |
|
| 362 |
-
for analysis in analysis_results:
|
| 363 |
topic = analysis['topic']
|
| 364 |
corpus_pct = analysis['corpus_percentage']
|
| 365 |
-
|
| 366 |
|
| 367 |
-
#
|
| 368 |
-
if
|
| 369 |
-
|
| 370 |
-
elif
|
| 371 |
-
|
| 372 |
-
elif
|
| 373 |
-
|
| 374 |
else:
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
output += f"""### {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 378 |
|
| 379 |
-
**
|
| 380 |
-
**Maximum Buildable:** {max_level.title()}
|
| 381 |
-
**AI Enhancement Needed:** {100-corpus_pct:.1f}%
|
| 382 |
-
**Supporting Documents:** {analysis['total_relevant_documents']} documents
|
| 383 |
|
| 384 |
-
**What Can Be Built:**
|
| 385 |
"""
|
| 386 |
|
| 387 |
-
|
| 388 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 389 |
|
|
|
|
| 390 |
if analysis['content_samples']:
|
|
|
|
| 391 |
output += f"""
|
| 392 |
-
**Sample Content Preview:**
|
| 393 |
-
"{
|
| 394 |
-
*(
|
| 395 |
|
| 396 |
---
|
| 397 |
|
| 398 |
"""
|
| 399 |
|
| 400 |
-
# Add
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
if best_analysis:
|
| 404 |
output += f"""
|
| 405 |
|
| 406 |
-
## ๐ฏ
|
|
|
|
|
|
|
| 407 |
|
| 408 |
-
**
|
| 409 |
-
- **Corpus Coverage:** {
|
| 410 |
-
- **
|
| 411 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 412 |
|
| 413 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 414 |
"""
|
| 415 |
|
| 416 |
return output
|
|
@@ -418,139 +553,1164 @@ def generate_content_analysis_interface(search_term):
|
|
| 418 |
except Exception as e:
|
| 419 |
return f"โ Analysis error: {str(e)}\n\nPlease try again with a different search term."
|
| 420 |
|
| 421 |
-
def
|
| 422 |
-
"""Generate
|
| 423 |
|
| 424 |
# First analyze the topic
|
| 425 |
analysis = analyze_content_sufficiency(topic)
|
| 426 |
|
| 427 |
if analysis['status'] == 'error':
|
| 428 |
-
return f"โ Cannot generate
|
| 429 |
|
| 430 |
-
if
|
| 431 |
-
|
|
|
|
|
|
|
| 432 |
|
| 433 |
**Analysis Results:**
|
| 434 |
- Corpus coverage: {analysis['corpus_percentage']:.1f}%
|
| 435 |
-
-
|
| 436 |
-
-
|
| 437 |
|
| 438 |
-
**Recommendation:** Try a
|
| 439 |
|
| 440 |
-
# Get enhancement
|
| 441 |
gap_percentage = 100 - analysis['corpus_percentage']
|
| 442 |
enhancement = get_chatgpt_enhancement(
|
| 443 |
topic,
|
| 444 |
-
|
| 445 |
analysis['corpus_percentage'],
|
| 446 |
-
f"Fill {gap_percentage:.1f}% content gap for
|
| 447 |
)
|
| 448 |
|
| 449 |
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")
|
|
|
|
| 450 |
|
| 451 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 452 |
|
| 453 |
**Generated:** {timestamp}
|
| 454 |
-
**
|
| 455 |
-
|
| 456 |
-
-
|
| 457 |
-
-
|
| 458 |
-
-
|
|
|
|
| 459 |
|
| 460 |
---
|
| 461 |
|
| 462 |
## ๐ฏ Learning Objectives
|
| 463 |
|
| 464 |
-
By
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 465 |
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 470 |
|
| 471 |
---
|
| 472 |
|
| 473 |
-
|
|
|
|
|
|
|
|
|
|
| 474 |
|
|
|
|
|
|
|
|
|
|
| 475 |
"""
|
| 476 |
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 480 |
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
|
|
|
|
|
|
| 484 |
|
| 485 |
"{sample['content'][:400]}{'...' if len(sample['content']) > 400 else ''}"
|
| 486 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 487 |
---
|
| 488 |
|
| 489 |
"""
|
| 490 |
|
| 491 |
-
# Add
|
| 492 |
-
|
|
|
|
|
|
|
| 493 |
|
| 494 |
-
|
| 495 |
|
| 496 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 497 |
"""
|
| 498 |
|
| 499 |
-
|
| 500 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 501 |
|
| 502 |
-
#
|
| 503 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 504 |
|
| 505 |
---
|
| 506 |
|
| 507 |
-
##
|
| 508 |
|
| 509 |
-
|
| 510 |
|
| 511 |
-
1. **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 512 |
|
| 513 |
-
|
| 514 |
|
| 515 |
-
|
| 516 |
|
| 517 |
-
###
|
| 518 |
|
| 519 |
-
**
|
|
|
|
|
|
|
|
|
|
| 520 |
|
| 521 |
-
|
| 522 |
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 527 |
|
| 528 |
---
|
| 529 |
|
| 530 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 531 |
|
| 532 |
-
|
| 533 |
-
- Practice the {topic} techniques in your current leadership role
|
| 534 |
-
- Observe how {topic} impacts your team dynamics and results
|
| 535 |
-
- Consider taking the full unit or course on {topic} for deeper development
|
| 536 |
|
| 537 |
-
**
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 541 |
"""
|
| 542 |
|
| 543 |
-
return
|
| 544 |
|
| 545 |
-
# Gradio Interface
|
| 546 |
-
def
|
| 547 |
|
| 548 |
with gr.Blocks(title="๐ง Intelligent Course Generator", theme=gr.themes.Soft()) as interface:
|
| 549 |
|
| 550 |
gr.HTML("""
|
| 551 |
-
<div style='text-align: center; padding: 20px;'>
|
| 552 |
<h1>๐ง Intelligent Course Generator</h1>
|
| 553 |
-
<p><strong>Analyzes your corpus โ Identifies buildable topics โ Generates
|
|
|
|
| 554 |
</div>
|
| 555 |
""")
|
| 556 |
|
|
@@ -558,59 +1718,126 @@ def create_interface():
|
|
| 558 |
|
| 559 |
# Content Analysis Tab
|
| 560 |
with gr.TabItem("๐ Content Analysis"):
|
| 561 |
-
gr.HTML("<h3>Step 1: Analyze What You Can Build</h3>")
|
|
|
|
| 562 |
|
| 563 |
with gr.Row():
|
| 564 |
analysis_input = gr.Textbox(
|
| 565 |
label="๐ Search Term",
|
| 566 |
-
placeholder="Enter topic area (e.g., 'communication', 'leadership', 'conflict')",
|
| 567 |
lines=1
|
| 568 |
)
|
| 569 |
-
analyze_btn = gr.Button("๐ Analyze Content", variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 570 |
|
| 571 |
-
analysis_output = gr.Markdown(label="Analysis Results")
|
| 572 |
analyze_btn.click(generate_content_analysis_interface, analysis_input, analysis_output)
|
| 573 |
|
| 574 |
-
#
|
| 575 |
-
with gr.TabItem("
|
| 576 |
-
gr.HTML("<h3>Step 2: Generate
|
|
|
|
| 577 |
|
| 578 |
with gr.Row():
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 585 |
|
| 586 |
-
|
| 587 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 588 |
|
| 589 |
# Quick Generator Tab
|
| 590 |
with gr.TabItem("โก Quick Generate"):
|
| 591 |
-
gr.HTML("<h3>Direct Generation (Skip Analysis)</h3>")
|
|
|
|
| 592 |
|
| 593 |
with gr.Row():
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 600 |
|
| 601 |
-
|
| 602 |
-
|
|
|
|
|
|
|
|
|
|
| 603 |
|
| 604 |
gr.HTML("""
|
| 605 |
-
<div style='margin-top: 30px; padding:
|
| 606 |
-
<h4>๐ How This Works:</h4>
|
| 607 |
-
<
|
| 608 |
-
<
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 614 |
</div>
|
| 615 |
""")
|
| 616 |
|
|
@@ -618,5 +1845,5 @@ def create_interface():
|
|
| 618 |
|
| 619 |
# Launch the interface
|
| 620 |
if __name__ == "__main__":
|
| 621 |
-
interface =
|
| 622 |
interface.launch(share=True, server_name="0.0.0.0", server_port=7860)
|
|
|
|
| 36 |
print(error_msg)
|
| 37 |
return None, None, error_msg
|
| 38 |
|
| 39 |
+
def extract_real_topics_from_corpus(search_term, max_topics=25):
|
| 40 |
"""Extract actual leadership topics from corpus content"""
|
| 41 |
|
| 42 |
try:
|
|
|
|
| 55 |
similarities = cosine_similarity(search_embedding, content_embeddings)[0]
|
| 56 |
|
| 57 |
# Get highly relevant content
|
| 58 |
+
relevant_indices = indices[similarities > 0.25]
|
| 59 |
relevant_content = [dataset[int(idx)]['content'] for idx in relevant_indices]
|
| 60 |
|
| 61 |
+
# Extract actual topics using comprehensive NLP patterns
|
| 62 |
topics = set()
|
| 63 |
|
| 64 |
+
# Enhanced leadership topic patterns
|
| 65 |
topic_patterns = [
|
| 66 |
+
r'\b([A-Z][a-z]+ [Ll]eadership)\b', # "Strategic Leadership"
|
| 67 |
+
r'\b([A-Z][a-z]+ [Mm]anagement)\b', # "Change Management"
|
| 68 |
+
r'\b([A-Z][a-z]+ [Ss]kills?)\b', # "Communication Skills"
|
| 69 |
+
r'\b([A-Z][a-z]+ [Dd]evelopment)\b', # "Team Development"
|
| 70 |
+
r'\b([A-Z][a-z]+ [Ii]ntelligence)\b', # "Emotional Intelligence"
|
| 71 |
+
r'\b([A-Z][a-z]+ [Bb]uilding)\b', # "Trust Building"
|
| 72 |
+
r'\b([A-Z][a-z]+ [Rr]esolution)\b', # "Conflict Resolution"
|
| 73 |
+
r'\b([A-Z][a-z]+ [Pp]lanning)\b', # "Strategic Planning"
|
| 74 |
+
r'\b([A-Z][a-z]+ [Tt]hinking)\b', # "Critical Thinking"
|
| 75 |
+
r'\bLeading ([A-Z][a-z]+)\b', # "Leading Change"
|
| 76 |
+
r'\bManaging ([A-Z][a-z]+)\b', # "Managing Conflict"
|
| 77 |
+
r'\bBuilding ([A-Z][a-z]+)\b', # "Building Trust"
|
| 78 |
+
r'\bDeveloping ([A-Z][a-z]+)\b', # "Developing Teams"
|
| 79 |
+
r'\bCreating ([A-Z][a-z]+)\b', # "Creating Vision"
|
| 80 |
+
r'\b([A-Z][a-z]+) [Cc]oaching\b', # "Performance Coaching"
|
| 81 |
+
r'\b([A-Z][a-z]+) [Nn]egotiation\b', # "Strategic Negotiation"
|
| 82 |
+
r'\b([A-Z][a-z]+) [Cc]ommunication\b', # "Crisis Communication"
|
| 83 |
]
|
| 84 |
|
| 85 |
for content in relevant_content:
|
|
|
|
| 93 |
|
| 94 |
# Clean up and validate topic
|
| 95 |
topic = topic.strip()
|
| 96 |
+
if len(topic.split()) <= 4 and len(topic) > 5:
|
| 97 |
topics.add(topic)
|
| 98 |
|
| 99 |
+
# Extract key leadership concepts
|
| 100 |
concept_words = []
|
| 101 |
for content in relevant_content:
|
| 102 |
+
# Look for leadership-relevant capitalized terms
|
| 103 |
+
words = re.findall(r'\b[A-Z][a-z]{3,}\b', content)
|
| 104 |
concept_words.extend(words)
|
| 105 |
|
| 106 |
# Find most common concepts
|
| 107 |
word_counts = Counter(concept_words)
|
| 108 |
+
common_concepts = [word for word, count in word_counts.most_common(60)
|
| 109 |
+
if count >= 3 and word not in ['The', 'This', 'That', 'They', 'Then', 'There']]
|
| 110 |
|
| 111 |
+
# Create meaningful topics from common concepts
|
| 112 |
leadership_contexts = [
|
| 113 |
"Leadership", "Management", "Development", "Skills", "Strategy",
|
| 114 |
+
"Communication", "Team Building", "Decision Making", "Innovation",
|
| 115 |
+
"Coaching", "Mentoring", "Performance", "Excellence", "Mastery"
|
| 116 |
]
|
| 117 |
|
| 118 |
+
for concept in common_concepts[:30]: # Top 30 concepts only
|
| 119 |
for context in leadership_contexts:
|
| 120 |
potential_topic = f"{concept} {context}"
|
| 121 |
+
if len(potential_topic) < 40: # Reasonable length
|
| 122 |
topics.add(potential_topic)
|
| 123 |
|
| 124 |
+
# Convert to list and sort by estimated relevance
|
| 125 |
topic_list = list(topics)[:max_topics]
|
| 126 |
|
| 127 |
return topic_list
|
|
|
|
| 131 |
return []
|
| 132 |
|
| 133 |
def analyze_content_sufficiency(topic):
|
| 134 |
+
"""Comprehensive analysis of corpus content for different generation levels"""
|
| 135 |
|
| 136 |
try:
|
| 137 |
dataset, model, error = safe_load_resources()
|
|
|
|
| 141 |
'message': error,
|
| 142 |
'corpus_percentage': 0,
|
| 143 |
'max_feasible': 'none',
|
| 144 |
+
'buildable_content': {}
|
| 145 |
}
|
| 146 |
|
| 147 |
print(f"๐ Analyzing content sufficiency for: {topic}")
|
| 148 |
|
| 149 |
+
# Enhanced search with multiple similarity calculations
|
| 150 |
topic_embedding = model.encode([topic])
|
| 151 |
+
sample_size = min(2000, len(dataset))
|
| 152 |
indices = np.random.choice(len(dataset), sample_size, replace=False)
|
| 153 |
|
| 154 |
content_texts = [dataset[int(idx)]['content'] for idx in indices]
|
|
|
|
| 156 |
|
| 157 |
similarities = cosine_similarity(topic_embedding, content_embeddings)[0]
|
| 158 |
|
| 159 |
+
# Enhanced relevance classification
|
| 160 |
+
excellent_relevance = similarities > 0.5 # Excellent matches
|
| 161 |
+
high_relevance = similarities > 0.4 # Strong matches
|
| 162 |
+
medium_relevance = similarities > 0.3 # Good matches
|
| 163 |
+
low_relevance = similarities > 0.2 # Acceptable matches
|
| 164 |
|
| 165 |
+
excellent_count = np.sum(excellent_relevance)
|
| 166 |
+
high_count = np.sum(high_relevance) - excellent_count
|
| 167 |
+
medium_count = np.sum(medium_relevance) - excellent_count - high_count
|
| 168 |
+
low_count = np.sum(low_relevance) - excellent_count - high_count - medium_count
|
| 169 |
|
| 170 |
+
# Get actual content for detailed analysis
|
| 171 |
relevant_indices = indices[similarities > 0.2]
|
| 172 |
relevant_content = []
|
| 173 |
|
|
|
|
| 186 |
'content': content,
|
| 187 |
'score': float(score),
|
| 188 |
'source_topic': source_topic,
|
| 189 |
+
'length': len(content),
|
| 190 |
+
'id': dataset[actual_idx]['id']
|
| 191 |
})
|
| 192 |
|
| 193 |
# Sort by relevance
|
| 194 |
relevant_content.sort(key=lambda x: x['score'], reverse=True)
|
| 195 |
|
| 196 |
+
# Enhanced corpus percentage calculation
|
| 197 |
+
total_relevant = excellent_count + high_count + medium_count + low_count
|
| 198 |
+
content_depth = sum(item['length'] for item in relevant_content[:15])
|
| 199 |
|
| 200 |
+
# Sophisticated scoring system
|
| 201 |
+
excellence_score = excellent_count * 5 # Excellent content worth 5 points each
|
| 202 |
+
quality_score = high_count * 3 # High quality worth 3 points each
|
| 203 |
+
good_score = medium_count * 2 # Good content worth 2 points each
|
| 204 |
+
basic_score = low_count * 1 # Basic content worth 1 point each
|
| 205 |
|
| 206 |
+
relevance_score = min(50, (excellence_score + quality_score + good_score + basic_score))
|
| 207 |
+
depth_score = min(30, content_depth / 15000) # Content depth scoring
|
| 208 |
+
coverage_score = min(20, total_relevant / 25) # Coverage breadth scoring
|
| 209 |
|
| 210 |
+
corpus_percentage = relevance_score + depth_score + coverage_score
|
|
|
|
| 211 |
|
| 212 |
+
# Determine buildable content for each level
|
| 213 |
+
buildable_content = {
|
| 214 |
+
'micro_lesson': None,
|
| 215 |
+
'unit': None,
|
| 216 |
+
'course': None
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
# Micro-lesson requirements (most lenient)
|
| 220 |
+
if corpus_percentage >= 40 and (excellent_count >= 1 or high_count >= 2):
|
| 221 |
+
buildable_content['micro_lesson'] = {
|
| 222 |
+
'feasible': True,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
'title': f"Essential {topic} Leadership Principles",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
'corpus_support': f"{corpus_percentage:.1f}%",
|
| 225 |
+
'ai_needed': f"{100-corpus_percentage:.1f}%",
|
| 226 |
+
'duration': '5-8 minutes',
|
| 227 |
+
'confidence': 'High' if corpus_percentage >= 60 else 'Medium'
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
# Unit requirements (moderate)
|
| 231 |
+
if corpus_percentage >= 55 and excellent_count >= 2 and (high_count + excellent_count) >= 5:
|
| 232 |
+
buildable_content['unit'] = {
|
| 233 |
+
'feasible': True,
|
| 234 |
+
'title': f"Comprehensive {topic} Leadership Unit",
|
| 235 |
+
'corpus_support': f"{corpus_percentage:.1f}%",
|
| 236 |
+
'ai_needed': f"{100-corpus_percentage:.1f}%",
|
| 237 |
+
'duration': '45-60 minutes',
|
| 238 |
+
'micro_lessons': min(6, max(4, (excellent_count + high_count) // 2)),
|
| 239 |
+
'confidence': 'High' if corpus_percentage >= 70 else 'Medium'
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
# Course requirements (most stringent)
|
| 243 |
+
if corpus_percentage >= 65 and excellent_count >= 4 and (excellent_count + high_count) >= 10:
|
| 244 |
+
estimated_units = min(5, max(3, excellent_count // 2))
|
| 245 |
+
buildable_content['course'] = {
|
| 246 |
+
'feasible': True,
|
| 247 |
+
'title': f"Complete {topic} Leadership Mastery Course",
|
| 248 |
+
'corpus_support': f"{corpus_percentage:.1f}%",
|
| 249 |
+
'ai_needed': f"{100-corpus_percentage:.1f}%",
|
| 250 |
+
'duration': f"{estimated_units * 60}-{estimated_units * 75} minutes",
|
| 251 |
+
'units': estimated_units,
|
| 252 |
+
'total_lessons': estimated_units * 5,
|
| 253 |
+
'confidence': 'High' if corpus_percentage >= 75 else 'Medium'
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
# Determine maximum feasible level
|
| 257 |
+
if buildable_content['course'] and buildable_content['course']['feasible']:
|
| 258 |
+
max_feasible = 'course'
|
| 259 |
+
elif buildable_content['unit'] and buildable_content['unit']['feasible']:
|
| 260 |
+
max_feasible = 'unit'
|
| 261 |
+
elif buildable_content['micro_lesson'] and buildable_content['micro_lesson']['feasible']:
|
| 262 |
+
max_feasible = 'micro_lesson'
|
| 263 |
+
else:
|
| 264 |
max_feasible = 'insufficient'
|
| 265 |
|
| 266 |
return {
|
|
|
|
| 269 |
'corpus_percentage': corpus_percentage,
|
| 270 |
'max_feasible': max_feasible,
|
| 271 |
'buildable_content': buildable_content,
|
| 272 |
+
'content_samples': relevant_content[:8],
|
| 273 |
+
'excellent_count': int(excellent_count),
|
| 274 |
+
'high_count': int(high_count),
|
| 275 |
+
'medium_count': int(medium_count),
|
| 276 |
+
'total_documents': len(relevant_content),
|
| 277 |
+
'quality_breakdown': {
|
| 278 |
+
'excellent': int(excellent_count),
|
| 279 |
+
'high': int(high_count),
|
| 280 |
+
'medium': int(medium_count),
|
| 281 |
+
'low': int(low_count)
|
| 282 |
+
}
|
| 283 |
}
|
| 284 |
|
| 285 |
except Exception as e:
|
| 286 |
return {
|
| 287 |
+
'status': 'error',
|
| 288 |
'message': f"Analysis error: {str(e)}",
|
| 289 |
'corpus_percentage': 0,
|
| 290 |
'max_feasible': 'error'
|
| 291 |
}
|
| 292 |
|
| 293 |
def get_chatgpt_enhancement(topic, content_type, corpus_percentage, gap_description):
|
| 294 |
+
"""Get ChatGPT content to fill specific gaps"""
|
| 295 |
|
| 296 |
try:
|
| 297 |
import openai
|
|
|
|
| 299 |
|
| 300 |
if not api_key:
|
| 301 |
return {
|
| 302 |
+
'enhanced_content': f"AI enhancement unavailable for {topic}. Proceeding with {corpus_percentage:.1f}% corpus content only.",
|
| 303 |
+
'gap_areas': ["AI enhancement not available - using corpus content only"],
|
| 304 |
+
'references': ["No AI enhancement - corpus-based content only"]
|
| 305 |
}
|
| 306 |
|
| 307 |
openai.api_key = api_key
|
| 308 |
|
| 309 |
+
# Detailed prompts based on content type
|
| 310 |
+
if content_type == "micro_lesson":
|
| 311 |
+
prompt = f"""Create focused micro-lesson content for "{topic}" leadership development.
|
| 312 |
|
| 313 |
CONTEXT:
|
| 314 |
- Corpus provides {corpus_percentage:.1f}% coverage
|
| 315 |
+
- Need to fill {100-corpus_percentage:.1f}% gap in content
|
| 316 |
+
- Target: 5-8 minute learning experience
|
| 317 |
- Gap areas: {gap_description}
|
| 318 |
|
| 319 |
+
REQUIREMENTS:
|
| 320 |
+
1. 2-3 key principles for {topic} that complement existing corpus knowledge
|
| 321 |
+
2. 1-2 practical techniques leaders can implement immediately
|
| 322 |
+
3. Real-world example or case study demonstrating {topic} application
|
| 323 |
+
4. Common challenges in {topic} and how to overcome them
|
| 324 |
+
5. Quick assessment questions to verify understanding
|
| 325 |
|
| 326 |
+
Provide specific, actionable content with academic references where possible."""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
|
| 328 |
+
elif content_type == "unit":
|
| 329 |
+
prompt = f"""Design comprehensive unit content for "{topic}" leadership development.
|
| 330 |
+
|
| 331 |
+
CONTEXT:
|
| 332 |
+
- Corpus provides {corpus_percentage:.1f}% coverage
|
| 333 |
+
- Need to fill {100-corpus_percentage:.1f}% gap across multiple lessons
|
| 334 |
+
- Target: 45-60 minute total learning experience
|
| 335 |
+
- Gap areas: {gap_description}
|
| 336 |
+
|
| 337 |
+
REQUIREMENTS:
|
| 338 |
+
1. 4-6 progressive lesson topics within {topic}
|
| 339 |
+
2. Advanced frameworks and methodologies for {topic}
|
| 340 |
+
3. Integration strategies between lesson components
|
| 341 |
+
4. Assessment approaches for unit mastery
|
| 342 |
+
5. Capstone application project for {topic}
|
| 343 |
+
|
| 344 |
+
Include research-based frameworks and cite sources where possible."""
|
| 345 |
+
|
| 346 |
+
else: # course
|
| 347 |
+
prompt = f"""Create comprehensive course architecture for "{topic}" leadership development.
|
| 348 |
+
|
| 349 |
+
CONTEXT:
|
| 350 |
+
- Corpus provides {corpus_percentage:.1f}% coverage
|
| 351 |
+
- Need to fill {100-corpus_percentage:.1f}% gap across full course
|
| 352 |
+
- Target: 3-5 hour complete learning experience
|
| 353 |
+
- Gap areas: {gap_description}
|
| 354 |
+
|
| 355 |
+
REQUIREMENTS:
|
| 356 |
+
1. 3-5 major units with clear progression in {topic} mastery
|
| 357 |
+
2. Advanced leadership theories and research in {topic}
|
| 358 |
+
3. Comprehensive assessment and evaluation framework
|
| 359 |
+
4. Capstone project integrating all {topic} components
|
| 360 |
+
5. Implementation roadmap for organizational application
|
| 361 |
+
|
| 362 |
+
Include cutting-edge research and cite academic sources extensively."""
|
| 363 |
|
| 364 |
response = openai.ChatCompletion.create(
|
| 365 |
model="gpt-4",
|
| 366 |
messages=[
|
| 367 |
+
{"role": "system", "content": "You are an expert leadership development specialist with extensive academic and practical experience."},
|
| 368 |
{"role": "user", "content": prompt}
|
| 369 |
],
|
| 370 |
+
max_tokens=1500,
|
| 371 |
temperature=0.3
|
| 372 |
)
|
| 373 |
|
| 374 |
content = response.choices[0].message.content
|
| 375 |
|
| 376 |
+
# Extract references
|
| 377 |
references = re.findall(r'\([A-Za-z]+.*?\d{4}\)', content)
|
| 378 |
if not references:
|
| 379 |
+
references = ["AI-generated content - manual source verification recommended"]
|
| 380 |
|
| 381 |
return {
|
| 382 |
'enhanced_content': content,
|
| 383 |
'gap_areas': [gap_description],
|
| 384 |
+
'references': references[:10] # Limit to 10 references
|
| 385 |
}
|
| 386 |
|
| 387 |
except Exception as e:
|
| 388 |
return {
|
| 389 |
'enhanced_content': f"AI enhancement error: {str(e)}",
|
| 390 |
+
'gap_areas': [f"Enhancement failed: {str(e)}"],
|
| 391 |
+
'references': [f"Enhancement error: {str(e)}"]
|
| 392 |
}
|
| 393 |
|
| 394 |
def generate_content_analysis_interface(search_term):
|
| 395 |
+
"""Enhanced content analysis interface with detailed insights"""
|
| 396 |
|
| 397 |
+
if not search_term or len(search_term.strip()) < 2:
|
| 398 |
+
return "โ ๏ธ Please enter a search term (at least 2 characters)"
|
| 399 |
|
| 400 |
try:
|
| 401 |
# Extract real topics from corpus
|
| 402 |
print(f"๐ Extracting topics related to: {search_term}")
|
| 403 |
+
real_topics = extract_real_topics_from_corpus(search_term, max_topics=20)
|
| 404 |
|
| 405 |
if not real_topics:
|
| 406 |
+
return f"โ No relevant topics found in corpus for '{search_term}'. Try broader terms like 'leadership', 'management', 'communication', or 'strategy'."
|
| 407 |
|
| 408 |
+
# Analyze top 6 topics for buildability
|
| 409 |
analysis_results = []
|
| 410 |
+
for i, topic in enumerate(real_topics[:6]):
|
| 411 |
analysis = analyze_content_sufficiency(topic)
|
| 412 |
if analysis['status'] == 'success':
|
| 413 |
analysis_results.append(analysis)
|
| 414 |
|
| 415 |
+
# Sort by corpus percentage (best first)
|
| 416 |
+
analysis_results.sort(key=lambda x: x['corpus_percentage'], reverse=True)
|
| 417 |
+
|
| 418 |
+
# Format comprehensive results
|
| 419 |
+
output = f"""# ๐ COMPREHENSIVE CONTENT ANALYSIS: "{search_term}"
|
| 420 |
+
|
| 421 |
+
## ๐ฏ Available Topics from Your Leadership Corpus
|
| 422 |
|
| 423 |
+
**Discovered {len(real_topics)} relevant leadership topics:**
|
| 424 |
|
|
|
|
| 425 |
"""
|
| 426 |
|
| 427 |
+
# Show all topics in organized format
|
| 428 |
+
for i, topic in enumerate(real_topics[:15], 1):
|
| 429 |
+
output += f"{i:2d}. {topic}\n"
|
| 430 |
|
| 431 |
+
if len(real_topics) > 15:
|
| 432 |
+
output += f"... and {len(real_topics)-15} additional topics\n"
|
| 433 |
|
| 434 |
output += f"""
|
| 435 |
|
| 436 |
+
## ๐ DETAILED BUILDABILITY ANALYSIS
|
| 437 |
+
|
| 438 |
+
**Analysis of top 6 topics showing what can be built at each level:**
|
| 439 |
+
|
| 440 |
+
---
|
| 441 |
|
| 442 |
"""
|
| 443 |
|
| 444 |
+
for i, analysis in enumerate(analysis_results, 1):
|
| 445 |
topic = analysis['topic']
|
| 446 |
corpus_pct = analysis['corpus_percentage']
|
| 447 |
+
quality = analysis['quality_breakdown']
|
| 448 |
|
| 449 |
+
# Determine overall grade
|
| 450 |
+
if corpus_pct >= 75:
|
| 451 |
+
grade = "๐ EXCELLENT"
|
| 452 |
+
elif corpus_pct >= 60:
|
| 453 |
+
grade = "โญ GOOD"
|
| 454 |
+
elif corpus_pct >= 45:
|
| 455 |
+
grade = "โ
VIABLE"
|
| 456 |
else:
|
| 457 |
+
grade = "โ ๏ธ LIMITED"
|
| 458 |
+
|
| 459 |
+
output += f"""### {i}. {grade} **{topic}**
|
| 460 |
+
|
| 461 |
+
**Overall Corpus Coverage:** {corpus_pct:.1f}%
|
| 462 |
+
**Quality Breakdown:** {quality['excellent']} excellent, {quality['high']} high, {quality['medium']} medium quality documents
|
| 463 |
+
**Total Supporting Documents:** {analysis['total_documents']}
|
| 464 |
|
| 465 |
+
**๐ฏ BUILDABLE CONTENT LEVELS:**
|
|
|
|
|
|
|
|
|
|
| 466 |
|
|
|
|
| 467 |
"""
|
| 468 |
|
| 469 |
+
# Show what can be built at each level
|
| 470 |
+
for level in ['micro_lesson', 'unit', 'course']:
|
| 471 |
+
buildable = analysis['buildable_content'][level]
|
| 472 |
+
level_name = level.replace('_', '-').title()
|
| 473 |
+
|
| 474 |
+
if buildable and buildable.get('feasible'):
|
| 475 |
+
confidence_emoji = "๐ข" if buildable['confidence'] == 'High' else "๐ก"
|
| 476 |
+
output += f"""**{confidence_emoji} {level_name}:** โ
FEASIBLE
|
| 477 |
+
- {buildable['title']}
|
| 478 |
+
- Corpus: {buildable['corpus_support']} | AI Enhancement: {buildable['ai_needed']}
|
| 479 |
+
- Duration: {buildable['duration']}
|
| 480 |
+
- Confidence: {buildable['confidence']}
|
| 481 |
+
"""
|
| 482 |
+
if level == 'unit' and 'micro_lessons' in buildable:
|
| 483 |
+
output += f" - Includes: {buildable['micro_lessons']} micro-lessons\n"
|
| 484 |
+
elif level == 'course' and 'units' in buildable:
|
| 485 |
+
output += f" - Includes: {buildable['units']} units, {buildable['total_lessons']} total lessons\n"
|
| 486 |
+
else:
|
| 487 |
+
output += f"**๐ด {level_name}:** โ Insufficient content\n"
|
| 488 |
|
| 489 |
+
# Show sample content preview
|
| 490 |
if analysis['content_samples']:
|
| 491 |
+
best_sample = analysis['content_samples'][0]
|
| 492 |
output += f"""
|
| 493 |
+
**๐ Sample Content Preview:**
|
| 494 |
+
"{best_sample['content'][:250]}..."
|
| 495 |
+
*(Quality Score: {best_sample['score']:.3f} | Source: {best_sample['source_topic']})*
|
| 496 |
|
| 497 |
---
|
| 498 |
|
| 499 |
"""
|
| 500 |
|
| 501 |
+
# Add recommendations section
|
| 502 |
+
if analysis_results:
|
| 503 |
+
best_topic = analysis_results[0]
|
|
|
|
| 504 |
output += f"""
|
| 505 |
|
| 506 |
+
## ๐ฏ RECOMMENDATIONS
|
| 507 |
+
|
| 508 |
+
### ๐ **BEST TOPIC FOR GENERATION**
|
| 509 |
|
| 510 |
+
**Topic:** {best_topic['topic']}
|
| 511 |
+
- **Corpus Coverage:** {best_topic['corpus_percentage']:.1f}%
|
| 512 |
+
- **Quality:** {best_topic['quality_breakdown']['excellent']} excellent + {best_topic['quality_breakdown']['high']} high quality sources
|
| 513 |
+
- **Maximum Feasible Level:** {best_topic['max_feasible'].replace('_', '-').title()}
|
| 514 |
+
|
| 515 |
+
### ๐ **SUGGESTED GENERATION STRATEGY**
|
| 516 |
+
|
| 517 |
+
"""
|
| 518 |
+
|
| 519 |
+
# Provide specific recommendations based on the best topic
|
| 520 |
+
buildable = best_topic['buildable_content']
|
| 521 |
+
|
| 522 |
+
if buildable['course'] and buildable['course'].get('feasible'):
|
| 523 |
+
output += f"""๐ **RECOMMENDED: Complete Course**
|
| 524 |
+
- Generate the full {buildable['course']['title']}
|
| 525 |
+
- {buildable['course']['units']} units with {buildable['course']['total_lessons']} total lessons
|
| 526 |
+
- Estimated development time: {buildable['course']['duration']}
|
| 527 |
+
- Confidence level: {buildable['course']['confidence']}"""
|
| 528 |
+
|
| 529 |
+
elif buildable['unit'] and buildable['unit'].get('feasible'):
|
| 530 |
+
output += f"""๐ **RECOMMENDED: Unit Development**
|
| 531 |
+
- Generate {buildable['unit']['title']}
|
| 532 |
+
- {buildable['unit']['micro_lessons']} micro-lessons included
|
| 533 |
+
- Duration: {buildable['unit']['duration']}
|
| 534 |
+
- Confidence level: {buildable['unit']['confidence']}"""
|
| 535 |
+
|
| 536 |
+
elif buildable['micro_lesson'] and buildable['micro_lesson'].get('feasible'):
|
| 537 |
+
output += f"""๐ **RECOMMENDED: Micro-Lesson**
|
| 538 |
+
- Generate {buildable['micro_lesson']['title']}
|
| 539 |
+
- Duration: {buildable['micro_lesson']['duration']}
|
| 540 |
+
- Confidence level: {buildable['micro_lesson']['confidence']}"""
|
| 541 |
+
|
| 542 |
+
output += f"""
|
| 543 |
|
| 544 |
+
### ๐ **NEXT STEPS**
|
| 545 |
+
1. Use the "Content Generator" tab below
|
| 546 |
+
2. Select "{best_topic['topic']}" as your topic
|
| 547 |
+
3. Choose your desired generation level
|
| 548 |
+
4. Generate complete content with full gamification
|
| 549 |
"""
|
| 550 |
|
| 551 |
return output
|
|
|
|
| 553 |
except Exception as e:
|
| 554 |
return f"โ Analysis error: {str(e)}\n\nPlease try again with a different search term."
|
| 555 |
|
| 556 |
+
def generate_complete_gamified_content(topic, generation_level):
|
| 557 |
+
"""Generate complete content with ALL gamification elements based on level"""
|
| 558 |
|
| 559 |
# First analyze the topic
|
| 560 |
analysis = analyze_content_sufficiency(topic)
|
| 561 |
|
| 562 |
if analysis['status'] == 'error':
|
| 563 |
+
return f"โ Cannot generate content: {analysis['message']}"
|
| 564 |
|
| 565 |
+
# Check if the requested level is feasible
|
| 566 |
+
buildable = analysis['buildable_content'].get(generation_level)
|
| 567 |
+
if not buildable or not buildable.get('feasible'):
|
| 568 |
+
return f"""โ Insufficient Content for {generation_level.replace('_', '-').title()} on "{topic}"
|
| 569 |
|
| 570 |
**Analysis Results:**
|
| 571 |
- Corpus coverage: {analysis['corpus_percentage']:.1f}%
|
| 572 |
+
- Quality documents: {analysis['quality_breakdown']['excellent']} excellent, {analysis['quality_breakdown']['high']} high
|
| 573 |
+
- **This topic can support:** {analysis['max_feasible'].replace('_', '-').title() if analysis['max_feasible'] != 'insufficient' else 'None'}
|
| 574 |
|
| 575 |
+
**Recommendation:** Try a lower level or choose a topic with higher corpus coverage."""
|
| 576 |
|
| 577 |
+
# Get AI enhancement for gaps
|
| 578 |
gap_percentage = 100 - analysis['corpus_percentage']
|
| 579 |
enhancement = get_chatgpt_enhancement(
|
| 580 |
topic,
|
| 581 |
+
generation_level,
|
| 582 |
analysis['corpus_percentage'],
|
| 583 |
+
f"Fill {gap_percentage:.1f}% content gap for {generation_level.replace('_', '-')} on {topic}"
|
| 584 |
)
|
| 585 |
|
| 586 |
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")
|
| 587 |
+
level_display = generation_level.replace('_', '-').title()
|
| 588 |
|
| 589 |
+
# Generate different content based on level
|
| 590 |
+
if generation_level == "micro_lesson":
|
| 591 |
+
return generate_complete_micro_lesson(topic, analysis, enhancement, timestamp)
|
| 592 |
+
elif generation_level == "unit":
|
| 593 |
+
return generate_complete_unit(topic, analysis, enhancement, timestamp)
|
| 594 |
+
else: # course
|
| 595 |
+
return generate_complete_course(topic, analysis, enhancement, timestamp)
|
| 596 |
+
|
| 597 |
+
def generate_complete_micro_lesson(topic, analysis, enhancement, timestamp):
|
| 598 |
+
"""Generate complete micro-lesson with ALL gamification elements"""
|
| 599 |
+
|
| 600 |
+
corpus_pct = analysis['corpus_percentage']
|
| 601 |
+
content_samples = analysis['content_samples'][:4] # Top 4 relevant pieces
|
| 602 |
+
|
| 603 |
+
lesson = f"""# ๐ฏ COMPLETE GAMIFIED MICRO-LESSON: {topic}
|
| 604 |
|
| 605 |
**Generated:** {timestamp}
|
| 606 |
+
**Level:** Micro-Lesson (5-8 minutes complete experience)
|
| 607 |
+
**Content Quality Analysis:**
|
| 608 |
+
- ๐ **Corpus Content:** {corpus_pct:.1f}%
|
| 609 |
+
- ๐ค **AI Enhancement:** {100-corpus_pct:.1f}%
|
| 610 |
+
- ๐ **Supporting Documents:** {analysis['total_documents']} relevant sources
|
| 611 |
+
- โญ **Quality Standard:** {'Excellent (75%+)' if corpus_pct >= 75 else 'Good (60%+)' if corpus_pct >= 60 else 'Viable (45%+)' if corpus_pct >= 45 else 'Limited'}
|
| 612 |
|
| 613 |
---
|
| 614 |
|
| 615 |
## ๐ฏ Learning Objectives
|
| 616 |
|
| 617 |
+
By completing this **{topic}** micro-lesson, you will:
|
| 618 |
+
|
| 619 |
+
1. **๐ง Understand** the essential principles and frameworks of {topic} in leadership practice
|
| 620 |
+
2. **โก Apply** evidence-based {topic} strategies to immediate leadership challenges
|
| 621 |
+
3. **๐ Analyze** how {topic} impacts team dynamics and organizational outcomes
|
| 622 |
+
4. **๐ Create** a personal action plan for implementing {topic} in your role
|
| 623 |
+
|
| 624 |
+
---
|
| 625 |
+
|
| 626 |
+
## ๐ง Opening Reflection & Personal Assessment (1 minute)
|
| 627 |
+
|
| 628 |
+
### ๐ฏ Current State Assessment
|
| 629 |
+
**Rate your current {topic} effectiveness (1-10):** ___
|
| 630 |
+
|
| 631 |
+
### ๐ญ Personal Experience Activation
|
| 632 |
+
*Take 30 seconds to reflect:*
|
| 633 |
+
- **Recent Challenge:** Think of a recent situation where {topic} was important
|
| 634 |
+
- **What Happened:** What specific outcomes occurred?
|
| 635 |
+
- **Learning Edge:** What would you approach differently next time?
|
| 636 |
+
|
| 637 |
+
**โ๏ธ Quick Reflection:**
|
| 638 |
+
________________________________
|
| 639 |
+
________________________________
|
| 640 |
+
|
| 641 |
+
---
|
| 642 |
+
|
| 643 |
+
## ๐ Evidence-Based Foundation: {topic} (2-3 minutes)
|
| 644 |
|
| 645 |
+
### ๐ Insights from Your Leadership Corpus
|
| 646 |
+
|
| 647 |
+
"""
|
| 648 |
+
|
| 649 |
+
# Add corpus insights with full context
|
| 650 |
+
for i, sample in enumerate(content_samples, 1):
|
| 651 |
+
lesson += f"""**๐ง Core Insight {i}** *(Relevance: {sample['score']:.3f})*
|
| 652 |
+
*Source: {sample['source_topic']} | Document: {sample['id']}*
|
| 653 |
+
|
| 654 |
+
"{sample['content'][:500]}{'...' if len(sample['content']) > 500 else ''}"
|
| 655 |
+
|
| 656 |
+
**๐ก Key Takeaway:** {sample['content'].split('.')[0]}.
|
| 657 |
|
| 658 |
---
|
| 659 |
|
| 660 |
+
"""
|
| 661 |
+
|
| 662 |
+
# Add AI enhancement content
|
| 663 |
+
lesson += f"""### ๐ค Enhanced Leadership Intelligence
|
| 664 |
|
| 665 |
+
{enhancement['enhanced_content'][:1000]}{'...' if len(enhancement['enhanced_content']) > 1000 else ''}
|
| 666 |
+
|
| 667 |
+
**๐ Supporting References:**
|
| 668 |
"""
|
| 669 |
|
| 670 |
+
for ref in enhancement['references'][:5]:
|
| 671 |
+
lesson += f"- {ref}\n"
|
| 672 |
+
|
| 673 |
+
# Add complete gamification suite
|
| 674 |
+
lesson += f"""
|
| 675 |
+
|
| 676 |
+
---
|
| 677 |
+
|
| 678 |
+
## ๐ฎ COMPLETE GAMIFICATION SUITE: {topic} (3-4 minutes)
|
| 679 |
+
|
| 680 |
+
### ๐ฏ Game 1: Leadership Scenario Challenge - {topic} Crisis Simulation
|
| 681 |
+
|
| 682 |
+
**๐ฌ Scenario Setup:**
|
| 683 |
+
You're leading a high-stakes project where {topic} is critical to success. Multiple pressures are testing your capabilities:
|
| 684 |
+
|
| 685 |
+
- **Time Pressure:** Critical deadline in 2 weeks
|
| 686 |
+
- **Stakeholder Complexity:** Multiple competing priorities from different departments
|
| 687 |
+
- **Resource Constraints:** 20% budget reduction, key team member on leave
|
| 688 |
+
- **Performance Scrutiny:** Executive leadership monitoring results closely
|
| 689 |
+
- **Team Dynamics:** Mix of remote/in-office, varying skill levels
|
| 690 |
+
|
| 691 |
+
**โก Challenge Round 1: Immediate {topic} Response**
|
| 692 |
+
|
| 693 |
+
Your team approaches you with concerns about the project. Choose your {topic} approach:
|
| 694 |
+
|
| 695 |
+
**A) ๐ฏ Direct Action Approach**
|
| 696 |
+
- Address {topic} challenges head-on in team meeting
|
| 697 |
+
- *Benefit:* Transparent, collaborative problem-solving
|
| 698 |
+
- *Risk:* May expose vulnerabilities or overwhelm team
|
| 699 |
+
|
| 700 |
+
**B) ๐ค Individual Consultation Approach**
|
| 701 |
+
- Handle {topic} through one-on-one stakeholder conversations
|
| 702 |
+
- *Benefit:* Customized approach, builds individual relationships
|
| 703 |
+
- *Risk:* May seem secretive, inconsistent messaging
|
| 704 |
+
|
| 705 |
+
**C) ๐ Systematic Framework Approach**
|
| 706 |
+
- Implement structured {topic} methodology immediately
|
| 707 |
+
- *Benefit:* Comprehensive, nothing gets missed
|
| 708 |
+
- *Risk:* May feel rigid or slow in crisis
|
| 709 |
+
|
| 710 |
+
**D) ๐ฌ Research-Based Approach**
|
| 711 |
+
- Analyze best practices and consult experts before action
|
| 712 |
+
- *Benefit:* Evidence-based decision making
|
| 713 |
+
- *Risk:* Analysis paralysis while situation deteriorates
|
| 714 |
+
|
| 715 |
+
**Your Choice:** ___ **Reasoning:** ________________________________
|
| 716 |
+
|
| 717 |
+
**๐ฏ Challenge Round 2: Stakeholder Management**
|
| 718 |
+
|
| 719 |
+
Three key stakeholders approach you with different perspectives on {topic}:
|
| 720 |
+
|
| 721 |
+
**๐ Executive Sponsor:** "I need concrete proof that your {topic} approach will deliver results. Show me metrics and ROI projections."
|
| 722 |
+
|
| 723 |
+
**๐ ๏ธ Technical Lead:** "Your {topic} strategy isn't accounting for technical complexity. We need more time for quality implementation."
|
| 724 |
+
|
| 725 |
+
**๐ฅ Team Representative:** "The team is concerned about workload and expectations. How will {topic} help rather than add more pressure?"
|
| 726 |
+
|
| 727 |
+
**Design your response strategy for each stakeholder:**
|
| 728 |
+
|
| 729 |
+
**Executive Response:** ________________________________
|
| 730 |
+
|
| 731 |
+
**Technical Response:** ________________________________
|
| 732 |
+
|
| 733 |
+
**Team Response:** ________________________________
|
| 734 |
+
|
| 735 |
+
### ๐ Game 2: Strategic Priority Matrix - {topic} Implementation
|
| 736 |
+
|
| 737 |
+
**๐ฒ Resource Allocation Challenge:**
|
| 738 |
+
|
| 739 |
+
You have 100 "implementation points" to distribute across {topic} initiatives. Each choice impacts your success differently:
|
| 740 |
+
|
| 741 |
+
**๐ฅ High-Impact Initiatives (15-25 points each):**
|
| 742 |
+
- Leadership modeling of {topic} behaviors consistently
|
| 743 |
+
- Clear communication systems for {topic} expectations
|
| 744 |
+
- Measurement and feedback systems for {topic} effectiveness
|
| 745 |
+
- Cultural integration of {topic} into team values
|
| 746 |
+
|
| 747 |
+
**โก Medium-Impact Initiatives (8-15 points each):**
|
| 748 |
+
- Training programs for {topic} skill development
|
| 749 |
+
- Process optimization to support {topic} implementation
|
| 750 |
+
- Technology tools enabling better {topic} collaboration
|
| 751 |
+
- Cross-functional integration breaking down {topic} silos
|
| 752 |
+
|
| 753 |
+
**๐ง Foundation Initiatives (3-8 points each):**
|
| 754 |
+
- Individual coaching for {topic} development
|
| 755 |
+
- Documentation of {topic} best practices
|
| 756 |
+
- Recognition programs celebrating {topic} successes
|
| 757 |
+
- Regular feedback collection on {topic} effectiveness
|
| 758 |
+
|
| 759 |
+
**Your Strategic Allocation:**
|
| 760 |
+
|
| 761 |
+
High-Impact: _________________ (Total: ___ points)
|
| 762 |
+
Medium-Impact: _________________ (Total: ___ points)
|
| 763 |
+
Foundation: _________________ (Total: ___ points)
|
| 764 |
+
|
| 765 |
+
**Total Used:** ___/100 points
|
| 766 |
+
|
| 767 |
+
### ๐ Game 3: Behavior-Outcome Mapping Challenge
|
| 768 |
+
|
| 769 |
+
**Match {topic} Leadership Behaviors with Their Likely Outcomes:**
|
| 770 |
+
|
| 771 |
+
**{topic} Behaviors:**
|
| 772 |
+
1. Consistent demonstration of {topic} principles in daily interactions
|
| 773 |
+
2. Vulnerability in sharing {topic} learning challenges and mistakes
|
| 774 |
+
3. Inclusive decision-making around {topic} approaches and strategies
|
| 775 |
+
4. Recognition of both {topic} successes and meaningful learning attempts
|
| 776 |
+
5. Investment in developing {topic} capabilities in team members
|
| 777 |
+
|
| 778 |
+
**Potential Outcomes:**
|
| 779 |
+
A. Increased psychological safety around {topic} experimentation
|
| 780 |
+
B. Enhanced credibility and trust in {topic} leadership
|
| 781 |
+
C. Improved innovation and creative approaches to {topic}
|
| 782 |
+
D. Better overall performance and measurable results through {topic}
|
| 783 |
+
E. Sustained {topic} culture beyond individual leadership presence
|
| 784 |
+
|
| 785 |
+
**Your Matching:** 1-___, 2-___, 3-___, 4-___, 5-___
|
| 786 |
+
|
| 787 |
+
**๐ง Advanced Challenge:** Identify which behavior-outcome pairs create reinforcing cycles.
|
| 788 |
+
|
| 789 |
+
---
|
| 790 |
+
|
| 791 |
+
## ๐ค Socratic Deep Dive: {topic} Mastery (1-2 minutes)
|
| 792 |
+
|
| 793 |
+
### ๐ง Critical Thinking Questions
|
| 794 |
+
|
| 795 |
+
**Question 1: Experience Integration**
|
| 796 |
+
*"Thinking about your most successful {topic} experience, what specific conditions made it work? How can you systematically recreate those conditions?"*
|
| 797 |
+
|
| 798 |
+
**Your Response:** ________________________________
|
| 799 |
+
|
| 800 |
+
**Question 2: Challenge Analysis**
|
| 801 |
+
*"What makes {topic} particularly difficult in your current context? What systemic barriers exist, and which could you influence?"*
|
| 802 |
+
|
| 803 |
+
**Your Response:** ________________________________
|
| 804 |
+
|
| 805 |
+
**Question 3: Impact Assessment**
|
| 806 |
+
*"If you dramatically improved your {topic} capabilities, what would change first in your team's dynamics and performance?"*
|
| 807 |
+
|
| 808 |
+
**Your Response:** ________________________________
|
| 809 |
+
|
| 810 |
+
**Question 4: Integration Strategy**
|
| 811 |
+
*"How does {topic} connect with your other leadership strengths? Where might there be tensions between {topic} and other priorities?"*
|
| 812 |
+
|
| 813 |
+
**Your Response:** ________________________________
|
| 814 |
+
|
| 815 |
+
**Question 5: Growth Edge Identification**
|
| 816 |
+
*"What's one aspect of {topic} that, if you mastered it, would create a breakthrough in your leadership effectiveness?"*
|
| 817 |
+
|
| 818 |
+
**Your Response:** ________________________________
|
| 819 |
+
|
| 820 |
+
---
|
| 821 |
+
|
| 822 |
+
## โ
ASSESSMENT OPTIONS
|
| 823 |
+
|
| 824 |
+
### ๐โโ๏ธ Speed Mastery Track (5 minutes)
|
| 825 |
+
1. **Key Insights:** What are 3 core principles of {topic} from this lesson?
|
| 826 |
+
2. **Immediate Application:** How will you apply {topic} to a current challenge this week?
|
| 827 |
+
3. **Behavior Commitment:** What's one specific {topic} behavior you'll practice daily?
|
| 828 |
+
|
| 829 |
+
### ๐ฎ Complete Quest Track (15 minutes)
|
| 830 |
+
- Complete all gamified activities with detailed reflection
|
| 831 |
+
- Answer all Socratic questions with depth and examples
|
| 832 |
+
- Create comprehensive {topic} implementation plan
|
| 833 |
+
- Design approach for teaching {topic} concepts to a colleague
|
| 834 |
+
|
| 835 |
+
### ๐ Mastery Plus Innovation Track (25 minutes)
|
| 836 |
+
- All Quest elements PLUS
|
| 837 |
+
- Research one additional {topic} resource and integrate insights
|
| 838 |
+
- Create novel {topic} solution for your specific organizational context
|
| 839 |
+
- Develop plan for building {topic} capabilities across your team
|
| 840 |
+
- Design metrics for measuring {topic} effectiveness
|
| 841 |
+
|
| 842 |
+
## ๐๏ธ Achievement Badge System
|
| 843 |
+
|
| 844 |
+
**๐ฅ {topic} Explorer:** Completed learning journey with clear understanding
|
| 845 |
+
**๐ฅ {topic} Practitioner:** Demonstrated practical application capabilities
|
| 846 |
+
**๐ฅ {topic} Innovator:** Showed creative problem-solving and adaptation
|
| 847 |
+
**๐ {topic} Leader:** Created value for others through {topic} expertise
|
| 848 |
+
|
| 849 |
+
---
|
| 850 |
+
|
| 851 |
+
## ๐ Integration & Commitment
|
| 852 |
+
|
| 853 |
+
### ๐ Growth Tracking
|
| 854 |
+
**Pre-Lesson {topic} Confidence:** ___ (from opening assessment)
|
| 855 |
+
**Post-Lesson {topic} Confidence:** ___ (rate now 1-10)
|
| 856 |
+
**Confidence Growth:** +___ points
|
| 857 |
+
|
| 858 |
+
### ๐ Action Commitment
|
| 859 |
+
**My {topic} Power Move:** What specific action will you take in the next 48 hours to apply {topic}?
|
| 860 |
+
|
| 861 |
+
**Commitment:** ________________________________
|
| 862 |
+
|
| 863 |
+
**Success Metric:** How will you know this action was effective?
|
| 864 |
+
|
| 865 |
+
**Measurement:** ________________________________
|
| 866 |
+
|
| 867 |
+
### ๐ Connection & Growth
|
| 868 |
+
**Next Learning Priority:** Based on this lesson, what aspect of {topic} do you want to explore deeper?
|
| 869 |
+
|
| 870 |
+
**Learning Goal:** ________________________________
|
| 871 |
+
|
| 872 |
+
---
|
| 873 |
+
|
| 874 |
+
## ๐ Lesson Summary & Resources
|
| 875 |
+
|
| 876 |
+
### โ
**Content Quality Verification**
|
| 877 |
+
- **Corpus Foundation:** {corpus_pct:.1f}% from your leadership knowledge base
|
| 878 |
+
- **AI Enhancement:** {100-corpus_pct:.1f}% research-based content additions
|
| 879 |
+
- **Total Sources:** {analysis['total_documents']} relevant documents analyzed
|
| 880 |
+
- **Quality Assurance:** All content evidence-based and practically applicable
|
| 881 |
+
|
| 882 |
+
### ๐ **Key Resources Referenced**
|
| 883 |
+
"""
|
| 884 |
+
|
| 885 |
+
# Add corpus sources
|
| 886 |
+
for i, sample in enumerate(content_samples[:3], 1):
|
| 887 |
+
lesson += f"- **Source {i}:** {sample['source_topic']} (Relevance: {sample['score']:.3f})\n"
|
| 888 |
+
|
| 889 |
+
lesson += "\n**Enhanced with Academic Research:**\n"
|
| 890 |
+
for ref in enhancement['references'][:3]:
|
| 891 |
+
lesson += f"- {ref}\n"
|
| 892 |
+
|
| 893 |
+
lesson += f"""
|
| 894 |
+
|
| 895 |
+
### ๐ฏ **Learning Outcomes Achieved**
|
| 896 |
+
โ
Evidence-based understanding of {topic} principles
|
| 897 |
+
โ
Practical application strategies for immediate use
|
| 898 |
+
โ
Personal assessment and growth planning completed
|
| 899 |
+
โ
Gamified skill practice and scenario testing
|
| 900 |
+
โ
Socratic reflection and critical thinking development
|
| 901 |
+
|
| 902 |
+
**๐ Congratulations! You've completed a comprehensive {topic} micro-lesson with full gamification and evidence-based content.**
|
| 903 |
+
|
| 904 |
+
---
|
| 905 |
+
|
| 906 |
+
*Generated by Intelligent Course Generator | Corpus Coverage: {corpus_pct:.1f}% | Quality Standard Met โ
*
|
| 907 |
+
"""
|
| 908 |
+
|
| 909 |
+
return lesson
|
| 910 |
+
|
| 911 |
+
def generate_complete_unit(topic, analysis, enhancement, timestamp):
|
| 912 |
+
"""Generate complete unit with multiple micro-lessons"""
|
| 913 |
+
|
| 914 |
+
corpus_pct = analysis['corpus_percentage']
|
| 915 |
+
unit_info = analysis['buildable_content']['unit']
|
| 916 |
+
num_lessons = unit_info['micro_lessons']
|
| 917 |
+
|
| 918 |
+
# Create lesson topics from corpus analysis
|
| 919 |
+
lesson_topics = []
|
| 920 |
+
content_samples = analysis['content_samples'][:num_lessons*2] # More content for multiple lessons
|
| 921 |
+
|
| 922 |
+
# Generate meaningful lesson topics based on actual corpus content
|
| 923 |
+
base_topics = [
|
| 924 |
+
f"Foundational {topic} Principles",
|
| 925 |
+
f"Advanced {topic} Strategies",
|
| 926 |
+
f"Applied {topic} in Complex Situations",
|
| 927 |
+
f"{topic} and Team Dynamics",
|
| 928 |
+
f"Leading {topic} Through Change",
|
| 929 |
+
f"Mastering {topic} Communication"
|
| 930 |
+
]
|
| 931 |
+
|
| 932 |
+
lesson_topics = base_topics[:num_lessons]
|
| 933 |
+
|
| 934 |
+
unit = f"""# ๐ COMPLETE GAMIFIED LEARNING UNIT: {topic}
|
| 935 |
+
|
| 936 |
+
**Generated:** {timestamp}
|
| 937 |
+
**Level:** Complete Unit ({unit_info['duration']})
|
| 938 |
+
**Structure:** {num_lessons} Micro-Lessons with Full Gamification
|
| 939 |
+
**Content Quality Analysis:**
|
| 940 |
+
- ๐ **Corpus Content:** {corpus_pct:.1f}%
|
| 941 |
+
- ๐ค **AI Enhancement:** {100-corpus_pct:.1f}%
|
| 942 |
+
- ๐ **Supporting Documents:** {analysis['total_documents']} relevant sources
|
| 943 |
+
- โญ **Quality Standard:** {unit_info['confidence']} Confidence Level
|
| 944 |
+
|
| 945 |
+
---
|
| 946 |
+
|
| 947 |
+
## ๐ฏ Unit Learning Objectives
|
| 948 |
+
|
| 949 |
+
By completing this **{topic}** unit, you will:
|
| 950 |
+
|
| 951 |
+
1. **๐ง Master** comprehensive {topic} frameworks and methodologies for complex leadership challenges
|
| 952 |
+
2. **โก Apply** advanced {topic} strategies across diverse organizational contexts and situations
|
| 953 |
+
3. **๐ Analyze** the systemic impact of {topic} on organizational culture and performance outcomes
|
| 954 |
+
4. **๐ Design** integrated {topic} solutions that drive sustainable organizational improvement
|
| 955 |
+
5. **๐ฅ Develop** {topic} capabilities in others through coaching and mentoring approaches
|
| 956 |
+
|
| 957 |
+
---
|
| 958 |
+
|
| 959 |
+
## ๐ Unit Architecture & Progressive Learning Path
|
| 960 |
+
|
| 961 |
+
### ๐บ๏ธ Learning Journey Overview
|
| 962 |
+
|
| 963 |
+
"""
|
| 964 |
+
|
| 965 |
+
for i, lesson_topic in enumerate(lesson_topics, 1):
|
| 966 |
+
duration = "8-10 minutes" if i <= 2 else "10-12 minutes" # Later lessons longer
|
| 967 |
+
lesson += f"""**Lesson {i}: {lesson_topic}**
|
| 968 |
+
- Duration: {duration}
|
| 969 |
+
- Focus: {'Foundation Building' if i <= 2 else 'Advanced Application' if i <= 4 else 'Mastery Integration'}
|
| 970 |
+
- Games: 3+ gamified activities per lesson
|
| 971 |
+
- Assessment: Speed/Quest/Mastery tracks
|
| 972 |
+
|
| 973 |
+
"""
|
| 974 |
+
|
| 975 |
+
unit += f"""
|
| 976 |
+
**Total Unit Time:** {unit_info['duration']}
|
| 977 |
+
**Capstone Project:** Integrated {topic} Leadership Challenge
|
| 978 |
+
|
| 979 |
+
---
|
| 980 |
+
|
| 981 |
+
"""
|
| 982 |
+
|
| 983 |
+
# Generate each complete lesson
|
| 984 |
+
for i, lesson_topic in enumerate(lesson_topics, 1):
|
| 985 |
+
# Use different content samples for each lesson
|
| 986 |
+
lesson_content_start = (i-1) * 2
|
| 987 |
+
lesson_content_end = min(lesson_content_start + 2, len(content_samples))
|
| 988 |
+
lesson_samples = content_samples[lesson_content_start:lesson_content_end]
|
| 989 |
+
|
| 990 |
+
unit += f"""# ๐ฏ UNIT LESSON {i}/{num_lessons}: {lesson_topic}
|
| 991 |
+
|
| 992 |
+
**Duration:** 8-12 minutes | **Method:** Socratic + Complete Gamification | **Level:** Unit Integration
|
| 993 |
+
|
| 994 |
+
## ๐ฏ Lesson Learning Objectives
|
| 995 |
+
|
| 996 |
+
1. **Master** {lesson_topic} principles through evidence-based understanding
|
| 997 |
+
2. **Apply** {lesson_topic} techniques in realistic leadership scenarios
|
| 998 |
+
3. **Integrate** {lesson_topic} with other leadership competencies from this unit
|
| 999 |
+
4. **Evaluate** {lesson_topic} effectiveness through practical assessment
|
| 1000 |
+
|
| 1001 |
+
## ๐ง Opening Reflection & Unit Connection (1 minute)
|
| 1002 |
+
|
| 1003 |
+
### ๐ Unit Integration Check
|
| 1004 |
+
*"How does {lesson_topic} connect to what you learned in the previous lessons of this unit? What patterns are emerging in your {topic} development?"*
|
| 1005 |
+
|
| 1006 |
+
### ๐ญ Personal Experience Activation
|
| 1007 |
+
*"Describe a recent situation where {lesson_topic} was important in your leadership role. What happened? What would you like to handle differently?"*
|
| 1008 |
+
|
| 1009 |
+
**๐ฏ Learning Goal Setting:** What's your specific objective for {lesson_topic} development today?
|
| 1010 |
+
|
| 1011 |
+
**Goal:** ________________________________
|
| 1012 |
+
|
| 1013 |
+
---
|
| 1014 |
+
|
| 1015 |
+
## ๐ Evidence-Based Content: {lesson_topic} (2-3 minutes)
|
| 1016 |
+
|
| 1017 |
+
### ๐ From Your Leadership Corpus
|
| 1018 |
+
|
| 1019 |
+
"""
|
| 1020 |
|
| 1021 |
+
# Add lesson-specific corpus content
|
| 1022 |
+
if lesson_samples:
|
| 1023 |
+
for j, sample in enumerate(lesson_samples, 1):
|
| 1024 |
+
unit += f"""**๐ง Insight {j}** *(Relevance: {sample['score']:.3f})*
|
| 1025 |
+
*Source: {sample['source_topic']} | Document: {sample['id']}*
|
| 1026 |
|
| 1027 |
"{sample['content'][:400]}{'...' if len(sample['content']) > 400 else ''}"
|
| 1028 |
|
| 1029 |
+
**๐ก Key Application:** How does this insight apply specifically to {lesson_topic}?
|
| 1030 |
+
|
| 1031 |
+
---
|
| 1032 |
+
|
| 1033 |
+
"""
|
| 1034 |
+
else:
|
| 1035 |
+
unit += f"""**๐ง Corpus Integration for {lesson_topic}**
|
| 1036 |
+
*Drawing from foundational {topic} principles identified in unit analysis*
|
| 1037 |
+
|
| 1038 |
+
Using the evidence-based insights from your corpus, {lesson_topic} represents a critical component of comprehensive {topic} leadership capability.
|
| 1039 |
+
|
| 1040 |
+
---
|
| 1041 |
+
|
| 1042 |
+
"""
|
| 1043 |
+
|
| 1044 |
+
# Add lesson-specific AI enhancement
|
| 1045 |
+
unit += f"""### ๐ค Research Enhancement: {lesson_topic}
|
| 1046 |
+
|
| 1047 |
+
{enhancement['enhanced_content'][i*200:(i+1)*400]}...
|
| 1048 |
+
|
| 1049 |
+
---
|
| 1050 |
+
|
| 1051 |
+
## ๐ฎ Complete Gamification Suite: {lesson_topic} (3-4 minutes)
|
| 1052 |
+
|
| 1053 |
+
### ๐ฏ Game 1: {lesson_topic} Scenario Challenge
|
| 1054 |
+
|
| 1055 |
+
**๐ฌ Scenario:** You're implementing {lesson_topic} in a complex organizational context.
|
| 1056 |
+
|
| 1057 |
+
**Challenge Variables:**
|
| 1058 |
+
- **Stakeholder Complexity:** Multiple departments with competing priorities
|
| 1059 |
+
- **Resource Constraints:** Limited time and budget for {lesson_topic} initiatives
|
| 1060 |
+
- **Cultural Resistance:** Some team members skeptical of {lesson_topic} approaches
|
| 1061 |
+
- **Performance Pressure:** Results expected within 30 days
|
| 1062 |
+
|
| 1063 |
+
**Round 1: Strategy Selection**
|
| 1064 |
+
|
| 1065 |
+
Choose your {lesson_topic} approach:
|
| 1066 |
+
|
| 1067 |
+
**A) ๐ฏ Comprehensive Implementation**
|
| 1068 |
+
- Full-scale {lesson_topic} rollout across all teams
|
| 1069 |
+
- *Benefit:* Maximum impact and consistency
|
| 1070 |
+
- *Risk:* Overwhelming, potential resistance
|
| 1071 |
+
|
| 1072 |
+
**B) ๐งช Pilot Program Approach**
|
| 1073 |
+
- Test {lesson_topic} with willing early adopters
|
| 1074 |
+
- *Benefit:* Learning and refinement opportunity
|
| 1075 |
+
- *Risk:* Slower organization-wide adoption
|
| 1076 |
+
|
| 1077 |
+
**C) ๐ค Consultation-Based Approach**
|
| 1078 |
+
- Engage stakeholders in co-designing {lesson_topic} strategy
|
| 1079 |
+
- *Benefit:* Buy-in and customization
|
| 1080 |
+
- *Risk:* Longer timeline, potential compromise
|
| 1081 |
+
|
| 1082 |
+
**Your Choice & Reasoning:** ________________________________
|
| 1083 |
+
|
| 1084 |
+
**Round 2: Challenge Response**
|
| 1085 |
+
Midway through implementation, you encounter unexpected resistance. Design your adaptive {lesson_topic} strategy:
|
| 1086 |
+
|
| 1087 |
+
**Adaptive Strategy:** ________________________________
|
| 1088 |
+
|
| 1089 |
+
### ๐ Game 2: {lesson_topic} Priority Matrix
|
| 1090 |
+
|
| 1091 |
+
**Resource Allocation Challenge for {lesson_topic}:**
|
| 1092 |
+
|
| 1093 |
+
Distribute 100 implementation points across {lesson_topic} initiatives:
|
| 1094 |
+
|
| 1095 |
+
**๐ฅ High-Impact (20-30 points each):**
|
| 1096 |
+
- Leader modeling of {lesson_topic} behaviors
|
| 1097 |
+
- System changes supporting {lesson_topic}
|
| 1098 |
+
- Measurement framework for {lesson_topic} results
|
| 1099 |
+
|
| 1100 |
+
**โก Medium-Impact (10-20 points each):**
|
| 1101 |
+
- Training programs for {lesson_topic} skills
|
| 1102 |
+
- Communication campaign about {lesson_topic}
|
| 1103 |
+
- Recognition systems for {lesson_topic} success
|
| 1104 |
+
|
| 1105 |
+
**๐ง Foundation (5-10 points each):**
|
| 1106 |
+
- Individual coaching for {lesson_topic}
|
| 1107 |
+
- Documentation of {lesson_topic} practices
|
| 1108 |
+
- Feedback collection on {lesson_topic} effectiveness
|
| 1109 |
+
|
| 1110 |
+
**Your Allocation:** ________________________________
|
| 1111 |
+
|
| 1112 |
+
### ๐ Game 3: {lesson_topic} Systems Mapping
|
| 1113 |
+
|
| 1114 |
+
**Map the relationships between {lesson_topic} behaviors and organizational outcomes:**
|
| 1115 |
+
|
| 1116 |
+
**Behavior โ Immediate Effect โ Ripple Effect โ System Change**
|
| 1117 |
+
|
| 1118 |
+
Example: Consistent {lesson_topic} communication โ Team clarity โ Improved performance โ Cultural transformation
|
| 1119 |
+
|
| 1120 |
+
**Your System Map:** ________________________________
|
| 1121 |
+
|
| 1122 |
+
---
|
| 1123 |
+
|
| 1124 |
+
## ๐ค Socratic Deep Dive: {lesson_topic} (1-2 minutes)
|
| 1125 |
+
|
| 1126 |
+
**Question 1:** *"What makes {lesson_topic} particularly challenging in your context? What would need to change to make it easier?"*
|
| 1127 |
+
|
| 1128 |
+
**Response:** ________________________________
|
| 1129 |
+
|
| 1130 |
+
**Question 2:** *"How does {lesson_topic} reinforce or conflict with other aspects of your leadership approach?"*
|
| 1131 |
+
|
| 1132 |
+
**Response:** ________________________________
|
| 1133 |
+
|
| 1134 |
+
**Question 3:** *"If you could only implement one aspect of {lesson_topic}, which would create the most leverage?"*
|
| 1135 |
+
|
| 1136 |
+
**Response:** ________________________________
|
| 1137 |
+
|
| 1138 |
+
---
|
| 1139 |
+
|
| 1140 |
+
## โ
Lesson Assessment & Integration
|
| 1141 |
+
|
| 1142 |
+
### ๐โโ๏ธ Speed Check (2 minutes)
|
| 1143 |
+
1. Key insight about {lesson_topic}?
|
| 1144 |
+
2. One application for this week?
|
| 1145 |
+
3. Integration with previous unit lessons?
|
| 1146 |
+
|
| 1147 |
+
### ๐ฎ Complete Integration (5 minutes)
|
| 1148 |
+
- Connect {lesson_topic} to previous unit lessons
|
| 1149 |
+
- Design implementation approach for your context
|
| 1150 |
+
- Plan for measuring {lesson_topic} effectiveness
|
| 1151 |
+
|
| 1152 |
+
### ๐ Mastery Application (10 minutes)
|
| 1153 |
+
- All integration elements PLUS
|
| 1154 |
+
- Create teaching approach for {lesson_topic}
|
| 1155 |
+
- Design organizational change strategy using {lesson_topic}
|
| 1156 |
+
|
| 1157 |
+
---
|
| 1158 |
+
|
| 1159 |
+
## ๐๏ธ Lesson Badges
|
| 1160 |
+
|
| 1161 |
+
**๐ฅ {lesson_topic} Understanding:** Grasped core concepts and connections
|
| 1162 |
+
**๐ฅ {lesson_topic} Application:** Demonstrated practical implementation capability
|
| 1163 |
+
**๐ฅ {lesson_topic} Integration:** Connected with broader {topic} mastery
|
| 1164 |
+
**๐ {lesson_topic} Innovation:** Created novel approaches and solutions
|
| 1165 |
+
|
| 1166 |
---
|
| 1167 |
|
| 1168 |
"""
|
| 1169 |
|
| 1170 |
+
# Add unit capstone
|
| 1171 |
+
unit += f"""
|
| 1172 |
+
|
| 1173 |
+
## ๐ UNIT CAPSTONE PROJECT: Integrated {topic} Leadership Challenge
|
| 1174 |
|
| 1175 |
+
### ๐ฏ Capstone Overview
|
| 1176 |
|
| 1177 |
+
**Challenge:** Design and present a comprehensive {topic} implementation strategy for your organization that integrates all {num_lessons} lesson components.
|
| 1178 |
+
|
| 1179 |
+
### ๐ Project Requirements
|
| 1180 |
+
|
| 1181 |
+
**Phase 1: Analysis & Planning (15 minutes)**
|
| 1182 |
+
1. **Organizational Assessment:** Analyze your organization's current {topic} capabilities
|
| 1183 |
+
2. **Integration Strategy:** Show how all {num_lessons} lesson topics work together
|
| 1184 |
+
3. **Implementation Roadmap:** Create 90-day plan with specific milestones
|
| 1185 |
+
|
| 1186 |
+
**Phase 2: Strategy Design (20 minutes)**
|
| 1187 |
+
1. **Stakeholder Strategy:** Address different stakeholder needs and concerns
|
| 1188 |
+
2. **Resource Allocation:** Distribute limited resources across {topic} initiatives
|
| 1189 |
+
3. **Risk Mitigation:** Identify and plan for potential implementation challenges
|
| 1190 |
+
4. **Success Metrics:** Define measurable outcomes for {topic} effectiveness
|
| 1191 |
+
|
| 1192 |
+
**Phase 3: Innovation & Leadership (15 minutes)**
|
| 1193 |
+
1. **Creative Solutions:** Design novel approaches to {topic} challenges
|
| 1194 |
+
2. **Change Leadership:** Plan for leading organizational adoption of {topic}
|
| 1195 |
+
3. **Capability Building:** Strategy for developing {topic} skills in others
|
| 1196 |
+
4. **Sustainability:** Ensure {topic} improvements persist beyond initial implementation
|
| 1197 |
+
|
| 1198 |
+
### ๐ฎ Capstone Gamification Elements
|
| 1199 |
+
|
| 1200 |
+
**๐ฒ Random Challenge Cards:** Draw 3 challenge cards that add constraints to your strategy:
|
| 1201 |
+
- Budget reduced by 30%
|
| 1202 |
+
- Key stakeholder initially resistant
|
| 1203 |
+
- Accelerated timeline due to market pressures
|
| 1204 |
+
- Remote team implementation required
|
| 1205 |
+
- Cultural change resistance expected
|
| 1206 |
+
|
| 1207 |
+
**๐
Excellence Criteria:**
|
| 1208 |
+
- **๐ฅ Completion:** Addresses all project requirements with basic competency
|
| 1209 |
+
- **๐ฅ Integration:** Demonstrates clear connections between all unit lessons
|
| 1210 |
+
- **๐ฅ Innovation:** Shows creative problem-solving and leadership insight
|
| 1211 |
+
- **๐ Mastery:** Creates value that others could implement and benefit from
|
| 1212 |
+
|
| 1213 |
+
### โ
Capstone Assessment Options
|
| 1214 |
+
|
| 1215 |
+
**๐โโ๏ธ Executive Summary Track (30 minutes)**
|
| 1216 |
+
- 2-page strategy summary hitting all key requirements
|
| 1217 |
+
- Focus on practical implementation and results
|
| 1218 |
+
|
| 1219 |
+
**๐ฎ Complete Strategy Track (50 minutes)**
|
| 1220 |
+
- Full project with detailed analysis and planning
|
| 1221 |
+
- Include stakeholder presentation materials
|
| 1222 |
+
|
| 1223 |
+
**๐ Innovation Leadership Track (75 minutes)**
|
| 1224 |
+
- All strategy elements PLUS
|
| 1225 |
+
- Original research integration
|
| 1226 |
+
- Mentoring plan for developing {topic} leaders
|
| 1227 |
+
- Organizational change methodology design
|
| 1228 |
+
|
| 1229 |
+
---
|
| 1230 |
+
|
| 1231 |
+
## ๐ UNIT COMPLETION & RECOGNITION
|
| 1232 |
+
|
| 1233 |
+
### ๐ Unit Mastery Verification
|
| 1234 |
+
|
| 1235 |
+
**Learning Objective Achievement:**
|
| 1236 |
+
โ
Comprehensive {topic} framework mastery
|
| 1237 |
+
โ
Advanced strategy application across contexts
|
| 1238 |
+
โ
Systematic impact analysis capabilities
|
| 1239 |
+
โ
Integrated solution design skills
|
| 1240 |
+
โ
Leadership development and coaching abilities
|
| 1241 |
+
|
| 1242 |
+
### ๐ Unit Achievement Badges
|
| 1243 |
+
|
| 1244 |
+
**๐ {topic} Graduate:** Completed all {num_lessons} lessons with understanding
|
| 1245 |
+
**๐ฏ {topic} Strategist:** Demonstrated advanced application and integration
|
| 1246 |
+
**๐ {topic} Innovator:** Showed creative problem-solving and adaptation
|
| 1247 |
+
**๐ {topic} Master:** Achieved capstone excellence and leadership capability
|
| 1248 |
+
|
| 1249 |
+
### ๐ Unit Impact Assessment
|
| 1250 |
+
|
| 1251 |
+
**Pre-Unit {topic} Confidence:** ___ (1-10)
|
| 1252 |
+
**Post-Unit {topic} Confidence:** ___ (1-10)
|
| 1253 |
+
**Total Confidence Growth:** +___ points
|
| 1254 |
+
|
| 1255 |
+
**Most Valuable Lesson:** Which of the {num_lessons} lessons provided the greatest insight?
|
| 1256 |
+
|
| 1257 |
+
**Biggest Breakthrough:** What's your most significant {topic} learning from this unit?
|
| 1258 |
+
|
| 1259 |
+
**Implementation Commitment:** What will you begin implementing from this unit within 1 week?
|
| 1260 |
+
|
| 1261 |
+
---
|
| 1262 |
+
|
| 1263 |
+
## ๐ Recommended Next Steps
|
| 1264 |
+
|
| 1265 |
+
### ๐ฏ Immediate Actions (Week 1)
|
| 1266 |
+
1. Begin implementing your capstone strategy
|
| 1267 |
+
2. Share {topic} insights with your team
|
| 1268 |
+
3. Practice {topic} behaviors daily
|
| 1269 |
+
|
| 1270 |
+
### ๐ Continued Learning (Month 1)
|
| 1271 |
+
1. Consider the complete {topic} course for deeper mastery
|
| 1272 |
+
2. Research additional {topic} resources identified in lessons
|
| 1273 |
+
3. Begin developing {topic} capabilities in others
|
| 1274 |
+
|
| 1275 |
+
### ๐ Long-term Development (Quarter 1)
|
| 1276 |
+
1. Measure and refine your {topic} implementation
|
| 1277 |
+
2. Become a {topic} resource for your organization
|
| 1278 |
+
3. Contribute to {topic} best practices and innovation
|
| 1279 |
+
|
| 1280 |
+
---
|
| 1281 |
+
|
| 1282 |
+
**๐ Congratulations! You've completed a comprehensive {topic} unit with {num_lessons} fully gamified micro-lessons, complete Socratic development, and an integrated capstone project.**
|
| 1283 |
+
|
| 1284 |
+
*Generated by Intelligent Course Generator | Corpus Coverage: {corpus_pct:.1f}% | Unit Standard: {unit_info['confidence']} Confidence โ
*
|
| 1285 |
"""
|
| 1286 |
|
| 1287 |
+
return unit
|
| 1288 |
+
|
| 1289 |
+
def generate_complete_course(topic, analysis, enhancement, timestamp):
|
| 1290 |
+
"""Generate complete course with multiple units"""
|
| 1291 |
+
|
| 1292 |
+
corpus_pct = analysis['corpus_percentage']
|
| 1293 |
+
course_info = analysis['buildable_content']['course']
|
| 1294 |
+
num_units = course_info['units']
|
| 1295 |
+
total_lessons = course_info['total_lessons']
|
| 1296 |
|
| 1297 |
+
# Generate unit topics
|
| 1298 |
+
unit_topics = [
|
| 1299 |
+
f"Foundational {topic} Leadership Principles",
|
| 1300 |
+
f"Advanced {topic} Strategies and Implementation",
|
| 1301 |
+
f"Applied {topic} in Complex Organizational Contexts",
|
| 1302 |
+
f"Leading {topic} Through Change and Innovation",
|
| 1303 |
+
f"Mastering {topic} for Sustainable Excellence"
|
| 1304 |
+
][:num_units]
|
| 1305 |
+
|
| 1306 |
+
course = f"""# ๐ COMPLETE GAMIFIED LEADERSHIP COURSE: {topic}
|
| 1307 |
+
|
| 1308 |
+
**Generated:** {timestamp}
|
| 1309 |
+
**Level:** Complete Course ({course_info['duration']})
|
| 1310 |
+
**Architecture:** {num_units} Units | {total_lessons} Total Micro-Lessons
|
| 1311 |
+
**Content Quality Analysis:**
|
| 1312 |
+
- ๐ **Corpus Content:** {corpus_pct:.1f}%
|
| 1313 |
+
- ๐ค **AI Enhancement:** {100-corpus_pct:.1f}%
|
| 1314 |
+
- ๐ **Supporting Documents:** {analysis['total_documents']} relevant sources
|
| 1315 |
+
- โญ **Quality Standard:** {course_info['confidence']} Confidence Level
|
| 1316 |
|
| 1317 |
---
|
| 1318 |
|
| 1319 |
+
## ๐ฏ Course Learning Objectives
|
| 1320 |
|
| 1321 |
+
By completing this comprehensive **{topic}** course, you will:
|
| 1322 |
|
| 1323 |
+
1. **๐ง Master** the complete spectrum of {topic} leadership frameworks, from foundational principles to advanced organizational transformation strategies
|
| 1324 |
+
2. **โก Apply** sophisticated {topic} methodologies across all organizational levels and contexts, adapting to cultural and situational variables
|
| 1325 |
+
3. **๐ Analyze** systemic organizational patterns and design {topic} interventions that create sustainable culture change and performance improvement
|
| 1326 |
+
4. **๐ Innovate** novel {topic} solutions that address unique organizational challenges and create competitive advantage through leadership excellence
|
| 1327 |
+
5. **๐ฅ Develop** comprehensive {topic} leadership capabilities in others through coaching, mentoring, and organizational development initiatives
|
| 1328 |
+
6. **๐ Evaluate** the long-term impact of {topic} initiatives on organizational performance, culture, and strategic outcomes
|
| 1329 |
|
| 1330 |
+
---
|
| 1331 |
|
| 1332 |
+
## ๐บ๏ธ Course Architecture & Learning Journey
|
| 1333 |
|
| 1334 |
+
### ๐ Course Overview
|
| 1335 |
|
| 1336 |
+
**Total Learning Experience:** {course_info['duration']}
|
| 1337 |
+
**Progressive Mastery Path:** Foundation โ Application โ Innovation โ Mastery โ Leadership
|
| 1338 |
+
**Assessment Methodology:** Continuous gamified assessment with comprehensive capstone project
|
| 1339 |
+
**Practical Integration:** Real-world application throughout with organizational impact focus
|
| 1340 |
|
| 1341 |
+
### ๐ฏ Unit Progression Strategy
|
| 1342 |
|
| 1343 |
+
"""
|
| 1344 |
+
|
| 1345 |
+
# Add detailed unit overview
|
| 1346 |
+
for i, unit_topic in enumerate(unit_topics, 1):
|
| 1347 |
+
unit_duration = f"{45 + (i-1)*5}-{60 + (i-1)*5} minutes" # Progressive length increase
|
| 1348 |
+
lessons_per_unit = total_lessons // num_units + (1 if i <= total_lessons % num_units else 0)
|
| 1349 |
+
|
| 1350 |
+
course += f"""**Unit {i}: {unit_topic}**
|
| 1351 |
+
- **Duration:** {unit_duration}
|
| 1352 |
+
- **Micro-Lessons:** {lessons_per_unit} complete lessons with full gamification
|
| 1353 |
+
- **Focus:** {'Foundation Building & Core Principles' if i == 1 else 'Advanced Application & Strategy' if i == 2 else 'Complex Implementation & Innovation' if i == 3 else 'Change Leadership & Transformation' if i == 4 else 'Mastery Integration & Organizational Impact'}
|
| 1354 |
+
- **Capstone:** {unit_topic.split()[-2]} Implementation Challenge
|
| 1355 |
+
- **Assessment:** Speed/Quest/Mastery tracks with unit-specific achievement badges
|
| 1356 |
+
|
| 1357 |
+
"""
|
| 1358 |
+
|
| 1359 |
+
course += f"""
|
| 1360 |
+
**Course Capstone:** Comprehensive {topic} Organizational Transformation Project
|
| 1361 |
+
**Final Assessment:** Multi-dimensional leadership capability demonstration
|
| 1362 |
|
| 1363 |
---
|
| 1364 |
|
| 1365 |
+
"""
|
| 1366 |
+
|
| 1367 |
+
# Generate each complete unit (abbreviated for space, but would include full units)
|
| 1368 |
+
for i, unit_topic in enumerate(unit_topics, 1):
|
| 1369 |
+
lessons_per_unit = total_lessons // num_units + (1 if i <= total_lessons % num_units else 0)
|
| 1370 |
+
|
| 1371 |
+
course += f"""# ๐ COURSE UNIT {i}/{num_units}: {unit_topic}
|
| 1372 |
+
|
| 1373 |
+
**Unit Focus:** {'Establishing core {topic} competencies and foundational understanding' if i == 1 else 'Developing advanced {topic} strategies and implementation skills' if i == 2 else 'Mastering complex {topic} applications and innovative solutions' if i == 3 else 'Leading {topic} transformation and organizational change' if i == 4 else 'Achieving {topic} mastery and developing others'}
|
| 1374 |
+
|
| 1375 |
+
## ๐ฏ Unit Learning Objectives
|
| 1376 |
+
|
| 1377 |
+
1. **Understand** {unit_topic.lower()} across multiple organizational contexts and complexity levels
|
| 1378 |
+
2. **Apply** advanced techniques from {unit_topic.lower()} in realistic leadership scenarios
|
| 1379 |
+
3. **Integrate** {unit_topic.lower()} with previous course learning and broader leadership competencies
|
| 1380 |
+
4. **Create** innovative solutions using {unit_topic.lower()} for unique organizational challenges
|
| 1381 |
|
| 1382 |
+
## ๐ Unit Content Summary
|
|
|
|
|
|
|
|
|
|
| 1383 |
|
| 1384 |
+
**Micro-Lessons in this Unit ({lessons_per_unit} lessons):**
|
| 1385 |
+
|
| 1386 |
+
"""
|
| 1387 |
+
|
| 1388 |
+
# Generate lesson topics for this unit
|
| 1389 |
+
base_lesson_topics = [
|
| 1390 |
+
f"Core Principles of {unit_topic}",
|
| 1391 |
+
f"Strategic Application of {unit_topic}",
|
| 1392 |
+
f"Advanced Techniques in {unit_topic}",
|
| 1393 |
+
f"Innovation and Adaptation in {unit_topic}",
|
| 1394 |
+
f"Leading Others Through {unit_topic}",
|
| 1395 |
+
f"Measuring Impact of {unit_topic}"
|
| 1396 |
+
]
|
| 1397 |
+
|
| 1398 |
+
unit_lessons = base_lesson_topics[:lessons_per_unit]
|
| 1399 |
+
|
| 1400 |
+
for j, lesson in enumerate(unit_lessons, 1):
|
| 1401 |
+
course += f"""**Lesson {i}.{j}: {lesson}**
|
| 1402 |
+
- Duration: 8-12 minutes with complete gamification
|
| 1403 |
+
- Games: 3+ interactive scenarios, challenges, and simulations
|
| 1404 |
+
- Assessment: Multiple tracks (Speed/Quest/Mastery)
|
| 1405 |
+
- Integration: Builds on previous lessons and connects to future learning
|
| 1406 |
+
|
| 1407 |
+
"""
|
| 1408 |
+
|
| 1409 |
+
# Add unit capstone summary
|
| 1410 |
+
course += f"""
|
| 1411 |
+
### ๐ Unit {i} Capstone: {unit_topic} Implementation Challenge
|
| 1412 |
+
|
| 1413 |
+
**Challenge Overview:** Design and execute a comprehensive {unit_topic.lower()} strategy for your organization, demonstrating mastery of all unit concepts through practical application.
|
| 1414 |
+
|
| 1415 |
+
**Requirements:**
|
| 1416 |
+
- Integration of all {lessons_per_unit} lesson concepts
|
| 1417 |
+
- Real-world application with measurable outcomes
|
| 1418 |
+
- Innovation and creative problem-solving demonstration
|
| 1419 |
+
- Leadership capability development in others
|
| 1420 |
+
|
| 1421 |
+
**Assessment Levels:**
|
| 1422 |
+
- ๐ฅ **Competent:** Meets all basic requirements with solid understanding
|
| 1423 |
+
- ๐ฅ **Proficient:** Demonstrates advanced integration and application
|
| 1424 |
+
- ๐ฅ **Expert:** Shows innovation, leadership, and value creation
|
| 1425 |
+
- ๐ **Master:** Achieves breakthrough results others can learn from
|
| 1426 |
+
|
| 1427 |
+
---
|
| 1428 |
+
|
| 1429 |
+
"""
|
| 1430 |
+
|
| 1431 |
+
# Add comprehensive course capstone
|
| 1432 |
+
course += f"""
|
| 1433 |
+
|
| 1434 |
+
## ๐ COURSE CAPSTONE PROJECT: Complete {topic} Leadership Transformation
|
| 1435 |
+
|
| 1436 |
+
### ๐ฏ Capstone Challenge Overview
|
| 1437 |
+
|
| 1438 |
+
**Ultimate Challenge:** Design, implement, and evaluate a comprehensive {topic} transformation initiative that demonstrates mastery of all {num_units} units and {total_lessons} lessons, creating measurable organizational impact and developing {topic} leadership capabilities throughout your organization.
|
| 1439 |
+
|
| 1440 |
+
### ๐ Capstone Project Phases
|
| 1441 |
+
|
| 1442 |
+
**Phase 1: Comprehensive Analysis & Strategy Design (45 minutes)**
|
| 1443 |
+
|
| 1444 |
+
**๐ Organizational Assessment:**
|
| 1445 |
+
- Complete {topic} capability assessment across all organizational levels
|
| 1446 |
+
- Identify systemic barriers and enablers for {topic} excellence
|
| 1447 |
+
- Analyze cultural factors that impact {topic} implementation
|
| 1448 |
+
- Map stakeholder interests and influence patterns related to {topic}
|
| 1449 |
+
|
| 1450 |
+
**๐ฏ Integrated Strategy Development:**
|
| 1451 |
+
- Synthesize learnings from all {num_units} units into coherent strategy
|
| 1452 |
+
- Design multi-phase implementation approach using course frameworks
|
| 1453 |
+
- Create adaptive mechanisms for strategy refinement based on feedback
|
| 1454 |
+
- Develop comprehensive change management approach for {topic} transformation
|
| 1455 |
+
|
| 1456 |
+
**๐ Success Framework Creation:**
|
| 1457 |
+
- Define multi-dimensional success metrics for {topic} initiatives
|
| 1458 |
+
- Create measurement systems for both quantitative and qualitative outcomes
|
| 1459 |
+
- Design feedback loops for continuous improvement and adaptation
|
| 1460 |
+
- Establish baseline measurements and target outcomes with timelines
|
| 1461 |
+
|
| 1462 |
+
**Phase 2: Implementation Planning & Innovation (60 minutes)**
|
| 1463 |
+
|
| 1464 |
+
**๐ Detailed Implementation Design:**
|
| 1465 |
+
- Create 6-month implementation roadmap with specific milestones
|
| 1466 |
+
- Design pilot programs for testing {topic} approaches
|
| 1467 |
+
- Plan for scaling successful {topic} initiatives across organization
|
| 1468 |
+
- Develop contingency strategies for potential implementation challenges
|
| 1469 |
+
|
| 1470 |
+
**๐ก Innovation & Creative Solutions:**
|
| 1471 |
+
- Design novel {topic} approaches specific to your organizational context
|
| 1472 |
+
- Create unique solutions for identified {topic} challenges
|
| 1473 |
+
- Develop proprietary frameworks combining course concepts innovatively
|
| 1474 |
+
- Plan for contributing new {topic} knowledge to broader leadership community
|
| 1475 |
+
|
| 1476 |
+
**๐ฅ Leadership Development Strategy:**
|
| 1477 |
+
- Design program for developing {topic} leadership capabilities in others
|
| 1478 |
+
- Create mentoring and coaching approaches for {topic} skill development
|
| 1479 |
+
- Plan for building {topic} expertise throughout organizational levels
|
| 1480 |
+
- Develop succession planning for {topic} leadership continuity
|
| 1481 |
+
|
| 1482 |
+
**๐ Sustainability & Evolution Planning:**
|
| 1483 |
+
- Design systems for maintaining {topic} momentum beyond initial implementation
|
| 1484 |
+
- Create mechanisms for evolving {topic} approaches based on changing needs
|
| 1485 |
+
- Plan for integrating {topic} excellence into organizational culture permanently
|
| 1486 |
+
- Develop approaches for continuous {topic} innovation and improvement
|
| 1487 |
+
|
| 1488 |
+
**Phase 3: Advanced Leadership & Value Creation (90 minutes)**
|
| 1489 |
+
|
| 1490 |
+
**๐ฏ Executive Presentation Development:**
|
| 1491 |
+
- Create compelling presentation for senior leadership on {topic} transformation
|
| 1492 |
+
- Develop business case with ROI projections and risk mitigation strategies
|
| 1493 |
+
- Design stakeholder engagement strategy for gaining {topic} initiative support
|
| 1494 |
+
- Plan for securing resources and organizational commitment to {topic} excellence
|
| 1495 |
+
|
| 1496 |
+
**๐ Organizational Impact Modeling:**
|
| 1497 |
+
- Model potential organizational impact of comprehensive {topic} implementation
|
| 1498 |
+
- Analyze competitive advantages created through {topic} leadership excellence
|
| 1499 |
+
- Project long-term organizational benefits and cultural transformation outcomes
|
| 1500 |
+
- Design approaches for measuring and communicating {topic} value creation
|
| 1501 |
+
|
| 1502 |
+
**๐ Thought Leadership & Knowledge Contribution:**
|
| 1503 |
+
- Develop original insights and frameworks from {topic} implementation experience
|
| 1504 |
+
- Create knowledge products (articles, presentations, training materials) for others
|
| 1505 |
+
- Design research approaches for validating {topic} innovation effectiveness
|
| 1506 |
+
- Plan for contributing to {topic} leadership knowledge and best practices
|
| 1507 |
+
|
| 1508 |
+
### ๐ฎ Capstone Gamification Elements
|
| 1509 |
+
|
| 1510 |
+
**๐ฒ Master Challenge Cards:** Your capstone must address 3 randomly selected challenge cards:
|
| 1511 |
+
|
| 1512 |
+
*Challenge Card Examples:*
|
| 1513 |
+
- **Resource Constraint:** Implement with 40% less budget than initially planned
|
| 1514 |
+
- **Accelerated Timeline:** Achieve results in half the expected timeframe
|
| 1515 |
+
- **Cultural Resistance:** Overcome significant organizational skepticism about {topic}
|
| 1516 |
+
- **Remote Implementation:** Execute strategy with 75% remote workforce
|
| 1517 |
+
- **Leadership Transition:** Implement during major organizational leadership changes
|
| 1518 |
+
- **Crisis Context:** Deploy {topic} strategy during organizational crisis or major change
|
| 1519 |
+
|
| 1520 |
+
**๐
Mastery Achievement Levels:**
|
| 1521 |
+
|
| 1522 |
+
**๐ฅ Capstone Completion:**
|
| 1523 |
+
- Addresses all project requirements with competent execution
|
| 1524 |
+
- Demonstrates solid understanding of course concepts
|
| 1525 |
+
- Shows practical application capability
|
| 1526 |
+
|
| 1527 |
+
**๐ฅ Strategic Integration:**
|
| 1528 |
+
- Seamlessly integrates concepts from all {num_units} units
|
| 1529 |
+
- Demonstrates advanced strategic thinking and planning
|
| 1530 |
+
- Shows innovative problem-solving and adaptation
|
| 1531 |
+
|
| 1532 |
+
**๐ฅ Leadership Excellence:**
|
| 1533 |
+
- Creates breakthrough value for organization and others
|
| 1534 |
+
- Demonstrates thought leadership and original insights
|
| 1535 |
+
- Shows capability to develop {topic} mastery in others
|
| 1536 |
+
|
| 1537 |
+
**๐ Master Practitioner:**
|
| 1538 |
+
- Achieves measurable organizational transformation through {topic}
|
| 1539 |
+
- Contributes new knowledge and frameworks to {topic} field
|
| 1540 |
+
- Demonstrates capability to lead {topic} transformation at scale
|
| 1541 |
+
|
| 1542 |
+
### โ
Capstone Assessment Tracks
|
| 1543 |
+
|
| 1544 |
+
**๐โโ๏ธ Executive Impact Track (90 minutes)**
|
| 1545 |
+
- Strategic summary with implementation roadmap
|
| 1546 |
+
- Executive presentation with business case
|
| 1547 |
+
- Focus on practical results and organizational value
|
| 1548 |
+
|
| 1549 |
+
**๐ฎ Complete Transformation Track (3 hours)**
|
| 1550 |
+
- Full project addressing all phases and requirements
|
| 1551 |
+
- Comprehensive analysis, strategy, and implementation planning
|
| 1552 |
+
- Detailed innovation and leadership development components
|
| 1553 |
+
|
| 1554 |
+
**๐ Master Leadership Track (5 hours)**
|
| 1555 |
+
- All transformation elements PLUS
|
| 1556 |
+
- Original research and framework development
|
| 1557 |
+
- Thought leadership contribution and knowledge creation
|
| 1558 |
+
- Advanced organizational development and culture change strategy
|
| 1559 |
+
|
| 1560 |
+
---
|
| 1561 |
+
|
| 1562 |
+
## ๐ COURSE COMPLETION & MASTER CERTIFICATION
|
| 1563 |
+
|
| 1564 |
+
### ๐ Complete Course Mastery Verification
|
| 1565 |
+
|
| 1566 |
+
**Learning Objective Achievement Across {num_units} Units:**
|
| 1567 |
+
โ
Complete spectrum {topic} framework mastery demonstrated
|
| 1568 |
+
โ
Sophisticated methodology application across all contexts proven
|
| 1569 |
+
โ
Systemic analysis and intervention design capabilities verified
|
| 1570 |
+
โ
Innovation and novel solution creation documented
|
| 1571 |
+
โ
Comprehensive leadership development abilities confirmed
|
| 1572 |
+
โ
Long-term impact evaluation and strategy evolution planned
|
| 1573 |
+
|
| 1574 |
+
### ๐ Course Master Achievement Badges
|
| 1575 |
+
|
| 1576 |
+
**๐ {topic} Course Graduate:** Completed all {num_units} units and {total_lessons} lessons with demonstrated understanding
|
| 1577 |
+
**๐ฏ {topic} Strategic Leader:** Showed advanced integration and strategic application across organizational contexts
|
| 1578 |
+
**๐ {topic} Innovation Master:** Demonstrated creative problem-solving and breakthrough solution development
|
| 1579 |
+
**๐ {topic} Transformation Leader:** Achieved capstone excellence with organizational impact and leadership development
|
| 1580 |
+
**๐ {topic} Master Practitioner:** Recognized for thought leadership contribution and exceptional mastery demonstration
|
| 1581 |
+
|
| 1582 |
+
### ๐ Course Impact Assessment
|
| 1583 |
+
|
| 1584 |
+
**Pre-Course {topic} Confidence:** ___ (1-10)
|
| 1585 |
+
**Post-Course {topic} Confidence:** ___ (1-10)
|
| 1586 |
+
**Total Mastery Growth:** +___ points
|
| 1587 |
+
|
| 1588 |
+
**Most Transformative Unit:** Which of the {num_units} units created the biggest breakthrough in your {topic} understanding?
|
| 1589 |
+
|
| 1590 |
+
**Greatest Innovation:** What's your most original insight or solution developed during this course?
|
| 1591 |
+
|
| 1592 |
+
**Implementation Commitment:** What major {topic} initiative will you launch within 30 days of course completion?
|
| 1593 |
+
|
| 1594 |
+
**Legacy Vision:** How will you use your {topic} mastery to develop others and contribute to the field?
|
| 1595 |
+
|
| 1596 |
+
---
|
| 1597 |
+
|
| 1598 |
+
## ๐ Post-Course Development & Mastery Continuation
|
| 1599 |
+
|
| 1600 |
+
### ๐ฏ Immediate Implementation (Week 1-2)
|
| 1601 |
+
1. **Launch Capstone Strategy:** Begin implementing your comprehensive {topic} transformation plan
|
| 1602 |
+
2. **Share Course Insights:** Present key learnings to your leadership team and organization
|
| 1603 |
+
3. **Begin Daily Practice:** Implement advanced {topic} behaviors and approaches consistently
|
| 1604 |
+
4. **Establish Measurement:** Set up systems for tracking {topic} implementation effectiveness
|
| 1605 |
+
|
| 1606 |
+
### ๐ Continued Mastery Development (Month 1-3)
|
| 1607 |
+
1. **Advanced Research Integration:** Explore cutting-edge {topic} research and integrate with course learning
|
| 1608 |
+
2. **Peer Learning Network:** Connect with other {topic} leaders for continued learning and collaboration
|
| 1609 |
+
3. **Organizational Coaching:** Begin developing {topic} capabilities in direct reports and colleagues
|
| 1610 |
+
4. **Innovation Laboratory:** Experiment with novel {topic} approaches and document results
|
| 1611 |
+
|
| 1612 |
+
### ๐ Thought Leadership & Contribution (Quarter 1-2)
|
| 1613 |
+
1. **Knowledge Sharing:** Present at conferences or publish articles on {topic} innovations
|
| 1614 |
+
2. **Organizational Transformation:** Lead major {topic} initiatives with measurable impact
|
| 1615 |
+
3. **Leadership Development:** Mentor others in {topic} mastery and create development programs
|
| 1616 |
+
4. **Field Contribution:** Contribute to {topic} best practices and advancement of the field
|
| 1617 |
+
|
| 1618 |
+
### ๐ Master Practitioner Evolution (Year 1+)
|
| 1619 |
+
1. **Organizational Excellence:** Achieve recognized excellence in {topic} leadership within your organization
|
| 1620 |
+
2. **Industry Recognition:** Gain recognition as a {topic} thought leader and expert practitioner
|
| 1621 |
+
3. **Knowledge Creation:** Develop proprietary frameworks and methodologies in {topic}
|
| 1622 |
+
4. **Legacy Building:** Create lasting impact through {topic} transformation and leadership development
|
| 1623 |
+
|
| 1624 |
+
---
|
| 1625 |
+
|
| 1626 |
+
## ๐ Complete Course Resource Library
|
| 1627 |
+
|
| 1628 |
+
### ๐ Corpus Content Utilized
|
| 1629 |
+
**Total Relevant Documents:** {analysis['total_documents']} from your leadership knowledge base
|
| 1630 |
+
**Content Quality Distribution:**
|
| 1631 |
+
- Excellent Relevance: {analysis['quality_breakdown']['excellent']} documents
|
| 1632 |
+
- High Relevance: {analysis['quality_breakdown']['high']} documents
|
| 1633 |
+
- Medium Relevance: {analysis['quality_breakdown']['medium']} documents
|
| 1634 |
+
|
| 1635 |
+
**Top Source Topics from Your Corpus:**
|
| 1636 |
+
"""
|
| 1637 |
+
|
| 1638 |
+
# Add top source topics from corpus analysis
|
| 1639 |
+
source_topics = set()
|
| 1640 |
+
for sample in analysis['content_samples'][:10]:
|
| 1641 |
+
source_topics.add(sample['source_topic'])
|
| 1642 |
+
|
| 1643 |
+
for topic_source in list(source_topics)[:5]:
|
| 1644 |
+
course += f"- {topic_source}\n"
|
| 1645 |
+
|
| 1646 |
+
course += f"""
|
| 1647 |
+
|
| 1648 |
+
### ๐ค Enhanced Research Integration
|
| 1649 |
+
**AI Enhancement Coverage:** {100-corpus_pct:.1f}% research-based content additions
|
| 1650 |
+
**Academic References Integrated:** {len(enhancement['references'])} research sources
|
| 1651 |
+
**Knowledge Gaps Addressed:** Advanced frameworks, cutting-edge research, implementation methodologies
|
| 1652 |
+
|
| 1653 |
+
**Key Research Areas Enhanced:**
|
| 1654 |
+
"""
|
| 1655 |
+
|
| 1656 |
+
for ref in enhancement['references'][:5]:
|
| 1657 |
+
course += f"- {ref}\n"
|
| 1658 |
+
|
| 1659 |
+
course += f"""
|
| 1660 |
+
|
| 1661 |
+
### ๐ฎ Complete Gamification Suite Summary
|
| 1662 |
+
**Total Gamified Activities:** {total_lessons * 3}+ across all lessons
|
| 1663 |
+
**Interactive Scenarios:** {num_units * 5}+ comprehensive leadership challenges
|
| 1664 |
+
**Assessment Options:** Speed/Quest/Mastery tracks for every lesson and unit
|
| 1665 |
+
**Achievement System:** {total_lessons + num_units + 5} total badges available
|
| 1666 |
+
**Capstone Challenges:** Multi-dimensional assessment with real-world application
|
| 1667 |
+
|
| 1668 |
+
### ๐ Quality Assurance Verification
|
| 1669 |
+
โ
**Corpus Integration:** {corpus_pct:.1f}% evidence-based content from your leadership knowledge
|
| 1670 |
+
โ
**Research Enhancement:** Academic validation and advanced framework integration
|
| 1671 |
+
โ
**Practical Application:** Every lesson includes immediate real-world application
|
| 1672 |
+
โ
**Progressive Mastery:** Clear learning progression from foundation to advanced mastery
|
| 1673 |
+
โ
**Leadership Development:** Comprehensive capability building for developing others
|
| 1674 |
+
โ
**Organizational Impact:** Focus on measurable results and transformation
|
| 1675 |
+
|
| 1676 |
+
---
|
| 1677 |
+
|
| 1678 |
+
## ๐ CONGRATULATIONS - MASTER PRACTITIONER STATUS ACHIEVED!
|
| 1679 |
+
|
| 1680 |
+
**You have completed the most comprehensive {topic} leadership development experience available, combining:**
|
| 1681 |
+
|
| 1682 |
+
๐ง **Evidence-Based Learning:** {corpus_pct:.1f}% corpus content + {100-corpus_pct:.1f}% research enhancement
|
| 1683 |
+
๐ **Complete Curriculum:** {num_units} units, {total_lessons} lessons, comprehensive capstone project
|
| 1684 |
+
๐ฎ **Full Gamification:** {total_lessons * 3}+ interactive activities with complete assessment system
|
| 1685 |
+
๐ค **Socratic Development:** Deep critical thinking and reflection integrated throughout
|
| 1686 |
+
๐ **Practical Application:** Immediate implementation with measurable organizational impact
|
| 1687 |
+
๐ฅ **Leadership Capability:** Advanced skills for developing {topic} mastery in others
|
| 1688 |
+
|
| 1689 |
+
**You are now equipped to:**
|
| 1690 |
+
- Lead {topic} transformation at organizational scale
|
| 1691 |
+
- Develop {topic} leadership capabilities in others
|
| 1692 |
+
- Contribute original insights and innovations to the {topic} field
|
| 1693 |
+
- Achieve sustained competitive advantage through {topic} excellence
|
| 1694 |
+
|
| 1695 |
+
**Welcome to the community of {topic} Master Practitioners. Your journey of impact and contribution begins now.**
|
| 1696 |
+
|
| 1697 |
+
---
|
| 1698 |
+
|
| 1699 |
+
*Generated by Intelligent Course Generator | Corpus Coverage: {corpus_pct:.1f}% | Course Standard: {course_info['confidence']} Confidence | Master Level Achievement โ
*
|
| 1700 |
"""
|
| 1701 |
|
| 1702 |
+
return course
|
| 1703 |
|
| 1704 |
+
# Enhanced Gradio Interface with Level Selection
|
| 1705 |
+
def create_comprehensive_interface():
|
| 1706 |
|
| 1707 |
with gr.Blocks(title="๐ง Intelligent Course Generator", theme=gr.themes.Soft()) as interface:
|
| 1708 |
|
| 1709 |
gr.HTML("""
|
| 1710 |
+
<div style='text-align: center; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 15px; margin-bottom: 20px;'>
|
| 1711 |
<h1>๐ง Intelligent Course Generator</h1>
|
| 1712 |
+
<p><strong>Analyzes your corpus โ Identifies buildable topics โ Generates complete content with level selection</strong></p>
|
| 1713 |
+
<p>โจ <em>Real topics, not placeholders. Complete gamification, not summaries.</em> โจ</p>
|
| 1714 |
</div>
|
| 1715 |
""")
|
| 1716 |
|
|
|
|
| 1718 |
|
| 1719 |
# Content Analysis Tab
|
| 1720 |
with gr.TabItem("๐ Content Analysis"):
|
| 1721 |
+
gr.HTML("<h3>๐ Step 1: Analyze What You Can Build</h3>")
|
| 1722 |
+
gr.HTML("<p>Enter a topic area to discover what real leadership topics exist in your corpus and what can be built at each level.</p>")
|
| 1723 |
|
| 1724 |
with gr.Row():
|
| 1725 |
analysis_input = gr.Textbox(
|
| 1726 |
label="๐ Search Term",
|
| 1727 |
+
placeholder="Enter topic area (e.g., 'communication', 'leadership', 'conflict', 'strategy')",
|
| 1728 |
lines=1
|
| 1729 |
)
|
| 1730 |
+
analyze_btn = gr.Button("๐ Analyze Content", variant="primary", size="lg")
|
| 1731 |
+
|
| 1732 |
+
analysis_output = gr.Markdown(label="๐ Analysis Results", height=600)
|
| 1733 |
+
|
| 1734 |
+
gr.HTML("""
|
| 1735 |
+
<div style='margin-top: 15px; padding: 10px; background-color: #f8f9fa; border-radius: 8px; border-left: 4px solid #28a745;'>
|
| 1736 |
+
<strong>๐ก Pro Tip:</strong> This analysis shows you exactly what topics exist in your corpus and what can be built at each level (micro-lesson, unit, course). Use specific topics from the results for generation.
|
| 1737 |
+
</div>
|
| 1738 |
+
""")
|
| 1739 |
|
|
|
|
| 1740 |
analyze_btn.click(generate_content_analysis_interface, analysis_input, analysis_output)
|
| 1741 |
|
| 1742 |
+
# Content Generator Tab
|
| 1743 |
+
with gr.TabItem("๐ฏ Content Generator"):
|
| 1744 |
+
gr.HTML("<h3>๐ Step 2: Generate Complete Content</h3>")
|
| 1745 |
+
gr.HTML("<p>Select your topic and generation level to create complete content with full gamification, Socratic questioning, and assessment options.</p>")
|
| 1746 |
|
| 1747 |
with gr.Row():
|
| 1748 |
+
with gr.Column(scale=2):
|
| 1749 |
+
topic_input = gr.Textbox(
|
| 1750 |
+
label="๐ฏ Specific Topic",
|
| 1751 |
+
placeholder="Enter exact topic from analysis (e.g., 'Strategic Communication Leadership')",
|
| 1752 |
+
lines=1
|
| 1753 |
+
)
|
| 1754 |
+
with gr.Column(scale=1):
|
| 1755 |
+
level_selector = gr.Dropdown(
|
| 1756 |
+
label="๐ Generation Level",
|
| 1757 |
+
choices=[
|
| 1758 |
+
("๐ Micro-Lesson (5-8 min)", "micro_lesson"),
|
| 1759 |
+
("๐ Complete Unit (45-60 min)", "unit"),
|
| 1760 |
+
("๐ Full Course (3-5 hours)", "course")
|
| 1761 |
+
],
|
| 1762 |
+
value="micro_lesson",
|
| 1763 |
+
interactive=True
|
| 1764 |
+
)
|
| 1765 |
+
|
| 1766 |
+
generate_btn = gr.Button("๐ Generate Complete Content", variant="primary", size="lg")
|
| 1767 |
|
| 1768 |
+
content_output = gr.Markdown(label="๐ Generated Content", height=800)
|
| 1769 |
+
|
| 1770 |
+
gr.HTML("""
|
| 1771 |
+
<div style='margin-top: 15px; padding: 10px; background-color: #e3f2fd; border-radius: 8px; border-left: 4px solid #2196f3;'>
|
| 1772 |
+
<strong>๐ฏ Content Features:</strong> Every generation includes complete gamification (scenarios, challenges, assessments), Socratic questioning, achievement badges, and immediate implementation strategies.
|
| 1773 |
+
</div>
|
| 1774 |
+
""")
|
| 1775 |
+
|
| 1776 |
+
generate_btn.click(
|
| 1777 |
+
generate_complete_gamified_content,
|
| 1778 |
+
inputs=[topic_input, level_selector],
|
| 1779 |
+
outputs=content_output
|
| 1780 |
+
)
|
| 1781 |
|
| 1782 |
# Quick Generator Tab
|
| 1783 |
with gr.TabItem("โก Quick Generate"):
|
| 1784 |
+
gr.HTML("<h3>โก Direct Generation (Skip Analysis)</h3>")
|
| 1785 |
+
gr.HTML("<p>Generate content directly without analysis if you already know your topic and level.</p>")
|
| 1786 |
|
| 1787 |
with gr.Row():
|
| 1788 |
+
with gr.Column(scale=2):
|
| 1789 |
+
quick_topic = gr.Textbox(
|
| 1790 |
+
label="๐ฏ Topic",
|
| 1791 |
+
placeholder="Enter any leadership topic",
|
| 1792 |
+
lines=1
|
| 1793 |
+
)
|
| 1794 |
+
with gr.Column(scale=1):
|
| 1795 |
+
quick_level = gr.Dropdown(
|
| 1796 |
+
label="๐ Level",
|
| 1797 |
+
choices=[
|
| 1798 |
+
("๐ Micro-Lesson", "micro_lesson"),
|
| 1799 |
+
("๐ Unit", "unit"),
|
| 1800 |
+
("๐ Course", "course")
|
| 1801 |
+
],
|
| 1802 |
+
value="micro_lesson"
|
| 1803 |
+
)
|
| 1804 |
+
|
| 1805 |
+
quick_generate_btn = gr.Button("โก Generate Now", variant="secondary", size="lg")
|
| 1806 |
+
|
| 1807 |
+
quick_output = gr.Markdown(label="๐ Generated Content", height=800)
|
| 1808 |
|
| 1809 |
+
quick_generate_btn.click(
|
| 1810 |
+
generate_complete_gamified_content,
|
| 1811 |
+
inputs=[quick_topic, quick_level],
|
| 1812 |
+
outputs=quick_output
|
| 1813 |
+
)
|
| 1814 |
|
| 1815 |
gr.HTML("""
|
| 1816 |
+
<div style='margin-top: 30px; padding: 20px; background-color: #f8f9fa; border-radius: 15px; border: 2px solid #e9ecef;'>
|
| 1817 |
+
<h4>๐ How This Complete System Works:</h4>
|
| 1818 |
+
<div style='display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 15px;'>
|
| 1819 |
+
<div>
|
| 1820 |
+
<h5>๐ Content Analysis</h5>
|
| 1821 |
+
<ol>
|
| 1822 |
+
<li><strong>Real Topic Extraction:</strong> Finds actual leadership topics in your corpus</li>
|
| 1823 |
+
<li><strong>Sufficiency Analysis:</strong> Determines what can be built at each level</li>
|
| 1824 |
+
<li><strong>Quality Assessment:</strong> Shows corpus % vs AI enhancement needed</li>
|
| 1825 |
+
<li><strong>Buildability Report:</strong> Recommends optimal generation level</li>
|
| 1826 |
+
</ol>
|
| 1827 |
+
</div>
|
| 1828 |
+
<div>
|
| 1829 |
+
<h5>๐ฏ Content Generation</h5>
|
| 1830 |
+
<ol>
|
| 1831 |
+
<li><strong>Level Selection:</strong> Choose micro-lesson, unit, or course</li>
|
| 1832 |
+
<li><strong>Complete Gamification:</strong> Scenarios, challenges, assessments</li>
|
| 1833 |
+
<li><strong>Socratic Development:</strong> Deep questioning and reflection</li>
|
| 1834 |
+
<li><strong>Achievement System:</strong> Badges and recognition levels</li>
|
| 1835 |
+
</ol>
|
| 1836 |
+
</div>
|
| 1837 |
+
</div>
|
| 1838 |
+
<div style='margin-top: 20px; padding: 15px; background-color: #d1ecf1; border-radius: 10px;'>
|
| 1839 |
+
<p><strong>๐ฏ Result:</strong> Complete, professional-grade content on actual topics from your corpus with full gamification and immediate implementation strategies. No more generic "micro lessons" - real content for real learning!</p>
|
| 1840 |
+
</div>
|
| 1841 |
</div>
|
| 1842 |
""")
|
| 1843 |
|
|
|
|
| 1845 |
|
| 1846 |
# Launch the interface
|
| 1847 |
if __name__ == "__main__":
|
| 1848 |
+
interface = create_comprehensive_interface()
|
| 1849 |
interface.launch(share=True, server_name="0.0.0.0", server_port=7860)
|