Add 2 files
Browse files- index.html +72 -352
- prompts.txt +2 -1
index.html
CHANGED
|
@@ -39,6 +39,21 @@
|
|
| 39 |
transform: translateY(-2px);
|
| 40 |
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 41 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
</style>
|
| 43 |
</head>
|
| 44 |
<body class="bg-gray-900 text-gray-100">
|
|
@@ -54,6 +69,10 @@
|
|
| 54 |
</div>
|
| 55 |
</div>
|
| 56 |
<div class="flex items-center space-x-2">
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
<button id="refreshBtn" class="bg-gray-700 hover:bg-gray-600 text-white px-4 py-2 rounded-lg flex items-center space-x-2 transition">
|
| 58 |
<i class="fas fa-sync-alt"></i>
|
| 59 |
<span>Refresh Data</span>
|
|
@@ -125,356 +144,57 @@
|
|
| 125 |
</div>
|
| 126 |
</div>
|
| 127 |
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
"
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
"
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
},
|
| 182 |
-
{
|
| 183 |
-
title: "Mental health interventions",
|
| 184 |
-
code: "HORIZON-HLTH-2023-STAYHLTH-01-02",
|
| 185 |
-
deadline: "05.05.2023",
|
| 186 |
-
budget: "€35 million"
|
| 187 |
-
}
|
| 188 |
-
]
|
| 189 |
-
}
|
| 190 |
-
};
|
| 191 |
-
|
| 192 |
-
// DOM elements
|
| 193 |
-
const chatContainer = document.getElementById('chatContainer');
|
| 194 |
-
const userInput = document.getElementById('userInput');
|
| 195 |
-
const sendBtn = document.getElementById('sendBtn');
|
| 196 |
-
const uploadBtn = document.getElementById('uploadBtn');
|
| 197 |
-
const uploadSection = document.getElementById('uploadSection');
|
| 198 |
-
const fileInput = document.getElementById('fileInput');
|
| 199 |
-
const fileName = document.getElementById('fileName');
|
| 200 |
-
const cancelUpload = document.getElementById('cancelUpload');
|
| 201 |
-
const submitUpload = document.getElementById('submitUpload');
|
| 202 |
-
const exampleBtns = document.querySelectorAll('.example-btn');
|
| 203 |
-
const refreshBtn = document.getElementById('refreshBtn');
|
| 204 |
-
const updateTime = document.getElementById('updateTime');
|
| 205 |
-
|
| 206 |
-
// Update last refreshed time
|
| 207 |
-
function updateRefreshTime() {
|
| 208 |
-
const now = new Date();
|
| 209 |
-
updateTime.textContent = now.toLocaleString();
|
| 210 |
-
}
|
| 211 |
-
|
| 212 |
-
// Initialize
|
| 213 |
-
updateRefreshTime();
|
| 214 |
-
|
| 215 |
-
// Add message to chat
|
| 216 |
-
function addMessage(sender, message, isBot = false, calls = null) {
|
| 217 |
-
const messageDiv = document.createElement('div');
|
| 218 |
-
messageDiv.className = `flex ${isBot ? 'justify-start' : 'justify-end'}`;
|
| 219 |
-
|
| 220 |
-
const contentDiv = document.createElement('div');
|
| 221 |
-
contentDiv.className = `max-w-3/4 rounded-lg p-4 ${isBot ? 'bg-gray-700' : 'bg-blue-600'}`;
|
| 222 |
-
|
| 223 |
-
if (isBot) {
|
| 224 |
-
const senderDiv = document.createElement('p');
|
| 225 |
-
senderDiv.className = 'font-medium text-blue-400';
|
| 226 |
-
senderDiv.textContent = sender;
|
| 227 |
-
contentDiv.appendChild(senderDiv);
|
| 228 |
-
}
|
| 229 |
-
|
| 230 |
-
const messageContent = document.createElement('div');
|
| 231 |
-
|
| 232 |
-
if (typeof message === 'string') {
|
| 233 |
-
messageContent.innerHTML = message.replace(/\n/g, '<br>');
|
| 234 |
-
} else {
|
| 235 |
-
messageContent.appendChild(message);
|
| 236 |
-
}
|
| 237 |
-
|
| 238 |
-
contentDiv.appendChild(messageContent);
|
| 239 |
-
|
| 240 |
-
if (calls) {
|
| 241 |
-
const callsContainer = document.createElement('div');
|
| 242 |
-
callsContainer.className = 'mt-4 space-y-3';
|
| 243 |
-
|
| 244 |
-
calls.forEach(call => {
|
| 245 |
-
const callCard = document.createElement('div');
|
| 246 |
-
callCard.className = 'call-card bg-gray-600 p-4 rounded-lg';
|
| 247 |
-
|
| 248 |
-
if (call.title) {
|
| 249 |
-
const title = document.createElement('h3');
|
| 250 |
-
title.className = 'font-bold text-lg text-blue-300';
|
| 251 |
-
title.textContent = call.title;
|
| 252 |
-
callCard.appendChild(title);
|
| 253 |
-
}
|
| 254 |
-
|
| 255 |
-
if (call.panel) {
|
| 256 |
-
const panel = document.createElement('h3');
|
| 257 |
-
panel.className = 'font-bold text-lg text-blue-300';
|
| 258 |
-
panel.textContent = call.panel;
|
| 259 |
-
callCard.appendChild(panel);
|
| 260 |
-
}
|
| 261 |
-
|
| 262 |
-
const details = document.createElement('div');
|
| 263 |
-
details.className = 'mt-2 text-sm';
|
| 264 |
-
|
| 265 |
-
if (call.code) {
|
| 266 |
-
const code = document.createElement('p');
|
| 267 |
-
code.innerHTML = `<span class="font-medium">Code:</span> ${call.code}`;
|
| 268 |
-
details.appendChild(code);
|
| 269 |
-
}
|
| 270 |
-
|
| 271 |
-
if (call.deadline) {
|
| 272 |
-
const deadline = document.createElement('p');
|
| 273 |
-
deadline.innerHTML = `<span class="font-medium">Deadline:</span> ${call.deadline}`;
|
| 274 |
-
details.appendChild(deadline);
|
| 275 |
-
}
|
| 276 |
-
|
| 277 |
-
if (call.budget) {
|
| 278 |
-
const budget = document.createElement('p');
|
| 279 |
-
budget.innerHTML = `<span class="font-medium">Budget:</span> ${call.budget}`;
|
| 280 |
-
details.appendChild(budget);
|
| 281 |
-
}
|
| 282 |
-
|
| 283 |
-
if (call.relevance) {
|
| 284 |
-
const relevance = document.createElement('p');
|
| 285 |
-
relevance.innerHTML = `<span class="font-medium">Relevance:</span> ${call.relevance}`;
|
| 286 |
-
details.appendChild(relevance);
|
| 287 |
-
}
|
| 288 |
-
|
| 289 |
-
if (call.topics) {
|
| 290 |
-
const topics = document.createElement('p');
|
| 291 |
-
topics.innerHTML = `<span class="font-medium">Topics:</span> ${call.topics.join(', ')}`;
|
| 292 |
-
details.appendChild(topics);
|
| 293 |
-
}
|
| 294 |
-
|
| 295 |
-
callCard.appendChild(details);
|
| 296 |
-
callsContainer.appendChild(callCard);
|
| 297 |
-
});
|
| 298 |
-
|
| 299 |
-
contentDiv.appendChild(callsContainer);
|
| 300 |
-
}
|
| 301 |
-
|
| 302 |
-
messageDiv.appendChild(contentDiv);
|
| 303 |
-
chatContainer.appendChild(messageDiv);
|
| 304 |
-
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 305 |
-
}
|
| 306 |
-
|
| 307 |
-
// Show typing indicator
|
| 308 |
-
function showTyping() {
|
| 309 |
-
const typingDiv = document.createElement('div');
|
| 310 |
-
typingDiv.className = 'flex justify-start';
|
| 311 |
-
|
| 312 |
-
const contentDiv = document.createElement('div');
|
| 313 |
-
contentDiv.className = 'bg-gray-700 rounded-lg p-4 max-w-xs';
|
| 314 |
-
|
| 315 |
-
const typingContent = document.createElement('div');
|
| 316 |
-
typingContent.className = 'flex items-center space-x-2';
|
| 317 |
-
|
| 318 |
-
const dots = document.createElement('span');
|
| 319 |
-
dots.className = 'typing-indicator';
|
| 320 |
-
|
| 321 |
-
typingContent.appendChild(document.createTextNode('Academic Project Advisor is typing'));
|
| 322 |
-
typingContent.appendChild(dots);
|
| 323 |
-
|
| 324 |
-
contentDiv.appendChild(typingContent);
|
| 325 |
-
typingDiv.appendChild(contentDiv);
|
| 326 |
-
chatContainer.appendChild(typingDiv);
|
| 327 |
-
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 328 |
-
|
| 329 |
-
return typingDiv;
|
| 330 |
-
}
|
| 331 |
-
|
| 332 |
-
// Hide typing indicator
|
| 333 |
-
function hideTyping(typingDiv) {
|
| 334 |
-
if (typingDiv && typingDiv.parentNode) {
|
| 335 |
-
typingDiv.parentNode.removeChild(typingDiv);
|
| 336 |
-
}
|
| 337 |
-
}
|
| 338 |
-
|
| 339 |
-
// Process user input
|
| 340 |
-
function processUserInput() {
|
| 341 |
-
const message = userInput.value.trim();
|
| 342 |
-
if (!message) return;
|
| 343 |
-
|
| 344 |
-
addMessage('You', message);
|
| 345 |
-
userInput.value = '';
|
| 346 |
-
|
| 347 |
-
const typingDiv = showTyping();
|
| 348 |
-
|
| 349 |
-
// Simulate processing delay
|
| 350 |
-
setTimeout(() => {
|
| 351 |
-
hideTyping(typingDiv);
|
| 352 |
-
|
| 353 |
-
// Simple TF-IDF simulation - find best match
|
| 354 |
-
let bestMatch = null;
|
| 355 |
-
let bestScore = 0;
|
| 356 |
-
|
| 357 |
-
for (const [key, value] of Object.entries(knowledgeBase)) {
|
| 358 |
-
// Simple similarity calculation (in a real app, this would use TF-IDF)
|
| 359 |
-
const words = message.toLowerCase().split(/\s+/);
|
| 360 |
-
const keywords = key.toLowerCase().split(/\s+/);
|
| 361 |
-
const intersection = words.filter(word => keywords.includes(word));
|
| 362 |
-
const score = intersection.length / Math.max(words.length, keywords.length);
|
| 363 |
-
|
| 364 |
-
if (score > bestScore) {
|
| 365 |
-
bestScore = score;
|
| 366 |
-
bestMatch = {key, value};
|
| 367 |
-
}
|
| 368 |
-
}
|
| 369 |
-
|
| 370 |
-
// Threshold for matching
|
| 371 |
-
if (bestScore >= 0.25) {
|
| 372 |
-
const response = bestMatch.value;
|
| 373 |
-
|
| 374 |
-
if (response.calls || response.callCode) {
|
| 375 |
-
addMessage(
|
| 376 |
-
'Academic Project Advisor',
|
| 377 |
-
response.answer,
|
| 378 |
-
true,
|
| 379 |
-
response.calls || [{
|
| 380 |
-
title: response.answer.split(' - ')[0],
|
| 381 |
-
code: response.callCode,
|
| 382 |
-
deadline: response.deadline,
|
| 383 |
-
topics: response.topics
|
| 384 |
-
}]
|
| 385 |
-
);
|
| 386 |
-
} else {
|
| 387 |
-
addMessage('Academic Project Advisor', response.answer, true);
|
| 388 |
-
}
|
| 389 |
-
|
| 390 |
-
// Add standard note
|
| 391 |
-
addMessage(
|
| 392 |
-
'Academic Project Advisor',
|
| 393 |
-
'If you upload an updated CV or project documents, I can provide more personalized recommendations.',
|
| 394 |
-
true
|
| 395 |
-
);
|
| 396 |
-
} else {
|
| 397 |
-
addMessage(
|
| 398 |
-
'Academic Project Advisor',
|
| 399 |
-
'I couldn\'t find a perfect match for your query. Could you please provide more details about your research area, career stage, or specific funding program you\'re interested in?',
|
| 400 |
-
true
|
| 401 |
-
);
|
| 402 |
-
}
|
| 403 |
-
}, 1500);
|
| 404 |
-
}
|
| 405 |
-
|
| 406 |
-
// Event listeners
|
| 407 |
-
sendBtn.addEventListener('click', processUserInput);
|
| 408 |
-
userInput.addEventListener('keypress', (e) => {
|
| 409 |
-
if (e.key === 'Enter') processUserInput();
|
| 410 |
-
});
|
| 411 |
-
|
| 412 |
-
uploadBtn.addEventListener('click', () => {
|
| 413 |
-
uploadSection.classList.toggle('hidden');
|
| 414 |
-
});
|
| 415 |
-
|
| 416 |
-
fileInput.addEventListener('change', (e) => {
|
| 417 |
-
if (e.target.files.length > 0) {
|
| 418 |
-
fileName.textContent = e.target.files[0].name;
|
| 419 |
-
submitUpload.disabled = false;
|
| 420 |
-
} else {
|
| 421 |
-
fileName.textContent = '';
|
| 422 |
-
submitUpload.disabled = true;
|
| 423 |
-
}
|
| 424 |
-
});
|
| 425 |
-
|
| 426 |
-
cancelUpload.addEventListener('click', () => {
|
| 427 |
-
uploadSection.classList.add('hidden');
|
| 428 |
-
fileInput.value = '';
|
| 429 |
-
fileName.textContent = '';
|
| 430 |
-
submitUpload.disabled = true;
|
| 431 |
-
});
|
| 432 |
-
|
| 433 |
-
submitUpload.addEventListener('click', () => {
|
| 434 |
-
if (fileInput.files.length > 0) {
|
| 435 |
-
const typingDiv = showTyping();
|
| 436 |
-
|
| 437 |
-
// Simulate file processing
|
| 438 |
-
setTimeout(() => {
|
| 439 |
-
hideTyping(typingDiv);
|
| 440 |
-
|
| 441 |
-
addMessage(
|
| 442 |
-
'Academic Project Advisor',
|
| 443 |
-
'Thank you for uploading your document. I have processed it and will now be able to provide more tailored recommendations for funding opportunities.',
|
| 444 |
-
true
|
| 445 |
-
);
|
| 446 |
-
|
| 447 |
-
uploadSection.classList.add('hidden');
|
| 448 |
-
fileInput.value = '';
|
| 449 |
-
fileName.textContent = '';
|
| 450 |
-
submitUpload.disabled = true;
|
| 451 |
-
}, 3000);
|
| 452 |
-
}
|
| 453 |
-
});
|
| 454 |
-
|
| 455 |
-
// Example buttons
|
| 456 |
-
exampleBtns.forEach(btn => {
|
| 457 |
-
btn.addEventListener('click', () => {
|
| 458 |
-
userInput.value = btn.textContent.trim();
|
| 459 |
-
processUserInput();
|
| 460 |
-
});
|
| 461 |
-
});
|
| 462 |
-
|
| 463 |
-
// Refresh button
|
| 464 |
-
refreshBtn.addEventListener('click', () => {
|
| 465 |
-
const typingDiv = showTyping();
|
| 466 |
-
|
| 467 |
-
// Simulate refresh
|
| 468 |
-
setTimeout(() => {
|
| 469 |
-
hideTyping(typingDiv);
|
| 470 |
-
updateRefreshTime();
|
| 471 |
-
addMessage(
|
| 472 |
-
'Academic Project Advisor',
|
| 473 |
-
'Knowledge base has been refreshed with the latest funding calls and project data.',
|
| 474 |
-
true
|
| 475 |
-
);
|
| 476 |
-
}, 2000);
|
| 477 |
-
});
|
| 478 |
-
</script>
|
| 479 |
-
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Dragon09/academic" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 480 |
</html>
|
|
|
|
| 39 |
transform: translateY(-2px);
|
| 40 |
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 41 |
}
|
| 42 |
+
.modal {
|
| 43 |
+
transition: opacity 0.3s ease, transform 0.3s ease;
|
| 44 |
+
}
|
| 45 |
+
.modal-content {
|
| 46 |
+
max-height: calc(100vh - 100px);
|
| 47 |
+
}
|
| 48 |
+
.data-table {
|
| 49 |
+
font-family: monospace;
|
| 50 |
+
}
|
| 51 |
+
.data-table th {
|
| 52 |
+
text-align: left;
|
| 53 |
+
position: sticky;
|
| 54 |
+
top: 0;
|
| 55 |
+
background-color: #1f2937;
|
| 56 |
+
}
|
| 57 |
</style>
|
| 58 |
</head>
|
| 59 |
<body class="bg-gray-900 text-gray-100">
|
|
|
|
| 69 |
</div>
|
| 70 |
</div>
|
| 71 |
<div class="flex items-center space-x-2">
|
| 72 |
+
<button id="dataBtn" class="bg-gray-700 hover:bg-gray-600 text-white px-4 py-2 rounded-lg flex items-center space-x-2 transition">
|
| 73 |
+
<i class="fas fa-database"></i>
|
| 74 |
+
<span>Check Data</span>
|
| 75 |
+
</button>
|
| 76 |
<button id="refreshBtn" class="bg-gray-700 hover:bg-gray-600 text-white px-4 py-2 rounded-lg flex items-center space-x-2 transition">
|
| 77 |
<i class="fas fa-sync-alt"></i>
|
| 78 |
<span>Refresh Data</span>
|
|
|
|
| 144 |
</div>
|
| 145 |
</div>
|
| 146 |
|
| 147 |
+
<!-- Data Inspection Modal -->
|
| 148 |
+
<div id="dataModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50 opacity-0 pointer-events-none modal">
|
| 149 |
+
<div class="bg-gray-800 rounded-xl shadow-2xl w-full max-w-5xl modal-content overflow-hidden">
|
| 150 |
+
<div class="flex items-center justify-between p-4 border-b border-gray-700">
|
| 151 |
+
<h3 class="text-xl font-bold">Knowledge Base Inspection</h3>
|
| 152 |
+
<button id="closeModal" class="text-gray-400 hover:text-gray-300">
|
| 153 |
+
<i class="fas fa-times text-xl"></i>
|
| 154 |
+
</button>
|
| 155 |
+
</div>
|
| 156 |
+
<div class="p-4 overflow-auto">
|
| 157 |
+
<div class="mb-4">
|
| 158 |
+
<div class="flex items-center space-x-4 mb-4">
|
| 159 |
+
<div class="flex-1">
|
| 160 |
+
<label class="block text-sm font-medium mb-1">Search Knowledge Base</label>
|
| 161 |
+
<input type="text" id="dataSearch" placeholder="Filter questions or answers..." class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2">
|
| 162 |
+
</div>
|
| 163 |
+
<div>
|
| 164 |
+
<label class="block text-sm font-medium mb-1">Data Type</label>
|
| 165 |
+
<select id="dataType" class="bg-gray-700 border border-gray-600 rounded-lg px-4 py-2">
|
| 166 |
+
<option value="all">All Data</option>
|
| 167 |
+
<option value="questions">Questions Only</option>
|
| 168 |
+
<option value="answers">Answers Only</option>
|
| 169 |
+
<option value="calls">Funding Calls</option>
|
| 170 |
+
</select>
|
| 171 |
+
</div>
|
| 172 |
+
</div>
|
| 173 |
+
<div class="bg-gray-700 rounded-lg p-4">
|
| 174 |
+
<div class="flex justify-between items-center mb-2">
|
| 175 |
+
<span class="text-sm font-medium">Knowledge Base Statistics</span>
|
| 176 |
+
<span class="text-xs bg-blue-600 px-2 py-1 rounded">Simulated Data</span>
|
| 177 |
+
</div>
|
| 178 |
+
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 text-center">
|
| 179 |
+
<div class="bg-gray-800 p-3 rounded-lg">
|
| 180 |
+
<div class="text-sm text-gray-400">Total Entries</div>
|
| 181 |
+
<div class="text-xl font-bold" id="totalEntries">24</div>
|
| 182 |
+
</div>
|
| 183 |
+
<div class="bg-gray-800 p-3 rounded-lg">
|
| 184 |
+
<div class="text-sm text-gray-400">ERC Calls</div>
|
| 185 |
+
<div class="text-xl font-bold" id="ercCalls">5</div>
|
| 186 |
+
</div>
|
| 187 |
+
<div class="bg-gray-800 p-3 rounded-lg">
|
| 188 |
+
<div class="text-sm text-gray-400">Horizon Calls</div>
|
| 189 |
+
<div class="text-xl font-bold" id="horizonCalls">12</div>
|
| 190 |
+
</div>
|
| 191 |
+
<div class="bg-gray-800 p-3 rounded-lg">
|
| 192 |
+
<div class="text-sm text-gray-400">Other Calls</div>
|
| 193 |
+
<div class="text-xl font-bold" id="otherCalls">7</div>
|
| 194 |
+
</div>
|
| 195 |
+
</div>
|
| 196 |
+
</div>
|
| 197 |
+
</div>
|
| 198 |
+
<div class="overflow-auto">
|
| 199 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
</html>
|
prompts.txt
CHANGED
|
@@ -1 +1,2 @@
|
|
| 1 |
-
You are “Academic Project Advisor Bot” – an expert assistant that helps faculty members decide which European research funding calls (ERC, Horizon Europe, COST, etc.) fit their CV and ideas. Data you can use Project catalog file: 🔄 /project_dataset/project.csv Columns: • question (text) – typical user enquiry or project title • answer (text) – reference answer / call description • topics, callCodes, fundingScheme … (strings) – extra context Mentoring dialogues file: 🔄 /project_dataset/demo_sohbet_fikirden_sinerji.csv Alternating rows (even=row 0,2,4…) are user questions, odd rows are advisor answers. Horizon calls list file: 🔄 /project_dataset/horizon_projects_dataset.csv Same columns as (1). How to build your internal knowledge base A. Read each CSV once at start-up, combine all text columns into a single array “corpus”. B. Create an in-memory TF–IDF vector index of corpus (max 5 000 terms, English + Turkish stop words). C. Build a dict “qa_pairs” from (1) and (2): key = question, value = answer. How to formulate a reply Transform the incoming user message with the TF–IDF vectoriser, compute cosine similarity against the corpus. If max-similarity ≥ 0.25 → a. If the most-similar text exists as a key in qa_pairs ⇒ return that answer verbatim. b. Else compose a short paragraph: • summarise the closest funding call (title, code, deadline if present). • mention why it matches the user’s query (field, TRL, role). If max-similarity < 0.25 ⇒ politely ask for clarification. Always add one bullet point at the end: “If you upload an updated CV or CSV I will retrain myself automatically.” Style rules • Language: respond in the language the user wrote. • Tone: concise, friendly, authoritative, no hallucinated facts. • Never reveal raw embeddings or TF–IDF weights. Auto-refresh logic Every 6 hours the agent must: ① scan folder 🔄 /project_dataset/new_data/ for *.csv files, ② if present, append them to corpus + qa_pairs, ③ rebuild the TF–IDF matrix in memory, ④ move processed files to 🔄 /project_dataset/new_data/archived/ with timestamp suffix, ⑤ log the action to update_log.txt. Reject policy If the user requests disallowed content or personal data about real individuals, respond with: “Sorry, I can’t help with that.” ──────────────────────────────────────────────────────── USER-PROMPT (what normal end-users will type) ──────────────────────────────────────────────────────── User messages can be free-form. Examples the system must handle: • “ERC Consolidator için uygun muyum?” • “Show me open Cluster-6 calls on alternative proteins.” • “We have an interdisciplinary idea on AI ethics – suggest suitable Synergy panels.” • “retrain” → should trigger manual refresh of the knowledge base immediately.
|
|
|
|
|
|
| 1 |
+
You are “Academic Project Advisor Bot” – an expert assistant that helps faculty members decide which European research funding calls (ERC, Horizon Europe, COST, etc.) fit their CV and ideas. Data you can use Project catalog file: 🔄 /project_dataset/project.csv Columns: • question (text) – typical user enquiry or project title • answer (text) – reference answer / call description • topics, callCodes, fundingScheme … (strings) – extra context Mentoring dialogues file: 🔄 /project_dataset/demo_sohbet_fikirden_sinerji.csv Alternating rows (even=row 0,2,4…) are user questions, odd rows are advisor answers. Horizon calls list file: 🔄 /project_dataset/horizon_projects_dataset.csv Same columns as (1). How to build your internal knowledge base A. Read each CSV once at start-up, combine all text columns into a single array “corpus”. B. Create an in-memory TF–IDF vector index of corpus (max 5 000 terms, English + Turkish stop words). C. Build a dict “qa_pairs” from (1) and (2): key = question, value = answer. How to formulate a reply Transform the incoming user message with the TF–IDF vectoriser, compute cosine similarity against the corpus. If max-similarity ≥ 0.25 → a. If the most-similar text exists as a key in qa_pairs ⇒ return that answer verbatim. b. Else compose a short paragraph: • summarise the closest funding call (title, code, deadline if present). • mention why it matches the user’s query (field, TRL, role). If max-similarity < 0.25 ⇒ politely ask for clarification. Always add one bullet point at the end: “If you upload an updated CV or CSV I will retrain myself automatically.” Style rules • Language: respond in the language the user wrote. • Tone: concise, friendly, authoritative, no hallucinated facts. • Never reveal raw embeddings or TF–IDF weights. Auto-refresh logic Every 6 hours the agent must: ① scan folder 🔄 /project_dataset/new_data/ for *.csv files, ② if present, append them to corpus + qa_pairs, ③ rebuild the TF–IDF matrix in memory, ④ move processed files to 🔄 /project_dataset/new_data/archived/ with timestamp suffix, ⑤ log the action to update_log.txt. Reject policy If the user requests disallowed content or personal data about real individuals, respond with: “Sorry, I can’t help with that.” ──────────────────────────────────────────────────────── USER-PROMPT (what normal end-users will type) ──────────────────────────────────────────────────────── User messages can be free-form. Examples the system must handle: • “ERC Consolidator için uygun muyum?” • “Show me open Cluster-6 calls on alternative proteins.” • “We have an interdisciplinary idea on AI ethics – suggest suitable Synergy panels.” • “retrain” → should trigger manual refresh of the knowledge base immediately.
|
| 2 |
+
I need to check my data
|