('that is my best sword ''pos')('this is an awesome post''pos')(' do not like this cafe''neg')(' am tired of this bed ''neg')(" can' deal with this"'neg')('she is my sworn enemy!''neg')(' never had caring mom ''neg'firstwe will import the naivebayesclassifier class from the textblob package this classifier is very easy to work with and is based on the bayes theorem the train variable consists of tuples that each holds the actual training data each tuple contains the sentence and the group it is associated with nowto train our modelwe will instantiate naivebayesclassifier object by passing the train to itcl naivebayesclassifier(trainthe updated naive bayesian model cl will predict the category that an unknown sentence belongs to up to this pointour model knows of only two categories that phrase can belong toneg and pos the following code runs the following tests using our modelprint(cl classify(" just love breakfast")print(cl classify("yesterday was sunday")print(cl classify("why can' he pay my bills")print(cl classify("they want to kill the president of bantu")the output of our test is as followspos pos neg neg we can see that the algorithm has had some degree of success in classifying the input phrases into their categories well this contrived example is overly simplistic but it does show promise that if given the right amounts of data and suitable algorithm or modelit is possible for machine to carry out tasks without any human help