# 7. File extension hint if 'txt' in tokens: features['file_extension'] = 'txt' features['looks_like_filename'] = True else: features['looks_like_filename'] = False
# 8. Pairwise patterns (bigrams) bigrams = [' '.join(tokens[i:i+2]) for i in range(len(tokens)-1)] features['bigrams'] = bigrams stephen 52 yahoo com gmail com mail com 2020 21 txt
# 9. Embedded feature: "year + number" combo if len(years) == 1 and len(numbers) > 1: other_nums = [n for n in numbers if n not in years] if other_nums: features['year_num_pair'] = (years[0], other_nums[0]) Embedded feature: "year + number" combo if len(years)
# 2. Name detection (if first token looks like a name) if tokens and tokens[0].isalpha() and tokens[0][0].isupper(): features['has_name'] = True features['first_token_is_name'] = tokens[0] else: features['has_name'] = False '21 txt'] year_num_pair: (2020
# 4. Email-related fragments email_domains = ['gmail', 'yahoo', 'mail', 'outlook', 'hotmail'] found_domains = [d for d in email_domains if d in tokens] features['email_domains_mentioned'] = found_domains features['email_domain_count'] = len(found_domains)
token_count: 9 char_count: 44 digit_count: 6 alpha_count: 32 has_name: False numbers_found: [52, 2020, 21] num_count: 3 num_sum: 2093 num_avg: 697.666... email_domains_mentioned: ['yahoo', 'gmail', 'mail'] email_domain_count: 3 possible_emails: [] years_found: [2020] file_extension: txt looks_like_filename: True bigrams: ['stephen 52', '52 yahoo', 'yahoo com', 'com gmail', 'gmail com', 'com mail', 'mail com', 'com 2020', '2020 21', '21 txt'] year_num_pair: (2020, 21) entropy: 3.892 from sentence_transformers import SentenceTransformer model = SentenceTransformer('all-MiniLM-L6-v2') embedding = model.encode(raw) features['sentence_embedding'] = embedding # 384-dim vector If by “make a deep feature” you meant something else (e.g., a neural net feature map, a regex to extract a password/username, or a data pipeline), let me know and I’ll adjust.