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

  Write a program that prompts a user to enter a us dollar

Write a program that prompts a user to enter a US dollar amount. Output a table similar to the one in the example below. The second prompt should ask the user to enter a 1 to convert to euros, a 2 to convert to pounds and a 3 to convert to ruble..

  Allows the user to enter a temperature and whether

Write a program that allows the user to enter a temperature and whether the temperature is stated in Celsius or Fahrenheit...or whethe

  Write a version of sumpairs

Write a version of sumPairs  that sums each component of the pairs separately, returning a pair consisting of the sum of the first components and the sum of the second components. So basically [(3,1)(10,3)] would return (13,4).

  Generate a gui to perform as a binary calculator

Generate a GUI to perform as a binary calculator which can do addition, subtraction, multiplication, division, logical bit AND, and logical bit OR for binary integer numbers

  Design an adt for the problem

Design an ADT for this problem. Be sure to consider all necessary operations to maintain the appointment book for one year, to archive the yearly book and create a new book for the following year.

  Importance of information management for starbucks

1. Ascertain the importance of information management for Starbucks. 2. Analyze the fundamental impact of IT architecture or enterprise architecture on information management of Starbucks. Determine if IT architecture impacts the effectiveness or ..

  How many numbers do you want to enter

Write a program that asks the user "How many numbers do you want to enter?" With that value, create an array that is big enough to hold that amount of numbers (integers).

  Create a 2d array of randomly generated ints

Write a complete Java class that will create a 2D array of randomly generated ints that of size 5 rows and 10 columns. Print the values of each cell to a 5x10 table.

  Java program that plays a guessing game with the user

The user must be allowed to play until deciding to explicitly terminate the game (I would use an exit button on the GUI window).

  Working for hypothetical insurance company

Assume that you are working for hypothetical insurance company. This company offers insurance for 4 types of vehicles: cars, trucks, motor cycles and boats. In order to keep the program manageable, we will assume that we do not make a finer distin..

  Starting hand gesture for the computer

You will develop a webpage that will allow the user to play Rock- Paper- Scissors against the computer.

  Create a java program to calculate the circumference

Create a Java program based on the geometric shapes. The program should begin by prompting you for the shape you want to calculate the circumference.

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