In this project you are going to take a survey and give to employees to see how they are satisfied with their job. The survey will be an online form that sends the responses to an email address. After the emails have been received, the data will be processed before putting it into the AI algorithum.
You will take the results of the survey and analyze the data using a natural language processing sentiment analysis algorithum. We are looking for positive, negative and neutral sentiments.
Day 1: Deciding on survey questions
You can design your survey if your are so inclined. I made up a survey. The questions should reveal the employees' true feelings on the subject. I considered the following areas in the survey I designed:
Wages
Health benefits
Vision and hearing benefits
Prescription benefits
Sick leave
Relationship with immediate supervisor
Supervisor's appreciation
Valued employees
Work environment
Evaluation procedure
To measure each area I used a 1-10 designation that can be set by scrolling a numerical control. Once emphasis is away from the control the code sends the program to a javascript function. There is a function for each of the listed subjects. Each function determines what number was selected and based on the number positive,neutral and negative points are awarded. Numbers one,two,three indicate negative responses. Four, five, six are neutral responses to the question. Numbers seven and eight are good, positive responses and nine and ten are excellent positive responses. Once the points for each have been decided, I created text to describe what the number signifies.
For example, if a survey respondent selected a number 10 for the wages question, the response should be something like: "Wages are excellent." Our Python sentiment analyzer evalues text and classifies it as to negative, neutral or positive sentiment.
If you wish, create your own survey questions.
Day 2: Loading the flexible model template and css files.
The flexible box model is designed for responsive design. There is one line of code in the cascading style sheets '@media screen and max-width' that uses screen size. Responsive design makes it possible to control how the screen looks on many devices from computers with large screens to cell phones.
Cascading style sheets lesson
The flexible box model works with 5 cascading style sheet files that are linked when the program opens.
Flexible Box Model Template
Click on link for flexible box model.
Right Click the mouse.
Select view page source
Highlight all text. Drag from top to bottom.
Press CTRL+C to put text on the clipboard.
Open Notepad ++.
Paste text into Notepad++ using CTRL+V
Save your file as an HTML file.
Now we need to get copies of our cascading style sheet files for the project. There are five of them.
X-small
Click copy text button and paste the contents into Notepad++.
Save your css file in the same folder as your html tutorial and call it'xs.css'.
Small CSS
Click copy text button and paste the contents into Notepad++.
Save your css file in the same folder as your html tutorial and call it'small.css'.
Medium
Click copy text button and paste the contents into Notepad++.
Save your css file in the same folder as your html tutorial and call it'medium.css'.
Large
Click copy text button and paste the contents into Notepad++.
Save your css file in the same folder as your html tutorial and call it'large.css'.
X-Large
Click copy text button and paste the contents into Notepad++.
Save your css file in the same folder as your html tutorial and call it'xl.css'.
Day 3: Testing the flexible box model
Now let's run our application to see how it performs with different screen sizes. Notepad++ allows us to run html applications using different browsers. We will use Chrome in this lesson. Feel free to use any of the others to see how the application is formatted with them
Your screen should look like this:
As you can see there 5 sections:
Header - light blue
Navigation section - dark gray
Article section - medium gray
Side section - light gray
Footer - dark gray
The color of each of these sections can be changed as well as other characteristics within each section.
Header Section
To create the header, locate the header tags <Header> and</Header> Type the name of the document, Employment Satisfaction Survey between the tags.
Image for survey
Right click and Save image as empSat.JPEG
Survey Instructions
Paste the information into the nav section.
Mail To Tag
We now have to create a way for the survey responses to be sent to the company. There are a number of ways this can be done. Here we will use the mailto tag to send the information from the survey to an email address.
Survey Questions in nav section
A score of 1 indicates the least agreement and a 10 indicates the most agreement.
Wages
On a scale of 1-10, do you feel that your wages at our company are fair and competitive?
Points (between 1 and 10):
Health Benefits
On a scale of 1-10, do you believe that you have a good health insurance benefits package?
Points (between 1 and 10):
Dental Insurance
On a scale of 1-10, do you believe that you have a good dental insurance benefits package?
Points (between 1 and 10):
Vision and Hearing Insurance
On a scale of 1-10, do you believe that you have a good vision and hearing insurance benefits package?
Points (between 1 and 10):
Prescription Insurance
On a scale of 1-10, do you believe that you have a good prescription insurance benefits package?
Points (between 1 and 10):
Paste this text into end of nav section.
Survey Questions in article section
Sick Days
On a scale of 1-10, do you believe that you have an adequate number of sick days?
Points (between 1 and 10):
Supervisor Relations
A score of 1 indicates the least agreement and a 10 indicates the most agreement.
On a scale of 1-10, Do you have a good relationship with your immediate supervisor?
Points (between 1 and 10):
Supervisor Appreciation
On a scale of 1-10, Do you feel that your immediate supervisor appreciates you?
Points (between 1 and 10):
Valued Employee
On a scale of 1-10, Do you feel that your input is valued by our company?
Points (between 1 and 10):
Work Environment
On a scale of 1-10, Rate your work environment.
Points (between 1 and 10):
Evaluations
On a scale of 1-10, Rate your work environment.
Points (between 1 and 10):
Paste this code into the beginning of article section.
The way the code works is as follows:
The user clicks on the arrows on the number box controls to set their answers. This is the inout type = number
A range of numbers can be set I used 1 and 10 as min and max
The control is given and id and a name
When the user leaves the field, the onBlur code sends each question's responses to javaScript functions.
Javascript Code
Day 4: Coding the application
Paste the javascript code segment between the head tags <head> and </head>
The way the functions work is as follows.
The response, point values, from the user are evaluated by an if statement.
If the user's response to any given question is either a 1, a 2 or a 3, These are evaluated as negative responses.
For negative responses, I created sentences reflecting that the user did not like the expression.
The sentence that I created is then sent back to the html document and displayed at the appropriate demo tag location.
If the user selected a 4 or 5 or 6 then the sentence was neutral, like my wages are OK.
If the user selected numbers 7 or 8, then the sentence reflected a good sentiment about the item being evaluated.
If the user selected either a 9 or 10, then the sentence was very positive or excellent.
Later in the project, these sentences will be put into a Python program that is designed to gauge sentiment.
Textarea with Responses
The next step is to select where the sentences are displayed. We are going to do it in the third column, the aside section of our web page. Here is the code.
Key in the code in the aside section of your application. Save you program.
Submit Button
The last part of the survey is to send the information on the form to the email address that we have already supplied.
Here is the code:
<input type="submit" value="Submit" />
<br>
</form>
Key it in and save your project. Now let's run it to see how it works. Here is a finished copy if your are having trouble. Finished Survey
Make sure that you use the arrow keys to give each question a value, before hitting the submit button. if you omitted a field, the program will not let you execute the code for the submit button.
Let's look at the results: the email. Do the responses reflect the points given? Remember one, two, three and very bad. Four, five and six are neutral. Seven and eight are good and nine and ten are excellent.
Here is what you should expect the email to look like. I am using Microsoft Outlook.
Python's Sentiment Analyzer
Day 5: Looking at Python's algorithum for sentiment intensity.
Sentiment analysis is a technique designed to extract emotions from textual data. Four numbers are the output:negative score, neutral score, positive score, and compound score. The compound score is the sum of the negative, neutral and positive scores normalized to the range of -1 to +1. In other words, it represents the overall sentiment of the survey's responent.
Adjectives, all caps, exclamation points all play a role in identifying sentiment intensity.
Look at the following ourput illustrating this.
Look at the three sentences carefullly. In the first sentence, the negative word, awful, is in all capital letters, and the sentence ends with two exclamation marks and the compound score is -.65.
The second sentence contains lower case letters for the negative word, awful, and is followed by two exclamation marks. The commpound output score for this one is -.55.
The third sentence has a lower case negative word and ends with a period. The output score is -.45.
This example shows how the analyzer works. It is not just negative, positive or neutral words.
Evaluating sentiment intensity for wages paid to employees.
We received 500 emails, one for each of employees. To tabulate all of them would be a huge task. We will take a random sample of 20 from the list.
If you want to see how the random numbers were selected, you can create a new Python project and key in the following text to generate random numbers. The first example does not eliminate duplicates.
Random numbers duplicates allowed
import random
rand_list=[]
n=20
for i in range(n):
rand_list.append(random.randint(1,500))
print(rand_list)
The way the functions work is as follows. 20 numbers are selected from 1 to 500
Random numbers eliminating duplicates
#eliminate duplicate random numbers
import random as rd
random = rd.randint(1,500)
rdlist = []
for _ in range(20):
while random not in rdlist:
rdlist.append(random)
print(rdlist)
while random in rdlist:
random = rd.randint(1,500)
One very important part of an employee's attitude about the company is the wages that they are paid. In this section we will take 20 random survey questions collected on wages to see what the employee sentiment is about the wages that they are paid.
The data was colllected from the 500 emails that were submitted as a result of the survey.
#from nltk.sentiment import SentimentIntensityAnalyzer
from nltk.sentiment.vader import SentimentIntensityAnalyzer
analyzer = SentimentIntensityAnalyzer()
review419 = "Wages are AWFUL!!"
review277 = "Wages are very average."
review373 = "Wages are good!!"
review288 = "Wages are EXCELLENT!!"
review358 = "Wages are AWFUL!!"
review119 = "Wages are very average."
review210 = "Wages are good!!"
review375 = "Wages are EXCELLENT!!"
review392 = "Wages are good!!"
review403 = "Wages are good!!"
review61 = "Wages are good!!"
review361 = "Wages are good!!"
review446 = "Wages are good!!"
review233 = "Wages are good!!"
review91 = "Wages are good!!"
review34 = "Wages are good!!"
review123 = "Wages are EXCELLENT!!"
review16= "Wages are good!!"
review342 = "Wages are very average."
review392 = "Wages are good!!"
review419_score = analyzer.polarity_scores(review419)
print("Score for Review #419: {}".format(review419_score))
review277_score = analyzer.polarity_scores(review277)
print("Score for Review #277: {}".format(review277_score))
review373_score = analyzer.polarity_scores(review373)
print("Score for Review #373: {}".format(review373_score))
review288_score = analyzer.polarity_scores(review288)
print("Score for Review #288: {}".format(review288_score))
review358_score = analyzer.polarity_scores(review358)
print("Score for Review #358: {}".format(review358_score))
review119_score = analyzer.polarity_scores(review119)
print("Score for Review #119: {}".format(review119_score))
review210_score = analyzer.polarity_scores(review210)
print("Score for Review #210: {}".format(review210_score))
review375_score = analyzer.polarity_scores(review375)
print("Score for Review #375: {}".format(review375_score))
review392_score = analyzer.polarity_scores(review392)
print("Score for Review #392: {}".format(review392_score))
review403_score = analyzer.polarity_scores(review403)
print("Score for Review #403: {}".format(review403_score))
review61_score = analyzer.polarity_scores(review61)
print("Score for Review #61: {}".format(review61_score))
review361_score = analyzer.polarity_scores(review361)
print("Score for Review #361: {}".format(review361_score))
review446_score = analyzer.polarity_scores(review446)
print("Score for Review #446: {}".format(review446_score))
review233_score = analyzer.polarity_scores(review233)
print("Score for Review #223: {}".format(review233_score))
review91_score = analyzer.polarity_scores(review91)
print("Score for Review #91: {}".format(review91_score))
review34_score = analyzer.polarity_scores(review34)
print("Score for Review #34: {}".format(review34_score))
# 17 to 20
review123_score = analyzer.polarity_scores(review123)
print("Score for Review #123: {}".format(review123_score))
review16_score = analyzer.polarity_scores(review16)
print("Score for Review #16: {}".format(review16_score))
review342_score = analyzer.polarity_scores(review342)
print("Score for Review #342: {}".format(review342_score))
review392_score = analyzer.polarity_scores(review392)
print("Score for Review #392: {}".format(review392_score))
compoundNums = [-.6505,0,.5399,.7199,-.6505,0,.5399,.7199,.5399,.5399,.5399,.5399,.5399,.5399,.5399,.5399,.7199,.5399,0,.5399]
accum = 0
for w in compoundNums:
accum = accum + w
print(accum/20)
Start a new Python project and paste the code segments
Here is the output.
The way the functions work is as follows.
In the program above, notice that the variable accum starts out with a value of 0. Next, the iteration is performed 20 times. Inside the for loop, the update occurs. w has the value of current item (1 the first time, then 2, then 3, etc.). accum is reassigned a new value which is the old value plus the current value of w.
Now we can evauate the number we obtained, 0.3668750000000001. This is the average score for employees' sentiment towards the wages that they are paid by the company.
positive sentiment: compound score >= 0.05
neutral sentiment: (compound score > -0.05) and (compound score <0.05)
negative sentiment: compound score <= -0.05
Our average compound score of .36 tells us that we are doing a decent job on our salaries.
Day 6: Detailed analysis of one survey
Now let's look at one survey that includes all 11 responses to the survey. The responses for this employee are listed in the variable "sentence".
import nltk
from nltk.tokenize import word_tokenize, RegexpTokenizer
from nltk.sentiment.vader import SentimentIntensityAnalyzer
sentence = "Wages are good!! Health benefits are very good!! Dental insurance benefits package is at best average. Vision and hearing are quite good!! Prescription benefits are EXCEPTIONAL!! I found the number of sick days available was quite good!! I have a DREADFUL relationship with my supervisor. My supervisor LOATHES AND HATES ME!! He is a TERRIBLE human being!! I am NOT a valued employee. My work environment is EXTREMELY BAD!!!! My evaluations are AWFUL!!"
tokenized_sentence = nltk.word_tokenize(sentence)
sid = SentimentIntensityAnalyzer()
pos_word_list=[]
neu_word_list=[]
neg_word_list=[]
for word in tokenized_sentence:
if (sid.polarity_scores(word)['compound']) >= 0.1:
pos_word_list.append(word)
elif (sid.polarity_scores(word)['compound']) <= -0.1:
neg_word_list.append(word)
else:
neu_word_list.append(word)
print('Positive:',pos_word_list)
print('Neutral:',neu_word_list)
print('Negative:',neg_word_list)
score = sid.polarity_scores(sentence)
print('\nScores:', score)
Paste the code segments
The way the functions work is as follows.
First we import nltk, natural language tool kit
We also import sentiment intensity analyzer
The results from one survey are given the variable name sentence.
Positive, neutral and negative words are loaded into an array
A list for each word type is printed.
Percentages for each type of word are printed
A compound score is calculated.
Positive, neutral and negative words are picked out of the single survey. For example in this one survey, negative words: "SICK", "DREADFUL", "LOATHES", "HATES", "TERRIBLE", "BAD", "AWFUL" are found and printed out.
Positive words selected were: "good", 'benefits, "good", "benefits", "best", "good", "valued". Do you see a problem. The word "benefits" can have dual meanings. The way the algorithum looked at "benefits" meant that this is a good thing that helps someone. Our meaning for "benefits" meant packages offered by our company to our employees.
Neutral words
Our compound scores is -.4025. It is a terrible score. We will need to analyze why this score is -.4025. If we look at the sentence, we can see the answers for each question. Six of the comments are positive and neutral and 5 are very negative. The relationship with the employee's supervisor is a problem. Respondent believes that the supervisor hates them. This employee does not feel like a valued employee and the work environment is terrible.
Day 7: Summarizing Results
More research into the data we collected from the surveys is needed.
Here are the results from the random sample of 20 employees. To get the textual responses, I entered the numbers from the spreadsheet into the actual survey. Then I copied and pasted it into the sentiment intensity analyzer template. The survey numbers are the random numbers assigned to each survey.
random sample survey results
Compiled survey results
#from nltk.sentiment import SentimentIntensityAnalyzer
from nltk.sentiment.vader import SentimentIntensityAnalyzer
analyzer = SentimentIntensityAnalyzer()
survey133 = "Wages are very average.Health benefits are pretty much just average.Dental insurance benefits package is at best just average.Vision and hearing insurance benefits package is at best just average.I found that the prescription drug benefits were quite good!!The amount of sick days our company gives employees is consisent with the other companie in in the state.I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey280 = "Wages are very average.Health benefits are pretty much just average.Dental insurance benefits package is at best just average.Vision and hearing insurance benefits package is at best just average.I found that the prescription drug benefits were quite good!!The amount of sick days our company gives employees is consisent with the other companies in the state.I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey169 = "Wages are very average.Health benefits are pretty much just average.Dental insurance benefits package is at best just average.Vision and hearing insurance benefits package is at best just average.I found that the prescription drug benefits were quite good!!I found that the number of sick days available was quite good!!I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey496 = "Wages are good!!Health benefits are pretty much just average.Dental insurance benefits package is at best just average.Vision and hearing insurance benefits package is at best just averageI found that the prescription drug benefits were quite good!!I found that the number of sick days available was quite good!!I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey55 = "Wages are good!!Health benefits are pretty much just average.Dental insurance benefits package is at best just average.Vision and hearing insurance benefits package is at best just average.I found that the prescription drug benefits were quite good!!I found that the number of sick days available was quite good!!I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey328 = "Wages are very average.Health benefits are pretty much just average.Dental benefits are quite good!!Vision and hearing insurance benefits package is at best just average.I found that the prescription drug benefits were quite good!!I found that the number of sick days available was quite good!!I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey177 = "Wages are good!!Health benefits are very good!!Dental benefits are quite good!!Vision and hearing insurance benefits package is at best just average.Prescription package is at best just average.The amount of sick days our company gives employees is consisent with the other companies in the state.I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey44 = "Wages are very average.Health benefits are very good!!Dental benefits are quite good!!Vision and hearing insurance benefits package is at best just average.Prescription package is at best just average.The amount of sick days our company gives employees is consisent with the other companies in the state.I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey31 = "Wages are good!!Health benefits are very good!!Dental benefits are quite good!!Vision and hearing insurance benefits package is at best just average.Prescription package is at best just average.The amount of sick days our company gives employees is consisent with the other companies in the state.I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey2 = "Wages are very average.Health benefits are very good!!Dental benefits are quite good!!Vision and hearing benefits are quite good!!I found that the prescription drug benefits were quite good!!I found that the number of sick days available was quite good!!I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey490 = "Wages are very average.Health benefits are pretty much just average.Dental benefits are quite good!!Vision and hearing insurance benefits package is at best just average.I found that the prescription drug benefits were quite good!!I found that the number of sick days available was quite good!!I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.=My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey6 = "Wages are very average.Health benefits are very good!!Dental insurance benefits package is at best just average.Vision and hearing insurance benefits package is at best just average.I found that the prescription drug benefits were quite good!!I found that the number of sick days available was quite good!!I have a decent relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey201 = "Wages are good!!Health benefits are very good!!Dental insurance benefits package is at best just average.Vision and hearing insurance benefits package is at best just average.Prescription package is at best just average.I found that the number of sick days available was quite good!!I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey400 = "Wages are good!!Health benefits are pretty much just average.Dental insurance benefits package is at best just average.Vision and hearing insurance benefits package is at best just average.Prescription package is at best just average.The amount of sick days our company gives employees is consisent with the other companies in the state.I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey232 = "Wages are good!!Health benefits are very good!!Dental insurance benefits package is at best just average.Vision and hearing insurance benefits package is at best just average.I found that the prescription drug benefits were quite good!!The amount of sick days our company gives employees is consisent with the other companies in the state.I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey223= "Wages are good!!Health benefits are very good!!Dental benefits are quite good!!Vision and hearing insurance benefits package is at best just average.I found that the prescription drug benefits were quite good!!The amount of sick days our company gives employees is consisent with the other companies in the state.I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I feel somewhat valuable to my company.My work environment is EXTREMELY BAD!!!!My evaluations are pretty average."
survey225 = "Wages are good!!Health benefits are very good!!Dental benefits are quite good!!Vision and hearing insurance benefits package is at best just average.I found that the prescription drug benefits were quite good!!The amount of sick days our company gives employees is consisent with the other companies in the state.I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I feel somewhat valuable to my company.My work environment is EXTREMELY BAD!!!!My evaluations are pretty average."
survey421= "Wages are good!!Health benefits are very good!!Dental benefits are quite good!!Vision and hearing benefits are quite good!!Prescriptions benefits are EXCEPTIONAL!!I found that the number of sick days available was quite good!!I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey265 = "Wages are very average.Health benefits are very good!!Dental benefits are quite good!!Vision and hearing insurance benefits package is at best just averageI found that the prescription drug benefits were quite good!!I found that the number of sick days available was quite good!!I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are pretty average."
survey349 = "Wages are very average.Health benefits are pretty much just average.Dental insurance benefits package is at best just average.Vision and hearing insurance benefits package is at best just average.Prescription package is at best just average.I found that the number of sick days available was quite good!!I have a DREADFULL relationship with my supervisor.My supervisor REALLY LOATHES AND HATES ME. He is a TERRIBLE human being!!I am NOT a valuable employee.My work environment is EXTREMELY BAD!!!!My evaluations are AWFUL!!"
survey133_score = analyzer.polarity_scores(survey133)
print("Score for Survey #133: {}".format(survey133_score))
survey280_score = analyzer.polarity_scores(survey280)
print("Score for Survey #280: {}".format(survey280_score))
survey169_score = analyzer.polarity_scores(survey169)
print("Score for Survey #169: {}".format(survey169_score))
survey496_score = analyzer.polarity_scores(survey496)
print("Score for Survey #496: {}".format(survey496_score))
survey55_score = analyzer.polarity_scores(survey55)
print("Score for Survey #55: {}".format(survey55_score))
survey328_score = analyzer.polarity_scores(survey328)
print("Score for survey #328: {}".format(survey328_score))
survey177_score = analyzer.polarity_scores(survey177)
print("Score for Survey #177: {}".format(survey177_score))
survey44_score = analyzer.polarity_scores(survey44)
print("Score for Survey #44: {}".format(survey44_score))
survey31_score = analyzer.polarity_scores(survey31)
print("Score for Survey #31: {}".format(survey31_score))
survey2_score = analyzer.polarity_scores(survey2)
print("Score for Survey #2: {}".format(survey2_score))
survey490_score = analyzer.polarity_scores(survey490)
print("Score for Survey #490: {}".format(survey490_score))
survey6_score = analyzer.polarity_scores(survey6)
print("Score for Survey #6: {}".format(survey6_score))
survey201_score = analyzer.polarity_scores(survey201)
print("Score for Survey #201: {}".format(survey201_score))
survey400_score = analyzer.polarity_scores(survey400)
print("Score for Survey #400: {}".format(survey400_score))
survey232_score = analyzer.polarity_scores(survey232)
print("Score for Survey #232: {}".format(survey232_score))
survey223_score = analyzer.polarity_scores(survey223)
print("Score for Survey #223: {}".format(survey223_score))
survey225_score = analyzer.polarity_scores(survey225)
print("Score for Survey #225: {}".format(survey225_score))
survey421_score = analyzer.polarity_scores(survey421)
print("Score for Survey #421: {}".format(survey421_score))
survey265_score = analyzer.polarity_scores(survey265)
print("Score for Survey #265: {}".format(survey265_score))
survey349_score = analyzer.polarity_scores(survey349)
print("Score for Survey #349: {}".format(survey349_score))
Start a new Python Notebook.
Click copy text button and paste the contents into a new frame.
Save your project and call it siaSurveyResults.ipynb.
Run this block of code to see how our respondents rated our company.
It looks like we have a lot of disgruntled employees. Check out all the negative scores. It appears that respondents 223, 225 and 349 are happy campers.
There a few dreadfull surveys. Respondents 2 and 421 have negative scores in the 90's.
Let's add some code to give us an overall average score. I created an array called compoundNums of their compound scores. I added a variable called accum in which It added each score while the loop is being processed. Then I divided the total of the socres by the number of surveys, 20 to get the aveage.
compoundNums = [-0.3999,-0.3999,-0.3378,-0.5428,-0.5428,-0.7643,-0.8626,-0.8302,-0.8626,-0.9324,-0.7643,-0.6798,-0.6253,-0.2967,-0.7908,0.5399,0.5309,-0.9442,-0.4323,0.5053]
accum = 0
for w in compoundNums:
accum = accum + w
print(accum/20)
Click copy text button and paste the contents into a new frame.
Save your project and call it siaSurveyResults.ipynb.
Run all cells to get the overall sentiment of our employees.
-0.4716299999999999
This survey is not very encouraging.
There are few bright spots in our survey, however. Respondents 223, 225 and 349 gave us a positive score around 50%.
Now let's look at the worst scores. Respondents 2 and 421 gave us a negative 90 plus score.
Upon examination of the individual surveys, it appears that employee relations are at an all-time low.
Looks like upper management needs to make some major changes in the way supervisors treat their employees.
It appeares that things like wages and benefits are viewed in a positive way. The relations with supervisors is a critical problem.