فهرست مطالب
Cover
Title Page
Copyright and Credits
Contributors
Table of Contents
Preface
Part 1:Essentials
Chapter 1: Foundations
Emotions
Categorical
Dimensional
Sentiment
Why emotion analysis is important
Introduction to NLP
Phrase structure grammar versus dependency grammar
Rule-based parsers versus data-driven parsers
Semantics (the study of meaning)
Introduction to machine learning
Technical requirements
A sample project
Logistic regression
Support vector machines (SVMs)
K-nearest neighbors (k-NN)
Decision trees
Random forest
Neural networks
Making predictions
A sample text classification problem
Summary
References
Part 2:Building and Using a Dataset
Chapter 2: Building and Using a Dataset
Ready-made data sources
Creating your own dataset
Data from PDF files
Data from web scraping
Data from RSS feeds
Data from APIs
Other data sources
Transforming data
Non-English datasets
Evaluation
Summary
References
Chapter 3: Labeling Data
Why labeling must be high quality
The labeling process
Best practices
Labeling the data
Gold tweets
The competency task
The annotation task
Buy or build?
Results
Inter-annotator reliability
Calculating Krippendorff’s alpha
Debrief
Summary
References
Chapter 4: Preprocessing – Stemming, Tagging, and Parsing
Readers
Word parts and compound words
Tokenizing, morphology, and stemming
Spelling changes
Multiple and contextual affixes
Compound words
Tagging and parsing
Summary
References
Part 3:Approaches
Chapter 5: Sentiment Lexicons and Vector-Space Models
Datasets and metrics
Sentiment lexicons
Extracting a sentiment lexicon from a corpus
Similarity measures and vector-space models
Vector spaces
Calculating similarity
Latent semantic analysis
Summary
References
Chapter 6: Naïve Bayes
Preparing the data for sklearn
Naïve Bayes as a machine learning algorithm
Naively applying Bayes’ theorem as a classifier
Multi-label datasets
Summary
References
Chapter 7: Support Vector Machines
A geometric introduction to SVMs
Using SVMs for sentiment mining
Applying our SVMs
Using a standard SVM with a threshold
Making multiple SVMs
Summary
References
Chapter 8: Neural Networks and Deep Neural Networks
Single-layer neural networks
Multi-layer neural networks
Summary
References
Chapter 9: Exploring Transformers
Introduction to transformers
How data flows through the transformer model
Input embeddings
Positional encoding
Encoders
Decoders
Linear layer
Softmax layer
Output probabilities
Hugging Face
Existing models
Transformers for classification
Implementing transformers
Google Colab
Single-emotion datasets
Multi-emotion datasets
Summary
References
Chapter 10: Multiclassifiers
Multilabel datasets are hard to work with
Confusion matrices
Using “neutral” as a label
Thresholds and local thresholds
Multiple independent classifiers
Summary
Part 4:Case Study
Chapter 11: Case Study – The Qatar Blockade
The case study
Short-term changes
Long-term changes
Proportionality revisited
Summary
Index
Other Books You May Enjoy
Title Page
Copyright and Credits
Contributors
Table of Contents
Preface
Part 1:Essentials
Chapter 1: Foundations
Emotions
Categorical
Dimensional
Sentiment
Why emotion analysis is important
Introduction to NLP
Phrase structure grammar versus dependency grammar
Rule-based parsers versus data-driven parsers
Semantics (the study of meaning)
Introduction to machine learning
Technical requirements
A sample project
Logistic regression
Support vector machines (SVMs)
K-nearest neighbors (k-NN)
Decision trees
Random forest
Neural networks
Making predictions
A sample text classification problem
Summary
References
Part 2:Building and Using a Dataset
Chapter 2: Building and Using a Dataset
Ready-made data sources
Creating your own dataset
Data from PDF files
Data from web scraping
Data from RSS feeds
Data from APIs
Other data sources
Transforming data
Non-English datasets
Evaluation
Summary
References
Chapter 3: Labeling Data
Why labeling must be high quality
The labeling process
Best practices
Labeling the data
Gold tweets
The competency task
The annotation task
Buy or build?
Results
Inter-annotator reliability
Calculating Krippendorff’s alpha
Debrief
Summary
References
Chapter 4: Preprocessing – Stemming, Tagging, and Parsing
Readers
Word parts and compound words
Tokenizing, morphology, and stemming
Spelling changes
Multiple and contextual affixes
Compound words
Tagging and parsing
Summary
References
Part 3:Approaches
Chapter 5: Sentiment Lexicons and Vector-Space Models
Datasets and metrics
Sentiment lexicons
Extracting a sentiment lexicon from a corpus
Similarity measures and vector-space models
Vector spaces
Calculating similarity
Latent semantic analysis
Summary
References
Chapter 6: Naïve Bayes
Preparing the data for sklearn
Naïve Bayes as a machine learning algorithm
Naively applying Bayes’ theorem as a classifier
Multi-label datasets
Summary
References
Chapter 7: Support Vector Machines
A geometric introduction to SVMs
Using SVMs for sentiment mining
Applying our SVMs
Using a standard SVM with a threshold
Making multiple SVMs
Summary
References
Chapter 8: Neural Networks and Deep Neural Networks
Single-layer neural networks
Multi-layer neural networks
Summary
References
Chapter 9: Exploring Transformers
Introduction to transformers
How data flows through the transformer model
Input embeddings
Positional encoding
Encoders
Decoders
Linear layer
Softmax layer
Output probabilities
Hugging Face
Existing models
Transformers for classification
Implementing transformers
Google Colab
Single-emotion datasets
Multi-emotion datasets
Summary
References
Chapter 10: Multiclassifiers
Multilabel datasets are hard to work with
Confusion matrices
Using “neutral” as a label
Thresholds and local thresholds
Multiple independent classifiers
Summary
Part 4:Case Study
Chapter 11: Case Study – The Qatar Blockade
The case study
Short-term changes
Long-term changes
Proportionality revisited
Summary
Index
Other Books You May Enjoy