Question: Assignment Exercise 2: PART A: Q1: Using a data set of your choice, do the following. Remember that the only pre-requisite before setting about with
Assignment Exercise 2: PART A: Q1: Using a data set of your choice, do the following. Remember that the only pre-requisite before setting about with Naive classification is to have an existing set of examples for each category/ class [Training data] that we wish to bucket / categorize pieces of text into Classifier A: Train a Naive Bayes classifier using Bag of words approach. Compare performance for the above model [confusion matrix + performance metrics accuracy, precision and recall]. Q2: Design and implement Hidden Markov Model (HMM) based Part-of-Speech (POS) tagger with the following assumptions: - Markov assumption length 1 - Probability of any state sk depends on its previous state only, i.e., P(sk | sk-1) Evaluate the following in your HMM and report: - Precision, recall and F1-score. - Confusion matrix (Each element Aij of matrix A denotes the number of times tag i classified as tag j) Note: The brown corpus in NLTK comes with its data POS tagged, so you can use the brown tagged POS data set to train your HMM PART B: Given a tweet and an emotion X, determine the intensity or degree of emotion X felt by the speaker -- a real-valued score between 0 and 1. The maximum possible score 1 stands for feeling the maximum amount of emotion X (or having a mental state maximally inclined towards feeling emotion X). The minimum possible score 0 stands for feeling the least amount of emotion X (or having a mental state maximally away from feeling emotion X). The tweet along with the emotion X will be referred to as an instance. Features to implement: You are provided with a paper pdf. You need to construct the feature vector as given in the paper ((Section 2.3.1) + N-grams features (N= 1, 2)) DATA SET: https://saifmohammad.com/WebPages/EmotionIntensity-SharedTask.html You are required to use the training sets of the two emotion classes - Anger and Joy, for training the model and the test sets of the emotion classes for testing the model. Machine learning algorithms: A. Naive Bayes: Implement the algorithm from scratch on the provided dataset. Train the model on the train set and report the performance metrics on the test set. Evaluation: a. Report accuracy, precision, recall
with code in python solve any one part and please send code in executable form
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
