Welcome to the Simplilearn Community

Want to join the rest of our members? Sign up right away!

Sign Up

Natural Language Processing | May 01 - May 23 | Gurdeep | 2021

Aman kumar verma

Member
Alumni
  1. if you've uninstalled Jupyter themes and cannot see the toolbar, try clicking the 'View' dropdown menu in a notebook and then 'Toggle Toolbar'.
  2. If that doesn't work, then try reinstalling jupyter themes, then reset to the default UI
    jt -r (if still not fixed, try step 1 again after running the reset command)
  3. If you're still toolbar-less, then try installing a theme with the toolbar toggled on jt -t grade 3 -T (then steps 2 and 1)
 

Partha Chaudhuri

Active Member
  1. if you've uninstalled Jupyter themes and cannot see the toolbar, try clicking the 'View' dropdown menu in a notebook and then 'Toggle Toolbar'.
  2. If that doesn't work, then try reinstalling jupyter themes, then reset to the default UI
    jt -r (if still not fixed, try step 1 again after running the reset command)
  3. If you're still toolbar-less, then try installing a theme with the toolbar toggled on jt -t grade 3 -T (then steps 2 and 1)
2nd solution worked. Thanks
 
Please guide me on how to start with the following task given.
Note: the original file is actually in an xlsx format, I don't know why I'm not able to attach an excel file, so I just copied the text snippets from the excel file and pasted it in text doc


Task:

Develop a simple sentiment analyser



Part 1


The task is to create code that is able to read a text snippet and identify the sentiment of the input text snippet based on a dictionary.



This dictionary needs to store 2 sets of words – words indicating positive sentiment (e.g., good, great, happy, etc) and the other set of words indicate negative sentiment (e.g., bad, angry, unhappy, sad, etc). You will need to build this dictionary and take care to see that simple transformation of words such as case changes or different noun or verb forms do not affect the functioning of your code. You may also extend the dictionary to include phrases or terms containing multiple words to make it more general.



In case the input text snippet includes both negative and positive words, you may count the number of positive and negative terms and give the snippet a sentiment score that ranges from -1 to 1. An example of such a function is given next:

Sentiment score =

(Number of positive words – number of negative words)

max{number of positive words, number of negative words}



A score close to 0 indicates a neutral statement; whereas a score close to 1 or -1 indicates a positive or negative sentiment respectively.



You may use the sample text snippets (attached) and dictionary links provided with this mail and extend them to make them more general. Feel free to think about other enhancements that will improve sentiment analyser and implement them. Remember, the idea is to be able to capture sentiments accurately for customer feedback or customer service comments from insurance domain.



Part 2


Extend the code created in part 1 to read multiple text snippets (number may vary from 1 to a few thousands) and identify sentiments for each of those snippets based on the stored dictionary.



Note:

Our suggestion is to use Python for this task, although if that is difficult or not possible for some reason, you may use R.

You can start with the dictionary based on the following links:

https://ptrckprry.com/course/ssd/data/positive-words.txt

https://ptrckprry.com/course/ssd/data/negative-words.txt


Thanks & Regards
Manjari
 

Attachments

  • sample text.txt
    880 bytes · Views: 0
Top