
# Text Representation

## 🔖 Outline

To be added


## 🗒️ Notebooks

Set of notebooks associated with the chapter. 

1. **[One-Hot Encoding](https://github.com/practical-nlp/practical-nlp/blob/master/Ch3/01_OneHotEncoding.ipynb)**: Here we demonstrate One-Hot encoding from the first principle as well as scikit learn's implementation on our toy corpus.

2. **[Bag of Words](https://github.com/practical-nlp/practical-nlp/blob/master/Ch3/02_Bag_of_Words.ipynb)** : Here we demonstrate how to arrive at the bag of words representation for our toy corpus.
    

3. **[Bag of N Grams](https://github.com/practical-nlp/practical-nlp/blob/master/Ch3/03_Bag_of_N_Grams.ipynb)**: Here we demonstrate how Bag of N-Grams work using our toy corpus.

4. **[TF-IDF](https://github.com/practical-nlp/practical-nlp/blob/master/Ch3/04_TF_IDF.ipynb)**: Here we demonstrate how to obtain the get the TF-IDF representation of a document using sklearn's TfidfVectorizer(we will be using our toy corpus). 

5. **[Pre-trained Word Embeddings](https://github.com/practical-nlp/practical-nlp/blob/master/Ch3/05_Pre_Trained_Word_Embeddings.ipynb)**: Here we demonstrate how we can represent text using pre-trained word embedding models and how to use them to get representations for the full text.

6. **[Custom Word Embeddings](https://github.com/practical-nlp/practical-nlp/blob/master/Ch3/06_Training_embeddings_using_gensim.ipynb)**: Here we demonstrate how to train a custom Word Embedding model(word2vec) using gensim on both, our toy corpus and a subset of Wikipedia data.

7. **[Vector Representations via averaging](https://github.com/practical-nlp/practical-nlp/blob/master/Ch3/07_DocVectors_using_averaging_Via_spacy.ipynb)**: Here we demonstrate averaging of Document Vectors using spaCy.

8. **[Doc2Vec Model](https://github.com/practical-nlp/practical-nlp/blob/master/Ch3/08_Training_Dov2Vec_using_Gensim.ipynb)**: Here we demonstrate how to train your own doc2vec model.

9. **[Visualizing Embeddings Using TSNE](https://github.com/practical-nlp/practical-nlp/blob/master/Ch3/09_Visualizing_Embeddings_Using_TSNE.ipynb)**: Here we demonstrate how we can use dimensionality reduction techniques such as TSNE to visualize embeddings.

10. **[Visualizing Embeddings using Tensorboard](https://github.com/practical-nlp/practical-nlp/blob/master/Ch3/10_Visualizing_Embeddings_using_Tensorboard.ipynb)**: Here we demonstrate how we can visualize embeddings using Tensorboard.


## 🖼️ Figures

Color figures as requested by the readers. 

![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-1.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-2.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-3.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-4.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-5.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-6.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-7.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-8.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-9.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-10.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-11.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-12.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-13.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-14.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-15.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-16.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-17.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-18.png)
![figure](https://github.com/practical-nlp/practical-nlp-figures/raw/master/figures/3-19.png)

