File size: 14,514 Bytes
60dece9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Emotion Insight Engine</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.gradient-bg {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.pulse-animation {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
.fade-in {
animation: fadeIn 0.5s ease-in;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.sentiment-bar {
transition: width 0.5s ease-in-out;
}
.waveform {
background: repeating-linear-gradient(90deg, #4f46e5, #4f46e5 2px, transparent 2px, transparent 4px);
animation: wave 1s linear infinite;
}
@keyframes wave {
from { background-position-x: 0; }
to { background-position-x: 4px; }
}
</style>
</head>
<body class="min-h-screen bg-gray-100">
<div class="container mx-auto px-4 py-8">
<!-- Header -->
<header class="gradient-bg text-white rounded-xl shadow-lg mb-8 p-6">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="flex items-center mb-4 md:mb-0">
<i class="fas fa-brain text-3xl mr-3"></i>
<h1 class="text-2xl md:text-3xl font-bold">Emotion Insight Engine</h1>
</div>
<div class="flex space-x-2">
<button id="historyBtn" class="bg-white bg-opacity-20 hover:bg-opacity-30 px-4 py-2 rounded-lg flex items-center">
<i class="fas fa-history mr-2"></i> Session History
</button>
<button id="settingsBtn" class="bg-white bg-opacity-20 hover:bg-opacity-30 px-4 py-2 rounded-lg">
<i class="fas fa-cog"></i>
</button>
</div>
</div>
<p class="mt-4 opacity-90">Analyze text or voice input through multiple cognitive layers to gain emotional insights</p>
</header>
<!-- Main Content -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Input Section -->
<div class="lg:col-span-2 bg-white rounded-xl shadow-lg p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold">Input Analysis</h2>
<div class="flex space-x-2">
<button id="textTab" class="px-4 py-2 bg-indigo-600 text-white rounded-lg">Text</button>
<button id="audioTab" class="px-4 py-2 bg-gray-200 hover:bg-gray-300 rounded-lg">Audio</button>
</div>
</div>
<!-- Text Input -->
<div id="textInputSection" class="mb-6">
<textarea id="inputText" class="w-full h-40 p-4 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="Type or paste your text here..."></textarea>
<div class="flex justify-end mt-2">
<button id="analyzeTextBtn" class="gradient-bg text-white px-6 py-2 rounded-lg hover:opacity-90 flex items-center pulse-animation">
<i class="fas fa-brain mr-2"></i> Analyze Text
</button>
</div>
</div>
<!-- Audio Input -->
<div id="audioInputSection" class="hidden">
<div class="bg-gray-100 p-4 rounded-lg mb-4">
<div class="flex justify-between items-center mb-2">
<span class="font-medium">Voice Recording</span>
<div class="flex space-x-2">
<button id="recordBtn" class="bg-red-500 text-white px-4 py-1 rounded-full flex items-center">
<i class="fas fa-microphone mr-1"></i> Record
</button>
<button id="uploadBtn" class="bg-gray-500 text-white px-4 py-1 rounded-full">
<i class="fas fa-upload mr-1"></i> Upload
</button>
</div>
</div>
<div id="waveform" class="h-12 waveform rounded mb-2"></div>
<div class="text-sm text-gray-600">Click record to start capturing audio</div>
</div>
<div class="flex justify-end">
<button id="analyzeAudioBtn" class="gradient-bg text-white px-6 py-2 rounded-lg hover:opacity-90 flex items-center">
<i class="fas fa-brain mr-2"></i> Analyze Audio
</button>
</div>
</div>
<!-- Processing Animation -->
<div id="processingSection" class="hidden text-center py-8">
<div class="inline-block animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-indigo-600 mb-4"></div>
<p class="text-gray-600">Processing through cognitive layers...</p>
</div>
<!-- Results -->
<div id="resultsSection" class="hidden">
<div class="bg-gray-50 p-4 rounded-lg mb-4">
<h3 class="font-semibold mb-2">Emotion Breakdown</h3>
<div id="emotionBars" class="space-y-3">
<!-- Dynamically generated emotion bars -->
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="bg-gray-50 p-4 rounded-lg">
<h3 class="font-semibold mb-2">Key Sentiments</h3>
<div id="sentimentTags" class="flex flex-wrap gap-2">
<!-- Dynamically generated sentiment tags -->
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<h3 class="font-semibold mb-2">Contextual Analysis</h3>
<div id="contextualAnalysis" class="text-sm">
<!-- Dynamically generated contextual analysis -->
</div>
</div>
</div>
</div>
</div>
<!-- Analysis Layers -->
<div class="bg-white rounded-xl shadow-lg p-6">
<h2 class="text-xl font-semibold mb-4">Cognitive Layers</h2>
<div class="space-y-4">
<div class="layer-card bg-indigo-50 border-l-4 border-indigo-500 p-4 rounded-r-lg">
<div class="flex justify-between items-start">
<div>
<h3 class="font-medium text-indigo-800">Emotion Layer</h3>
<p class="text-sm text-gray-600 mt-1">HuggingFace/Empath sentiment parsing</p>
</div>
<i class="fas fa-heart text-indigo-500 mt-1"></i>
</div>
<div id="emotionLayerStatus" class="text-xs text-gray-500 mt-2">Waiting for input...</div>
</div>
<div class="layer-card bg-purple-50 border-l-4 border-purple-500 p-4 rounded-r-lg">
<div class="flex justify-between items-start">
<div>
<h3 class="font-medium text-purple-800">Meaning Layer</h3>
<p class="text-sm text-gray-600 mt-1">LangChain + Vector memory of prior sessions</p>
</div>
<i class="fas fa-book text-purple-500 mt-1"></i>
</div>
<div id="meaningLayerStatus" class="text-xs text-gray-500 mt-2">Waiting for input...</div>
</div>
<div class="layer-card bg-blue-50 border-l-4 border-blue-500 p-4 rounded-r-lg">
<div class="flex justify-between items-start">
<div>
<h3 class="font-medium text-blue-800">Logic Layer</h3>
<p class="text-sm text-gray-600 mt-1">Symbolic reasoner / Python rule engine</p>
</div>
<i class="fas fa-cogs text-blue-500 mt-1"></i>
</div>
<div id="logicLayerStatus" class="text-xs text-gray-500 mt-2">Waiting for input...</div>
</div>
<div class="layer-card bg-green-50 border-l-4 border-green-500 p-4 rounded-r-lg">
<div class="flex justify-between items-start">
<div>
<h3 class="font-medium text-green-800">Feedback Layer</h3>
<p class="text-sm text-gray-600 mt-1">Human rating + reinforcement learning</p>
</div>
<i class="fas fa-chart-line text-green-500 mt-1"></i>
</div>
<div id="feedbackLayerStatus" class="text-xs text-gray-500 mt-2">Waiting for input...</div>
</div>
<div class="layer-card bg-yellow-50 border-l-4 border-yellow-500 p-4 rounded-r-lg">
<div class="flex justify-between items-start">
<div>
<h3 class="font-medium text-yellow-800">Reflection</h3>
<p class="text-sm text-gray-600 mt-1">Auto-rewriting of internal belief tree</p>
</div>
<i class="fas fa-lightbulb text-yellow-500 mt-1"></i>
</div>
<div id="reflectionLayerStatus" class="text-xs text-gray-500 mt-2">Waiting for input...</div>
</div>
</div>
<div class="mt-6 bg-gray-50 p-4 rounded-lg">
<h3 class="font-semibold mb-2">Memory Context</h3>
<div id="memoryContext" class="text-sm text-gray-600">
No prior session data available
</div>
</div>
</div>
</div>
<!-- Insight Output -->
<div id="insightOutput" class="mt-6 hidden">
<div class="bg-white rounded-xl shadow-lg p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold">Cognitive Insight</h2>
<div class="flex space-x-2">
<button id="rateInsightBtn" class="bg-gray-200 hover:bg-gray-300 px-4 py-2 rounded-lg">
<i class="fas fa-star mr-1"></i> Rate Insight
</button>
</div>
</div>
<div id="insightContent" class="bg-indigo-50 border border-indigo-100 rounded-lg p-4">
<!-- Dynamically generated insight content -->
</div>
</div>
</div>
</div>
<!-- Modals -->
<!-- History Modal -->
<div id="historyModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
<div class="bg-white rounded-xl shadow-xl w-full max-w-2xl max-h-[80vh] overflow-hidden">
<div class="flex justify-between items-center border-b p-4">
<h3 class="text-lg font-semibold">Session History</h3>
<button id="closeHistoryModal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="p-4 overflow-y-auto">
<div id="historyList" class="space-y-3">
<!-- Dynamically generated history items -->
<div class="text-center py-8 text-gray-500">
No history available yet
</div>
</div>
</div>
</div>
</div>
<!-- Settings Modal -->
<div id="settingsModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
<div class="bg-white rounded-xl shadow-xl w-full max-w-md max-h-[80vh] overflow-hidden">
<div class="flex justify-between items-center border-b p-4">
<h3 class="text-lg font-semibold">Settings</h3>
<button id="closeSettingsModal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="p-4 overflow-y-auto">
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Analysis Depth</label>
<select class="w-full p-
<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=MHE-LLC/roe" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |