Sentiment Analysis Python – 3 – Cleaning Text for Natural Language Processing (NLP)




[ad_1]

All right guys! Welcome back. In this video we are going to learn how to clean the text before we can apply our natural language processing concepts on it. Cleaning is done in two main ways. Making sure everything is in lowercase and secondly we remove all the unwanted characters from it like punctuations.

But even before that we need to read text in our python program.

We need to convert it to lowercase because the words are the soul of analyzing text. And when we compare words in natural language processing a word like an Apple with a capital A, is not equal to the same word in small case, for example an apple with a small ‘a’. Therefore to compare words we need to make sure the entire text which we are going to be analyzing is in lower case. This is will make more sense as we go further along the videos.

Source Code – https://github.com/attreyabhatt/Sentiment-Analysis

Next video – Tokenization and Stop Words
https://youtu.be/KrEhmADXTr8

Full playlist – https://www.youtube.com/playlist?list=PLhTjy8cBISEoOtB5_nwykvB9wfEDscuEo

Subscribe – https://www.youtube.com/channel/UCirPbvoHzD78Lnyll6YYUpg?sub_confirmation=1
Website – www.buildwithpython.com
Instagram – http://instagram.com/buildwithpython

#python #nltk #nlp

Source


[ad_2]

Comment List

  • buildwithpython
    December 3, 2020

    I used regex library.
    New data = Re.sub('[!@?/:;]', ' ', lower_case)

  • buildwithpython
    December 3, 2020

    import string

    ab="Hello how Are You?"

    low=ab.lower() #converting text into lowercase

    punct=low.translate(str.maketrans('','',string.punctuation))

    print(low)

    it's showing error "AttributeError: module 'string' has no attribute 'maketrans' "

  • buildwithpython
    December 3, 2020

    AttributeError: module 'string' has no attribute 'maketrans'

  • buildwithpython
    December 3, 2020

    Great video , amazing explanation . Keep this up bro

  • buildwithpython
    December 3, 2020

    Super bro, you explained it in an easy way…

  • buildwithpython
    December 3, 2020

    Thank you…

  • buildwithpython
    December 3, 2020

    Can u make video on classification of text using python …ex ..noun , pronoun etc.. identify from the text file

  • buildwithpython
    December 3, 2020

    I just love u….. I learn django from u and now I am learning nltk ..Nice explanation…. U know very well what to explain…..N how …… Thank you soooooooooooooooooooooooooo much…😄😍

  • buildwithpython
    December 3, 2020

    So pumped to code along this tutorial! This is just what I need to fan my python spark after my motivation to code faded a bit.

  • buildwithpython
    December 3, 2020

    Hey! Wonderful explanations, keep up the work man we love it. At the end of the video where you were explaining what it does was really nice because I really needed to understand why there were 2 empty strings and how it managed to remove the punc. Please keep going just a bit in depth because when you understand what you do, you really feel like you learned something and not just copied what a person did.

  • buildwithpython
    December 3, 2020

    Bro please put some python project video please

  • buildwithpython
    December 3, 2020

    Hey man long time !!!

Write a comment