Chapter 4 After Modfiy
Chapter 4 After Modfiy
Further enhancements to this approach may involve creating more sophisticated dictionaries
with degrees of positive, negative, and neutral sentiment of words or formulating specific
heuristics (e.g., usage of certain smileys indicate positive sentiment) and using them to make
predictions. This approach is called lexicon-based sentiment analysis.
5- Describe with an example the confusion matrix of a classifier. ?
A confusion matrix is a table that is used to evaluate the performance of a classifier by
comparing the actual and predicted class labels.
discriminative classifier →that aims to learn the probability distribution over all classes
9- How to use word embeddings as features for text classification ?
Words and n-grams have been used primarily as features in text classification for a long
time. Different ways of vectorizing words have been proposed, and we used one such
representation in the last section, CountVectorizer.
neural network–based architectures have become popular for “learning” word
representations, which are known as “word embeddings.”
We’ll use the sentiment-labeled sentences dataset from the UCI repository, consisting of 1,500
positive-sentiment and 1,500 negative sentiment sentences from Amazon. All the steps are
detailed in the Word2Vec.
10- List the steps for converting training and test data into a format suitable for the neural
network. ?
1. Tokenize the texts and convert them into word index vectors.
2. Pad the text sequences so that all text vectors are of the same length.
3. Map every word index to an embedding vector.
4. Use the output from Step 3 as the input to a neural network architecture
11- Which technique is better for text classification CNN or LSTM and why ?
when the size of the data set is large or the sentences are long, it is preferable to use the
LSTM.
LSTMs and other variants of RNNs in general have become the go-to way of doing neural
language modeling. This is primarily because language is sequential in nature and RNNs are
specialized in working with sequential data.
LSTMs are more powerful in utilizing the sequential nature of text, they’re much more data
hungry as compared to CNNs.
12- How text classification models can be interpreted ?
As ML models started getting deployed in real-world applications, interest in the direction of
model interpretability grew. Recent research resulted in usable tools for interpreting model
predictions (especially for classification). Lime is one such tool that attempts to interpret a
black-box classification model by approximating it with a linear model locally around a given
training instance.
13- How to solve no training and less training data problems?
No Training Data → The first step in such a scenario is creating an annotated dataset
Less Training Data → One approach to address such problems is active learning, approach
for domain adaptation
14- Give some options to explore when no labels exist for a dataset.?
Use existing APIs or libraries
Use public datasets
Utilize weak supervision
Active learning
Learning from implicit and explicit feedback
15- Describe the pipeline for building a classifier when there is no training data.?