🔤 Text Encoding Playground

Convert Text to Numerical Representations for ML/DL Models

Label Encoding

What is it? Converts categorical text labels to integer values (0, 1, 2, ...). Useful for ordinal data or as input to tree-based models.

One-Hot Encoding

What is it? Creates binary vectors where each category gets its own column with 1 or 0. Prevents ordinal assumptions in ML algorithms.

Bag-of-Words (BoW)

What is it? Counts word occurrences in documents, creating a vector representation. Ignores word order and grammar.

TF-IDF (Term Frequency–Inverse Document Frequency)

What is it? Weights words by their importance. Frequent words in one document but rare across all documents get higher scores. Better than BoW for NLP tasks.

Embeddings (Word2Vec-like)

What is it? Dense vector representations where similar words have similar vectors. Captures semantic meaning. Simulated with hash-based approach for demonstration.