sqibhe commited on
Commit
bcf1f93
·
verified ·
1 Parent(s): be8223e

Add 2 files

Browse files
Files changed (2) hide show
  1. index.html +697 -87
  2. prompts.txt +2 -1
index.html CHANGED
@@ -3,7 +3,7 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>AI Content Analyzer & Humanizer</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
  <style>
@@ -56,13 +56,94 @@
56
  transform: translateY(-2px);
57
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
58
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  </style>
60
  </head>
61
  <body class="min-h-screen bg-gray-50 p-4">
62
  <div class="max-w-6xl mx-auto">
63
  <div class="text-center mb-8">
64
- <h1 class="text-3xl font-bold text-gray-800 mb-2">AI Content Analyzer & Humanizer</h1>
65
- <p class="text-gray-600">Analyze your AI-generated content and transform it into natural human-like text</p>
66
  </div>
67
 
68
  <!-- Tabs -->
@@ -116,33 +197,172 @@
116
  </div>
117
 
118
  <div id="analysisResults" class="hidden">
119
- <div class="mb-6">
120
- <h3 class="font-semibold text-gray-700 mb-2">AI Detection Score</h3>
121
- <div class="flex items-center mb-1">
122
- <div class="w-full progress-bar">
123
- <div id="aiScoreBar" class="progress-fill bg-red-500" style="width: 0%"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  </div>
125
- <span id="aiScoreText" class="ml-3 font-bold text-gray-700">0%</span>
126
  </div>
127
- <p class="text-sm text-gray-500">Higher score indicates more detectable AI patterns</p>
128
  </div>
129
 
 
130
  <div class="mb-6">
131
- <h3 class="font-semibold text-gray-700 mb-2">Human Likeness Score</h3>
132
- <div class="flex items-center mb-1">
133
- <div class="w-full progress-bar">
134
- <div id="humanScoreBar" class="progress-fill bg-green-500" style="width: 0%"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  </div>
136
- <span id="humanScoreText" class="ml-3 font-bold text-gray-700">0%</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  </div>
138
- <p class="text-sm text-gray-500">Higher score indicates more human-like qualities</p>
139
  </div>
140
 
 
141
  <div class="mb-4">
142
- <h3 class="font-semibold text-gray-700 mb-2">Key Findings</h3>
143
- <ul id="keyFindings" class="list-disc pl-5 space-y-1 text-gray-600">
 
 
144
  <!-- Findings will be added here -->
145
- </ul>
 
 
 
 
 
 
 
 
 
 
146
  </div>
147
 
148
  <div class="mt-6 pt-4 border-t border-gray-200">
@@ -174,6 +394,26 @@
174
  <div id="humanizerWordCount" class="word-count">0 words</div>
175
  </div>
176
  <div class="px-4 pb-4">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  <button
178
  id="humanizeBtn"
179
  class="w-full humanizer-bg hover:opacity-90 text-white font-bold py-3 px-6 rounded-lg shadow-lg transform transition-all duration-200 hover:scale-[1.01] focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50">
@@ -197,11 +437,16 @@
197
  readonly></textarea>
198
  <div id="outputWordCount" class="word-count">0 words</div>
199
  </div>
200
- <div class="px-4 pb-4">
201
  <button
202
  id="copyBtn"
203
- class="w-full bg-gray-700 hover:bg-gray-800 text-white font-bold py-3 px-6 rounded-lg shadow-lg transform transition-all duration-200 hover:scale-[1.01] focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-opacity-50">
204
- <i class="fas fa-copy mr-2"></i> Copy to Clipboard
 
 
 
 
 
205
  </button>
206
  </div>
207
  </div>
@@ -214,7 +459,7 @@
214
  <div class="pulse">
215
  <i class="fas fa-spinner fa-spin mr-2"></i>
216
  </div>
217
- <span>Analyzing content...</span>
218
  </div>
219
  </div>
220
 
@@ -223,7 +468,7 @@
223
  <div class="pulse">
224
  <i class="fas fa-spinner fa-spin mr-2"></i>
225
  </div>
226
- <span>Humanizing content...</span>
227
  </div>
228
  </div>
229
 
@@ -246,6 +491,7 @@
246
  const proceedToHumanizeBtn = document.getElementById('proceedToHumanizeBtn');
247
  const humanizeBtn = document.getElementById('humanizeBtn');
248
  const copyBtn = document.getElementById('copyBtn');
 
249
  const analyzerLoading = document.getElementById('analyzerLoading');
250
  const humanizerLoading = document.getElementById('humanizerLoading');
251
  const errorMessage = document.getElementById('errorMessage');
@@ -259,10 +505,26 @@
259
  const humanScoreBar = document.getElementById('humanScoreBar');
260
  const humanScoreText = document.getElementById('humanScoreText');
261
  const keyFindings = document.getElementById('keyFindings');
 
 
262
  const analyzerTab = document.getElementById('analyzerTab');
263
  const humanizerTab = document.getElementById('humanizerTab');
264
  const analyzerPanel = document.getElementById('analyzerPanel');
265
  const humanizerPanel = document.getElementById('humanizerPanel');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
 
267
  // Tab Switching
268
  analyzerTab.addEventListener('click', function() {
@@ -312,8 +574,8 @@
312
  analyzeBtn.classList.add('opacity-75');
313
 
314
  try {
315
- // Simulate API call
316
- const analysis = await simulateAnalysisApiCall(inputText);
317
 
318
  // Display results
319
  displayAnalysisResults(analysis);
@@ -341,6 +603,8 @@
341
  // Humanize button click handler
342
  humanizeBtn.addEventListener('click', async function() {
343
  const inputText = humanizerInput.value.trim();
 
 
344
 
345
  if (!inputText) {
346
  showError("Please enter some text to humanize.");
@@ -354,8 +618,8 @@
354
  humanizeBtn.classList.add('opacity-75');
355
 
356
  try {
357
- // Simulate API call
358
- const humanizedText = await simulateHumanizeApiCall(inputText);
359
 
360
  humanOutput.value = humanizedText;
361
 
@@ -393,6 +657,19 @@
393
  }
394
  });
395
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  // Function to display analysis results
397
  function displayAnalysisResults(analysis) {
398
  analysisPlaceholder.classList.add('hidden');
@@ -404,46 +681,230 @@
404
  humanScoreBar.style.width = `${analysis.humanScore}%`;
405
  aiScoreText.textContent = `${analysis.aiScore}%`;
406
  humanScoreText.textContent = `${analysis.humanScore}%`;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
407
  }, 100);
408
 
409
  // Add key findings
410
  keyFindings.innerHTML = '';
411
  analysis.findings.forEach(finding => {
412
- const li = document.createElement('li');
413
- li.textContent = finding;
414
- keyFindings.appendChild(li);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  });
416
  }
417
 
418
- // Function to simulate analysis API call
419
- async function simulateAnalysisApiCall(text) {
420
  // Simulate network delay
421
- await new Promise(resolve => setTimeout(resolve, 1500));
422
 
423
- // Calculate some fake metrics based on text characteristics
424
  const wordCount = text.split(/\s+/).length;
425
  const sentenceCount = text.split(/[.!?]+/).filter(s => s.trim().length > 0).length;
426
  const avgSentenceLength = wordCount / sentenceCount;
427
- const aiKeywords = ['artificial intelligence', 'machine learning', 'algorithm', 'neural network', 'AI model'];
 
 
428
 
429
  // Calculate AI score (0-100)
430
  let aiScore = 0;
 
 
 
431
 
432
- // Score based on AI keywords
433
  aiKeywords.forEach(keyword => {
434
- if (text.toLowerCase().includes(keyword)) {
435
- aiScore += 15;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
436
  }
437
  });
438
 
439
- // Score based on sentence length variation
440
- if (avgSentenceLength > 18 || avgSentenceLength < 8) {
441
- aiScore += 20;
 
 
 
 
442
  }
443
 
444
- // Score based on certain patterns
445
- if (text.includes("However,") || text.includes("Furthermore,") || text.includes("Moreover,")) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  aiScore += 15;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
447
  }
448
 
449
  // Cap at 100
@@ -452,62 +913,211 @@
452
  // Human score is inverse of AI score with some randomness
453
  const humanScore = Math.min(100, Math.max(0, 100 - aiScore + (Math.random() * 20 - 10)));
454
 
455
- // Generate findings
456
- const findings = [];
457
-
458
- if (aiScore > 70) {
459
- findings.push("Highly likely to be AI-generated content");
460
- findings.push("Contains multiple AI-related keywords");
461
- findings.push("Sentence structure shows repetitive patterns");
462
- } else if (aiScore > 40) {
463
- findings.push("Likely contains some AI-generated elements");
464
- findings.push("Some sentences show unnatural patterns");
465
- findings.push("Could benefit from more human-like variations");
466
- } else {
467
- findings.push("Content appears mostly human-like");
468
- findings.push("Few detectable AI patterns found");
 
 
 
 
 
 
 
 
 
 
 
 
 
469
  }
470
 
471
- if (avgSentenceLength > 20) {
472
- findings.push("Some sentences are unusually long");
 
 
 
 
473
  }
474
 
475
- if (text.split(/[.!?]+/).length < 3 && wordCount > 50) {
476
- findings.push("Low sentence variation detected");
 
 
 
 
477
  }
478
 
479
  return {
480
  aiScore: Math.round(aiScore),
481
  humanScore: Math.round(humanScore),
482
- findings: findings
 
 
 
 
 
 
 
 
483
  };
484
  }
485
 
486
- // Function to simulate humanize API call
487
- async function simulateHumanizeApiCall(text) {
488
  // Simulate network delay
489
- await new Promise(resolve => setTimeout(resolve, 1500));
490
-
491
- // This is where you would normally make the actual API call to your proxy
492
- return text.replace(/AI|artificial intelligence/gi, match =>
493
- match.toLowerCase() === 'ai' ? 'human intelligence' : 'natural human thinking'
494
- )
495
- .replace(/\bhowever\b/gi, 'but')
496
- .replace(/\bfurthermore\b/gi, 'also')
497
- .replace(/\bmoreover\b/gi, 'what\'s more')
498
- .replace(/\bthus\b/gi, 'so')
499
- .replace(/\bhence\b/gi, 'that\'s why')
500
- .replace(/\bnevertheless\b/gi, 'still')
501
- .replace(/\bconsequently\b/gi, 'as a result')
502
- .replace(/\bin conclusion\b/gi, 'to wrap things up')
503
- .replace(/\badditionally\b/gi, 'on top of that')
504
- .replace(/\butilize\b/gi, 'use')
505
- .replace(/\bcommence\b/gi, 'start')
506
- .replace(/\bterminate\b/gi, 'end')
507
- .replace(/\boptimal\b/gi, 'best')
508
- .replace(/\bendeavor\b/gi, 'try')
509
- .replace(/\bascertain\b/gi, 'find out')
510
- .replace(/\bameliorate\b/gi, 'improve');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  }
512
 
513
  function showError(message) {
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Advanced AI Content Analyzer & Humanizer</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
  <style>
 
56
  transform: translateY(-2px);
57
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
58
  }
59
+ .metric-card {
60
+ transition: all 0.3s ease;
61
+ }
62
+ .metric-card:hover {
63
+ transform: translateY(-3px);
64
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
65
+ }
66
+ .highlight-ai {
67
+ background-color: rgba(255, 0, 0, 0.1);
68
+ border-bottom: 2px dashed red;
69
+ }
70
+ .highlight-human {
71
+ background-color: rgba(0, 255, 0, 0.1);
72
+ border-bottom: 2px dashed green;
73
+ }
74
+ .highlight-neutral {
75
+ background-color: rgba(255, 255, 0, 0.1);
76
+ border-bottom: 2px dashed orange;
77
+ }
78
+ .analysis-tag {
79
+ display: inline-block;
80
+ padding: 2px 8px;
81
+ border-radius: 12px;
82
+ font-size: 0.75rem;
83
+ font-weight: 600;
84
+ margin-right: 4px;
85
+ margin-bottom: 4px;
86
+ }
87
+ .tag-ai {
88
+ background-color: #fee2e2;
89
+ color: #b91c1c;
90
+ }
91
+ .tag-human {
92
+ background-color: #dcfce7;
93
+ color: #166534;
94
+ }
95
+ .tag-neutral {
96
+ background-color: #fef3c7;
97
+ color: #92400e;
98
+ }
99
+ .tag-warning {
100
+ background-color: #fef3c7;
101
+ color: #92400e;
102
+ }
103
+ .tag-danger {
104
+ background-color: #fee2e2;
105
+ color: #b91c1c;
106
+ }
107
+ .tag-success {
108
+ background-color: #dcfce7;
109
+ color: #166534;
110
+ }
111
+ .sentence-complexity {
112
+ height: 4px;
113
+ border-radius: 2px;
114
+ margin-top: 2px;
115
+ }
116
+ .tooltip {
117
+ position: relative;
118
+ display: inline-block;
119
+ }
120
+ .tooltip .tooltiptext {
121
+ visibility: hidden;
122
+ width: 200px;
123
+ background-color: #555;
124
+ color: #fff;
125
+ text-align: center;
126
+ border-radius: 6px;
127
+ padding: 5px;
128
+ position: absolute;
129
+ z-index: 1;
130
+ bottom: 125%;
131
+ left: 50%;
132
+ margin-left: -100px;
133
+ opacity: 0;
134
+ transition: opacity 0.3s;
135
+ }
136
+ .tooltip:hover .tooltiptext {
137
+ visibility: visible;
138
+ opacity: 1;
139
+ }
140
  </style>
141
  </head>
142
  <body class="min-h-screen bg-gray-50 p-4">
143
  <div class="max-w-6xl mx-auto">
144
  <div class="text-center mb-8">
145
+ <h1 class="text-3xl font-bold text-gray-800 mb-2">Advanced AI Content Analyzer & Humanizer</h1>
146
+ <p class="text-gray-600">Comprehensive analysis of AI-generated content with detailed metrics and humanization</p>
147
  </div>
148
 
149
  <!-- Tabs -->
 
197
  </div>
198
 
199
  <div id="analysisResults" class="hidden">
200
+ <!-- Overall Scores -->
201
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
202
+ <div class="metric-card bg-white p-4 rounded-lg border border-gray-200 shadow-sm">
203
+ <h3 class="font-semibold text-gray-700 mb-2 flex items-center">
204
+ <i class="fas fa-robot text-red-500 mr-2"></i> AI Detection Score
205
+ </h3>
206
+ <div class="flex items-center mb-1">
207
+ <div class="w-full progress-bar">
208
+ <div id="aiScoreBar" class="progress-fill bg-red-500" style="width: 0%"></div>
209
+ </div>
210
+ <span id="aiScoreText" class="ml-3 font-bold text-gray-700">0%</span>
211
+ </div>
212
+ <p class="text-sm text-gray-500">Higher score indicates more detectable AI patterns</p>
213
+ </div>
214
+
215
+ <div class="metric-card bg-white p-4 rounded-lg border border-gray-200 shadow-sm">
216
+ <h3 class="font-semibold text-gray-700 mb-2 flex items-center">
217
+ <i class="fas fa-user text-green-500 mr-2"></i> Human Likeness Score
218
+ </h3>
219
+ <div class="flex items-center mb-1">
220
+ <div class="w-full progress-bar">
221
+ <div id="humanScoreBar" class="progress-fill bg-green-500" style="width: 0%"></div>
222
+ </div>
223
+ <span id="humanScoreText" class="ml-3 font-bold text-gray-700">0%</span>
224
  </div>
225
+ <p class="text-sm text-gray-500">Higher score indicates more human-like qualities</p>
226
  </div>
 
227
  </div>
228
 
229
+ <!-- Detailed Metrics -->
230
  <div class="mb-6">
231
+ <h3 class="font-semibold text-gray-700 mb-3 flex items-center">
232
+ <i class="fas fa-tachometer-alt text-blue-500 mr-2"></i> Detailed Metrics
233
+ </h3>
234
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
235
+ <div class="metric-card bg-white p-3 rounded-lg border border-gray-200 shadow-sm">
236
+ <div class="flex justify-between items-start">
237
+ <div>
238
+ <h4 class="text-sm font-medium text-gray-600">Perplexity Score</h4>
239
+ <p id="perplexityScore" class="text-lg font-bold">--</p>
240
+ </div>
241
+ <div class="tooltip">
242
+ <i class="fas fa-info-circle text-gray-400"></i>
243
+ <span class="tooltiptext">Measures unpredictability of word choices. Higher values are more human-like.</span>
244
+ </div>
245
+ </div>
246
+ <div class="progress-bar mt-2">
247
+ <div id="perplexityBar" class="progress-fill bg-blue-500" style="width: 0%"></div>
248
+ </div>
249
+ </div>
250
+
251
+ <div class="metric-card bg-white p-3 rounded-lg border border-gray-200 shadow-sm">
252
+ <div class="flex justify-between items-start">
253
+ <div>
254
+ <h4 class="text-sm font-medium text-gray-600">Burstiness Score</h4>
255
+ <p id="burstinessScore" class="text-lg font-bold">--</p>
256
+ </div>
257
+ <div class="tooltip">
258
+ <i class="fas fa-info-circle text-gray-400"></i>
259
+ <span class="tooltiptext">Measures variation in sentence structure. Higher values are more human-like.</span>
260
+ </div>
261
+ </div>
262
+ <div class="progress-bar mt-2">
263
+ <div id="burstinessBar" class="progress-fill bg-purple-500" style="width: 0%"></div>
264
+ </div>
265
+ </div>
266
+
267
+ <div class="metric-card bg-white p-3 rounded-lg border border-gray-200 shadow-sm">
268
+ <div class="flex justify-between items-start">
269
+ <div>
270
+ <h4 class="text-sm font-medium text-gray-600">Formality Index</h4>
271
+ <p id="formalityScore" class="text-lg font-bold">--</p>
272
+ </div>
273
+ <div class="tooltip">
274
+ <i class="fas fa-info-circle text-gray-400"></i>
275
+ <span class="tooltiptext">Measures use of formal language. Higher values may indicate AI.</span>
276
+ </div>
277
+ </div>
278
+ <div class="progress-bar mt-2">
279
+ <div id="formalityBar" class="progress-fill bg-yellow-500" style="width: 0%"></div>
280
+ </div>
281
+ </div>
282
+
283
+ <div class="metric-card bg-white p-3 rounded-lg border border-gray-200 shadow-sm">
284
+ <div class="flex justify-between items-start">
285
+ <div>
286
+ <h4 class="text-sm font-medium text-gray-600">Passive Voice</h4>
287
+ <p id="passiveScore" class="text-lg font-bold">--</p>
288
+ </div>
289
+ <div class="tooltip">
290
+ <i class="fas fa-info-circle text-gray-400"></i>
291
+ <span class="tooltiptext">Percentage of passive voice constructions. Higher values may indicate AI.</span>
292
+ </div>
293
+ </div>
294
+ <div class="progress-bar mt-2">
295
+ <div id="passiveBar" class="progress-fill bg-orange-500" style="width: 0%"></div>
296
+ </div>
297
  </div>
298
+
299
+ <div class="metric-card bg-white p-3 rounded-lg border border-gray-200 shadow-sm">
300
+ <div class="flex justify-between items-start">
301
+ <div>
302
+ <h4 class="text-sm font-medium text-gray-600">Sentence Variation</h4>
303
+ <p id="sentenceVarScore" class="text-lg font-bold">--</p>
304
+ </div>
305
+ <div class="tooltip">
306
+ <i class="fas fa-info-circle text-gray-400"></i>
307
+ <span class="tooltiptext">Measures diversity in sentence length and structure. Higher is better.</span>
308
+ </div>
309
+ </div>
310
+ <div class="progress-bar mt-2">
311
+ <div id="sentenceVarBar" class="progress-fill bg-teal-500" style="width: 0%"></div>
312
+ </div>
313
+ </div>
314
+
315
+ <div class="metric-card bg-white p-3 rounded-lg border border-gray-200 shadow-sm">
316
+ <div class="flex justify-between items-start">
317
+ <div>
318
+ <h4 class="text-sm font-medium text-gray-600">Personalization</h4>
319
+ <p id="personalScore" class="text-lg font-bold">--</p>
320
+ </div>
321
+ <div class="tooltip">
322
+ <i class="fas fa-info-circle text-gray-400"></i>
323
+ <span class="tooltiptext">Measures use of personal pronouns and anecdotes. Higher is better.</span>
324
+ </div>
325
+ </div>
326
+ <div class="progress-bar mt-2">
327
+ <div id="personalBar" class="progress-fill bg-pink-500" style="width: 0%"></div>
328
+ </div>
329
+ </div>
330
+ </div>
331
+ </div>
332
+
333
+ <!-- Text Analysis -->
334
+ <div class="mb-6">
335
+ <h3 class="font-semibold text-gray-700 mb-3 flex items-center">
336
+ <i class="fas fa-search text-blue-500 mr-2"></i> Text Analysis
337
+ </h3>
338
+ <div class="bg-gray-50 p-4 rounded-lg border border-gray-200 max-h-60 overflow-y-auto">
339
+ <div id="analyzedText" class="whitespace-pre-wrap"></div>
340
+ </div>
341
+ <div class="mt-2 flex flex-wrap">
342
+ <span class="text-xs mr-3"><span class="inline-block w-3 h-3 bg-red-100 border border-red-300 mr-1"></span> AI-like patterns</span>
343
+ <span class="text-xs mr-3"><span class="inline-block w-3 h-3 bg-green-100 border border-green-300 mr-1"></span> Human-like patterns</span>
344
+ <span class="text-xs"><span class="inline-block w-3 h-3 bg-yellow-100 border border-yellow-300 mr-1"></span> Neutral/Uncertain</span>
345
  </div>
 
346
  </div>
347
 
348
+ <!-- Key Findings -->
349
  <div class="mb-4">
350
+ <h3 class="font-semibold text-gray-700 mb-3 flex items-center">
351
+ <i class="fas fa-lightbulb text-blue-500 mr-2"></i> Key Findings
352
+ </h3>
353
+ <div id="keyFindings" class="space-y-2">
354
  <!-- Findings will be added here -->
355
+ </div>
356
+ </div>
357
+
358
+ <!-- Common AI Patterns Found -->
359
+ <div class="mb-4">
360
+ <h3 class="font-semibold text-gray-700 mb-2 flex items-center">
361
+ <i class="fas fa-exclamation-triangle text-orange-500 mr-2"></i> Common AI Patterns Detected
362
+ </h3>
363
+ <div id="aiPatterns" class="flex flex-wrap">
364
+ <!-- Patterns will be added here -->
365
+ </div>
366
  </div>
367
 
368
  <div class="mt-6 pt-4 border-t border-gray-200">
 
394
  <div id="humanizerWordCount" class="word-count">0 words</div>
395
  </div>
396
  <div class="px-4 pb-4">
397
+ <div class="grid grid-cols-2 gap-3 mb-3">
398
+ <div>
399
+ <label class="block text-sm font-medium text-gray-700 mb-1">Humanization Level</label>
400
+ <select id="humanizeLevel" class="w-full border border-gray-300 rounded-md py-2 px-3 focus:outline-none focus:ring-2 focus:ring-purple-500">
401
+ <option value="light">Light (subtle changes)</option>
402
+ <option value="medium" selected>Medium (balanced)</option>
403
+ <option value="heavy">Heavy (complete rewrite)</option>
404
+ </select>
405
+ </div>
406
+ <div>
407
+ <label class="block text-sm font-medium text-gray-700 mb-1">Target Tone</label>
408
+ <select id="targetTone" class="w-full border border-gray-300 rounded-md py-2 px-3 focus:outline-none focus:ring-2 focus:ring-purple-500">
409
+ <option value="neutral">Neutral</option>
410
+ <option value="casual">Casual</option>
411
+ <option value="professional">Professional</option>
412
+ <option value="friendly">Friendly</option>
413
+ <option value="academic">Academic</option>
414
+ </select>
415
+ </div>
416
+ </div>
417
  <button
418
  id="humanizeBtn"
419
  class="w-full humanizer-bg hover:opacity-90 text-white font-bold py-3 px-6 rounded-lg shadow-lg transform transition-all duration-200 hover:scale-[1.01] focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50">
 
437
  readonly></textarea>
438
  <div id="outputWordCount" class="word-count">0 words</div>
439
  </div>
440
+ <div class="px-4 pb-4 grid grid-cols-2 gap-3">
441
  <button
442
  id="copyBtn"
443
+ class="bg-gray-700 hover:bg-gray-800 text-white font-bold py-3 px-6 rounded-lg shadow-lg transform transition-all duration-200 hover:scale-[1.01] focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-opacity-50">
444
+ <i class="fas fa-copy mr-2"></i> Copy
445
+ </button>
446
+ <button
447
+ id="analyzeAgainBtn"
448
+ class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg shadow-lg transform transition-all duration-200 hover:scale-[1.01] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50">
449
+ <i class="fas fa-redo mr-2"></i> Re-analyze
450
  </button>
451
  </div>
452
  </div>
 
459
  <div class="pulse">
460
  <i class="fas fa-spinner fa-spin mr-2"></i>
461
  </div>
462
+ <span>Analyzing content with advanced metrics...</span>
463
  </div>
464
  </div>
465
 
 
468
  <div class="pulse">
469
  <i class="fas fa-spinner fa-spin mr-2"></i>
470
  </div>
471
+ <span>Humanizing content (this may take a moment)...</span>
472
  </div>
473
  </div>
474
 
 
491
  const proceedToHumanizeBtn = document.getElementById('proceedToHumanizeBtn');
492
  const humanizeBtn = document.getElementById('humanizeBtn');
493
  const copyBtn = document.getElementById('copyBtn');
494
+ const analyzeAgainBtn = document.getElementById('analyzeAgainBtn');
495
  const analyzerLoading = document.getElementById('analyzerLoading');
496
  const humanizerLoading = document.getElementById('humanizerLoading');
497
  const errorMessage = document.getElementById('errorMessage');
 
505
  const humanScoreBar = document.getElementById('humanScoreBar');
506
  const humanScoreText = document.getElementById('humanScoreText');
507
  const keyFindings = document.getElementById('keyFindings');
508
+ const aiPatterns = document.getElementById('aiPatterns');
509
+ const analyzedText = document.getElementById('analyzedText');
510
  const analyzerTab = document.getElementById('analyzerTab');
511
  const humanizerTab = document.getElementById('humanizerTab');
512
  const analyzerPanel = document.getElementById('analyzerPanel');
513
  const humanizerPanel = document.getElementById('humanizerPanel');
514
+ const perplexityScore = document.getElementById('perplexityScore');
515
+ const perplexityBar = document.getElementById('perplexityBar');
516
+ const burstinessScore = document.getElementById('burstinessScore');
517
+ const burstinessBar = document.getElementById('burstinessBar');
518
+ const formalityScore = document.getElementById('formalityScore');
519
+ const formalityBar = document.getElementById('formalityBar');
520
+ const passiveScore = document.getElementById('passiveScore');
521
+ const passiveBar = document.getElementById('passiveBar');
522
+ const sentenceVarScore = document.getElementById('sentenceVarScore');
523
+ const sentenceVarBar = document.getElementById('sentenceVarBar');
524
+ const personalScore = document.getElementById('personalScore');
525
+ const personalBar = document.getElementById('personalBar');
526
+ const humanizeLevel = document.getElementById('humanizeLevel');
527
+ const targetTone = document.getElementById('targetTone');
528
 
529
  // Tab Switching
530
  analyzerTab.addEventListener('click', function() {
 
574
  analyzeBtn.classList.add('opacity-75');
575
 
576
  try {
577
+ // Simulate API call with comprehensive analysis
578
+ const analysis = await simulateComprehensiveAnalysis(inputText);
579
 
580
  // Display results
581
  displayAnalysisResults(analysis);
 
603
  // Humanize button click handler
604
  humanizeBtn.addEventListener('click', async function() {
605
  const inputText = humanizerInput.value.trim();
606
+ const level = humanizeLevel.value;
607
+ const tone = targetTone.value;
608
 
609
  if (!inputText) {
610
  showError("Please enter some text to humanize.");
 
618
  humanizeBtn.classList.add('opacity-75');
619
 
620
  try {
621
+ // Simulate API call with tone and level options
622
+ const humanizedText = await simulateHumanizeApiCall(inputText, level, tone);
623
 
624
  humanOutput.value = humanizedText;
625
 
 
657
  }
658
  });
659
 
660
+ // Analyze again button
661
+ analyzeAgainBtn.addEventListener('click', function() {
662
+ if (humanOutput.value.trim()) {
663
+ aiInput.value = humanOutput.value;
664
+ humanizerInput.value = humanOutput.value;
665
+ const words = humanOutput.value ? humanOutput.value.split(/\s+/).length : 0;
666
+ inputWordCount.textContent = `${words} words`;
667
+ humanizerWordCount.textContent = `${words} words`;
668
+ analyzerTab.click();
669
+ analyzeBtn.click();
670
+ }
671
+ });
672
+
673
  // Function to display analysis results
674
  function displayAnalysisResults(analysis) {
675
  analysisPlaceholder.classList.add('hidden');
 
681
  humanScoreBar.style.width = `${analysis.humanScore}%`;
682
  aiScoreText.textContent = `${analysis.aiScore}%`;
683
  humanScoreText.textContent = `${analysis.humanScore}%`;
684
+
685
+ // Detailed metrics
686
+ perplexityScore.textContent = analysis.perplexity;
687
+ perplexityBar.style.width = `${analysis.perplexity}%`;
688
+ burstinessScore.textContent = analysis.burstiness;
689
+ burstinessBar.style.width = `${analysis.burstiness}%`;
690
+ formalityScore.textContent = analysis.formality;
691
+ formalityBar.style.width = `${analysis.formality}%`;
692
+ passiveScore.textContent = `${analysis.passiveVoice}%`;
693
+ passiveBar.style.width = `${analysis.passiveVoice}%`;
694
+ sentenceVarScore.textContent = analysis.sentenceVariation;
695
+ sentenceVarBar.style.width = `${analysis.sentenceVariation}%`;
696
+ personalScore.textContent = analysis.personalization;
697
+ personalBar.style.width = `${analysis.personalization}%`;
698
  }, 100);
699
 
700
  // Add key findings
701
  keyFindings.innerHTML = '';
702
  analysis.findings.forEach(finding => {
703
+ const div = document.createElement('div');
704
+ div.className = 'flex items-start';
705
+ div.innerHTML = `
706
+ <div class="flex-shrink-0 mt-1 mr-2">
707
+ <i class="fas ${finding.severity === 'high' ? 'fa-exclamation-circle text-red-500' : finding.severity === 'medium' ? 'fa-info-circle text-yellow-500' : 'fa-check-circle text-green-500'}"></i>
708
+ </div>
709
+ <div>
710
+ <p class="text-gray-700">${finding.text}</p>
711
+ ${finding.suggestion ? `<p class="text-sm text-gray-500 mt-1">${finding.suggestion}</p>` : ''}
712
+ </div>
713
+ `;
714
+ keyFindings.appendChild(div);
715
+ });
716
+
717
+ // Add AI patterns
718
+ aiPatterns.innerHTML = '';
719
+ analysis.patterns.forEach(pattern => {
720
+ const span = document.createElement('span');
721
+ span.className = `analysis-tag ${pattern.type === 'ai' ? 'tag-ai' : pattern.type === 'human' ? 'tag-human' : 'tag-neutral'}`;
722
+ span.textContent = pattern.text;
723
+ aiPatterns.appendChild(span);
724
+ });
725
+
726
+ // Display analyzed text with highlights
727
+ analyzedText.innerHTML = '';
728
+ const textSegments = analysis.textSegments;
729
+
730
+ textSegments.forEach(segment => {
731
+ const span = document.createElement('span');
732
+ span.className = segment.class;
733
+ span.textContent = segment.text;
734
+
735
+ if (segment.tooltip) {
736
+ span.classList.add('tooltip');
737
+ const tooltipSpan = document.createElement('span');
738
+ tooltipSpan.className = 'tooltiptext';
739
+ tooltipSpan.textContent = segment.tooltip;
740
+ span.appendChild(tooltipSpan);
741
+ }
742
+
743
+ analyzedText.appendChild(span);
744
  });
745
  }
746
 
747
+ // Function to simulate comprehensive analysis API call
748
+ async function simulateComprehensiveAnalysis(text) {
749
  // Simulate network delay
750
+ await new Promise(resolve => setTimeout(resolve, 2000));
751
 
752
+ // Calculate metrics based on text characteristics
753
  const wordCount = text.split(/\s+/).length;
754
  const sentenceCount = text.split(/[.!?]+/).filter(s => s.trim().length > 0).length;
755
  const avgSentenceLength = wordCount / sentenceCount;
756
+ const aiKeywords = ['artificial intelligence', 'machine learning', 'algorithm', 'neural network', 'AI model', 'deep learning', 'language model'];
757
+ const formalWords = ['utilize', 'commence', 'terminate', 'optimal', 'endeavor', 'ascertain', 'ameliorate', 'furthermore', 'moreover', 'however'];
758
+ const passiveVoiceRegex = /\b(am|is|are|was|were|be|being|been)\s+[a-z]+\b/gi;
759
 
760
  // Calculate AI score (0-100)
761
  let aiScore = 0;
762
+ let patterns = [];
763
+ let textSegments = [];
764
+ let findings = [];
765
 
766
+ // 1. Check for AI keywords
767
  aiKeywords.forEach(keyword => {
768
+ const regex = new RegExp(keyword, 'gi');
769
+ const matches = text.match(regex);
770
+ if (matches) {
771
+ aiScore += matches.length * 5;
772
+ patterns.push({ type: 'ai', text: `AI keyword: ${keyword}` });
773
+
774
+ // Add to text segments
775
+ let lastIndex = 0;
776
+ let match;
777
+ while ((match = regex.exec(text)) !== null) {
778
+ // Add text before match
779
+ if (match.index > lastIndex) {
780
+ textSegments.push({
781
+ text: text.substring(lastIndex, match.index),
782
+ class: ''
783
+ });
784
+ }
785
+
786
+ // Add highlighted match
787
+ textSegments.push({
788
+ text: match[0],
789
+ class: 'highlight-ai',
790
+ tooltip: `AI-related keyword detected`
791
+ });
792
+
793
+ lastIndex = regex.lastIndex;
794
+ }
795
+
796
+ // Add remaining text
797
+ if (lastIndex < text.length) {
798
+ textSegments.push({
799
+ text: text.substring(lastIndex),
800
+ class: ''
801
+ });
802
+ }
803
+ }
804
+ });
805
+
806
+ // 2. Check for formal words
807
+ let formalWordCount = 0;
808
+ formalWords.forEach(word => {
809
+ const regex = new RegExp(`\\b${word}\\b`, 'gi');
810
+ const matches = text.match(regex);
811
+ if (matches) {
812
+ formalWordCount += matches.length;
813
+ patterns.push({ type: 'ai', text: `Formal word: ${word}` });
814
  }
815
  });
816
 
817
+ if (formalWordCount > 0) {
818
+ aiScore += Math.min(30, formalWordCount * 3);
819
+ findings.push({
820
+ text: `Found ${formalWordCount} overly formal word${formalWordCount > 1 ? 's' : ''} (e.g., ${formalWords.find(w => text.toLowerCase().includes(w)) || 'utilize'})`,
821
+ severity: 'medium',
822
+ suggestion: 'Consider replacing with more natural alternatives'
823
+ });
824
  }
825
 
826
+ // 3. Check for passive voice
827
+ const passiveMatches = text.match(passiveVoiceRegex) || [];
828
+ const passiveVoicePercentage = Math.round((passiveMatches.length / sentenceCount) * 100);
829
+ if (passiveVoicePercentage > 20) {
830
+ aiScore += Math.min(20, (passiveVoicePercentage - 20));
831
+ findings.push({
832
+ text: `High passive voice usage (${passiveVoicePercentage}% of sentences)`,
833
+ severity: 'medium',
834
+ suggestion: 'Try to use more active voice constructions'
835
+ });
836
+ patterns.push({ type: 'ai', text: `Passive voice overuse` });
837
+ }
838
+
839
+ // 4. Check sentence length variation
840
+ const sentences = text.split(/[.!?]+/).filter(s => s.trim().length > 0);
841
+ const sentenceLengths = sentences.map(s => s.split(/\s+/).length);
842
+ const lengthVariation = calculateVariation(sentenceLengths);
843
+
844
+ if (lengthVariation < 0.4) {
845
  aiScore += 15;
846
+ findings.push({
847
+ text: 'Low sentence length variation detected',
848
+ severity: 'medium',
849
+ suggestion: 'Try mixing short, medium and long sentences'
850
+ });
851
+ patterns.push({ type: 'ai', text: `Uniform sentence length` });
852
+ }
853
+
854
+ // 5. Check for repetitive phrasing
855
+ const phraseRepetition = checkPhraseRepetition(text);
856
+ if (phraseRepetition.count > 0) {
857
+ aiScore += Math.min(20, phraseRepetition.count * 5);
858
+ findings.push({
859
+ text: `Repetitive phrasing detected (e.g., "${phraseRepetition.example}")`,
860
+ severity: 'high',
861
+ suggestion: 'Try to vary your phrasing and word choice'
862
+ });
863
+ patterns.push({ type: 'ai', text: `Repetitive phrasing` });
864
+ }
865
+
866
+ // 6. Check for personalization
867
+ const personalPronouns = (text.match(/\b(I|me|my|mine|we|us|our|ours)\b/gi) || []).length;
868
+ const personalizationScore = Math.min(100, Math.round((personalPronouns / wordCount) * 10000));
869
+
870
+ if (personalizationScore < 5) {
871
+ aiScore += 10;
872
+ findings.push({
873
+ text: 'Lack of personal pronouns or subjective perspective',
874
+ severity: 'low',
875
+ suggestion: 'Consider adding personal perspective where appropriate'
876
+ });
877
+ patterns.push({ type: 'ai', text: `Lacks personalization` });
878
+ }
879
+
880
+ // 7. Check for vague generalizations
881
+ const vaguePhrases = ['many ways', 'various aspects', 'numerous factors', 'multiple benefits', 'revolutionizing', 'transformative impact'];
882
+ let vagueCount = 0;
883
+ vaguePhrases.forEach(phrase => {
884
+ if (text.toLowerCase().includes(phrase)) {
885
+ vagueCount++;
886
+ }
887
+ });
888
+
889
+ if (vagueCount > 0) {
890
+ aiScore += Math.min(15, vagueCount * 3);
891
+ findings.push({
892
+ text: `Found ${vagueCount} vague generalization${vagueCount > 1 ? 's' : ''}`,
893
+ severity: 'medium',
894
+ suggestion: 'Try to be more specific with examples or data'
895
+ });
896
+ patterns.push({ type: 'ai', text: `Vague generalizations` });
897
+ }
898
+
899
+ // 8. Check for perfect grammar (lack of colloquialisms)
900
+ const grammarErrors = (text.match(/\b(ain't|gonna|wanna|gotta|kinda|sorta)\b/gi) || []).length;
901
+ if (grammarErrors === 0 && wordCount > 100) {
902
+ aiScore += 5;
903
+ findings.push({
904
+ text: 'No colloquialisms or informal grammar detected',
905
+ severity: 'low',
906
+ suggestion: 'In casual contexts, some informal language can sound more natural'
907
+ });
908
  }
909
 
910
  // Cap at 100
 
913
  // Human score is inverse of AI score with some randomness
914
  const humanScore = Math.min(100, Math.max(0, 100 - aiScore + (Math.random() * 20 - 10)));
915
 
916
+ // Calculate perplexity (simulated)
917
+ const perplexity = Math.min(100, Math.max(0,
918
+ 70 - (aiScore * 0.6) + (Math.random() * 20 - 10)
919
+ ));
920
+
921
+ // Calculate burstiness (simulated)
922
+ const burstiness = Math.min(100, Math.max(0,
923
+ 60 - (aiScore * 0.5) + (Math.random() * 20 - 10)
924
+ ));
925
+
926
+ // Calculate formality index
927
+ const formality = Math.min(100, Math.max(0,
928
+ 20 + (aiScore * 0.4) + (Math.random() * 10 - 5)
929
+ ));
930
+
931
+ // Sentence variation score
932
+ const sentenceVariation = Math.min(100, Math.max(0,
933
+ 40 + (lengthVariation * 60) + (Math.random() * 10 - 5)
934
+ ));
935
+
936
+ // Add positive findings for human-like aspects
937
+ if (humanScore > 70) {
938
+ findings.unshift({
939
+ text: 'Content shows strong human-like qualities',
940
+ severity: 'low'
941
+ });
942
+ patterns.push({ type: 'human', text: `Human-like qualities` });
943
  }
944
 
945
+ if (personalizationScore > 10) {
946
+ findings.unshift({
947
+ text: 'Contains personal perspective or subjective elements',
948
+ severity: 'low'
949
+ });
950
+ patterns.push({ type: 'human', text: `Personal perspective` });
951
  }
952
 
953
+ if (lengthVariation > 0.6) {
954
+ findings.unshift({
955
+ text: 'Good variation in sentence length and structure',
956
+ severity: 'low'
957
+ });
958
+ patterns.push({ type: 'human', text: `Sentence variation` });
959
  }
960
 
961
  return {
962
  aiScore: Math.round(aiScore),
963
  humanScore: Math.round(humanScore),
964
+ perplexity: Math.round(perplexity),
965
+ burstiness: Math.round(burstiness),
966
+ formality: Math.round(formality),
967
+ passiveVoice: passiveVoicePercentage,
968
+ sentenceVariation: Math.round(sentenceVariation),
969
+ personalization: personalizationScore,
970
+ findings: findings,
971
+ patterns: patterns,
972
+ textSegments: textSegments.length > 0 ? textSegments : [{ text: text, class: '' }]
973
  };
974
  }
975
 
976
+ // Function to simulate humanize API call with options
977
+ async function simulateHumanizeApiCall(text, level = 'medium', tone = 'neutral') {
978
  // Simulate network delay
979
+ await new Promise(resolve => setTimeout(resolve, 2500));
980
+
981
+ // Apply transformations based on level and tone
982
+ let result = text;
983
+
984
+ // Level transformations
985
+ if (level === 'heavy') {
986
+ // Heavy transformation - complete rewrite
987
+ const sentences = result.split(/[.!?]+/);
988
+ result = sentences.map((sentence, i) => {
989
+ if (i % 3 === 0) return `You know, ${sentence.trim().toLowerCase()}`;
990
+ if (i % 4 === 0) return `Honestly, ${sentence.trim()}`;
991
+ if (i % 5 === 0) return `Personally, I think ${sentence.trim().toLowerCase()}`;
992
+ return sentence.trim();
993
+ }).join('. ') + (text.endsWith('.') ? '.' : '');
994
+
995
+ // Add more casual replacements
996
+ result = result.replace(/\bHowever\b/gi, 'But')
997
+ .replace(/\bFurthermore\b/gi, 'Also')
998
+ .replace(/\bMoreover\b/gi, 'What\'s more')
999
+ .replace(/\bThus\b/gi, 'So')
1000
+ .replace(/\bHence\b/gi, 'That\'s why')
1001
+ .replace(/\bNevertheless\b/gi, 'Still')
1002
+ .replace(/\bConsequently\b/gi, 'As a result')
1003
+ .replace(/\bIn conclusion\b/gi, 'To wrap things up')
1004
+ .replace(/\bAdditionally\b/gi, 'On top of that')
1005
+ .replace(/\bUtilize\b/gi, 'Use')
1006
+ .replace(/\bCommence\b/gi, 'Start')
1007
+ .replace(/\bTerminate\b/gi, 'End')
1008
+ .replace(/\bOptimal\b/gi, 'Best')
1009
+ .replace(/\bEndeavor\b/gi, 'Try')
1010
+ .replace(/\bAscertain\b/gi, 'Find out')
1011
+ .replace(/\bAmeliorate\b/gi, 'Improve')
1012
+ .replace(/\bIt is important to note that\b/gi, 'Remember that')
1013
+ .replace(/\bIn order to\b/gi, 'To')
1014
+ .replace(/\bWith regard to\b/gi, 'About')
1015
+ .replace(/\bAt this point in time\b/gi, 'Now')
1016
+ .replace(/\bDue to the fact that\b/gi, 'Because');
1017
+ } else if (level === 'medium') {
1018
+ // Medium transformation - balanced approach
1019
+ result = result.replace(/\bHowever\b/gi, 'But')
1020
+ .replace(/\bFurthermore\b/gi, 'Also')
1021
+ .replace(/\bMoreover\b/gi, 'Additionally')
1022
+ .replace(/\bThus\b/gi, 'So')
1023
+ .replace(/\bHence\b/gi, 'Therefore')
1024
+ .replace(/\bNevertheless\b/gi, 'Still')
1025
+ .replace(/\bConsequently\b/gi, 'As a result')
1026
+ .replace(/\bIn conclusion\b/gi, 'In summary')
1027
+ .replace(/\bUtilize\b/gi, 'Use')
1028
+ .replace(/\bCommence\b/gi, 'Begin')
1029
+ .replace(/\bTerminate\b/gi, 'End')
1030
+ .replace(/\bOptimal\b/gi, 'Best')
1031
+ .replace(/\bEndeavor\b/gi, 'Try')
1032
+ .replace(/\bAscertain\b/gi, 'Determine')
1033
+ .replace(/\bAmeliorate\b/gi, 'Improve')
1034
+ .replace(/\bIt is important to note that\b/gi, 'Note that')
1035
+ .replace(/\bIn order to\b/gi, 'To')
1036
+ .replace(/\bWith regard to\b/gi, 'Regarding')
1037
+ .replace(/\bAt this point in time\b/gi, 'Currently')
1038
+ .replace(/\bDue to the fact that\b/gi, 'Because');
1039
+ } else {
1040
+ // Light transformation - minimal changes
1041
+ result = result.replace(/\bUtilize\b/gi, 'Use')
1042
+ .replace(/\bCommence\b/gi, 'Begin')
1043
+ .replace(/\bTerminate\b/gi, 'End')
1044
+ .replace(/\bOptimal\b/gi, 'Best')
1045
+ .replace(/\bEndeavor\b/gi, 'Try')
1046
+ .replace(/\bAscertain\b/gi, 'Determine')
1047
+ .replace(/\bAmeliorate\b/gi, 'Improve');
1048
+ }
1049
+
1050
+ // Tone transformations
1051
+ if (tone === 'casual') {
1052
+ result = result.replace(/\bHowever\b/gi, 'But')
1053
+ .replace(/\bTherefore\b/gi, 'So')
1054
+ .replace(/\bAdditionally\b/gi, 'Also')
1055
+ .replace(/\bIn summary\b/gi, 'To sum up')
1056
+ .replace(/\bIt should be noted that\b/gi, 'Keep in mind that')
1057
+ .replace(/\bThis demonstrates that\b/gi, 'This shows that');
1058
+ } else if (tone === 'professional') {
1059
+ result = result.replace(/\bBut\b/gi, 'However')
1060
+ .replace(/\bSo\b/gi, 'Therefore')
1061
+ .replace(/\bAlso\b/gi, 'Additionally')
1062
+ .replace(/\bTo sum up\b/gi, 'In conclusion')
1063
+ .replace(/\bKeep in mind that\b/gi, 'It should be noted that')
1064
+ .replace(/\bThis shows that\b/gi, 'This demonstrates that');
1065
+ } else if (tone === 'friendly') {
1066
+ result = result.replace(/\bHowever\b/gi, 'But')
1067
+ .replace(/\bTherefore\b/gi, 'So')
1068
+ .replace(/\bAdditionally\b/gi, 'Also')
1069
+ .replace(/\bIn summary\b/gi, 'To wrap things up')
1070
+ .replace(/\bIt should be noted that\b/gi, 'Just remember that')
1071
+ .replace(/\bThis demonstrates that\b/gi, 'This shows that');
1072
+ } else if (tone === 'academic') {
1073
+ result = result.replace(/\bBut\b/gi, 'However')
1074
+ .replace(/\bSo\b/gi, 'Thus')
1075
+ .replace(/\bAlso\b/gi, 'Furthermore')
1076
+ .replace(/\bTo sum up\b/gi, 'In conclusion')
1077
+ .replace(/\bKeep in mind that\b/gi, 'It is important to note that')
1078
+ .replace(/\bThis shows that\b/gi, 'This demonstrates that');
1079
+ }
1080
+
1081
+ return result;
1082
+ }
1083
+
1084
+ // Helper function to calculate variation coefficient
1085
+ function calculateVariation(values) {
1086
+ if (values.length < 2) return 0;
1087
+ const mean = values.reduce((a, b) => a + b) / values.length;
1088
+ const variance = values.reduce((a, b) => a + Math.pow(b - mean, 2), 0) / values.length;
1089
+ const stdDev = Math.sqrt(variance);
1090
+ return stdDev / mean;
1091
+ }
1092
+
1093
+ // Helper function to check for repetitive phrasing
1094
+ function checkPhraseRepetition(text) {
1095
+ const phrases = [
1096
+ 'it is important to note',
1097
+ 'in conclusion',
1098
+ 'as a result',
1099
+ 'in other words',
1100
+ 'on the other hand',
1101
+ 'in addition',
1102
+ 'for example',
1103
+ 'this means that',
1104
+ 'it should be noted',
1105
+ 'as mentioned earlier'
1106
+ ];
1107
+
1108
+ let maxCount = 0;
1109
+ let maxPhrase = '';
1110
+
1111
+ phrases.forEach(phrase => {
1112
+ const regex = new RegExp(phrase, 'gi');
1113
+ const matches = text.match(regex) || [];
1114
+ if (matches.length > maxCount) {
1115
+ maxCount = matches.length;
1116
+ maxPhrase = phrase;
1117
+ }
1118
+ });
1119
+
1120
+ return { count: maxCount, example: maxPhrase };
1121
  }
1122
 
1123
  function showError(message) {
prompts.txt CHANGED
@@ -1,3 +1,4 @@
1
  Objective: Build a client-side web tool that sends user-inputted AI-generated text directly to the DeepSeek API and displays the humanized response in a second text box. Requirements Frontend: Simple HTML/CSS/JS interface with two text areas (input/output). A "Humanize" button to trigger the API request. Loading indicator during processing. Error handling for API failures. DeepSeek Integration: Direct API call to DeepSeek’s /v1/chat/completions endpoint. System prompt: "Rewrite this text to sound like a human wrote it. Use casual language, vary sentence structure, and avoid repetitive phrases. Keep technical terms intact." Include the user’s input text in the request. Security: Use a serverless proxy (e.g., Cloudflare Worker/Netlify Function) to hide the DeepSeek API key. Deployment: Host the static frontend on Netlify/Vercel. Deploy the proxy alongside the frontend.
2
  OKay Remove everything expect the tool from this page.
3
- Okay Expand this tool with Analysis as well, First our AI Text Input Should ask for the analyze and rate content for AI scale then Ask to convert it into hummonid content.
 
 
1
  Objective: Build a client-side web tool that sends user-inputted AI-generated text directly to the DeepSeek API and displays the humanized response in a second text box. Requirements Frontend: Simple HTML/CSS/JS interface with two text areas (input/output). A "Humanize" button to trigger the API request. Loading indicator during processing. Error handling for API failures. DeepSeek Integration: Direct API call to DeepSeek’s /v1/chat/completions endpoint. System prompt: "Rewrite this text to sound like a human wrote it. Use casual language, vary sentence structure, and avoid repetitive phrases. Keep technical terms intact." Include the user’s input text in the request. Security: Use a serverless proxy (e.g., Cloudflare Worker/Netlify Function) to hide the DeepSeek API key. Deployment: Host the static frontend on Netlify/Vercel. Deploy the proxy alongside the frontend.
2
  OKay Remove everything expect the tool from this page.
3
+ Okay Expand this tool with Analysis as well, First our AI Text Input Should ask for the analyze and rate content for AI scale then Ask to convert it into hummonid content.
4
+ Implement all of these standard to Analyze Content 2. Manual Detection Strategies Textual Red Flags Repetitive Phrasing: AI often reuses phrases (e.g., "It is important to note...") or synonyms in clusters. Overly Formal Tone: Unnatural formality in casual contexts (e.g., "utilize" instead of "use"). Lack of Personal Experience: No subjective anecdotes or emotional depth. Perfect Grammar: Fewer typos or colloquial errors compared to human writing. Vague Generalizations: Statements like "AI is revolutionizing many industries" without specifics. Structural Patterns Sentence Uniformity: Similar sentence lengths and structures. Passive Voice Overuse: Common in GPT-3.5/4 outputs. "Listicle" Format: AI defaults to bullet points or numbered lists when unsure. 3. Technical Analysis Perplexity & Burstiness Perplexity: Measures how "surprised" an AI model is by the text. AI text: Low perplexity (predictable word choices). Human text: High perplexity (unexpected phrasing). Burstiness: Variation in sentence length/complexity. AI text often has uniform burstiness scores. Watermarking (For Developers) Some AI models embed hidden statistical patterns (e.g., GPT-4). Tools like: GLTR (Giant Language Model Test Room): Visualizes word predictability. Sapling.ai Detector: Highlights likely AI-generated sections. 4. Hybrid Approaches Cross-Check with Metadata: Analyze document history (e.g., Google Docs version tracking for edits). Stylometric Analysis: Compare to the author’s known writing style. Fact-Checking: AI may hallucinate fake citations or outdated facts. 5. Limitations & Challenges False Positives: Human-written technical/scientific content can be flagged as AI. False Negatives: Advanced models (e.g., GPT-4o) mimic human writing better. Ethical Concerns: Tools like Turnitin face criticism for privacy issues.