-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
412 lines (397 loc) · 20.8 KB
/
Copy pathindex.html
File metadata and controls
412 lines (397 loc) · 20.8 KB
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Hallucination & Factuality Detection System | Pratima Kumari</title>
<meta name="description" content="A comprehensive pipeline for detecting, analyzing, and categorizing AI-generated hallucinations with evidence-based verification and factuality scoring.">
<meta name="keywords" content="AI Hallucination Detection, Factuality Evaluation, LLM Evaluation, Error Analysis, AI Quality Assurance, Data Validation">
<meta name="author" content="Pratima Kumari">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🔍</text></svg>">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Navigation -->
<nav id="navbar">
<div class="nav-container">
<a href="#" class="nav-brand">
<div class="nav-logo">
<svg width="28" height="28" viewBox="0 0 28 28" fill="none">
<circle cx="14" cy="14" r="12" stroke="url(#logo-grad)" stroke-width="2"/>
<path d="M9 14l3 3 7-7" stroke="url(#logo-grad)" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
<defs>
<linearGradient id="logo-grad" x1="0" y1="0" x2="28" y2="28">
<stop stop-color="#a855f7"/>
<stop offset="1" stop-color="#22d3ee"/>
</linearGradient>
</defs>
</svg>
</div>
<span class="nav-title">FactCheck<span class="accent">AI</span></span>
</a>
<div class="nav-links">
<a href="#pipeline-section">Pipeline</a>
<a href="#analyzer">Analyzer</a>
<a href="#about">About</a>
</div>
<a href="https://github.com/developerpratima" target="_blank" rel="noopener noreferrer" class="nav-github">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
</svg>
<span>Pratima Kumari</span>
</a>
</div>
</nav>
<!-- Hero Section -->
<section id="hero">
<canvas id="hero-canvas"></canvas>
<div class="hero-glow hero-glow-1"></div>
<div class="hero-glow hero-glow-2"></div>
<div class="hero-content">
<div class="hero-badge">
<span class="badge-dot"></span>
AI Quality Assurance System
</div>
<h1>AI Hallucination &<br><span class="gradient-text">Factuality Detection</span></h1>
<p class="hero-subtitle">A comprehensive pipeline for detecting, analyzing, and categorizing AI-generated hallucinations with evidence-based verification and factuality scoring.</p>
<div class="hero-keywords">
<span class="keyword-tag">Factuality Evaluation</span>
<span class="keyword-tag">Hallucination Detection</span>
<span class="keyword-tag">Error Analysis</span>
<span class="keyword-tag">AI Quality Assurance</span>
<span class="keyword-tag">LLM Evaluation</span>
<span class="keyword-tag">Data Validation</span>
</div>
<div class="hero-actions">
<button class="btn btn-primary" onclick="scrollToSection('analyzer')">
Try the Analyzer
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M3 8h10M9 4l4 4-4 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<button class="btn btn-secondary" onclick="scrollToSection('pipeline-section')">
View Pipeline
</button>
</div>
</div>
</section>
<!-- Pipeline Section -->
<section id="pipeline-section">
<div class="section-container">
<div class="section-header">
<span class="section-label">Architecture</span>
<h2>Detection Pipeline</h2>
<p>Our multi-stage pipeline systematically analyzes AI-generated content for factual accuracy</p>
</div>
<div class="pipeline-flow" id="pipeline-flow">
<div class="pipeline-step" data-step="0">
<div class="step-icon-wrap">
<div class="step-icon">📝</div>
<div class="step-number">01</div>
</div>
<h3>LLM Output</h3>
<p>AI-generated text input for analysis</p>
</div>
<div class="pipeline-connector"><div class="connector-line"></div><div class="connector-arrow">›</div></div>
<div class="pipeline-step" data-step="1">
<div class="step-icon-wrap">
<div class="step-icon">📋</div>
<div class="step-number">02</div>
</div>
<h3>Claim Extraction</h3>
<p>Identify individual factual assertions</p>
</div>
<div class="pipeline-connector"><div class="connector-line"></div><div class="connector-arrow">›</div></div>
<div class="pipeline-step" data-step="2">
<div class="step-icon-wrap">
<div class="step-icon">🔍</div>
<div class="step-number">03</div>
</div>
<h3>Evidence Verification</h3>
<p>Cross-reference claims against ground truth</p>
</div>
<div class="pipeline-connector"><div class="connector-line"></div><div class="connector-arrow">›</div></div>
<div class="pipeline-step" data-step="3">
<div class="step-icon-wrap">
<div class="step-icon">📊</div>
<div class="step-number">04</div>
</div>
<h3>Factuality Scoring</h3>
<p>Quantify accuracy with confidence metrics</p>
</div>
<div class="pipeline-connector"><div class="connector-line"></div><div class="connector-arrow">›</div></div>
<div class="pipeline-step" data-step="4">
<div class="step-icon-wrap">
<div class="step-icon">⚠️</div>
<div class="step-number">05</div>
</div>
<h3>Error Categorization</h3>
<p>Classify hallucination types and severity</p>
</div>
<div class="pipeline-connector"><div class="connector-line"></div><div class="connector-arrow">›</div></div>
<div class="pipeline-step" data-step="5">
<div class="step-icon-wrap">
<div class="step-icon">📄</div>
<div class="step-number">06</div>
</div>
<h3>Evaluation Report</h3>
<p>Comprehensive analysis and recommendations</p>
</div>
</div>
</div>
</section>
<!-- Analyzer Section -->
<section id="analyzer">
<div class="section-container">
<div class="section-header">
<span class="section-label">Interactive Demo</span>
<h2>Factuality Analyzer</h2>
<p>Enter AI-generated text and reference information to detect hallucinations</p>
</div>
<div class="example-selector">
<span class="example-label">Load Example:</span>
<button class="example-btn" data-example="0" onclick="loadExample(0)">
<span class="example-icon">🚀</span>
Apollo 11
</button>
<button class="example-btn" data-example="1" onclick="loadExample(1)">
<span class="example-icon">🌍</span>
Climate Science
</button>
<button class="example-btn" data-example="2" onclick="loadExample(2)">
<span class="example-icon">⚡</span>
Tesla & SpaceX
</button>
</div>
<div class="input-panels">
<div class="input-panel">
<div class="panel-header">
<div class="panel-indicator llm">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M8 1l2 3h4l-3 3 1 4-4-2-4 2 1-4-3-3h4l2-3z" fill="currentColor"/>
</svg>
LLM Generated Output
</div>
<span class="char-count" id="llm-count">0 chars</span>
</div>
<textarea id="llm-input" placeholder="Paste the AI-generated text here..." spellcheck="false"></textarea>
</div>
<div class="input-divider">
<div class="divider-icon">VS</div>
</div>
<div class="input-panel">
<div class="panel-header">
<div class="panel-indicator reference">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<rect x="2" y="2" width="12" height="12" rx="2" stroke="currentColor" stroke-width="1.5" fill="none"/>
<path d="M5 6h6M5 8h6M5 10h4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>
Ground Truth / Reference
</div>
<span class="char-count" id="ref-count">0 chars</span>
</div>
<textarea id="reference-input" placeholder="Paste the reference/ground-truth text here..." spellcheck="false"></textarea>
</div>
</div>
<div class="analyze-actions">
<button id="analyze-btn" class="btn btn-primary btn-large" onclick="runAnalysis()">
<span class="btn-content">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
<circle cx="8.5" cy="8.5" r="6" stroke="currentColor" stroke-width="2"/>
<path d="M13 13l4 4" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg>
Analyze for Hallucinations
</span>
<span class="btn-loading hidden">
<div class="spinner"></div>
Analyzing...
</span>
</button>
<button class="btn btn-ghost" onclick="clearInputs()">Clear All</button>
</div>
</div>
</section>
<!-- Progress Section -->
<section id="progress-section" class="hidden">
<div class="section-container">
<div class="progress-header">
<h3>⚙️ Analysis in Progress</h3>
<div class="progress-bar-wrap">
<div class="progress-bar" id="progress-bar"></div>
</div>
<span class="progress-percent" id="progress-percent">0%</span>
</div>
<div class="progress-steps" id="progress-steps"></div>
</div>
</section>
<!-- Results Section -->
<section id="results-section" class="hidden">
<div class="section-container">
<div class="section-header">
<span class="section-label">Analysis Complete</span>
<h2>Detection Results</h2>
</div>
<!-- Score Overview -->
<div class="results-overview" id="results-overview">
<div class="score-card-main">
<canvas id="score-gauge" width="240" height="240"></canvas>
<div class="score-info">
<div class="score-value" id="score-value">0%</div>
<div class="score-label">Factuality Score</div>
<div class="score-verdict" id="score-verdict">—</div>
</div>
</div>
<div class="stats-grid">
<div class="stat-card" id="stat-total">
<div class="stat-icon">📋</div>
<div class="stat-value">0</div>
<div class="stat-label">Total Claims</div>
</div>
<div class="stat-card supported" id="stat-supported">
<div class="stat-icon">✅</div>
<div class="stat-value">0</div>
<div class="stat-label">Supported</div>
</div>
<div class="stat-card unsupported" id="stat-unsupported">
<div class="stat-icon">⚠️</div>
<div class="stat-value">0</div>
<div class="stat-label">Unsupported</div>
</div>
<div class="stat-card contradicted" id="stat-contradicted">
<div class="stat-icon">❌</div>
<div class="stat-value">0</div>
<div class="stat-label">Contradicted / Fabricated</div>
</div>
</div>
</div>
<!-- Claims Table -->
<div class="claims-section">
<h3>📋 Claim-by-Claim Analysis</h3>
<div class="claims-table-wrap">
<table class="claims-table" id="claims-table">
<thead>
<tr>
<th>#</th>
<th>Claim</th>
<th>Status</th>
<th>Confidence</th>
<th>Error Type</th>
<th>Details</th>
</tr>
</thead>
<tbody id="claims-tbody"></tbody>
</table>
</div>
</div>
<!-- Charts -->
<div class="charts-row">
<div class="chart-card">
<h3>Error Distribution</h3>
<canvas id="error-chart" width="450" height="300"></canvas>
</div>
<div class="chart-card">
<h3>Claim Status Breakdown</h3>
<canvas id="status-chart" width="450" height="300"></canvas>
</div>
</div>
<!-- Detailed Report -->
<div class="report-section">
<div class="report-header">
<h3>📄 Evaluation Report</h3>
<button class="btn btn-secondary btn-small" onclick="downloadReport()">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M8 2v8M4 7l4 4 4-4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M2 12h12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg>
Download Report
</button>
</div>
<div class="report-content" id="report-content"></div>
</div>
</div>
</section>
<!-- About Section -->
<section id="about">
<div class="section-container">
<div class="section-header">
<span class="section-label">Methodology</span>
<h2>How It Works</h2>
<p>Advanced NLP techniques power each stage of the detection pipeline</p>
</div>
<div class="about-grid">
<div class="about-card">
<div class="about-icon">🧠</div>
<h3>Claim Extraction</h3>
<p>Natural language processing breaks down AI-generated text into individual factual assertions using sentence tokenization and claim detection heuristics.</p>
</div>
<div class="about-card">
<div class="about-icon">🔗</div>
<h3>Evidence Matching</h3>
<p>Multi-method similarity analysis including Jaccard similarity, weighted term overlap, n-gram matching, and entity comparison for robust verification.</p>
</div>
<div class="about-card">
<div class="about-icon">📐</div>
<h3>Factuality Scoring</h3>
<p>Weighted scoring algorithm considers claim importance, entity accuracy, numerical precision, and semantic alignment with reference sources.</p>
</div>
<div class="about-card">
<div class="about-icon">🏷️</div>
<h3>Error Taxonomy</h3>
<p>Systematic categorization into types: Fabrication, Contradiction, Exaggeration, Misattribution, and Unsupported claims with severity levels.</p>
</div>
<div class="about-card">
<div class="about-icon">📊</div>
<h3>Visual Analytics</h3>
<p>Interactive visualizations including factuality gauges, error distribution charts, and claim-level analysis for comprehensive understanding.</p>
</div>
<div class="about-card">
<div class="about-icon">📋</div>
<h3>Detailed Reports</h3>
<p>Comprehensive evaluation reports with executive summaries, per-claim analysis, severity assessments, and actionable recommendations.</p>
</div>
</div>
<div class="tech-stack">
<h3>Technology & Methodology</h3>
<div class="tech-tags">
<span>NLP Processing</span>
<span>Text Similarity</span>
<span>Named Entity Recognition</span>
<span>Claim Verification</span>
<span>Error Taxonomy</span>
<span>Statistical Scoring</span>
<span>Canvas Visualization</span>
<span>Vanilla JavaScript</span>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer id="footer">
<div class="footer-container">
<div class="footer-brand">
<span class="footer-title">FactCheck<span class="accent">AI</span></span>
<p>AI Hallucination & Factuality Detection System</p>
</div>
<div class="footer-links">
<h4>Quick Links</h4>
<a href="#pipeline-section">Pipeline</a>
<a href="#analyzer">Analyzer</a>
<a href="#about">About</a>
</div>
<div class="footer-author">
<h4>Developer</h4>
<p>Pratima Kumari</p>
<a href="https://github.com/developerpratima" target="_blank" rel="noopener noreferrer">github.com/developerpratima</a>
</div>
</div>
<div class="footer-bottom">
<p>© 2026 Pratima Kumari · AI Hallucination & Factuality Detection System</p>
</div>
</footer>
<script src="pipeline.js"></script>
<script src="app.js"></script>
</body>
</html>