Hello, all before going ahead in this session, let's have a quick recap of what we have done to now
in this project from importing data, both humming sentiment analysis with respect to positive sentences,
as well as negative sentencing, doing lots of data cleaning, doing lots of preprocessing this word
cloud visual and different different things.
We have also analyzed to what type of user Amazon is going to recommend more product.
And at the end, we have this beautiful box plot, which is exactly a distribution of the land of the
customer feedback.
Then we have this counterplan of my core feature and in this particular session we have this assignment
in which I have to analyze what exactly the behavior of the customers.
Because if in this final exam would consider finally the frame for this analysis in this final, you
have a column.
Which is exactly this text, so using this feature, using this feature, you can definitely come up
with this conclusion what exactly the behavior of our customers.
So very first, what we have to do next.
Let me show you a thing.
Save on this final.
I have to exit this text.
And if I'm going to access the Siedel, so you will see here I have all this for the very first time
that you have to do.
You have to convert all these words into some lowercase character.
So the question that you guys can ask why there is a need to convert all this stuff into lowercase.
Listen, at some place like, say, this dog is in the form of, let's say, cap, or you can get the
letters, but Lexcen somewhere else, it is in the form of a small cap.
So that definitely impacts a lot.
That's why you have to convert all your words in your Lorqess.
So if you have to convert this into lowercase, you have to just use this as dot, dot, lower order
and you have to just execute it now.
Now you will see over here all your text gets converted into some lowercase.
Now what you have to do, you have to store it somewhere else.
So I'm going to say I have to store it.
Lexing Final of text.
Now, what we have to do, we have to just execute it.
Now, after doing all these things, let's say I have to remove some extra or some special characters.
So let's say I'm going to show you a thing.
Let's say in this final of text, let's say I'm going to show you our data of this one sixty four index.
You will see this is all the data you will over here.
And if I'm going to use my that concept using Ardie, I'll function with this substitute and here I'm
going the same except A to Z and capitally to say whatever I have, I have to just replace it with this
space.
That's what this substitute will do.
And here I have to mention here on this text, I have to perform this operation that said and again,
if I'm going to execute it now, you will see over here in this in this entire text, this hundred gets
disappeared.
But we all see are this hundred matters a lot over here.
It means you can't use this logic to manipulate this data.
It means you have to use something, your own logic, because whenever you're in a built in modules
isn't going to help you at that time.
You have to write your own logic.
That's where your programming, your problem solving is going to help you a lot.
So let's say I'm going to say let's say very first I have to define my own punctuation.
So here I'm going to say my own punctuations or special character.
Whatever name you want to assign, it's all up to you.
Let's say my own punctuation marks and nothing.
But let's say the very first one.
This one, let's say I have this one, this bracket after let's say I have this one.
I have some big brushes.
I have some.
Godlee says, I have some this one.
Let's add this one or whatever you want to assign.
It's all up to you.
Let's say these are all my punctuation marks that I'm going to do.
Fine over here.
Discussion, Mark, let's say this slash whatever you want to say and it's all up to you.
And of the special characters like the exclamation, this actor, it has this dialogue and is like percentage
and let's say it is a star and let's say all these kinds of punctuation that you want to assign over
here.
Now, what we have to do, let's say I have to do this in this in my data and now I have to I create
on the stage.
So I'm going to say for character and data or for iron data, let me make it more user friendly for
character and data and whatever character you have, then you have to put a condition if character not
in in my punctuation that I have defined earlier.
So if it is not in punctuation, then only I'm going to define or you can say it then only I'm going
to consider it in my string.
So that is what you have to define that particular string.
So I'm just going to say this is string is nothing, but let's have to define it.
Let's say this is doing is no underscore punctuations.
It is exactly my blank string.
So here I'm going to say no underscore punctuation.
It goes to no one to score punctuation, concatenate.
You have to concatenate each and every.
Correct.
That's the same.
All idea behind my concatenation.
Now, what we have to do, we have to print this, no one is called punctuation string.
So for this, I'm just going to print my known as called punctuation, and I have to just execute the
cell.
Now, you will figure out this stuff gets executed and is still this hundred is still in your data.
And if you are going to compare both stuff, these are almost similar.
But there has some minor difference.
It is not going to remove this numerical data because in this punctuations, I haven't defined that.
Yeah, I have to eliminate this numerical data.
But if I'm going to use this substitute function of our module, it would eliminate my numerical data
as well.
So that's a drawback of substitute function.
You guys can also see in a similar way, you can approach to your text feature each and every text entry
by using these blocks of code.
So what I'm going to do, I'm just going to say very first, let me import a class, which is exactly
my string does add in this string class.
I have something very useful for you.
This is exactly my punctuation to it.
Exactly.
It'll me all the punctuations defined by Piperno.
Plus first I have to start somewhere.
I'm just going to say that these are my punctuations.
Now what we have to do, we have to basically copy all these stuff.
Let me just paste over here.
So here I'm going to say here I have to remove this one.
So this time I'm just going to say for character in let me create a function over here.
So I'm just going to provide a right indentation now.
And this time my function name is define, remove punctuation to remove, underscore punctuation and
whatever value I'm going to pass over here, it will just remove all the punctuation from that review.
That's what this function will do.
That simple.
Then I have to simply return this that said, just executed.
Now what we have to do, we have to apply this function on my text feature for this, I'm going to say
final of text, which is exactly this one does not apply.
And I have to apply this to remove, underscore punctuation and whatever ammunition it will do.
I have to upgrade my final text as well.
So here I'm going to see final text.
It goes to this one.
So just executed.
All the stuff gets executed over here.
Now you will see if I'm again going to go, let's say final thought had over there.
You will see this is exactly your data.
Now, if again, I'm let's again, I'm going to copy this final text one six four over here.
And let me show you this data again in front of you.
So this is exactly my entire data that has been modified just because of this function that I have written
over here now is still you have to do better pre processing on your data because in this data you will
fill it out.
You have many Stallworth's like laws as as they are.
These are exactly all the Star Wars that we have to remove so far.
This is what I'm going to do.
I'm just going to sit very first.
I have to import my and that library, which is exactly Analytica, which is exactly natural language
toolkit.
So if you haven't started, you can start using at.
Now I going to say from this Analytica dot corpus, I have something which is exactly my is Davut.
So I'm very first just going to import all this stuff just executed.
Now what we have to do, let's say in this, in this text, let's say I have to remove my all this is
stored so far.
This looks very false.
That's it.
I'm just going to storage.
I say this is mine.
Let's set it up to you, whatever name you want to assign and let me print it.
Yeah.
So now I'm just going to say for word in data, I have to access each and every word.
Then I'm just going to say very first I, I have to convert this into some list.
So I'm going to say data is split and I have to split it on the basis of the separator once all these
things happen that if I'm going to fetch this world, then on this world, I'm going to put a condition
that if this particular word.
So if word.
Not in my e-mail world, then only I'm going to consider this word.
That's what my logic is here.
I'm going to say a word not in threat of a stock word because you need your unique words here.
I would say set off is towers dot words because.
Yeah, here Dotto words because you need strong words of English language here.
I'm going to say I need Stallworth's of English language.
That's what these blocks of code will do for us.
Then whatever word it will return me, I'm just going to do is there.
So this is exactly mine code for list comprehension.
So if I'm going to execute it, you will see you have all your words.
You don't have any stored in this list.
Now, what you have to do, you have to concatenated.
So let's say I'm going to say all these words are in my body list.
Now, what I'm going to do, let's say very first, I would define some blank list, let's say start,
and then I'm going to create on this audit list.
So I'm going to say for W.D. or word Inari, whatever, W.T. I'm going to fetch or you can say whatever
element I'm going to fact from this list I have to concatenate in this string for this.
I'm going to say start equals to start plus W and after it I have to open some space as well.
So here I'm going to say start equals to your plus some space that that's all up to you.
Now what I'm going to do, I'm just going to print this start as well.
Just executed.
This is exactly that word that you have over here.
But here you have some strong words, but here you don't have any Star Wars.
So you have to apply the similar approach, the similar approach with respect to each and every text.
So what I'm going to do now, so now I'm just going to define a function over here next to this function
in my setting or remove the underscore is stop words.
And here, whatever you do, it will receive it will remove its top words from that particular review.
What dysfunction will do?
Symbol.
So I'm just going to copy all this stuff.
Just going to paste over here then either using these blocks of code you guys can also use join that
what we have used already when we are going to perform sentiment analysis with respect to our data here,
I have to say I have to simply join you, assign proper small presses over here that simply I have to
return it, text it, then just execute it.
Now, what do you have to do?
You have to apply this function, which is exactly my attribute underscore is downvotes to my text column.
So for this I'm going to say final of X value for us to have to accept this text, not apply what you
have to apply.
You have to apply this function simple.
Once all your stuff gets applied, then you have to update this text as well.
Just executed.
It will take some couple of seconds in execution because internally all these blocks of code will join
this list.
Comprehension code will run with respect to your two thousand rules.
So definitely it will take somewhere around one minutes depending upon what a specification, what type
of data, relatively bulky or whether it will be not bulky.
Now you will figure out all this stuff gets executed.
Let me show you a thing.
And on this, let's say if I'm going to accept this text of, let's say, any random value that you
want to assign over here, let's say forty five just executed.
Now you will see you don't have any money stored in your data.
So it is up to some extent your data is somehow ready.
I'm not saying your data is completely ready.
So it means you still have to do lots of analysis, lots of people sitting on your data to come up with
this conclusion.
What exactly the behavior of customers.
So that's all about the session in the upcoming session.
We are going to continue doing lots of people sitting on our data.
That's all about it.
Hope you love the session very much.
Thank you.
Have a nice day.
Keep learning.
Keep growing.
Keep practicing.