Stephen 52 Yahoo Com Gmail Com Mail Com 2020 21 Txt Instant

# 1. Basic stats features['token_count'] = len(tokens) features['char_count'] = len(text) features['digit_count'] = sum(c.isdigit() for c in text) features['alpha_count'] = sum(c.isalpha() for c in text)

# 7. File extension hint if 'txt' in tokens: features['file_extension'] = 'txt' features['looks_like_filename'] = True else: features['looks_like_filename'] = False stephen 52 yahoo com gmail com mail com 2020 21 txt

# 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

# 10. Text entropy (as a measure of unpredictability) import math freq = {} for ch in text: freq[ch] = freq.get(ch, 0) + 1 entropy = -sum((count/len(text)) * math.log2(count/len(text)) for count in freq.values()) features['entropy'] = round(entropy, 3) stephen 52 yahoo com gmail com mail com 2020 21 txt