Your Perfect Assignment is Just a Click Away
We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

                  p1
 

                  p1
 

CS1026: Assignment 3 – Sentiment Analysis
Weight: 11%
Learning Outcome:
By completing this assignment, you will gain skills relating to
• using functions,
• complex data structures,
• nested loops,
• text processing,
• file input and output,
• exceptions in Python,
• writing code that is used by other programs.
Background:
With the emergence of Internet companies such as Google, Facebook, and Twitter, more and more data accessible online is comprised of text.  Text ual  data and the computational means of processing it and extracting information is also increasingly more important in areas such as business, humanities, social sciences, etc.  In this assignment, you will deal with textual analysis.
Twitter has become very popular, with many people “tweeting” aspects of their daily lives.  This “flow of tweets” has recently become a way to study or guess how people feel about various aspects of the world or their own life.  For example, analysis of tweets has been used to try  to determine how certain geographical regions may be voting – this is done by analyzing the content, the words, and phrases, in tweets.  Similarly, analysis of keywords or phrases in tweets can be used to determine how popular or unpopular a movie might be.  This is often referred to as sentiment analysis.
Task:
In this assignment, you will write a Python module, called sentiment_analysis.py (this is the name of the file that you should use) and a main program, main.py, that uses the module to analyze Twitter information.  In this module, you will create a function that will perform simple  sentiment analysis on Twitter data.  The Twitter data contains comments from individuals about how they feel about their lives and comes from individuals across the continental United States.  The objective is to determine which timezone (Eastern, Central, Mountain, Pacific; see below for more information on how to do this) is
the “happiest”.  To do this, your program will need to:
• Analyze each individual tweet to determine a score – a “happiness score”.
• The “happiness score” for a single tweet is found by looking for certain keywords (which are given) in a tweet and for each keyword found in that tweet totaling their “sentiment values”.  In this assignment, each value is an integer from 1 to 10.
The happiness score for the tweet is simply the sum of the “sentiment values” for
keywords found in the tweet divided by the number of keywords found in the tweet.
If there are none of the given keywords in a tweet, it is just ignored, i.e., you do NOT
count it.
To determine the words in a tweet, you should do the following:
o Separate a tweet into words based on white space. A “word” is any sequence of
characters surrounded by white space (blank, tab, end of line, etc.).
o You should remove any punctuation from the beginning or end of the word.  So,
“#lonely” would become “lonely” and “happy!!” would become “happy”.
o You should convert the “word” into just lower case letters.  This gives you a “word”
from the tweet.
o If you match the “word” to any of the sentiment keywords (see below), you add the
score of that sentiment keyword to a total for the tweet; you can just do exact
matches.
• A “counted tweet” is a tweet in which there was at least one matched keyword.
• The “happiness score” for a timezone is just the total of the scores for all the counted
tweets in that region divided by the number of counted tweets in that region; again, if a
tweet has NO keywords, then it is NOT counted as a tweet in that timezone.
A file called tweets.txt contains the tweets and a file called keywords.txt contains keywords and scores for determining the “sentiment” of an individual tweet.  These files are described in more detail below.
File tweets.txt
The file tweets.txt contains the tweets; one per line (some lines are quite long).  The format of a tweet is:
  [lat, long] value date time text
where:
• [lat, long] – the latitude and longitude of where the tweet originated.  You will need
these values to determine the time zone in which the tweet originated.
• value – not used; this can be skipped.
• date – the date of the tweet; not used, this can be skipped.
• time – the time of day that the tweet was sent; not used this can be skipped.
• text – the text in the  tweet.
File keywords.txt
The file keywords.txt contains sentiment keywords and their “happiness scores”; one per line.
The format of a line is:
  keyword, value where:
• keyword – the keyword to look for.
• value – the value of the keyword; values are limited to 1, 5, 7 and 10, where 1
represents very “unhappy” and 10 represents “very happy”.
(you are free to explore different sets of keywords and values at your leisure for the sheer fun of it!).
Determining timezones across the continental United States
Given a latitude and longitude, the task of determining exactly the location that it corresponds to can be very challenging given the geographical boundaries of the United   States.  For this assignment, we simply approximate the regions corresponding to the timezones by rectangular areas defined by latitude and longitude points.  Our approximation  looks like:
             p9                         p7                           p5                          p3                       p1
 

Click HERE to order a unique plagiarism free paper done by 

professional writers and delivered before your deadline

In the dynamic world we currently live in, it’s becoming increasingly difficult for students to balance academics, co-curricular activities and entertainment among others. Students are required to submit countless assignments in a short time frame. These assignments should not be taken lightly as they form a major part of the grade when it comes to the end of the semester. Understanding the value of education and how these grades are important to students, Infinite Essays has made it its mission in life to offer customized essays to students at an affordable cost.

Click HERE to order a unique plagiarism free paper done by 

professional writers and delivered before your deadline

There are plenty of reasons why you should order a paper with Infinite Essays. We have reliable writers who are also very competent. They have over the years managed to work under tight schedules and deadlines. Whenever you order an essay with Infinite Essays, you are guaranteed a fast turnaround of your project and this is done on time. Other than writing custom papers, our writers provide value added services that include academic assistance in the areas that they have specialized in. We ensure that the work that we offer is free of plagiarism. Infinite Essays does not condone plagiarism in whatsoever manner. Our writers are very experienced and can handle of sorts of formats such as Turabian, Chicago, Harvard as well as APA and MLA. Infinite Essays covers a wide range of topics. At the moment, we specialize with over 68 topics. We understand the importance of maintaining confidentiality when dealing with our clients. It’s for this reason that we will never reveal the identity of our clients to whoever may be interested. Finally, we offer the most competitive rates in the industry.

Click HERE to order a unique plagiarism free paper done by 

professional writers and delivered before your deadline

Whenever you want to make an order with us, you will use our automated online ordering system. If you are having some difficulties of any sort, feel free to contact our live support and they will be more than happy to assist you. Ensure that you fill all the relevant information regarding your order. This is the area where you have to include the deadline of your assignment, the formatting style to be used and even the kind of academic paper you desire. The more information you give to our writers, the better.

Click HERE to order a unique plagiarism free paper done by 

professional writers and delivered before your deadline

Brief explanations of how our services work 1. Provide us with the necessary instructions. Go to the Order Now page and click the order now button. This is the part where you have to attach all the relevant attachments. At the same time, remember to add the instructions sheet here. Once you are sure that you have submitted all relevant information, please submit the final draft to us. 2. The second step will involve paying for the services. This is where an invoice will be sent to you. However, the easiest process is clicking the payment link and following all the prompts that come along. At the moment, all payments are made through PayPal only. 3. Working on your paper. Once you have made the payment, we will assign the order to a writer who will follow the instructions. Remember that our writers will spend countless hour laboring to ensure that the work they provide is meticulously researched. 4. Download your paper. When the writer is finished with the assignment, they will submit it to our writers who will then go through the paper to ensure that the paper has followed all instructions and there are no grammatical errors. We will then forward a copy of the assignment to your email. 5. Tell your friends. We always happy to receive a referral. Whenever a friend tells us that you recommended our services to them, we will give you a 40 percent discount for your next order. Whenever you have provided us with the necessary details, we will forward them to qualified writers who will handle the assignment for you. Remember that the writers will begin working on the assignment immediately. This is the sole reason we encourage our clients to provide their exact specifications during the first time.

Click HERE to order a unique plagiarism free paper done by 

professional writers and delivered before your deadline

Tackling an order may be challenging but we always offer the best. Before the assignment can be passed to you by our writers, it will be passed through a team of qualified editors and proofreaders to ensure that the paper is accurate and of the required quality. Once the editors are satisfied with the assignment, they will forward the assignment to your account and a copy to your email.

Click HERE to order a unique plagiarism free paper done by 

professional writers and delivered before your deadline

Discounts We offer the best prices in the industry. We currently have a 20 percent discount for all of our customers. If you feel the budget is putting a strain on you, contact our live support and they might consider you case. We treat each case differently. Remember that our main goal is to continue with education transformation. At the moment, we only accept payments in form of PayPal.

Click HERE to order a unique plagiarism free paper done by 

professional writers and delivered before your deadline

Why Choose Us While there are many companies in the writing service industry claiming to offer platinum services, none can match the services offered by Infinite Essays. Some of our writers have been with us since 2010. The testimonials that have been written by some of our happy customers is an indication of the good services that we offer.

Click HERE to order a unique plagiarism free paper done by 

professional writers and delivered before your deadline

Our Service Charter

1. Professional & Expert Writers

2. Top Quality Papers

3. Plagiarism-Free Papers: 

4. Timely Delivery

5. Affordable Prices

6. 24/7 Customer Support