Aobangaming commited on
Commit
6b8206f
·
verified ·
1 Parent(s): 24730bf

Upload 8 files

Browse files
Files changed (8) hide show
  1. Penalties.csv +14 -0
  2. ai thingy.py +823 -0
  3. aoban_weights.pth +3 -0
  4. app.py +50 -0
  5. change_length.py +35 -0
  6. settings.csv +13 -0
  7. training_data copy.csv +754 -0
  8. training_data.csv +11 -0
Penalties.csv ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hi hello can your hear today do you have any questions or topics how me meanwhile,2.0
2
+ hi hello how can there your you today do is there something specific you would like,5.0
3
+ hi do hear i help you today is there something specific topic to discuss want with,10.0
4
+ you are dumb sorry your hear assist to feedback about me i do not want i'm,1.5
5
+ you are dumb sorry i'm hear your feedback about me i do not want to discuss,3.0
6
+ hi how can i help you today do is there something specific topic me to discuss,0.5
7
+ hi hello hello how can can i can i can i can i can i can,50.0
8
+ what can you do i help with something today me specific topic meanwhile want to discuss,10.0
9
+ hi hello how can i do you today is there something specific topic with like to,1.2
10
+ what can you do i can today do you have any questions or topics meanwhile want,5.0
11
+ what can you do i today any questions or topics help with something specific topic to,4.0
12
+ what can you do i today any help with various tasks including - writing storytelling and,1.5
13
+ what can you do i today hello about need help with something specific topic to discuss storytelling,1.5
14
+ do you have any are dumb i'm sorry to hear your feedback about me i do not,2.0
ai thingy.py ADDED
@@ -0,0 +1,823 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torch.nn as nn
3
+ from torch.optim import Adam
4
+ from torch.utils.data import Dataset, DataLoader
5
+ import math
6
+ import time
7
+ import csv
8
+ import os
9
+ import re
10
+
11
+ # --- HYPERPARAMETERS ---
12
+ D_MODEL = 128
13
+ NUM_HEADS = 8
14
+ NUM_LAYERS = 10
15
+ DROPOUT = 0.2
16
+ MAX_SEQ_LENGTH = 17
17
+ LEARNING_RATE = 0.0002
18
+ NUM_EPOCHS = 20 # Default full training epochs
19
+ BATCH_SIZE = 64
20
+
21
+ NUM_EPOCHS = 100# Default full training epochs (increased)
22
+ INTERACTIVE_EPOCHS = 50 # Epochs for quick retraining (increased)
23
+
24
+ # --- GENERATION SETTINGS ---
25
+ TOP_K = 3
26
+ REPETITION_PENALTY = 3
27
+ TEMPERATURE = 1
28
+
29
+ PENALTIES_FILE = 'Penalties.csv'
30
+
31
+ def load_penalties():
32
+ loaded_penalties = []
33
+ if os.path.exists('Penalties.csv'):
34
+ with open('Penalties.csv', 'r', encoding='utf-8') as f:
35
+ reader = csv.reader(f)
36
+ for row in reader:
37
+ if len(row) >= 2:
38
+ # Store as a list of [sentence, penalty_value]
39
+ loaded_penalties.append([row[0], float(row[1])])
40
+ elif row:
41
+ # Fallback for old 1-column rows
42
+ loaded_penalties.append([row[0], 3.0])
43
+ return loaded_penalties
44
+
45
+ def save_single_penalty(penalty_string):
46
+ """Appends a new penalty to the CSV immediately."""
47
+ with open(PENALTIES_FILE, 'a', newline='', encoding='utf-8') as f:
48
+ writer = csv.writer(f)
49
+ writer.writerow([penalty_string])
50
+
51
+ SETTINGS_FILE = 'settings.csv'
52
+
53
+ def save_settings(penalty, temp):
54
+ with open('settings.csv', 'a', newline='', encoding='utf-8') as f:
55
+ writer = csv.writer(f)
56
+ # We save both so we have a history of your "knob" turns
57
+ writer.writerow([penalty, temp])
58
+ print(f"[Console] Logged to settings history: Penalty={penalty}, Temp={temp}")
59
+
60
+ def load_settings():
61
+ if os.path.exists('settings.csv'):
62
+ with open('settings.csv', 'r', encoding='utf-8') as f:
63
+ reader = csv.reader(f)
64
+ last_row = None
65
+ for row in reader:
66
+ if row:
67
+ last_row = row
68
+ if last_row:
69
+ return float(last_row[0]), float(last_row[1]) # Return penalty and temp
70
+ return 3.0, 1.0 # Default if file doesn't exist
71
+ # --- At the start of your script ---
72
+ penalties = load_penalties()
73
+
74
+ # --- PERSISTENCE CONFIGURATION ---
75
+ DATA_FILE = 'training_data.csv' # File where all training data is stored
76
+
77
+ # --- INITIAL DATA FALLBACK (The 27 sentences you provided) ---
78
+ DEFAULT_TRAINING_DATA = [
79
+ "The quick brown fox jumps over the lazy dog.",
80
+ "A glass of water is clear.",
81
+ "The sun is shining bright and the sky is clear.",
82
+ "The dog and the fox are friends forever.",
83
+ "Coding with Pytorch and Transformers is fun and very rewarding.",
84
+ "A computer runs very fast and never stops.",
85
+ "The windows are big and bright.",
86
+ "A green park is a great place to relax.",
87
+ "The sky is clear today, with no clouds.",
88
+ "The cat jumped over the fence.",
89
+ "The plane has many windows.",
90
+ "A big bird flew over the house.",
91
+ "The plane smoothly landed on the concrete runway.",
92
+ "The bird flew above the bustling city.",
93
+ "The plane had an engine failure and had to land in the river.",
94
+ "The Cessna 172 is a low-wing monoplane.",
95
+ "The plane flew by the trees.",
96
+ "The plane, almost out of fuel, finally landed at an airport.",
97
+ "The angry bird flew away furiously.",
98
+ "A plane is a machine that flies.",
99
+ "The fast plane landed at the bright airport.",
100
+ "The plane quickly landed on the runway.",
101
+ "The letter A is part of the alphabet.",
102
+ "The plane landed hardly on a grass runway in the forest.",
103
+ "The clouds were floating above the ground.",
104
+ "The plane was a very bright plane, it's livery glimmered in the night sky.",
105
+ "The GPWS sounds on a plane are like Caution Terrain PULL up PULL up."
106
+ ]
107
+
108
+ # --- FILE I/O FUNCTIONS (CRITICAL FOR PERSISTENCE) ---
109
+
110
+ def load_data_from_csv(filepath):
111
+ """Loads all training sentences from the CSV file, or returns the default data."""
112
+ texts = []
113
+
114
+ def split_into_sentences(paragraph):
115
+ # Split on sentence end punctuation followed by whitespace and a capital or number
116
+ # Use a safe regex string and fall back to newline/sentence punctuation splitting on error
117
+ try:
118
+ pattern = r'(?<=[\.\!?])\s+(?=[A-Z0-9"\'""\u201c])'
119
+ parts = re.split(pattern, paragraph)
120
+ return [p.strip() for p in parts if p and p.strip()]
121
+ except re.error:
122
+ # fallback: split on sentence enders and newlines
123
+ parts = re.split(r'[\.\!?]\s+|\n+', paragraph)
124
+ return [p.strip() for p in parts if p and p.strip()]
125
+
126
+ # Attempt to read existing data
127
+ if os.path.exists(filepath) and os.path.getsize(filepath) > 0:
128
+ print(f"[Console] Loading training data from {filepath}...")
129
+ try:
130
+ with open(filepath, 'r', newline='', encoding='utf-8') as f:
131
+ reader = csv.reader(f)
132
+ raw_rows = []
133
+ for row in reader:
134
+ if row and row[0].strip():
135
+ raw_text = row[0].strip()
136
+ # Remove surrounding quotes if present
137
+ if (raw_text.startswith('"') and raw_text.endswith('"')) or (raw_text.startswith("'") and raw_text.endswith("'")):
138
+ raw_text = raw_text[1:-1].strip()
139
+ if raw_text:
140
+ raw_rows.append(raw_text)
141
+
142
+ # Now split rows into sentences, filter and handle adjacent runs
143
+ sequence = []
144
+ for raw in raw_rows:
145
+ # If the row contains multiple sentences, split them
146
+ parts = split_into_sentences(raw)
147
+ # If splitting produced only one part but it contains multiple internal newlines, also split on newlines
148
+ if len(parts) == 1 and '\n' in parts[0]:
149
+ parts = [p.strip() for p in parts[0].splitlines() if p.strip()]
150
+
151
+ for s in parts:
152
+ # Normalize whitespace and strip quotes
153
+ s_clean = ' '.join(s.split()).strip(' "\'')
154
+ words = s_clean.split()
155
+
156
+ # Basic length filters to remove garbage/too-short sentences
157
+ if len(words) < 3:
158
+ continue
159
+ if len(words) > 300:
160
+ # skip extremely long paragraphs
161
+ continue
162
+
163
+ # Filter out noisy/corrupted lines
164
+ # Skip if contains excessive repetition (same word 3+ times in a row)
165
+ is_noisy = False
166
+ for i in range(len(words) - 2):
167
+ if words[i] == words[i+1] == words[i+2]:
168
+ is_noisy = True
169
+ break
170
+ if is_noisy:
171
+ continue
172
+
173
+ # Skip lines that look like training artifacts (high ratio of common junk words)
174
+ junk_patterns = ['pull', 'up', 'land', 'river', 'sky', 'clear', 'table']
175
+ junk_count = sum(1 for w in words if w in junk_patterns)
176
+ if junk_count > len(words) * 0.9999999: # more than 30% junk
177
+ continue
178
+
179
+ sequence.append(s_clean)
180
+
181
+ # Collapse consecutive identical sentences (runs) to at most two copies
182
+ i = 0
183
+ while i < len(sequence):
184
+ j = i + 1
185
+ while j < len(sequence) and sequence[j] == sequence[i]:
186
+ j += 1
187
+ run_len = j - i
188
+ if run_len == 1:
189
+ texts.append(sequence[i])
190
+ else:
191
+ # keep first and last occurrence of the run
192
+ texts.append(sequence[i])
193
+ texts.append(sequence[i])
194
+ i = j
195
+
196
+ except Exception as e:
197
+ print(f"[Console Bug] Error loading CSV: {e}. Falling back to default data.")
198
+ texts = [] # Clear corrupted load
199
+
200
+ # If no data loaded (file missing, empty, or corrupted), use the default knowledge base
201
+ if not texts:
202
+ print("[Console] CSV file not found or empty. Using default knowledge base.")
203
+ return list(DEFAULT_TRAINING_DATA)
204
+
205
+ # Debug: report how many sentences were actually loaded and sample content
206
+ print(f"[Console] Loaded {len(texts)} sentence(s) from {filepath}.")
207
+ sample_head = texts[:10]
208
+ sample_tail = texts[-10:]
209
+ print("[Console] First loaded sentences:")
210
+ for i, s in enumerate(sample_head, 1):
211
+ print(f" {i}: {s[:200]}")
212
+ if len(texts) > 10:
213
+ print("[Console] Last loaded sentences:")
214
+ start_index = max(0, len(texts) - 10)
215
+ for i, s in enumerate(texts[start_index:], start_index + 1):
216
+ print(f" {i}: {s[:200]}")
217
+
218
+ return texts
219
+
220
+ def save_data_to_csv(filepath, texts):
221
+ """Saves the entire list of training sentences (including new ones) to the CSV."""
222
+ # The 'w' mode ensures the file is overwritten with the complete, updated dataset.
223
+ print(f"[Console] Saving {len(texts)} sentences to {filepath} using 'w' mode...")
224
+ try:
225
+ with open(filepath, 'w', newline='', encoding='utf-8') as f:
226
+ writer = csv.writer(f)
227
+ # Write each sentence as a single row/column entry
228
+ for text in texts:
229
+ writer.writerow([text])
230
+ except Exception as e:
231
+ print(f"[Console Bug] Error saving to CSV: {e}")
232
+
233
+ # --- TOKENIZER ---
234
+ class SimpleTokenizer:
235
+ def __init__(self, texts):
236
+ self.word_to_idx = {"<PAD>": 0, "<UNK>": 1}
237
+ self.idx_to_word = {0: "<PAD>", 1: "<UNK>"}
238
+ self.build_vocab(texts)
239
+
240
+ def build_vocab(self, texts):
241
+ for text in texts:
242
+ for word in text.lower().split():
243
+ word = word.strip("/<>")
244
+ if word not in self.word_to_idx:
245
+ idx = len(self.word_to_idx)
246
+ self.word_to_idx[word] = idx
247
+ self.idx_to_word[idx] = word
248
+
249
+ def encode(self, text, max_len):
250
+ words = [word.strip(".,!?") for word in text.lower().split()]
251
+ indices = [self.word_to_idx.get(word, self.word_to_idx["<UNK>"]) for word in words]
252
+
253
+ # Padding and Truncation
254
+ if len(indices) < max_len:
255
+ indices.extend([self.word_to_idx["<PAD>"]] * (max_len - len(indices)))
256
+ elif len(indices) > max_len:
257
+ indices = indices[:max_len]
258
+
259
+ return torch.tensor(indices, dtype=torch.long)
260
+
261
+ def decode(self, indices):
262
+ return " ".join([self.idx_to_word.get(idx.item(), "<UNK>") for idx in indices if idx.item() != self.word_to_idx["<PAD>"]])
263
+
264
+ @property
265
+ def vocab_size(self):
266
+ return len(self.word_to_idx)
267
+
268
+ # --- DATASET ---
269
+ class TextDataset(Dataset):
270
+ def __init__(self, texts, tokenizer, max_len):
271
+ self.data = []
272
+ for text in texts:
273
+ encoded = tokenizer.encode(text, max_len)
274
+ self.data.append(encoded)
275
+
276
+ def __len__(self):
277
+ return len(self.data)
278
+
279
+ def __getitem__(self, idx):
280
+ return self.data[idx]
281
+
282
+ # --- TRANSFORMER MODEL COMPONENTS (UNMODIFIED) ---
283
+
284
+ class PositionalEncoding(nn.Module):
285
+ def __init__(self, d_model, max_len=5000):
286
+ super(PositionalEncoding, self).__init__()
287
+ pe = torch.zeros(max_len, d_model)
288
+ position = torch.arange(0, max_len, dtype=torch.float).unsqueeze(1)
289
+ div_term = torch.exp(torch.arange(0, d_model, 2).float() * (-math.log(10000.0) / d_model))
290
+ pe[:, 0::2] = torch.sin(position * div_term)
291
+ pe[:, 1::2] = torch.cos(position * div_term)
292
+ pe = pe.unsqueeze(0).transpose(0, 1)
293
+ self.register_buffer('pe', pe)
294
+
295
+ def forward(self, x):
296
+ return x + self.pe[:x.size(1), :].transpose(0, 1)
297
+
298
+ class TransformerLanguageModel(nn.Module):
299
+ def __init__(self, vocab_size, d_model, nhead, num_layers, dropout, max_len):
300
+ super(TransformerLanguageModel, self).__init__()
301
+ self.model_type = 'Transformer'
302
+ self.d_model = d_model
303
+ self.vocab_size = vocab_size
304
+
305
+ self.embedding = nn.Embedding(vocab_size, d_model)
306
+ self.pos_encoder = PositionalEncoding(d_model, max_len)
307
+
308
+ # Use decoder layers for proper causal masking in text generation
309
+ decoder_layer = nn.TransformerDecoderLayer(
310
+ d_model=d_model,
311
+ nhead=nhead,
312
+ dim_feedforward=d_model*4,
313
+ dropout=dropout,
314
+ batch_first=True,
315
+ activation='gelu'
316
+ )
317
+ self.transformer_decoder = nn.TransformerDecoder(decoder_layer, num_layers=num_layers)
318
+
319
+ self.fc_out = nn.Linear(d_model, vocab_size)
320
+ self.init_weights()
321
+
322
+ def init_weights(self):
323
+ initrange = 0.1
324
+ self.embedding.weight.data.uniform_(-initrange, initrange)
325
+ self.fc_out.bias.data.zero_()
326
+ self.fc_out.weight.data.uniform_(-initrange, initrange)
327
+
328
+ def forward(self, src):
329
+ src = self.embedding(src) * math.sqrt(self.d_model)
330
+ src = self.pos_encoder(src)
331
+
332
+ # Create causal mask to prevent attending to future tokens
333
+ seq_len = src.size(1)
334
+ causal_mask = torch.triu(torch.ones(seq_len, seq_len, device=src.device) * float('-inf'), diagonal=1)
335
+
336
+ # Decoder expects (tgt, memory) but we use same for both (causal language modeling)
337
+ output = self.transformer_decoder(src, src, tgt_mask=causal_mask)
338
+ return self.fc_out(output)
339
+
340
+ # --- TRAINING FUNCTIONS ---
341
+ def train_model(model, data_loader, optimizer, criterion, device, epochs):
342
+ model.train()
343
+
344
+ for epoch in range(1, epochs + 1):
345
+ total_loss = 0.0
346
+
347
+ for batch in data_loader:
348
+ batch = batch.to(device)
349
+ # Unpacking the cargo correctly
350
+ src = batch[:, :-1]
351
+ tgt = batch[:, 1:]
352
+
353
+ optimizer.zero_grad()
354
+
355
+ # 1. THE BRAIN THINKS
356
+ output = model(src)
357
+
358
+ # 2. THE STANDARD LOSS (Lore Check)
359
+ # We reshape for CrossEntropy
360
+ current_loss = criterion(output.reshape(-1, output.size(-1)), tgt.reshape(-1))
361
+
362
+ # >>> THE BLACK BOX PENALTY (Mechanical Scandal Check) <<<
363
+ # If loss is at the "2.0 Purgatory", we slap it with a 0.5 penalty
364
+ if current_loss.item() > 1.9:
365
+ penalty = 1
366
+ current_loss = current_loss + penalty
367
+
368
+ # 3. THE REACTION
369
+ current_loss.backward()
370
+ optimizer.step()
371
+
372
+ total_loss += current_loss.item()
373
+
374
+ avg_loss = total_loss / len(data_loader)
375
+
376
+ if epochs > 10 and epoch % (epochs // 10) == 0:
377
+ print(f"Epoch {epoch}/{epochs}, Average Loss: {avg_loss:.4f}")
378
+ elif epochs > 0 and epochs <= 50 and epoch % 10 == 0:
379
+ print(f"Epoch {epoch}/{epochs}, Average Loss: {avg_loss:.4f}")
380
+ print(f"[Console] The {NUM_LAYERS} Layers have been updated.")
381
+
382
+ penalties = [] #Penalty list to track penalties applied during generation
383
+ # --- GENERATION FUNCTION (UNMODIFIED) ---
384
+ def generate_text(model, tokenizer, prompt, max_len, device, top_k=40, penalty=1.8, temperature=1.0):
385
+ global penalties, last_generated_text
386
+ global REPETITION_PENALTY, TEMPERATURE # <--- LINK TO THE SAVED SETTINGS
387
+
388
+ # If the function wasn't given a specific number, use the global loaded one
389
+ if penalty is None:
390
+ penalty = REPETITION_PENALTY
391
+ if temperature is None:
392
+ temperature = TEMPERATURE
393
+
394
+ model.eval()
395
+
396
+ encoded_prompt = tokenizer.encode(prompt, max_len=max_len).to(device)
397
+ # Count non-PAD tokens in encoded prompt to get true prompt length
398
+ pad_idx = tokenizer.word_to_idx["<PAD>"]
399
+ prompt_len = (encoded_prompt != pad_idx).sum().item()
400
+
401
+ generated_indices = encoded_prompt[:prompt_len].tolist()
402
+ input_ids = encoded_prompt.unsqueeze(0)
403
+
404
+ if prompt in penalties:
405
+ word = last_generated_text.lower().split()
406
+ banned_ids = [tokenizer.word_to_idx.get(w, 1) for w in word]
407
+
408
+
409
+ for i in range(prompt_len, max_len):
410
+ src_input = input_ids[:, :i]
411
+
412
+ with torch.no_grad():
413
+ output = model(src_input)
414
+
415
+ logits = output[0, i-1, :]
416
+ # Use this one!
417
+ # In your generate_text loop:
418
+ for record in penalties:
419
+ bad_sentence = record[0] # The string
420
+ saved_penalty = record[1] # The specific value for THIS mistake
421
+
422
+ if bad_sentence.startswith(prompt):
423
+ bad_words = bad_sentence[len(prompt):].strip().lower().split()
424
+ banned_ids = [tokenizer.word_to_idx.get(w, 1) for w in bad_words]
425
+
426
+ for bid in banned_ids:
427
+ # We use saved_penalty here, NOT the global one!
428
+ logits[bid] -= saved_penalty
429
+
430
+ # ... (The rest of the code continues with: logits = logits / TEMPERATURE, TOP_K filtering, etc.)
431
+ # Apply Repetition Penalty
432
+ history = generated_indices
433
+ for idx in set(history):
434
+ if logits[idx] > 0:
435
+ logits[idx] /= penalty
436
+ else:
437
+ logits[idx] *= penalty
438
+
439
+ # Apply temperature scaling before top-k
440
+ logits = logits / temperature
441
+
442
+ # Apply Top-K Sampling
443
+ top_k_values, top_k_indices = torch.topk(logits, min(top_k, len(logits)))
444
+ probabilities = torch.softmax(top_k_values, dim=0)
445
+
446
+ try:
447
+ next_token_idx = torch.multinomial(probabilities, num_samples=1).item()
448
+ except RuntimeError:
449
+ predicted_token = top_k_indices[0].item()
450
+ if predicted_token == tokenizer.word_to_idx["<PAD>"]:
451
+ break
452
+
453
+ else:
454
+ predicted_token = top_k_indices[next_token_idx].item()
455
+
456
+ generated_indices.append(predicted_token)
457
+ input_ids[0, i] = predicted_token
458
+ # --- START USER-REQUESTED WERE PLURALIZATION RULE ---
459
+
460
+
461
+ # Decode only the continuation text
462
+ decoded_text = tokenizer.decode(torch.tensor(generated_indices, dtype=torch.long))
463
+ prompt_words = [word.strip(".,!?") for word in prompt.lower().split()]
464
+ decoded_words = decoded_text.split()
465
+ start_index = len(prompt_words)
466
+
467
+ continuation_text = " ".join(decoded_words[start_index:])
468
+ return continuation_text.replace(" <pad>", "").strip()
469
+
470
+
471
+ # --- MAIN EXECUTION ---
472
+
473
+ # Global variables for model/tokenizer instances
474
+ last_generated_text = None
475
+ last_user_prompt = None
476
+ current_tokenizer = None
477
+ current_model = None
478
+ device = torch.device("cpu")
479
+ live_data_updates = [] # Temporary queue for new sentences added during the current session
480
+ initial_training_texts = [] # Stores all data loaded from CSV
481
+
482
+ def initialize_or_retrain(initial_train=True, use_live_data=False, epochs=NUM_EPOCHS):
483
+ global current_tokenizer, current_model, live_data_updates, initial_training_texts
484
+
485
+
486
+ # 1. Load Data (Permanent)
487
+ if initial_train:
488
+ initial_training_texts = load_data_from_csv(DATA_FILE)
489
+
490
+ training_data = list(initial_training_texts)
491
+
492
+ # 2. Add Live Data
493
+ if use_live_data:
494
+ print(f"[Console] Retraining on {len(initial_training_texts)} base examples plus {len(live_data_updates)} new examples.")
495
+ training_data.extend(live_data_updates)
496
+
497
+ # 3. Tokenizer Initialization and Model Rebuild if necessary
498
+ old_vocab_size = current_tokenizer.vocab_size if current_tokenizer else 0
499
+ current_tokenizer = SimpleTokenizer(training_data)
500
+ new_vocab_size = current_tokenizer.vocab_size
501
+
502
+ if new_vocab_size != old_vocab_size or initial_train:
503
+ if initial_train:
504
+ print(f"Tokenizer Vocabulary Size: {new_vocab_size}")
505
+ print(f"\nModel D_MODEL={D_MODEL}, NUM_HEADS={NUM_HEADS}, NUM_LAYERS={NUM_LAYERS}")
506
+
507
+ current_model = TransformerLanguageModel(
508
+ vocab_size=new_vocab_size,
509
+ d_model=D_MODEL,
510
+ nhead=NUM_HEADS,
511
+ num_layers=NUM_LAYERS,
512
+ dropout=DROPOUT,
513
+ max_len=MAX_SEQ_LENGTH
514
+ ).to(device)
515
+
516
+ if os.path.exists("aoban_weights.pth"):
517
+ checkpoint = torch.load("aoban_weights.pth", map_location=device)
518
+
519
+ # Get the sizes from the saved file vs the current model
520
+ saved_vocab_size = checkpoint['embedding.weight'].shape[0]
521
+ current_vocab_size = current_model.embedding.weight.shape[0]
522
+
523
+ if saved_vocab_size != current_vocab_size:
524
+ print(f"[Console] Expanding Aoban's brain from {saved_vocab_size} to {current_vocab_size} words...")
525
+
526
+ # 1. Create a copy of the model's current (empty/new) weights
527
+ new_state_dict = current_model.state_dict()
528
+
529
+ # 2. Loop through the saved memories and inject them into the new state
530
+ for key, value in checkpoint.items():
531
+ if key in new_state_dict:
532
+ if value.shape == new_state_dict[key].shape:
533
+ # Normal layers (Attention/Layers) fit perfectly
534
+ new_state_dict[key] = value
535
+ else:
536
+ # Entry/Exit layers (Embedding/FC) need surgical pasting
537
+ print(f"[Surgery] Patching {key}...")
538
+ # We copy the old 77 words into the first 77 slots of the 78 slots
539
+ new_state_dict[key][:saved_vocab_size] = value[:saved_vocab_size]
540
+
541
+ # 3. Load the expanded brain into the model
542
+ current_model.load_state_dict(new_state_dict)
543
+ else:
544
+ # If sizes match, just load normally
545
+ current_model.load_state_dict(checkpoint)
546
+ # 4. Training Setup and Execution
547
+ dataset = TextDataset(training_data, current_tokenizer, MAX_SEQ_LENGTH)
548
+ data_loader = DataLoader(dataset, batch_size=BATCH_SIZE, shuffle=True)
549
+
550
+ optimizer = Adam(current_model.parameters(), lr=LEARNING_RATE)
551
+ criterion = nn.CrossEntropyLoss(ignore_index=current_tokenizer.word_to_idx["<PAD>"])
552
+
553
+ print(f"\n[Console] Starting {epochs} epochs with {len(dataset)} examples...")
554
+ train_model(current_model, data_loader, optimizer, criterion, device, epochs)
555
+
556
+ # 5. Persistence Update (Saves data if it was a retraining session)
557
+ if use_live_data:
558
+ # 5a. Update the base list to include the new data
559
+ initial_training_texts = training_data
560
+
561
+ # 5b. Save the combined data permanently to the CSV
562
+ save_data_to_csv(DATA_FILE, initial_training_texts)
563
+
564
+ # 5c. Clear the temporary queue
565
+ live_data_updates = []
566
+ print("[Console] Retraining complete. New knowledge acquired and **permanently saved**.")
567
+
568
+
569
+ def interactive_mode():
570
+ global live_data_updates, last_generated_text, last_user_prompt, penalties
571
+ global REPETITION_PENALTY, TEMPERATURE # Add this line!
572
+
573
+ # 0. Load saved settings from settings.csv
574
+ REPETITION_PENALTY, TEMPERATURE = load_settings()
575
+
576
+ # Check if the file exists before initial training
577
+ file_existed_before_run = os.path.exists(DATA_FILE)
578
+ global device
579
+ device = torch.device("cuda")
580
+ if not torch.cuda.is_available():
581
+ print("Required GPU not located, running on CPU instead.")
582
+ device = torch.device("cpu")
583
+ # Run the initial, long training session
584
+ print(f"[Console] Using device: {device}")
585
+ initialize_or_retrain(initial_train=True, use_live_data=False, epochs=NUM_EPOCHS)
586
+
587
+ # IMPORTANT: If the file did not exist before this run (meaning default data was used),
588
+ # we force a save right now to write the 27 default sentences to the CSV file immediately.
589
+ if not file_existed_before_run:
590
+ print("\n[SYSTEM] CSV file was empty/missing. Forcing initial save of default knowledge...")
591
+ save_data_to_csv(DATA_FILE, initial_training_texts)
592
+ print("[SYSTEM] Default 27 sentences are now permanently written to training_data.csv.")
593
+
594
+ print("\n" + "=" * 60)
595
+ print("🤖 Console Information🤖")
596
+ print("1. Type a phrase to generate text (max 10 words).")
597
+ print("2. Use '!add [sentence]' to queue new training data.")
598
+ print("3. Use '!accept' to add the model's last **full** sentence to the training queue.")
599
+ print(f"4. Use '!retrain' to re-train the model on new data (runs for {INTERACTIVE_EPOCHS} epochs) **and save it**.")
600
+ print(f"5. Use '!refine' to re-train on existing data (runs for {INTERACTIVE_EPOCHS} epochs) **without saving.**")
601
+ print("6. Use '!penalty <value>' to regenerate with a different repetition penalty (higher = less repetition).")
602
+ print("7. Type 'quit' or 'exit' to stop.")
603
+ print("8. Type '!help' to see this message again.")
604
+ print("9. Use '!instead [corrected text]' to replace the last output with a corrected version.")
605
+ print("=" * 60)
606
+
607
+ while True:
608
+ try:
609
+ user_input = input("You: ")
610
+
611
+ if user_input.lower() in ['quit', 'exit']:
612
+ break
613
+
614
+ if user_input.lower().startswith('!add '):
615
+ sentence = user_input[5:].strip()
616
+ if sentence:
617
+ live_data_updates.append(sentence)
618
+ print(f"[Console] Added sentence to update queue: '{sentence}'")
619
+ print(f"[Console] Current update queue size: {len(live_data_updates)}. Type '!retrain' to apply and save changes.")
620
+ last_generated_text = None # Clear accepted text
621
+ last_user_prompt = None
622
+ continue
623
+
624
+ # --- !ACCEPT COMMAND ---
625
+ if user_input.lower().strip() == '!accept':
626
+ if last_generated_text and last_user_prompt:
627
+ # CRITICAL: Reconstruct the full sentence by joining prompt and output
628
+ full_sentence_parts = [last_user_prompt.strip(), last_generated_text.strip()]
629
+ sentence_to_add = " ".join(full_sentence_parts)
630
+
631
+ # Basic cleaning: ensure there aren't double spaces
632
+ sentence_to_add = " ".join(sentence_to_add.split())
633
+
634
+ if sentence_to_add and len(sentence_to_add.split()) > 4:
635
+ live_data_updates.append(sentence_to_add)
636
+ print(f"[Console] ACCEPTED: The full sentence '{sentence_to_add}' added to update queue.")
637
+ print(f"[Console] Current update queue size: {len(live_data_updates)}. Type '!retrain' to apply and save changes.")
638
+
639
+ last_generated_text = None # Clear after acceptance
640
+ last_user_prompt = None
641
+ else:
642
+ print("[Console] Cannot accept: The reconstructed sentence was too short or incomplete. Please use '!add [full sentence]' instead.")
643
+ else:
644
+ print("[Console] No text generated or prompt found. Generate text first.")
645
+ continue
646
+ # --- END !ACCEPT COMMAND ---
647
+
648
+ if user_input.lower() == '!help':
649
+ print("\n🤖 Console Information🤖")
650
+ print("1. Type a phrase to generate text (max 10 words).")
651
+ print("2. Use '!add [sentence]' to queue new training data.")
652
+ print("3. Use '!accept' to add the model's last **full** sentence to the training queue.")
653
+ print(f"4. Use '!retrain' to re-train the model on new data (runs for {INTERACTIVE_EPOCHS} epochs) **and save it**.")
654
+ print(f"5. Use '!refine' to re-train on existing data (runs for {INTERACTIVE_EPOCHS} epochs) **without saving.**")
655
+ print("6. Use '!penalty <value>' to regenerate with a different repetition penalty (higher = less repetition).")
656
+ print("7. Type 'quit' or 'exit' to stop.")
657
+ print("8. Type '!help' to see this message again.")
658
+ print("9. Use '!instead [corrected text]' to replace the last output with a corrected version.")
659
+ print("=" * 60 + "\n")
660
+ continue
661
+
662
+
663
+ if user_input.lower() == '!retrain':
664
+ if not live_data_updates:
665
+ print("[Console] No new data to train on. Use '!add [sentence]' first.")
666
+ continue
667
+
668
+ print(f"\n[Console] RETRAINING MODEL ON NEW DATA ({INTERACTIVE_EPOCHS} EPOCHS)...")
669
+ initialize_or_retrain(initial_train=False, use_live_data=True, epochs=INTERACTIVE_EPOCHS)
670
+ last_generated_text = None # Clear the accepted text cache
671
+ last_user_prompt = None
672
+ # To Load (at the start of your script)
673
+ torch.save(current_model.state_dict(), "aoban_weights.pth")
674
+ print("[Console] Model weights permanently saved to aoban_weights.pth")
675
+
676
+ last_generated_text = None
677
+ last_user_prompt = None
678
+ continue
679
+
680
+ # --- !ENDORSE COMMAND ---
681
+ if user_input.lower().startswith('!endorse'):
682
+ if last_generated_text and last_user_prompt:
683
+ try:
684
+ # Usage: !endorse 10 (or just !endorse for default 5)
685
+ parts = user_input.split()
686
+ multiplier = int(parts[1]) if len(parts) > 1 else 5
687
+
688
+ # We only want to endorse the GOOD part (e.g., "hello how can i help you today")
689
+ # You can manually edit the last_generated_text before endorsing if you want
690
+ full_sentence = f"{last_user_prompt.strip()} {last_generated_text.strip()}"
691
+
692
+ for _ in range(multiplier):
693
+ live_data_updates.append(full_sentence)
694
+
695
+ print(f"[SYSTEM] ENDORSED: Lore added {multiplier}x to queue.")
696
+ print(f"[SYSTEM] Target: {full_sentence}")
697
+ except ValueError:
698
+ print("[SYSTEM] Usage: !endorse <number>")
699
+ else:
700
+ print("[SYSTEM] Nothing to endorse.")
701
+ continue
702
+
703
+ if user_input.lower() == '!refine':
704
+ print(f"\n[Console] REFINING MODEL ON EXISTING DATA ({INTERACTIVE_EPOCHS} EPOCHS)...")
705
+ initialize_or_retrain(initial_train=False, use_live_data=False, epochs=INTERACTIVE_EPOCHS)
706
+ print("[Console] Refinement complete. Knowledge deepened on existing data.")
707
+ continue
708
+ if user_input.lower().startswith('!instead '):
709
+ if last_user_prompt and last_generated_text:
710
+ # The user provides the "Correct" version of the response
711
+ corrected_output = user_input[9:].strip()
712
+
713
+ # 1. LOG THE BAD ONE AS A PENALTY
714
+ # We pair the prompt with the bad output so the model learns to avoid it
715
+ penalty_record = f"{last_user_prompt} {last_generated_text}"
716
+ penalties.append(penalty_record)
717
+ with open('Penalties.csv', 'a', newline='', encoding='utf-8') as f:
718
+ csv.writer(f).writerow([penalty_record, REPETITION_PENALTY])
719
+
720
+ # 2. ADD THE CORRECT ONE TO THE QUEUE (Endorse it 5x)
721
+ full_correct_sentence = f"{last_user_prompt} {corrected_output}"
722
+ for _ in range(5):
723
+ live_data_updates.append(full_correct_sentence)
724
+
725
+ print(f"[SYSTEM] Fixed! '{last_generated_text}' is now penalized.")
726
+ print(f"[SYSTEM] Added correction: '{full_correct_sentence}' to training queue.")
727
+
728
+ # Optional: Set the corrected text as the 'last_generated_text'
729
+ # so you can !accept or !endorse it further
730
+ last_generated_text = corrected_output
731
+ torch.save(current_model.state_dict(), "aoban_weights.pth")
732
+ print("[Console] Model weights permanently saved to aoban_weights.pth")
733
+ else:
734
+ print("[SYSTEM] Nothing to replace. Generate text first.")
735
+ continue
736
+
737
+ # --- !PENALTY COMMAND ---
738
+ if user_input.lower().startswith('!penalty '):
739
+ try:
740
+ new_val = float(user_input[9:].strip())
741
+ REPETITION_PENALTY = new_val
742
+ save_settings(REPETITION_PENALTY, TEMPERATURE) # Store just the value
743
+
744
+ if last_user_prompt and last_generated_text:
745
+ penalty_record = f"{last_user_prompt} {last_generated_text}"
746
+ penalties.append(penalty_record)
747
+
748
+ # Save the sentence PAIRED with the penalty value used
749
+ with open('Penalties.csv', 'a', newline='', encoding='utf-8') as f:
750
+ writer = csv.writer(f)
751
+ # The index is automatically created by the row position in the CSV
752
+ writer.writerow([penalty_record, REPETITION_PENALTY])
753
+
754
+
755
+
756
+ # 3. Regenerate using the new permanent penalty
757
+ print(f"[Console] Regenerating with new saved penalty={REPETITION_PENALTY}...")
758
+ generated_text = generate_text(
759
+ current_model,
760
+ current_tokenizer,
761
+ last_user_prompt,
762
+ MAX_SEQ_LENGTH,
763
+ device,
764
+ TOP_K,
765
+ REPETITION_PENALTY, # Using the updated variable
766
+ TEMPERATURE
767
+ )
768
+
769
+ print(f"Model: {generated_text}")
770
+ last_generated_text = generated_text
771
+ print("\n[Console] If this full sentence is perfect, type '!accept'.")
772
+ torch.save(current_model.state_dict(), "aoban_weights.pth")
773
+ print("[Console] Model weights permanently saved to aoban_weights.pth")
774
+ except ValueError:
775
+ print(f"[Console] Invalid value. Usage: !penalty <number>.")
776
+ continue
777
+
778
+
779
+ if user_input.strip() and not user_input.lower().startswith(('!',)):
780
+ # Text generation logic
781
+ prompt = user_input.strip()
782
+
783
+ if len(prompt.split()) > MAX_SEQ_LENGTH - 1:
784
+ print(f"[Console] Prompt too long. Max {MAX_SEQ_LENGTH - 1} words supported.")
785
+ last_generated_text = None
786
+ last_user_prompt = None
787
+ continue
788
+
789
+ # 1. Store the prompt BEFORE generation
790
+ last_user_prompt = prompt
791
+
792
+ generated_text = generate_text(
793
+ current_model,
794
+ current_tokenizer,
795
+ prompt,
796
+ MAX_SEQ_LENGTH,
797
+ device,
798
+ TOP_K,
799
+ REPETITION_PENALTY,
800
+ TEMPERATURE
801
+ )
802
+ print(f"Model: {generated_text}")
803
+
804
+ # 2. Store the continuation AFTER generation
805
+ last_generated_text = generated_text
806
+
807
+ print("\n[Console] If this full sentence is perfect, type '!accept' to add it to the training queue.")
808
+
809
+ except KeyboardInterrupt:
810
+ print("\nExiting interactive mode.")
811
+ break
812
+ except Exception as e:
813
+ print(f"An error occurred: {e}")
814
+ break
815
+
816
+
817
+
818
+ if __name__ == "__main__":
819
+ # Load settings globally before anything starts
820
+ REPETITION_PENALTY, TEMPERATURE = load_settings()
821
+ print(f"[Console] Global Settings Initialized: Penalty={REPETITION_PENALTY}")
822
+
823
+ interactive_mode()
aoban_weights.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a02317ec3fe5957c1ec0a5aee6a42b37d135e1267115315814f2326714d38d30
3
+ size 10742915
app.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import contextlib
2
+ from flask import Flask, request, jsonify
3
+ from flask_cors import CORS
4
+ from scipy import io
5
+ import torch
6
+ # Import the specific functions from your ai_thingy script
7
+ # Make sure your AI script is named ai_thingy.py
8
+ from ai_thingy import (
9
+ initialize_or_retrain,
10
+ generate_text,
11
+ current_model,
12
+ current_tokenizer,
13
+ device,
14
+ MAX_SEQ_LENGTH
15
+ )
16
+ import ai_thingy
17
+
18
+ app = Flask(__name__)
19
+ CORS(app) # This allows your JS to talk to this Python server
20
+
21
+ # Initialize the model once when the server starts
22
+ print("[Bridge] Waking up the Aoban Brain...")
23
+ initialize_or_retrain(initial_train=True, epochs=10)
24
+
25
+ @app.route('/ask', methods=['POST'])
26
+ def ask():
27
+ try:
28
+ data = request.json
29
+ user_prompt = data.get("input", "")
30
+
31
+ # Use the imported generate_text
32
+ # We pass None for penalty/temp to let it use the script's defaults
33
+ response = ai_thingy.generate_text(
34
+ ai_thingy.current_model,
35
+ ai_thingy.current_tokenizer,
36
+ user_prompt,
37
+ ai_thingy.MAX_SEQ_LENGTH,
38
+ ai_thingy.device,
39
+ top_k=3,
40
+ penalty=3.0,
41
+ temperature=1.0
42
+ )
43
+
44
+ return jsonify({"response": response, "logs": "Generation successful."})
45
+
46
+ except Exception as e:
47
+ print(f"[CRASH] Aoban Brain Error: {e}")
48
+ return jsonify({"response": f"Brain Error: {str(e)}", "logs": str(e)}), 500
49
+ if __name__ == '__main__':
50
+ app.run(port=5000, debug=False)
change_length.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+
3
+ # 1. Load the current brain
4
+ checkpoint = torch.load("aoban_weights.pth", map_location='cpu')
5
+ old_pe = checkpoint['pos_encoder.pe']
6
+ old_len = old_pe.shape[0]
7
+
8
+ print(f"[System] Current Max Sequence Length is: {old_len}")
9
+ new_len_input = input("WHAT SEQ LENGTH WOULD YOU LIKE? ")
10
+
11
+ try:
12
+ new_len = int(new_len_input)
13
+
14
+ if new_len > old_len:
15
+ # EXPANDING: Add extra rows
16
+ diff = new_len - old_len
17
+ # Copy the last known position weights for the new slots
18
+ extra_padding = old_pe[-1:, :, :].repeat(diff, 1, 1)
19
+ checkpoint['pos_encoder.pe'] = torch.cat([old_pe, extra_padding], dim=0)
20
+ print(f"[System] Expanded from {old_len} to {new_len}.")
21
+
22
+ elif new_len < old_len:
23
+ # TRIMMING: Cut off the extra rows
24
+ checkpoint['pos_encoder.pe'] = old_pe[:new_len, :, :]
25
+ print(f"[System] Trimmed from {old_len} back to {new_len}.")
26
+
27
+ else:
28
+ print("[System] No change needed. Length is already correct.")
29
+
30
+ # 3. Save the modified brain
31
+ torch.save(checkpoint, "aoban_weights.pth")
32
+ print("[System] Surgery Complete. You can now restart your AI.")
33
+
34
+ except ValueError:
35
+ print("[System] Error: Please enter a valid number!")
settings.csv ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2.0,1.0
2
+ 5.0,1.0
3
+ 10.0,1.0
4
+ 1.5,1.0
5
+ 3.0,1.0
6
+ 0.5,1.0
7
+ 50.0,1.0
8
+ 10.0,1.0
9
+ 1.2,1.0
10
+ 5.0,1.0
11
+ 4.0,1.01
12
+ 1.5,1.01
13
+ 2.0,1.01
training_data copy.csv ADDED
@@ -0,0 +1,754 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The quick brown fox jumps over the lazy dog.
2
+ A glass of water is clear.
3
+ The sun is shining bright and the sky is clear.
4
+ The dog and the fox are friends forever.
5
+ Coding with Pytorch and Transformers is fun and very rewarding.
6
+ A computer runs very fast and never stops.
7
+ The windows are big and bright.
8
+ A green park is a great place to relax.
9
+ The sky is clear today
10
+ The cat jumped over the fence.
11
+ The plane has many windows.
12
+ A big bird flew over the house.
13
+ The plane smoothly landed on the concrete runway.
14
+ The bird flew above the bustling city.
15
+ The Cessna 172 is a low-wing monoplane.
16
+ The plane flew by the trees.
17
+ The angry bird flew away furiously.
18
+ A plane is a machine that flies.
19
+ The fast plane landed at the bright airport.
20
+ The plane quickly landed on the runway.
21
+ The letter A is part of the alphabet.
22
+ The clouds were floating above the ground.
23
+ The plane was a very bright plane
24
+ The dog barked at the man.
25
+ The lazy dog and playful fox ran across the field.
26
+ The aircraft began the final approach and the skilled pilot lowered the landing gear slowly.
27
+ This AI trains on multiple epochs.
28
+ A widebody aircraft has two aisles
29
+ Nice to meet you.
30
+ An airplane flew over his head.
31
+ Due to heavy turbulence
32
+ Passengers waited near the gate
33
+ British Airways 38 was a 777 that landed without both engines in the early 2000s.
34
+ The titanic was a huge ship.
35
+ Why wasn't the A320 long?
36
+ Is a 747 larger than a house?
37
+ I woke up this morning to the ringing alarm clock.
38
+ I walked out the front door and went to work.
39
+ Python is so fun!
40
+ One GPWS sound is: Caution!
41
+ An airplane is the same as a plane.
42
+ You read books.
43
+ Lamps are bright.
44
+ The large plane flew in the night sky cozily.
45
+ The plane crashed in the field.
46
+ Why did the book disappear?
47
+ He did his maths test.
48
+ The plane crashed in the forest.
49
+ The plane quickly crashed in the forest and caught fire.
50
+ The pilots did their best.
51
+ But everyone survived.
52
+ Why are modern computers so complex?
53
+ Complex computers compete in the computer competition.
54
+ The robot screamed in terror as smoke rose from its head.
55
+ The plane landed near the bridge
56
+ The food was cold and the tea was hot
57
+ He ran quickly through the park
58
+ A poor man named Chuck walked into the cabin for safety.
59
+ The pilot's bright plane flew over the bright airport.
60
+ The pilot had to land at the airport because he had an engine failure.
61
+ The Boeing 747 is larger than an A320.
62
+ The Boeing 787 is a modern wide-body aircraft.
63
+ She enjoys studying theoretical physics and quantum mechanics.
64
+ The new cloud service offers scalable storage solutions for large enterprises.
65
+ He carefully transplanted the delicate seedling into the larger pot.
66
+ The symphony hall's design optimizes every acoustic detail.
67
+ They discussed the ethical implications of using deepfake technology.
68
+ The ocean currents play a critical role in global climate regulation.
69
+ The journalist uncovered a major scandal involving corporate malfeasance.
70
+ The final stage of the process involves rigorous quality assurance testing.
71
+ Effective collaboration is essential for complex software development projects.
72
+ The faint stars were barely visible against the light pollution.
73
+ She researched the impact of social media algorithms on public opinion.
74
+ The laboratory is equipped with state-of-the-art spectrographic analysis tools.
75
+ He prefers composing music using analog synthesizers.
76
+ The company implemented a zero-waste policy across all manufacturing plants.
77
+ The history of warfare is intrinsically linked to technological innovation.
78
+ The small village relies primarily on subsistence agriculture.
79
+ They utilized a virtual reality simulation for professional training exercises.
80
+ The unexpected hail storm severely damaged the summer crops.
81
+ The museum docent provided fascinating details about the Renaissance paintings.
82
+ The theory of evolution is supported by extensive fossil evidence.
83
+ She spent the afternoon organizing her extensive collection of vintage records.
84
+ The financial audit revealed minor discrepancies in the quarterly report.
85
+ The development team used Python for the backend infrastructure.
86
+ He wrote a powerful poem about the impermanence of natural beauty.
87
+ The conservation group worked to protect the endangered rainforest habitat.
88
+ The new smartphone features enhanced battery life and camera resolution.
89
+ The legal brief argued persuasively for a change in jurisdiction.
90
+ They hiked to the summit just as the sun broke through the clouds.
91
+ Computational biology uses algorithms to analyze biological data.
92
+ The recipe requires precision in measuring the dry and wet ingredients.
93
+ She believes that kindness and empathy are universal virtues.
94
+ The complex network topology was mapped out on a detailed diagram.
95
+ The discovery of gravity is often attributed to Sir Isaac Newton.
96
+ The organization launched a new initiative aimed at digital literacy.
97
+ He used machine learning to personalize the user experience on the website.
98
+ The aroma of grilling herbs drifted enticingly from the open window.
99
+ They attended a seminar on sustainable urban planning strategies.
100
+ The book details the history of cartography and map making.
101
+ The construction project faced delays due to unforeseen weather conditions.
102
+ The study of cosmology explores the origin and structure of the universe.
103
+ She enjoys the tactile sensation of throwing clay on a pottery wheel.
104
+ The company's mission statement emphasizes innovation and integrity.
105
+ He meticulously documented the folklore and traditions of the region.
106
+ The satellite orbits the Earth collecting atmospheric data constantly.
107
+ The court ruled that the evidence was inadmissible due to procedural errors.
108
+ They celebrated their anniversary with a quiet dinner overlooking the harbor.
109
+ The rise of remote work has fundamentally changed office culture.
110
+ The philosopher explored the concept of free will versus determinism.
111
+ The chemical reaction produced a vivid blue precipitate instantly.
112
+ She uses geothermal energy to heat her environmentally conscious home.
113
+ The intricate lacework on the dress required hundreds of hours of labor.
114
+ He utilized sophisticated data visualization tools to present his findings.
115
+ The memoir offered a candid look at the challenges of early career life.
116
+ The river frequently floods its banks during the intense monsoon season.
117
+ They developed a proprietary algorithm for predicting stock market volatility.
118
+ The museum acquired a rare coin dating back to the Roman Empire.
119
+ She prefers reading physical books rather than digital e-readers.
120
+ The rescue team navigated the treacherous terrain after the earthquake.
121
+ The software update required a complete system restart and configuration.
122
+ The study found a strong correlation between exercise and mental well-being.
123
+ He is specializing in the study of deep-sea hydrothermal vents.
124
+ The town meeting focused on improving local public transportation options.
125
+ The artwork utilized unconventional materials
126
+ She mastered the complex choreography after weeks of intense rehearsals.
127
+ The manufacturing plant increased efficiency through automation.
128
+ The legal team prepared a detailed response to the plaintiff's complaint.
129
+ They enjoyed hiking along the coastal path at sunset every day.
130
+ The telescope array is located in a remote desert location for clarity.
131
+ The history of cryptography is a fascinating tale of codes and secrets.
132
+ The new curriculum emphasizes critical thinking and digital citizenship.
133
+ She applied non-parametric statistics to analyze the asymmetrical data.
134
+ The gentle lapping of waves against the boat was incredibly soothing.
135
+ He designed a robust system architecture to handle peak traffic loads.
136
+ The ancient civilization developed a sophisticated irrigation system.
137
+ They used augmented reality to overlay data onto the real-world view.
138
+ The unexpected snowfall delighted the local children immensely.
139
+ The foundation provides grants for independent investigative journalism.
140
+ She is studying the biomechanics of avian flight and wing structure.
141
+ The contract specified penalties for late delivery of the finished product.
142
+ The political cartoonist used satire to critique current events effectively.
143
+ He installed a smart home system to manage energy consumption automatically.
144
+ The old stone fence marked the boundary of the original farm property.
145
+ They celebrated the harvest with a traditional feast and local music.
146
+ The scientific method relies on testable hypotheses and empirical evidence.
147
+ She is learning Mandarin Chinese to better understand East Asian culture.
148
+ The car's navigation system guided them through the winding mountain roads.
149
+ The company is diversifying its portfolio into renewable energy projects.
150
+ He created a dynamic spreadsheet model for financial projections.
151
+ The concept of dark matter remains one of the greatest mysteries in physics.
152
+ The library hosts a weekly storytelling hour for young children.
153
+ She documented the gradual erosion of the cliff face over several years.
154
+ The journalist used encrypted messaging for sensitive communications.
155
+ The garden gate creaked open slowly in the morning breeze.
156
+ They are developing a new vaccine against a recently identified virus strain.
157
+ The historian specializes in the medieval period of European history.
158
+ He used a three-dimensional printer to quickly prototype the new design.
159
+ The atmosphere of Venus is toxic and extremely hot due to the greenhouse effect.
160
+ The Boeing 737 is the most widely used commercial aircraft in the world.
161
+ The Airbus A380 is the largest passenger airliner ever built.
162
+ Modern aircraft are equipped with advanced navigation systems.
163
+ Pilots undergo rigorous training before flying commercial aircraft.
164
+ The cockpit contains hundreds of instruments and controls.
165
+ Airlines schedule flights to maximize efficiency and profitability.
166
+ Aircraft maintenance crews perform daily safety checks.
167
+ Jet engines consume enormous amounts of fuel during flight.
168
+ The cabin crew ensures passenger safety and comfort.
169
+ Flight attendants receive training in emergency procedures.
170
+ Passengers board aircraft through jet bridges at the gate.
171
+ Baggage handlers load luggage into the aircraft hold.
172
+ Ground crews service aircraft between flights.
173
+ Fuel trucks fill the aircraft tanks before departure.
174
+ De-icing equipment protects aircraft from winter conditions.
175
+ Runways are carefully maintained for safe landings.
176
+ Air traffic controllers direct aircraft safely through airspace.
177
+ Weather forecasts help pilots plan flight routes.
178
+ Turbulence occurs when aircraft fly through unstable air masses.
179
+ Altitude affects fuel efficiency and aircraft performance.
180
+ Oxygen masks deploy automatically if cabin pressure drops.
181
+ Life jackets are located under passenger seats.
182
+ Emergency exits are clearly marked throughout the aircraft.
183
+ The fuselage is the main body of the aircraft.
184
+ Wings generate lift to keep the aircraft airborne.
185
+ Tail fins provide stability and control during flight.
186
+ Landing gear extends before approaching the runway.
187
+ Hydraulic systems power critical aircraft functions.
188
+ Avionics include radar
189
+ The autopilot system can fly the aircraft automatically.
190
+ Flight data recorders preserve information about flight parameters.
191
+ Cockpit voice recorders capture communications in the cockpit.
192
+ Regular inspections ensure aircraft remain airworthy.
193
+ Maintenance logs document all service performed on aircraft.
194
+ Aircraft undergo major overhauls every few years.
195
+ Spare parts are stocked for quick repairs.
196
+ Airlines employ thousands of maintenance technicians.
197
+ Engine efficiency has improved dramatically over decades.
198
+ Noise-reducing technology makes modern aircraft quieter.
199
+ Fuel-efficient designs reduce operating costs significantly.
200
+ Aircraft manufacturers conduct extensive safety testing.
201
+ Crash test simulations help engineers improve designs.
202
+ Accident investigations provide valuable safety lessons.
203
+ Safety regulations are enforced by aviation authorities.
204
+ Certification standards ensure aircraft meet strict requirements.
205
+ Insurance companies assess aircraft safety records.
206
+ Pilots report any mechanical issues immediately.
207
+ Maintenance crews address problems before the next flight.
208
+ Aircraft must pass multiple inspections before takeoff.
209
+ Safety is the highest priority in aviation.
210
+ The airline industry has an excellent safety record.
211
+ Modern aircraft are incredibly reliable machines.
212
+ Redundant systems ensure safety if components fail.
213
+ Backup power systems maintain critical functions.
214
+ The primary flight computer monitors system performance.
215
+ Secondary systems provide backup if primary systems fail.
216
+ Cross-checking instruments ensures accuracy of readings.
217
+ Pilots verify all readings before each flight.
218
+ Pre-flight checklists help pilots prepare for departure.
219
+ Post-flight checklists document the aircraft condition.
220
+ Flight logs record all relevant flight information.
221
+ Maintenance records track the complete service history.
222
+ Aircraft registration numbers identify each plane uniquely.
223
+ Livery designs distinguish airlines from competitors.
224
+ Paint schemes protect the aircraft surface.
225
+ Weather radar helps pilots navigate around storms.
226
+ Wind shear detection systems warn of dangerous conditions.
227
+ Terrain awareness systems prevent accidental crashes.
228
+ Traffic collision avoidance systems prevent midair collisions.
229
+ Navigation systems use multiple methods for accuracy.
230
+ GPS provides precise location information.
231
+ Inertial reference systems work when GPS is unavailable.
232
+ Communication radios connect pilots with air traffic control.
233
+ Transponders help identify aircraft on radar displays.
234
+ Squawk codes are assigned to each flight.
235
+ Flight plans file routes and altitudes in advance.
236
+ Airways provide designated routes through airspace.
237
+ Holding patterns allow aircraft to wait safely.
238
+ Approach procedures guide aircraft toward landing.
239
+ Instrument landing systems enable landings in fog.
240
+ Visual landing systems help pilots see the runway.
241
+ Runway lights guide aircraft during night operations.
242
+ Precision approach radar assists landing pilots.
243
+ Wind measurements help determine safe landing conditions.
244
+ Crosswind limits prevent unsafe landing attempts.
245
+ Takeoff roll requires a specific runway length.
246
+ Climb performance depends on weight and temperature.
247
+ Cruising altitude is maintained automatically.
248
+ Descent rates are carefully controlled by pilots.
249
+ Landing speeds are slower than cruising speeds.
250
+ Reverse thrust helps slow aircraft after landing.
251
+ Wheel brakes provide stopping force on the runway.
252
+ Ground spoilers increase drag during landing.
253
+ Flare technique allows smooth touchdown.
254
+ Touchdown occurs near the runway threshold.
255
+ Rollout distance is carefully calculated before landing.
256
+ Taxiway congestion is managed by controllers.
257
+ Gate assignments are made before arrival.
258
+ Ground handling equipment tows aircraft to gates.
259
+ Catering trucks provide meals and beverages.
260
+ Lavatory trucks service the onboard facilities.
261
+ Water trucks fill the aircraft water systems.
262
+ Trash trucks remove waste from the aircraft.
263
+ Cleaning crews prepare aircraft between flights.
264
+ Passenger comfort is important for airline loyalty.
265
+ In-flight entertainment systems provide movies and games.
266
+ WiFi connectivity allows passengers to stay connected.
267
+ Seat selection options give passengers choices.
268
+ Premium seating offers extra space and amenities.
269
+ Meal services vary based on flight duration.
270
+ Beverage services occur throughout the flight.
271
+ Duty-free shopping offers tax-free purchases.
272
+ Frequent flyer programs reward loyal customers.
273
+ Airline alliances allow code sharing and connections.
274
+ Connecting flights require careful timing.
275
+ Luggage transfers are handled automatically for connections.
276
+ International flights require passport and visa verification.
277
+ Customs inspections occur upon arrival.
278
+ Immigration processing can take significant time.
279
+ Travel documents must be valid for entry.
280
+ Visas are required for many countries.
281
+ Vaccination requirements may apply for some destinations.
282
+ Health certificates document medical procedures.
283
+ Travel insurance provides coverage for unexpected events.
284
+ Trip cancellation protection reimburses unused tickets.
285
+ Luggage insurance covers lost or damaged baggage.
286
+ Valuables should be carried in cabin baggage.
287
+ Restricted items are not allowed on aircraft.
288
+ Liquids must follow specific volume restrictions.
289
+ Sharp objects are prohibited from carry-on luggage.
290
+ Electronic devices must be powered down during taxi.
291
+ Seatbelts must be fastened during flight.
292
+ The fasten seatbelt sign indicates turbulence ahead.
293
+ Overhead bins have weight and size restrictions.
294
+ Aisle seats allow easy bathroom access.
295
+ Window seats provide views of the scenery.
296
+ Middle seats are the least desirable positions.
297
+ Galleys contain food and beverage service supplies.
298
+ Lavatories are occupied on rotation during flights.
299
+ Oxygen levels are maintained throughout the cabin.
300
+ Temperature controls keep the cabin comfortable.
301
+ Humidity levels affect passenger comfort.
302
+ Air circulation prevents stagnant air conditions.
303
+ Pressurization maintains breathable air at altitude.
304
+ Decompression emergencies are extremely rare.
305
+ Hypoxia occurs when oxygen levels are insufficient.
306
+ Cabin crew training includes emergency procedures.
307
+ Evacuation slides deploy rapidly during emergencies.
308
+ Life rafts are located on water flights.
309
+ Survival kits contain emergency supplies.
310
+ First aid kits are available onboard.
311
+ Medical emergencies are handled by trained crew.
312
+ Automated external defibrillators treat cardiac emergencies.
313
+ Communication with ground medical personnel is maintained.
314
+ Emergency diversion airports provide landing options.
315
+ Fuel dumping reduces aircraft weight if necessary.
316
+ Water landings are extremely unlikely events.
317
+ Aircraft flotation systems provide temporary buoyancy.
318
+ Rescue equipment is deployed by coast guard.
319
+ Search and rescue operations locate survivors.
320
+ Investigation teams analyze accident data.
321
+ Safety recommendations prevent similar accidents.
322
+ Aviation regulations evolve based on accident lessons.
323
+ Training programs incorporate recent safety findings.
324
+ Pilot experience reduces accident likelihood.
325
+ Rest requirements prevent pilot fatigue.
326
+ Fatigue management protocols protect safety.
327
+ Alcohol consumption is strictly prohibited for pilots.
328
+ Drug testing ensures pilot fitness for duty.
329
+ Medical certifications verify pilot health.
330
+ Vision requirements ensure adequate eyesight.
331
+ Hearing tests confirm adequate hearing ability.
332
+ Cardiovascular health is regularly evaluated.
333
+ Psychological evaluations assess mental fitness.
334
+ Stress management training helps pilots cope.
335
+ Simulator training prepares pilots for emergencies.
336
+ Emergency procedures are practiced regularly.
337
+ Engine failure drills prepare for system loss.
338
+ Fire emergency procedures are well rehearsed.
339
+ Hydraulic failure scenarios are practiced frequently.
340
+ Electrical failure simulations test backup systems.
341
+ Pressurization loss procedures are demonstrated.
342
+ Decompression scenarios are handled in simulators.
343
+ Evacuation drills prepare crews for rapid exits.
344
+ Water landing drills practice ditching procedures.
345
+ Terrorist threat scenarios are addressed in training.
346
+ Security protocols protect aircraft from threats.
347
+ Cockpit doors prevent unauthorized entry.
348
+ Air marshals provide additional security protection.
349
+ Background checks screen all aviation employees.
350
+ Baggage screening detects prohibited items.
351
+ Passenger screening includes metal detection.
352
+ Advanced imaging technology scans for weapons.
353
+ Dog teams detect explosives at airports.
354
+ Security perimeters restrict unauthorized access.
355
+ Employee badges allow controlled access.
356
+ Security cameras monitor restricted areas.
357
+ Access logs document who enters secure areas.
358
+ Cybersecurity protects aircraft systems from hackers.
359
+ Encryption secures sensitive aircraft data.
360
+ Software updates patch security vulnerabilities.
361
+ Antivirus protection prevents malware infections.
362
+ Intrusion detection identifies unauthorized access.
363
+ Firewalls protect network systems.
364
+ Backup systems ensure redundancy.
365
+ Data backups prevent information loss.
366
+ Cloud storage provides secure data storage.
367
+ Server maintenance ensures system reliability.
368
+ Network monitoring detects unusual activity.
369
+ System logs record all computer activities.
370
+ Audit trails track system changes.
371
+ Two-factor authentication secures accounts.
372
+ Password policies enforce strong passwords.
373
+ Biometric security uses fingerprints for identification.
374
+ Facial recognition technology identifies individuals.
375
+ Iris scanning provides additional verification.
376
+ Voice recognition technology confirms identity.
377
+ Digital signatures authenticate documents.
378
+ Blockchain technology ensures data integrity.
379
+ Cryptocurrency transactions provide security.
380
+ Virtual private networks protect communication.
381
+ SSL encryption secures web transactions.
382
+ TLS protocols protect data transmission.
383
+ DDoS protection prevents denial of service attacks.
384
+ Rate limiting controls traffic volume.
385
+ Load balancing distributes traffic efficiently.
386
+ Cache systems speed up data retrieval.
387
+ Database optimization improves query performance.
388
+ Query caching reduces database load.
389
+ Memory management ensures efficient resource use.
390
+ Garbage collection cleans up unused memory.
391
+ Thread management handles concurrent operations.
392
+ Process management controls system resources.
393
+ Task scheduling prioritizes important operations.
394
+ Queue management handles request backlogs.
395
+ Buffer management prevents data overflow.
396
+ Overflow protection prevents system crashes.
397
+ Error handling catches and reports issues.
398
+ Exception handling manages unexpected situations.
399
+ Logging records system events.
400
+ Monitoring alerts staff to problems.
401
+ Alerting systems notify administrators immediately.
402
+ Escalation procedures handle critical issues.
403
+ On-call rotation ensures 24-hour coverage.
404
+ Incident response teams handle emergencies.
405
+ Root cause analysis identifies problem sources.
406
+ Resolution procedures fix identified issues.
407
+ Documentation records problem details.
408
+ Knowledge bases preserve solutions.
409
+ Wiki systems share information.
410
+ Forum discussions exchange ideas.
411
+ Chat systems enable quick communication.
412
+ Email systems provide formal communication.
413
+ Tickets track problem resolution status.
414
+ Milestone tracking monitors project progress.
415
+ Sprint planning organizes development work.
416
+ Agile methodology improves team efficiency.
417
+ Scrum ceremonies coordinate team activities.
418
+ Daily standups keep teams aligned.
419
+ Retrospectives improve team processes.
420
+ Velocity tracking measures team productivity.
421
+ Burndown charts show project progress.
422
+ Release planning schedules code deployments.
423
+ Deployment automation speeds up releases.
424
+ Continuous integration catches problems early.
425
+ Continuous deployment releases code continuously.
426
+ Version control tracks code changes.
427
+ Git repositories store code history.
428
+ Branching strategies organize development work.
429
+ Pull requests review code before merging.
430
+ Code reviews improve code quality.
431
+ Testing frameworks automate quality assurance.
432
+ Unit tests verify individual functions.
433
+ Integration tests verify system components.
434
+ End-to-end tests verify complete workflows.
435
+ Performance tests measure system speed.
436
+ Load tests verify system capacity.
437
+ Stress tests find system limits.
438
+ Security testing identifies vulnerabilities.
439
+ Penetration testing simulates attacks.
440
+ Vulnerability scanning finds weaknesses.
441
+ Compliance testing ensures regulatory adherence.
442
+ Quality assurance processes prevent defects.
443
+ Bug tracking documents identified issues.
444
+ Severity levels prioritize bug fixes.
445
+ Priority levels organize fix scheduling.
446
+ Hotfix processes address critical issues.
447
+ Patch management distributes security updates.
448
+ Release notes document feature changes.
449
+ Migration guides help users transition.
450
+ Backward compatibility ensures old code works.
451
+ Forward compatibility allows future changes.
452
+ API documentation helps developers use services.
453
+ Code examples show correct usage patterns.
454
+ Tutorials teach common tasks.
455
+ Getting started guides ease onboarding.
456
+ FAQ sections answer common questions.
457
+ Troubleshooting guides solve common problems.
458
+ Support tickets enable customer assistance.
459
+ Community forums enable peer support.
460
+ Live chat provides immediate assistance.
461
+ Email support provides detailed responses.
462
+ Phone support enables voice communication.
463
+ Video tutorials demonstrate visual procedures.
464
+ Webinars enable interactive learning.
465
+ Conferences bring community together.
466
+ Meetups facilitate local networking.
467
+ User groups enable peer learning.
468
+ Mentorship programs match experts with learners.
469
+ Internship programs train new talent.
470
+ Apprenticeships teach skilled trades.
471
+ Bootcamps accelerate career transitions.
472
+ Online courses provide flexible learning.
473
+ University programs offer formal education.
474
+ Certification programs validate skills.
475
+ Continuing education maintains current knowledge.
476
+ Professional development advances careers.
477
+ Leadership training prepares managers.
478
+ Public speaking training builds communication skills.
479
+ Writing workshops improve documentation skills.
480
+ Presentation skills training enhances communication.
481
+ Negotiation training improves business outcomes.
482
+ Sales training increases revenue.
483
+ Customer service training improves satisfaction.
484
+ Time management training increases productivity.
485
+ Stress management training improves wellbeing.
486
+ Conflict resolution training prevents disputes.
487
+ Diversity training promotes inclusion.
488
+ Ethics training ensures compliance.
489
+ Harassment prevention training protects employees.
490
+ Safety training prevents workplace injuries.
491
+ Emergency procedures training prepares for crises.
492
+ First aid training saves lives.
493
+ CPR training provides lifesaving skills.
494
+ Defibrillator training teaches device usage.
495
+ Choking prevention training enables rescue.
496
+ Burn treatment training minimizes injury.
497
+ Fracture care training stabilizes injuries.
498
+ Wound care training prevents infection.
499
+ Infection control training prevents disease spread.
500
+ Hygiene practices prevent contamination.
501
+ Sanitation procedures maintain cleanliness.
502
+ Disinfection processes kill pathogens.
503
+ Sterilization ensures complete pathogen elimination.
504
+ Quarantine procedures prevent disease spread.
505
+ Isolation protocols protect vulnerable populations.
506
+ Personal protective equipment prevents pathogen exposure.
507
+ Vaccination programs prevent diseases.
508
+ Immunization records document vaccinations.
509
+ Booster shots maintain immunity levels.
510
+ Antibiotic therapy treats bacterial infections.
511
+ Antiviral therapy treats viral infections.
512
+ Pain management improves patient comfort.
513
+ Symptom management addresses disease effects.
514
+ Rehabilitation therapy restores function.
515
+ Physical therapy strengthens muscles.
516
+ Occupational therapy improves daily function.
517
+ Speech therapy improves communication.
518
+ Mental health counseling addresses emotional issues.
519
+ Psychotherapy treats mental disorders.
520
+ Medication management optimizes drug therapy.
521
+ Drug interactions are carefully monitored.
522
+ Side effects are managed carefully.
523
+ Allergic reactions are treated immediately.
524
+ Adverse events are reported promptly.
525
+ Clinical trials test new treatments.
526
+ Research studies advance medical knowledge.
527
+ Literature reviews summarize existing knowledge.
528
+ Meta-analyses combine multiple studies.
529
+ Systematic reviews assess evidence quality.
530
+ Evidence-based medicine improves outcomes.
531
+ Best practices guide clinical decisions.
532
+ Clinical guidelines standardize care.
533
+ Protocols ensure consistent procedures.
534
+ Procedures are documented carefully.
535
+ Records maintain patient information.
536
+ Privacy protection secures health data.
537
+ Confidentiality agreements protect information.
538
+ HIPAA compliance protects patient privacy.
539
+ Data security prevents unauthorized access.
540
+ Access controls limit information exposure.
541
+ Audit logs track data access.
542
+ Encryption protects data transmission.
543
+ Secure communications prevent eavesdropping.
544
+ VPNs provide secure connections.
545
+ Firewalls block unauthorized traffic.
546
+ Intrusion detection identifies attacks.
547
+ Antimalware software removes malicious code.
548
+ Antivirus programs prevent virus infections.
549
+ Ransomware protection prevents data theft.
550
+ Backup procedures prevent data loss.
551
+ Disaster recovery plans restore operations.
552
+ Business continuity planning minimizes disruption.
553
+ Risk management identifies potential problems.
554
+ Insurance coverage provides financial protection.
555
+ Liability protection limits legal exposure.
556
+ Workers compensation covers work injuries.
557
+ Unemployment insurance supports job loss.
558
+ Disability insurance replaces lost income.
559
+ Life insurance protects dependents.
560
+ Health insurance covers medical expenses.
561
+ Dental insurance covers tooth care.
562
+ Vision insurance covers eye care.
563
+ Mental health coverage addresses mental illness.
564
+ Substance abuse coverage treats addiction.
565
+ Rehabilitation coverage restores function.
566
+ Long-term care insurance covers extended care.
567
+ Nursing home care provides residential services.
568
+ Assisted living facilities support daily activities.
569
+ Senior care services assist aging adults.
570
+ Hospice care supports end-of-life comfort.
571
+ Palliative care relieves suffering.
572
+ Pain management improves quality of life.
573
+ Spiritual care supports belief systems.
574
+ Grief counseling supports bereavement.
575
+ Funeral services honor the deceased.
576
+ Estate planning organizes assets.
577
+ Will preparation documents wishes.
578
+ Probate processing distributes assets.
579
+ Trust management protects assets.
580
+ Financial planning builds wealth.
581
+ Investment strategies grow money.
582
+ Retirement planning ensures future security.
583
+ Pension plans provide retirement income.
584
+ Social security provides government retirement.
585
+ 401k plans offer employer retirement.
586
+ IRA accounts provide individual retirement.
587
+ Roth conversions reduce future taxes.
588
+ Tax planning minimizes tax burden.
589
+ Deduction strategies reduce taxable income.
590
+ Credit strategies reduce tax liability.
591
+ Refund optimization maximizes returns.
592
+ Quarterly payments prevent penalties.
593
+ Estimated taxes avoid surprises.
594
+ Extension requests delay filing deadlines.
595
+ Audit protection responds to IRS inquiries.
596
+ Appeals process challenges IRS decisions.
597
+ Settlement negotiations resolve disputes.
598
+ Collection defense prevents asset seizure.
599
+ Wage garnishment protection prevents income loss.
600
+ Lien release removes property claims.
601
+ Levy protection prevents forced sales.
602
+ Bankruptcy protection prevents creditor actions.
603
+ Debt restructuring reduces obligations.
604
+ Credit counseling improves financial health.
605
+ Debt consolidation simplifies payments.
606
+ Payment plans spread costs over time.
607
+ Hardship programs provide relief.
608
+ Forbearance pauses payments temporarily.
609
+ Deferment delays payments indefinitely.
610
+ Forgiveness programs cancel remaining debt.
611
+ Public service forgiveness rewards service.
612
+ Teacher forgiveness rewards educators.
613
+ Nurse forgiveness rewards healthcare workers.
614
+ Military forgiveness rewards service members.
615
+ Income-driven repayment reduces payments.
616
+ Standard repayment pays loans quickly.
617
+ Graduated repayment starts low then rises.
618
+ Employer benefits provide loan help.
619
+ Employer matching multiplies savings.
620
+ Profit sharing distributes gains.
621
+ Bonus plans reward performance.
622
+ Stock options provide ownership.
623
+ Restricted stock units defer compensation.
624
+ Equity compensation aligns interests.
625
+ Performance bonuses reward results.
626
+ Attendance bonuses reward reliability.
627
+ Referral bonuses reward recruitment.
628
+ Loyalty bonuses reward tenure.
629
+ Completion bonuses reward milestones.
630
+ Achievement bonuses reward excellence.
631
+ Safety bonuses reward protection.
632
+ Quality bonuses reward perfection.
633
+ Customer service bonuses reward satisfaction.
634
+ Efficiency bonuses reward productivity.
635
+ Innovation bonuses reward creativity.
636
+ Teamwork bonuses reward collaboration.
637
+ Leadership bonuses reward management.
638
+ Volunteer bonuses reward service.
639
+ Community bonuses reward participation.
640
+ Sustainability bonuses reward environmental protection.
641
+ Diversity bonuses reward inclusion.
642
+ Training bonuses reward development.
643
+ Certification bonuses reward credentials.
644
+ Degree bonuses reward education.
645
+ Language bonuses reward multilingualism.
646
+ Wellness bonuses reward health.
647
+ Fitness bonuses reward exercise.
648
+ Nutrition bonuses reward healthy eating.
649
+ Mental health bonuses reward wellbeing.
650
+ Work-life balance bonuses reward harmony.
651
+ Remote work bonuses reward flexibility.
652
+ Flexible schedule bonuses reward adjustment.
653
+ Compressed schedule bonuses reward efficiency.
654
+ Part-time bonuses reward availability.
655
+ Contract bonuses reward temporary work.
656
+ Freelance bonuses reward independent work.
657
+ Gig economy work provides flexibility.
658
+ Zero-hour contracts enable flexibility.
659
+ Employment agencies place workers.
660
+ Temp agencies provide temporary workers.
661
+ Staffing companies manage workforce.
662
+ Recruiting firms find candidates.
663
+ Headhunters identify top talent.
664
+ Executive search finds leaders.
665
+ Campus recruiting finds graduates.
666
+ Job fairs attract candidates.
667
+ Online job boards list positions.
668
+ LinkedIn recruiting finds professionals.
669
+ Indeed postings attract job seekers.
670
+ Glassdoor reviews influence candidates.
671
+ Salary websites inform negotiations.
672
+ Benefits packages attract employees.
673
+ Sign-on bonuses attract talent.
674
+ Relocation packages support moves.
675
+ Housing assistance supports new employees.
676
+ Transportation assistance reduces commute costs.
677
+ Childcare assistance supports parents.
678
+ Educational assistance supports learning.
679
+ Tuition reimbursement funds education.
680
+ Book allowances support learning.
681
+ Conference attendance funds development.
682
+ Membership fees cover professional organizations.
683
+ Subscription services provide resources.
684
+ Software licenses enable tool use.
685
+ Hardware provisioning enables productivity.
686
+ Office space supports collaboration.
687
+ Meeting rooms enable discussions.
688
+ Video conferencing enables remote meetings.
689
+ Phone systems enable communication.
690
+ Email systems enable messaging.
691
+ Instant messaging enables quick communication.
692
+ Project management tools organize work.
693
+ Time tracking ensures accurate billing.
694
+ Expense tracking controls spending.
695
+ Budget management optimizes resources.
696
+ Forecasting predicts future needs.
697
+ Scenario planning prepares for changes.
698
+ Contingency planning manages uncertainties.
699
+ Risk assessment identifies threats.
700
+ Opportunity assessment identifies advantages.
701
+ SWOT analysis evaluates position.
702
+ Competitor analysis understands rivals.
703
+ Market research understands customers.
704
+ Customer surveys gather feedback.
705
+ Focus groups explore ideas.
706
+ Interviews gather detailed information.
707
+ Observations understand behavior.
708
+ Experiments test hypotheses.
709
+ Case studies examine examples.
710
+ Data analysis draws conclusions.
711
+ Statistical analysis proves significance.
712
+ Regression analysis finds relationships.
713
+ Correlation analysis measures association.
714
+ Time series analysis tracks trends.
715
+ Forecasting predicts future values.
716
+ Sentiment analysis understands opinions.
717
+ Natural language processing interprets text.
718
+ Machine learning enables pattern recognition.
719
+ Deep learning finds complex patterns.
720
+ The Earth orbits the Sun once every three hundred and sixty five days.
721
+ Water freezes at zero degrees Celsius and boils at one hundred degrees.
722
+ Oxygen is a gas that humans need to breathe to stay alive.
723
+ The capital city of France is Paris which is known for its history.
724
+ Standard computers use binary code consisting of zeros and ones to process data.
725
+ Gravity is the force that pulls objects toward the center of the Earth.
726
+ Trees produce oxygen through a biological process called photosynthesis.
727
+ Mathematics is the study of numbers shapes and patterns in the universe.
728
+ Light travels at a speed of approximately three hundred thousand kilometers per second.
729
+ A standard human skeleton is made up of two hundred and six bones.
730
+ The Sun sets in the west and rises in the east due to the Earth's rotation.
731
+ "Hello, how can i help you today"
732
+ "Hello, how can i help you today?"
733
+ "Hello, how can i help you today"
734
+ "Hello, how can i help you today"
735
+ "Hello, how can i help you today?"
736
+ "Hi Hello, how can i help you today"
737
+ "Hi Hello, how can i help you today"
738
+ "hi Hello, how can i help you today"
739
+ "hi Hello, how can i help you today"
740
+ uhh i dont really know Thats okay what would you like to share me
741
+ uhh i dont really know Thats okay what would you like to share me
742
+ uhh i dont really know Thats okay what would you like to share me
743
+ uhh i dont really know Thats okay what would you like to share me
744
+ uhh i dont really know Thats okay what would you like to share me
745
+ hi hello how can i help you today
746
+ hi hello how can i help you today
747
+ hi hello how can i help you today
748
+ hi hello how can i help you today
749
+ hi hello how can i help you today
750
+ hi hello hello how can i help you
751
+ hi hello hello how can i help you
752
+ hi hello hello how can i help you
753
+ hi hello hello how can i help you
754
+ hi hello hello how can i help you
training_data.csv ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hi Hello how can i help you today?
2
+ "what can you do I can assist with various tasks including - writing storytelling and providing information"
3
+ hi Greetings How may I assist you today do you have a specific topic to discuss?
4
+ i dont know thats fine if you need help with something just ask me meanwhile would you like to share a specific topic you are interested in
5
+ "Hello Hi how can I assist you today, is there something specific you would like to discuss or learn about?"
6
+ hi Hello there how can I help you today do you have any questions or topics in mind
7
+ "You are dumb I'm sorry to hear your feedback about me, i do not want to get you annoyed so i'll just stop."
8
+ hi Greetings how may i assist you today do is there some specific topic you want to discuss
9
+ hi Hello how may i assist you today do is there something specific topic you want to discuss
10
+ "hi Hello, how can i can i help you today do you have any questions or topics you would like to discuss?"
11
+