sqibhe commited on
Commit
fdc3ce1
·
verified ·
1 Parent(s): 323f7cd

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +281 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Humanizer
3
- emoji: 🔥
4
- colorFrom: red
5
- colorTo: gray
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: humanizer
3
+ emoji: 🐳
4
+ colorFrom: pink
5
+ colorTo: green
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,281 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>AI Humanizer Tool</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>
10
+ .gradient-bg {
11
+ background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
12
+ }
13
+ .text-gradient {
14
+ background: linear-gradient(90deg, #6e8efb, #a777e3);
15
+ -webkit-background-clip: text;
16
+ background-clip: text;
17
+ color: transparent;
18
+ }
19
+ .textarea-container {
20
+ position: relative;
21
+ }
22
+ .textarea-container::after {
23
+ content: '';
24
+ position: absolute;
25
+ bottom: 0;
26
+ left: 0;
27
+ right: 0;
28
+ height: 4px;
29
+ background: linear-gradient(90deg, #6e8efb, #a777e3);
30
+ border-radius: 0 0 8px 8px;
31
+ }
32
+ .word-count {
33
+ position: absolute;
34
+ bottom: 10px;
35
+ right: 15px;
36
+ font-size: 0.8rem;
37
+ color: #6b7280;
38
+ background-color: rgba(255, 255, 255, 0.7);
39
+ padding: 2px 6px;
40
+ border-radius: 10px;
41
+ }
42
+ .pulse {
43
+ animation: pulse 2s infinite;
44
+ }
45
+ @keyframes pulse {
46
+ 0% { opacity: 0.6; }
47
+ 50% { opacity: 1; }
48
+ 100% { opacity: 0.6; }
49
+ }
50
+ </style>
51
+ </head>
52
+ <body class="min-h-screen bg-gray-50">
53
+ <div class="gradient-bg py-6 shadow-lg">
54
+ <div class="container mx-auto px-4">
55
+ <h1 class="text-3xl md:text-4xl font-bold text-center text-white">
56
+ <i class="fas fa-robot mr-2"></i> AI Humanizer Tool
57
+ </h1>
58
+ <p class="text-center text-white opacity-90 mt-2">
59
+ Transform AI-generated text into natural human-like writing
60
+ </p>
61
+ </div>
62
+ </div>
63
+
64
+ <div class="container mx-auto px-4 py-8 max-w-6xl">
65
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
66
+ <!-- Input Section -->
67
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden">
68
+ <div class="gradient-bg px-6 py-4">
69
+ <h2 class="text-xl font-semibold text-white">
70
+ <i class="fas fa-keyboard mr-2"></i> AI Text Input
71
+ </h2>
72
+ </div>
73
+ <div class="p-6 textarea-container">
74
+ <textarea
75
+ id="aiInput"
76
+ class="w-full h-64 p-4 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-300 resize-none"
77
+ placeholder="Paste your AI-generated text here..."></textarea>
78
+ <div id="inputWordCount" class="word-count">0 words</div>
79
+ </div>
80
+ </div>
81
+
82
+ <!-- Output Section -->
83
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden">
84
+ <div class="gradient-bg px-6 py-4">
85
+ <h2 class="text-xl font-semibold text-white">
86
+ <i class="fas fa-user mr-2"></i> Humanized Output
87
+ </h2>
88
+ </div>
89
+ <div class="p-6 textarea-container">
90
+ <textarea
91
+ id="humanOutput"
92
+ class="w-full h-64 p-4 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-300 resize-none bg-gray-50"
93
+ placeholder="Your humanized text will appear here..."
94
+ readonly></textarea>
95
+ <div id="outputWordCount" class="word-count">0 words</div>
96
+ </div>
97
+ </div>
98
+ </div>
99
+
100
+ <div class="mt-8 text-center">
101
+ <button
102
+ id="humanizeBtn"
103
+ class="gradient-bg hover:opacity-90 text-white font-bold py-3 px-8 rounded-full text-lg shadow-lg transform transition-all duration-200 hover:scale-105 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50">
104
+ <i class="fas fa-magic mr-2"></i> Humanize Text
105
+ </button>
106
+
107
+ <div id="loadingIndicator" class="mt-4 hidden">
108
+ <div class="inline-flex items-center gradient-bg text-white py-2 px-4 rounded-full">
109
+ <div class="pulse">
110
+ <i class="fas fa-spinner fa-spin mr-2"></i>
111
+ </div>
112
+ <span>Processing your text...</span>
113
+ </div>
114
+ </div>
115
+
116
+ <div id="errorMessage" class="mt-4 hidden">
117
+ <div class="inline-flex items-center bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded">
118
+ <i class="fas fa-exclamation-circle mr-2"></i>
119
+ <span id="errorText">Something went wrong. Please try again.</span>
120
+ </div>
121
+ </div>
122
+ </div>
123
+
124
+ <div class="mt-12 bg-white rounded-xl shadow-lg p-6">
125
+ <h3 class="text-xl font-semibold text-gray-800 mb-4">
126
+ <i class="fas fa-lightbulb mr-2 text-yellow-500"></i> How It Works
127
+ </h3>
128
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
129
+ <div class="bg-purple-50 p-4 rounded-lg">
130
+ <div class="text-purple-600 mb-2">
131
+ <i class="fas fa-paste text-2xl"></i>
132
+ </div>
133
+ <h4 class="font-medium text-gray-800">1. Paste AI Text</h4>
134
+ <p class="text-gray-600 mt-1 text-sm">Copy and paste any AI-generated content into the input box.</p>
135
+ </div>
136
+ <div class="bg-blue-50 p-4 rounded-lg">
137
+ <div class="text-blue-600 mb-2">
138
+ <i class="fas fa-magic text-2xl"></i>
139
+ </div>
140
+ <h4 class="font-medium text-gray-800">2. Humanize</h4>
141
+ <p class="text-gray-600 mt-1 text-sm">Click the button to transform it into natural human-like writing.</p>
142
+ </div>
143
+ <div class="bg-green-50 p-4 rounded-lg">
144
+ <div class="text-green-600 mb-2">
145
+ <i class="fas fa-clipboard text-2xl"></i>
146
+ </div>
147
+ <h4 class="font-medium text-gray-800">3. Copy & Use</h4>
148
+ <p class="text-gray-600 mt-1 text-sm">Get your humanized text and use it anywhere you need.</p>
149
+ </div>
150
+ </div>
151
+ </div>
152
+ </div>
153
+
154
+ <footer class="gradient-bg text-white py-6 mt-12">
155
+ <div class="container mx-auto px-4 text-center">
156
+ <p>AI Humanizer Tool - Making AI content sound authentically human</p>
157
+ <p class="mt-2 text-sm opacity-80">Note: This tool uses a secure proxy to protect your API key.</p>
158
+ </div>
159
+ </footer>
160
+
161
+ <script>
162
+ document.addEventListener('DOMContentLoaded', function() {
163
+ const aiInput = document.getElementById('aiInput');
164
+ const humanOutput = document.getElementById('humanOutput');
165
+ const humanizeBtn = document.getElementById('humanizeBtn');
166
+ const loadingIndicator = document.getElementById('loadingIndicator');
167
+ const errorMessage = document.getElementById('errorMessage');
168
+ const inputWordCount = document.getElementById('inputWordCount');
169
+ const outputWordCount = document.getElementById('outputWordCount');
170
+
171
+ // Update word count for input
172
+ aiInput.addEventListener('input', function() {
173
+ const text = aiInput.value.trim();
174
+ const words = text ? text.split(/\s+/).length : 0;
175
+ inputWordCount.textContent = `${words} words`;
176
+ });
177
+
178
+ // Humanize button click handler
179
+ humanizeBtn.addEventListener('click', async function() {
180
+ const inputText = aiInput.value.trim();
181
+
182
+ if (!inputText) {
183
+ showError("Please enter some text to humanize.");
184
+ return;
185
+ }
186
+
187
+ // Show loading, hide error
188
+ loadingIndicator.classList.remove('hidden');
189
+ errorMessage.classList.add('hidden');
190
+ humanizeBtn.disabled = true;
191
+ humanizeBtn.classList.add('opacity-75');
192
+
193
+ try {
194
+ // In a real implementation, you would call your serverless proxy here
195
+ // For this demo, we'll simulate the API call
196
+ const humanizedText = await simulateHumanizeApiCall(inputText);
197
+
198
+ humanOutput.value = humanizedText;
199
+
200
+ // Update output word count
201
+ const words = humanizedText ? humanizedText.split(/\s+/).length : 0;
202
+ outputWordCount.textContent = `${words} words`;
203
+
204
+ } catch (error) {
205
+ console.error("Error:", error);
206
+ showError("Failed to humanize text. Please try again later.");
207
+ } finally {
208
+ loadingIndicator.classList.add('hidden');
209
+ humanizeBtn.disabled = false;
210
+ humanizeBtn.classList.remove('opacity-75');
211
+ }
212
+ });
213
+
214
+ // Function to simulate API call (replace with actual API call in production)
215
+ async function simulateHumanizeApiCall(text) {
216
+ // Simulate network delay
217
+ await new Promise(resolve => setTimeout(resolve, 1500));
218
+
219
+ // This is where you would normally make the actual API call to your proxy
220
+ // For example:
221
+ /*
222
+ const response = await fetch('/api/humanize', {
223
+ method: 'POST',
224
+ headers: {
225
+ 'Content-Type': 'application/json',
226
+ },
227
+ body: JSON.stringify({
228
+ text: text
229
+ })
230
+ });
231
+
232
+ if (!response.ok) {
233
+ throw new Error('API request failed');
234
+ }
235
+
236
+ const data = await response.json();
237
+ return data.humanizedText;
238
+ */
239
+
240
+ // For demo purposes, we'll just return a modified version of the input
241
+ return text.replace(/AI|artificial intelligence/gi, match =>
242
+ match.toLowerCase() === 'ai' ? 'human intelligence' : 'natural human thinking'
243
+ )
244
+ .replace(/\bhowever\b/gi, 'but')
245
+ .replace(/\bfurthermore\b/gi, 'also')
246
+ .replace(/\bmoreover\b/gi, 'what\'s more')
247
+ .replace(/\bthus\b/gi, 'so')
248
+ .replace(/\bhence\b/gi, 'that\'s why')
249
+ .replace(/\bnevertheless\b/gi, 'still')
250
+ .replace(/\bconsequently\b/gi, 'as a result')
251
+ + "\n\n[Note: In a real implementation, this would be the response from the DeepSeek API]";
252
+ }
253
+
254
+ function showError(message) {
255
+ errorText.textContent = message;
256
+ errorMessage.classList.remove('hidden');
257
+ }
258
+
259
+ // Add copy to clipboard functionality
260
+ humanOutput.addEventListener('click', function() {
261
+ if (humanOutput.value) {
262
+ humanOutput.select();
263
+ document.execCommand('copy');
264
+
265
+ // Show temporary tooltip
266
+ const tooltip = document.createElement('div');
267
+ tooltip.className = 'fixed bg-gray-800 text-white px-3 py-1 rounded text-sm';
268
+ tooltip.textContent = 'Copied!';
269
+ tooltip.style.top = (event.pageY - 40) + 'px';
270
+ tooltip.style.left = (event.pageX - 30) + 'px';
271
+ document.body.appendChild(tooltip);
272
+
273
+ setTimeout(() => {
274
+ document.body.removeChild(tooltip);
275
+ }, 1000);
276
+ }
277
+ });
278
+ });
279
+ </script>
280
+ <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=sqibhe/humanizer" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
281
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
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.