Write java codes to perform sentiment analysis

Assignment Help JAVA Programming
Reference no: EM131252379

In this programming assignment, I am asked to write Java codes to perform Sentiment Analysis: classifying movie reviews as positive or negative.

You need to do the following tasks:

1. You will build a Naive Bayes model with Laplace (add-1) smoothing based on given training dataset. The training dataset is in the folder of "trainingdata", which contains two subfolders "pos" and "neg".

Your classifier will use words as features. You will also explore the effects of stop-word filtering. This means removing common words like "the", "a" and "it" from your train and testing sets. A stop list has been provided in the file named as "stop.txt".

2. You need to compute the prior probabilities for each class, and the probabilities of the vocabulary for each class. Particularly, you need to print out the following probabilities in your output:

(a) Vocabulary size of this training dataset

(b) Prior probabilities for each class (positive and negative)

(c) P(bad/positive) and P(bad/negative)

(d) P(great/positive) and P(great/negative)

(e) P(performance/positive) and P(performance/negative)

(f) P(life/positive) and P(life/negative)

(g) P(supposed/positive) and P(supposed/negative)

You should print one line for each item. Make sure you label them (positive or negative), and align them well.

3. You will use the Naive Bayes model trained above to test ten testing documents (stored in the folder of "testdata"). Specifically, for each testing document, you need to print out:

(a) document label

(b) probability for positive class (log base of 10)

(c) probability for positive class (log base of 10), and

(d) assignment of class (negative or positive)

The output for four items should be printed in one line, with ten lines in total. Make sure you align them well.

Training Data - https://www.dropbox.com/s/h1lwrxfc853sn7b/Training%20Data.zip?dl=0.

Reference no: EM131252379

Questions Cloud

Advantages of having views only contain : 1. What are the advantages of having views only contain the fields required by a given user? 2. Under which conditions should you create an index on a field (or combination of fields)?
Draw on assigned course readings in the construction : Draw on assigned course readings in the construction of your answer. It will be evaluated based on quality of answer, quality of prose, and level of familiarity it demonstrates with assigned readings. Responses which demonstrate mastery of assig..
Discuss the advantages and disadvantages of each method : Primary Task Response: Within the Discussion Board area, write 500-700 words that respond to the following questions with your thoughts, ideas, and comments. This will be the foundation for future discussions by your classmates. Be substantive and..
How well is the solution working : Explain the Five-Step Model in Ch. 3 of Thinking Critically, giving a brief description of each step. This should be no more than 50 words of the 300-word minimum.
Write java codes to perform sentiment analysis : In this programming assignment, I am asked to write Java codes to perform Sentiment Analysis: classifying movie reviews as positive or negative
Design entity relationship diagram for mail order database : Design an Entity-Relationship diagram for the mail order database and enter the design using a data-modeling tool such as ERWin.
What would a functionalist say is wrong with the mind : What would a functionalist say is wrong with the mind/brain identity theory? Explain and explain multiple realizability - Explain the type/token distinction.
How have these changes affected faculty performance : For an effective training, the objectives should define all three parameters. In this Assignment, you will set effective objectives for the recommended training program. Ensure that all the parameters are addressed.
Design an entity relationship diagram : Design an Entity-Relationship diagram for the movie order database and enter the design using a data-modeling tool such as ERWin.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd