bat-6 commited on
Commit
046dbd4
·
1 Parent(s): c10ffc0
src/recommendation_engine/chatbot_engine.py CHANGED
@@ -1225,21 +1225,33 @@ Choose what you want:
1225
 
1226
  if state.get("waiting_for_domain"):
1227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1228
  detected = extract_domain(user_input)
1229
 
1230
  if detected:
1231
-
1232
  state["waiting_for_domain"] = False
1233
-
1234
  analysis["domain"] = detected
1235
  analysis["intent"] = "idea"
1236
-
1237
- # Prevent treating the domain name as a weak project title
1238
  if "project_title" in analysis:
1239
  del analysis["project_title"]
1240
-
1241
  else:
1242
-
1243
  return (
1244
  "⚠️ Please enter a valid domain "
1245
  "(AI, healthcare, fintech...)"
 
1225
 
1226
  if state.get("waiting_for_domain"):
1227
 
1228
+ text_lower = user_input.lower().strip()
1229
+ question_words = ["what", "tell", "how", "list", "show", "can you", "help", "domain"]
1230
+ is_question = any(q in text_lower for q in question_words) or "?" in text_lower
1231
+
1232
+ if is_question and "other" not in text_lower:
1233
+ # Answer conversational question directly via LLM
1234
+ prompt = build_chat_prompt(state)
1235
+ full_prompt = (
1236
+ f"{prompt}\n\n"
1237
+ f"User History:\n{history_text}\n\n"
1238
+ f"User Input: {user_input}\n\n"
1239
+ "AI Assistant:"
1240
+ )
1241
+ response = generate_text(full_prompt, task="chat")
1242
+
1243
+ save_user_memory(user_id, {"history": history, "state": state})
1244
+ return finalize_response(user_input, response, history, state, user_id)
1245
+
1246
  detected = extract_domain(user_input)
1247
 
1248
  if detected:
 
1249
  state["waiting_for_domain"] = False
 
1250
  analysis["domain"] = detected
1251
  analysis["intent"] = "idea"
 
 
1252
  if "project_title" in analysis:
1253
  del analysis["project_title"]
 
1254
  else:
 
1255
  return (
1256
  "⚠️ Please enter a valid domain "
1257
  "(AI, healthcare, fintech...)"
src/recommendation_engine/idea_generator.py CHANGED
@@ -151,7 +151,7 @@ def generate_ideas(
151
 
152
  skip_dataset_similar = False
153
  for data_title in list(DATA_TITLES)[:500]:
154
- if compare_two_ideas(idea, data_title) >= 0.85:
155
  logger.info(f"[SKIP DATASET SIMILAR] {idea}")
156
  skip_dataset_similar = True
157
  break
 
151
 
152
  skip_dataset_similar = False
153
  for data_title in list(DATA_TITLES)[:500]:
154
+ if compare_two_ideas(idea, data_title) >= 0.40:
155
  logger.info(f"[SKIP DATASET SIMILAR] {idea}")
156
  skip_dataset_similar = True
157
  break
src/recommendation_engine/prompt_builder.py CHANGED
@@ -112,7 +112,8 @@ def build_idea_prompt(
112
  You are a senior AI innovation consultant.
113
 
114
  TASK:
115
- Generate {count} unique and high-quality graduation project ideas.
 
116
 
117
  DOMAIN:
118
  {domain}
@@ -121,24 +122,17 @@ PREVIOUS IDEAS:
121
  {list_to_text(previous_ideas, 20)}
122
 
123
  IMPORTANT REQUIREMENTS:
124
- - Ideas must solve REAL problems
125
- - Ideas must be practical and implementable
126
- - Prefer AI, automation, or intelligent systems
127
- - Avoid generic software projects
128
- - Avoid repeated themes or workflows
129
- - Each idea must represent a DIFFERENT concept
130
- - Encourage domain diversity and creativity
131
- - Prefer modern technologies and impactful use-cases
132
 
133
  STRICT RULES:
134
- - No repeated concepts
135
- - No semantic duplicates
136
- - No slight rewording
137
- - Avoid overused ideas like:
138
- prediction systems,
139
- recommendation systems,
140
- management systems,
141
- analytics dashboards
142
 
143
  FORMAT RULES:
144
  - One idea per line
@@ -148,17 +142,16 @@ FORMAT RULES:
148
  - Prefer 4–12 words
149
 
150
  GOOD IDEA EXAMPLES:
151
- - Smart traffic congestion prediction using drones
152
- - AI-powered emergency sign language translator
153
- - Blockchain-secured medical image sharing
154
- - Computer vision livestock health monitoring
155
- - Adaptive learning assistant for dyslexic students
156
 
157
  BAD IDEA EXAMPLES:
158
  - AI management system
159
  - Smart dashboard platform
 
160
  - Recommendation application
161
- - Analytics website
162
 
163
  OUTPUT:
164
  """.strip()
 
112
  You are a senior AI innovation consultant.
113
 
114
  TASK:
115
+ Generate {count} HIGHLY ORIGINAL (85%+ Novelty) and unique graduation project ideas.
116
+ The ideas MUST NOT be variants of existing common student projects.
117
 
118
  DOMAIN:
119
  {domain}
 
122
  {list_to_text(previous_ideas, 20)}
123
 
124
  IMPORTANT REQUIREMENTS:
125
+ - Ideas must possess HIGH ORIGINALITY. Do not suggest anything that resembles typical final-year student projects.
126
+ - Ideas must solve REAL problems using cutting-edge, novel approaches.
127
+ - Avoid generic software projects or standard web/mobile applications.
128
+ - Ideas must be practical and implementable.
129
+ - Prefer deep AI integrations (LLMs, Computer Vision, specialized ML models), advanced automation, or intelligent systems.
130
+ - Each idea must represent a COMPLETELY DIFFERENT concept.
 
 
131
 
132
  STRICT RULES:
133
+ - No repeated concepts or slight rewording.
134
+ - Avoid overused ideas like: standard prediction models, generic recommendation engines, basic management dashboards, IoT plant watering, face recognition attendance, or smart traffic lights.
135
+ - Push the boundaries of the selected domain to ensure maximum uniqueness.
 
 
 
 
 
136
 
137
  FORMAT RULES:
138
  - One idea per line
 
142
  - Prefer 4–12 words
143
 
144
  GOOD IDEA EXAMPLES:
145
+ - Smart traffic congestion prediction using drone-swarm analytics
146
+ - AI-powered emergency sign language translator with continuous learning
147
+ - Blockchain-secured federated learning for medical image sharing
148
+ - Adaptive AI-driven learning assistant for dyslexic students
 
149
 
150
  BAD IDEA EXAMPLES:
151
  - AI management system
152
  - Smart dashboard platform
153
+ - Disease prediction using machine learning
154
  - Recommendation application
 
155
 
156
  OUTPUT:
157
  """.strip()