International Research Journal of Engineering and Technology (IRJET)
Volume: 09 Issue: 02 | Feb 2022 www.irjet.net
![]()
International Research Journal of Engineering and Technology (IRJET)
Volume: 09 Issue: 02 | Feb 2022 www.irjet.net
e ISSN: 2395 0056
ISSN: 2395 0072
Ajinkya Hazare1, Abhishek Kalshetti2, Pratik Barai3, Premsing Rathod4 , Prof. Pramila M. Chawan5
1,2,3,4B. Tech Student, Dept. of Computer Engineering and IT, VJTI College, Mumbai, Maharashtra, India
5Associate Professor, Dept. of Computer Engineering and IT, VJTI College, Mumbai, Maharashtra, India
***
Abstract The world is witnessing noteworthy changes in the way how the markets are functioning. Now a lot of things are visible on social media about how the people are thinking and what their thoughts are when they go for buying a product fromtheir profile data andtweets. Weheredeveloped a model that will predict the intention of a customer of whether he or she is interested or not in buying a particular product using various text analytical models. Thus, customizing ads for different customers according to their taste and needat a particular point in time. We compared the results of our model with that of the original dataset and found out how accurate our model is. This is important because trends show that most of the customers who had shown interest in buying a product have mostly bought it.
Key Words: social media, profile data and tweets, customer, text analytical models, customizing ads
Here,inthisproject,weidentifiedpotentialcustomersbased on their tweets on Twitter. Thus, targeting the correct audience instead of trying to sell the product to everyone presentoutthere.Wehaveusedmachinelearningmodels here because manual testing is obsolete nowadays. The problem was to find the correct set of audiences for a particularproduct.Also,thereviewspostedbytheuserson social media helped us analyze and test our model. Even todaymanycompaniesusetheage oldmethodofsurveys forgettingcustomerfeedback.Wecomeheretohelpthem withourprediction.
Themotivationbehindthisprojectwasthatourmodelcan then be used by the big e commerce industries to target customers.Thus,exploitingtheavailabledataontheinternet tothefullest.Someofthechallengesfacedweregettingthe data in the desired format as it is not easily available and thenannotatingitaccordingtothemodel.
Online consumers' buying behavior has been studied through several research studies. Several researches have been conducted to study the consumer’s online buying behavior.Mostlythesewerefocusedonsuggestingtheclient products so that they would buy the advertised products. The primary intention of these studies was to know the
2022,
clients desire to buy a particular product. Rules based on linguistics were used to detect these types of wishes. Satisfactory coverage is not provided by these rule based approachesandtheirextensionishardbutidentifyingthe wishesiseffective.Purchaseintentiondetectiontaskisvery closetotaskoffindingandidentificationofreviewproducts. In these tasks, a machine learning approach is preferable thanarule basedapproachbecausethefeaturestakenfrom tweetdataaremostlygeneric.
Textanalysiscanbeperformedbyusingmachinelearning algorithmssuchasLinearRegression,NaiveBayes,Support VectorMachineandRandomForest.Theprocessoftellinga customeriftheyshouldpurchaseaproductorjustletitgo byprovidingthemthedataabouttheproductiscarriedout bysentimentanalysis.Marketersandfirmsusethisanalysis to study the user’s requirements so that the best possible matches for the product and customers are made by the system.
Atreekernelbasedmodel,aunigrammodelandafeature basedmodelwastakenintoconsiderationbyAgarwaletal. (2011)[1]inhisstudy.Neutral,positiveandnegativeclasses were the elements of the 3 way model to perform the classification of sentiments. In a tree kernel based model tweets were represented as trees. The unigram model consistedof10,000featuresandinthefeaturebasedmodel 100 features were used. Prior polarity of words that was combined with tags that consisted of their parts of speech(pos)werethefeaturesthatplayedasignificantpart in the task of classification. In conclusion, the tree kernel basedmodeloutperformedtheothertwomodels.
PakandParoubek(2010)[2]haveproposedamodelwhich classifies the tweets data into categories as objective, positiveandnegative.Annotationoftweetsusingemoticons automaticallyandcollectionoftweetsusingTwitterAPIwas carriedouttocreateatwittercorpus.Asentimentclassifier was developed using that corpus which was based on the multinomial Naive Bayes method that proposes to use featureslikePOS tagsandNgram.Thetrainingsetthatthey have taken into consideration was less effective as it consistedoftweetsonlyhavingemoticons.
TheClassificationofSentimentswasdonethroughamodel whichusesanensembleframeworkwasimplementedbyXia etal.[3].Differentfeaturesetsandclassificationtechniques
Factor value: 7.529 | ISO 9001:2008
Research Journal of Engineering and Technology (IRJET)
Volume: 09 Issue: 02 | Feb 2022 www.irjet.net
werecombinedtocreatethismodel.Threebaseclassifiers andtwotypesoffeatureswereappliedintheirwork.The baseclassifiersconsistedofSupportVectorMachines,Naive BayesandMaximumEntropy.Meta classifiercombination was used to perform sentiment classification. Ensemble approachessuchasweightedcombination,meta classifier combinationandfixedcombinationwereappliedtoachieve betteraccuracy.
Classificationoftweetsdatawasperformedinatwophase sentimentanalysismethod byBarbosa et al.(2010)[4] in theirmodel.Tweetswereclassifiedasobjectiveorsubjective inthefirstpartofclassificationandaspositiveornegativein thesecondpartofclassificationoftweets.Hashtagsusedby the consumer, retweets done by the user, any link that existed in the data, exclamation marks in the texts, prior polarity of words and POS were taken into consideration whileassemblingthefeaturespace.
Multinomial naive Bayes, stochastic gradient descent and hoeffdingtreeswereusedbyBifetandFrank(2010)[5]in theirapproach.TwitterstreamingdatafromFirehouseAPI wasusedbythemastheprimarydataset.Thedataprovided themessageswhichwereavailablepubliclyinreal timeof everyday use. The conclusion to their work after in depthconsideration of all the three models was that the stochasticgradientdescentbasedmodel,whenappliedwith properlearning,performedquitebetterthantherestofthe modelswhichweretakenintoconsideration.
Sentiment analysis in which bag of words was used was implemented by Turney et al [6].The mutual relationship between the words was not taken into account in this method.Also,inthismodelthedocumentwasrepresented asacollectionofwords.Unitingthevalueofeachandevery wordafter evaluatingthesentimentswasperformed with thehelpofaggregationfunctionssothatthesentimentofthe entiredocumentcouldbedetermined.
Pablo et. al. [7] paper was based on applying Naive Bayes classifiersonTwitterdataforpolaritydetectionofEnglish tweets. TwodifferentvariationsofNaive Bayesclassifiers were constructed. Tweets were classified as positive, neutral,andnegativeinoneoftheNaiveBayesclassifiers. Classificationofthetweetsaspositiveornegative,neglecting neutraltweetsandapplyingpolaritylexiconwascarriedout by another classifier which was binary. The classifier considered features such as Polarity Lexicons, Multiword extracted from different sources, Valence Shifters and Lemmas(verbs,nouns,adverbsandadjectives).
Punctuation, single words, n grams, and patterns as non identical feature typeswere used for data analysisfor the sentiment type classification in Twitter of user defined hashtagsintweetsinthemethodproposedbyDavidovetal., (2010) [8]. A single feature vector is made by combining these features after performing sentiment classification.
2022,
e ISSN: 2395 0056
p ISSN: 2395 0072
Sentiment assignment was implemented on each example using the K Nearest Neighbor algorithm in the test and trainingsetalongsidethefeaturevectorsconstruction.
CollectionofTwitterdatausingTwitterAPIwasproposedby Po WeiLianget.al.(2014)[9]intheirapproach.Thethree categoriesinwhichthedata isgroupedaremovie,mobile andcamera.Thedatawaslabeledaspositive,negativeand non opinions. Tweets containing opinions were filtered. Naive Bayes simplifying independence provided the assumption for the implementation of the Unigram Naive Bayes model whose implementation was successfully completed.Toeliminatetheuselessfeaturesthemethodof MutualInformationandChi squarefeatureextractionwas carriedout.Finally,whetherthetweetispositiveornegative ispredicted.
Implement a web application that forecasts a customer's likelihood/certainty of purchasing a product that he's interestedin,basedonhissocialmediapostssuchasTwitter tweets. This may enable the company/business to more effectivelytargetacertaincustomerandincreaserevenues. First, we hunt for tweets from potential buyers who are eager to purchase a product on Twitter. Based on who backedthosetweets,weestimate/predictthelikelihoodthat thebuyerwillpurchasethegoods.
We had to make our own because there are no publicly availableannotatedTwittertweetscorporafordetectingbuy intent.Thiswasaccomplishedbycrawlingthewebpagewith awebcrawlerbuiltbyJohnBakerFish.Wehadcollectedover 100,000tweets,butbecausetheywerenottagged,wehadto narrowitdowntojust3200tweets,whichwerechosenat random from the dataset and manually annotated using a criterionwedefined:
1 Comparing iPhone x with another phone and tellingotherphonearebetter?
NoPI
2 TalkingaboutgoodfeaturesofiPhonex? PI
3 TalkingaboutnegativefeaturesofiPhonex? NoPI
4 likedvideoonYouTubeaboutiPhonex? PI
Factor value: 7.529 | ISO 9001:2008
Research Journal of Engineering and Technology (IRJET)
Volume: 09 Issue: 02 | Feb 2022 www.irjet.net
Duetotimeconstraints,weonlyused3200tweetsfromsuch avastdataset.WedefinedPurchaseIntentionasanitemthat isrelatedwithactionwordssuchas(purchase,want,desire). Three people read each tweet, and the final class was determinedbythemostvotes.
Wepreprocessedthetweetsusingthesetechniques:
1. Lowercase: So, we started our groundwork by converting our text into lower case, to get case uniformity.
2. Remove Punctuations: Thenwepassedthatlowercase text to punctuations and special characters removal function.Textmaycontainunwantedspecialcharacters, spaces,tabsandetceterawhichhasnosignificantusein textclassification.
3. Stopwords Removal: Textalsocontainsuselesswords whichareroutinepartofthesentenceandgrammarbut donotcontributetothemeaningofthesentence.Likes of “the”, “a”, “an”, “in” and etcetera are the words mentionedabove.So,wedonotneedthesewords,andit isbettertoremovethese.
4. Common Words Removal: Then there also lots of repetitive words which from their recurrence do not contributetothemeaninginthesentence.Thiscanalso betheresultofmistakeasthedataweareanalyzingis aninformaldatawhereformalsentencenormsarenot takenintoconsideration.
5. Rare Words Removal: We also removed some rare wordslikenames,brandwords(notiPhonex),leftout html tags etc. These are unique words which do not contributemuchtointerpretationinthemodel.
6. Spell fix: Socialmediadataisfullofmisspellings.Andit is our job to fix these errors and give the model the correctwordsasinput.
7. Stemming: Thenwestemmedthewordstotheirroot. Stemmingworkslikebycuttingtheendorbeginningof theword,consideringthecommonprefixesorsuffixes that can be found in that word. For our purpose, we usedPortersStemmer,whichisavailablewithNLTK.
8. Lemmatization: Next, we also performed text lemmatization. This analysis is performed in morphologicalorder.Thewordgoesbacktothelemma andthelemmaisreturnedasoutput.
2022,
e ISSN: 2395 0056
p ISSN: 2395 0072
Wecreatedthreetypesofdocumentvectors:
1. TF: Thefirstisthetermfrequencydocumentvector.I savedthetextanditslabeledclassinadataframe.Then I built a new data frame with columns aswords and numberofdocumentsasrows.Therefore,theindividual frequencyofwordsinthedocumentcountisrecorded.
2. IDF: Aweightingmethodforgettinginformationfroma document.Thetermfrequencyandinversedocument frequencyvaluesarecalculatedandtheproductofTF* IDFisexpressedinTFIDF.IDFisimportantforfinding word relevance. Words such as `is`, ` the`, and `and` usually have a large TF. Therefore, the IDF calculated weightstoindicatehowimportanttheleastfrequently occurringwordsare.
3. TFIDF with Textblob Library: WeusedtheTextblob librarytocalculatetheemotionsofanindividualword and multiply the emotion score by the word's TF and TFIDF.
Weusedthetrainingdatasettobuildourmodels,andthen tested them with the testing dataset. The following techniques based on the Confusion Matrix (A confusion matrix is a table that is typically used to assess the performanceofaclassificationmodelonasetoftestdatafor whichthetruevaluesareknown)wereusedtoevaluateour models:
1. Accuracy:(TP+TN)/(TP+TN+FP+FN)
2. Precision:TP/(TP+FP)
3. Recall:TP/(TP+FN)
4. F Measure: (2 * Precision * Recall) / (Precision + Recall)
5. True Negative Rate: TN / (TN + FN) (for imbalance class analysis) In addition, we looked at the True PositiveRateandtheshapeoftheROCcurveforextra information.
Impact Factor value: 7.529 | ISO 9001:2008
Engineering and Technology (IRJET)
Volume: 09 Issue: 02 | Feb 2022 www.irjet.net
Here,wepredictedtheaccuracyforthemodelDecisionTree andDocumentVectorTF IDF.Thefigureaboveshowsthe resultsinpercentage.Level 1standsfor80 100%,Level2 standsfor60 80%,Level3standsfor50 60%.So,96.9%of thedatathatwaspredictedbythemodelhadanaccuracyof 80 100%.
This is what weobtained using the simple split technique andaddingallofthefeatureprocessingtechniques:
Naive Bayes Logistic Regressi on
Support Vector Machine
TF 78.2 80.2 80.5 69.3 76
TF IDF 65.6 78.2 78.2 72.3 77.6 binary doc 77.5 80.8 80.2 72.6 78.9
e ISSN: 2395 0056
p ISSN: 2395 0072
The logistic regression approach employing the binary documentvectorprovidedthemaximumaccuracy,asseenin the accuracy table. With the TF document vector, SVM providedaboutthesameaccuracy.
Naive Bayes Logistic Regression Support Vector Machine Decision Tree Artificial Neural Network
TF 83.4 83.2 85.4 83.8 84.9
TF IDF 83.5 84.2 86.2 84.7 85.8
binary doc 82.5 83.8 85.9 85.1 86
text blob+ TF 83.4 83.9 85 84.2
text blob+ TF IDF 84.8 85 85.2 86
text blob+ binary doc 83.4 84.5 85 83.6
Decision Tree Artificial Neural Network
Naive Bayes
Logistic Regress ion
Support Vector Machine Decision Tree Artificial Neural Network
TF 90.3 93.7 90.8 75.7 84.5
International Research Journal of TF IDF 70.3 89.1 86.2 79.1 85.8 binary doc 90.7 93.7 89.5 79.1 87.5
text blob+ TF 79.5 78.5 66 75.2 text blob+ TF IDF 78.9 76.9 69.6 75.6
text blob+ binary doc 79.5 78.5 72.3 79.2
text blob+ binary doc 92.4 89.1 78.6 91.6
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page2636 text blob+ TF 92.5 89.9 69 84.5 text blob+ TF IDF 89.1 85.8 74.5 82.4
of Engineering and Technology (IRJET)
Volume: 09 Issue: 02 | Feb 2022 www.irjet.net
Naive Bayes Logistic Regress ion
TF 32.8 29.7 42.2 45.3 43.8
TF IDF 48.4 37.5 48.4 46.9 46.9
binary doc 28.1 32.8 45.3 48.4 46.9
text
blob+ TF 31.2 39.5 54.7 40.6
text
blob+ TF IDF 40.6 43.7 51.6 50
e ISSN: 2395 0056
p ISSN: 2395 0072
TF+ lemmatizati on 75.6 76.9 73.6 73.6 71.3
Support Vector Machine Decision Tree Artificial Neural Network
TF IDF+ lemmatizati on 73.9 74.2 79.2 69.3 73.6
Using the accuracy table, we can see that the highest accuracywasgivenbythesupportvectormachinealgorithm using lemmatization in the data and using TF IDF as the documentvector.
Naiv e Baye s
text blob+ binary doc 31.2 39 48.4 32.8
Logistic Regressio n
Suppor t Vector Machin e
Decisio nTree
International Research Journal Artifici al Neural Networ k
We also utilized the real negative rate to see if our model was skewed towards only one class because we had an imbalanceclass.Usingthegenuinenegativeratemeasure, wecanseethatthemodelaccuratelypredictedthenegative classmorethanhalfofthetime.
Then we utilized the k fold method, which yielded the followingtableofresults:
Naive Bayes Logistic Regressi on
Support Vector Machin e
Decisi on Tree
TF+neg handling 75.2 76.9 74 69 74.2
TF IDF+ neg handling 70.2 74.4 77.7 70.4 67.8
TF+neg handling+ lemmatizati on
TF IDF+ neg handling+ lemmatizati on
2022,
Artifici al Neural Networ k
75.4 77.4 74.4 70.9 72.7
69.6 72.8 75.9 70.4 73.7
TF IDF+ neg handling+ lemmatizati on
43.3 47.6 48.3 51.3 51
© TF+neg handling 45.6 47 48.6 48.6 51
IRJET | TF IDF+ neg handling 11.4 26.9 49.1 46.2 0
11.4 24.9 46 52.7 49.3
TF+ lemmatizati on 49.4 46 47.1 57.5 51.7
TF IDF+ lemmatizati on 13.8 24.1 46 47.1 52.9
Usingthetruenegativeratetable,wecanobservethatofthe 5 algorithms, the decision tree approach handled the imbalance class problem the best, although the SVM and ANNalgorithmsdidaswell.
We witnessed promising results from our model because both the dataset and the testing model were built from scratch.Asthereisnosuchdatasetavailableforanalyzing consumerpurchaseintentionbasedontweetsfromTwitter.
Impact Factor value: 7.529 | ISO 9001:2008 Certified
Journal | Page2637 TF+neg handling+ lemmatizati on
Research Journal of Engineering and Technology (IRJET)
Volume: 09 Issue: 02 | Feb 2022 www.irjet.net
Five different models have been implemented by us here, thereforeourprojectstandsapartfromtheotherresearches thathavebeendoneinthisfield.Fromthesefivemodelswe choosethebestonesuitedfortheproductdata.Accuracyof 80% or more with an imbalance class dataset would be a victory.
TheFutureScopeofourprojectwouldincludeimplementing our model using deep learning algorithms. These would include algorithms like Convolutional Neural Networks (CNN), Recurrent Neural Network (RNN) and deep belief networks.Also,wewouldliketofocusonsomeparticular details of a product, instead of finding out the purchase intention of the product as a whole. This would help our modellearnbetterandwouldprovidemoreinsightsabout consumerthinkingandintentions.
[1] Agarwal,B. Xie,I. Vovsha, O.Rambow,R. Passonneau, “SentimentAnalysisofTwitterData",InProceedingsof the ACL 2011Workshop on Languages in Social Media,2011,pp.30 38
[2] A.Pak and P. Paroubek. „Twitter as a Corpus for SentimentAnalysisandOpinionMining".InProceedings of the Seventh Conference on International Language ResourcesandEvaluation,2010,pp.1320 1326
[3] R.Xia,C.Zong,andS.Li,“Ensembleoffeaturesetsand classification algorithms for sentiment classification,” InformationSciences:AnInternationalJournal,vol.181, no.6,pp.1138 1152,2011.
[4] L. Barbosa, J. Feng. “Robust Sentiment Detection on Twitter from Biased and Noisy Data". COLING 2010: PosterVolume,pp.36 44.
[5] BifetandE.Frank,"SentimentKnowledgeDiscoveryin Twitter Streaming Data", In Proceedings of the 13th InternationalConferenceonDiscoveryScience,Berlin, Germany:Springer,2010,pp.1 15.
[6] P.D.Turney,“Thumbsuporthumbsdown?:semantic orientation applied to unsupervised classification of reviews,”inProceedingsofthe40thannualmeetingon associationforcomputationallinguistics,pp.417 424, AssociationforComputationalLinguistics,2002.
[7] Pablo Gamallo, Marcos Garcia, “Citius: A Naive Bayes StrategyforSentimentAnalysisonEnglishTweets",8th International Workshop on Semantic Evaluation (SemEval 2014), Dublin, Ireland, Aug 23 24 2014, pp 171 175.
[8] DmitryDavidov,AriRappoport."EnhancedSentiment LearningUsingTwitterHashtagsandSmileys".Coling 2010: Poster Volume pages 241{249, Beijing, August 2010
2022, IRJET
e ISSN: 2395 0056
p ISSN: 2395 0072
[9] Po Wei Liang, Bi Ru Dai, “Opinion Mining on Social Media Data", IEEE 14th International Conference on MobileDataManagement,Milan,Italy,June3 6,2013, pp 91 96, ISBN:978 1 494673 6068 5, http://doi.ieeecomputersociety.org/10.1109/MDM.201 3
[10] Ajinkya Hazare, Abhishek Kalshetti, Pratik Barai, PremsingRathod,Prof.PramilaM.Chawan,”Consumer PurchaseIntentionPredictionSystem”,IRJET Volume: 08,Issue: 11,Nov 2021, https://www.irjet.net/archives/V8/i11/IRJET V8I1110.pdf
Ajinkya Hazare,B.TechStudent,Dept. ofComputerEngineeringandIT,VJTI College,Mumbai,Maharashtra,India
Impact Factor value: 7.529 | ISO 9001:2008
Abhishek Kalshetti,B.TechStudent, Dept.ofComputerEngineeringandIT, VJTI College, Mumbai, Maharashtra, India
Pratik Barai,B.TechStudent,Dept.of Computer Engineering and IT, VJTI College,Mumbai,Maharashtra,India
Premsing Rathod, B. Tech Student, Dept.ofComputerEngineeringandIT, VJTI College, Mumbai, Maharashtra, India
Prof. Pramila M. Chawan,isworking as an Associate Professor in the ComputerEngineeringDepartmentof VJTI, Mumbai. She has done her B.E. (Computer Engineering) and M.E. (Computer Engineering) from VJTI College of Engineering, Mumbai University. She has 28 years of teaching experience and has guided 80+ M. Tech. projects and 100+ B. Tech.projects.Shehaspublished134 papers in the International Journals, 20 papers in the National/International Conferences/
Research Journal of Engineering and Technology (IRJET)
Volume: 09 Issue: 02 | Feb 2022 www.irjet.net
Symposiums.ShehasworkedasanOrganizingCommittee member for 21 International Conferences and 5 AICTE/MHRDsponsoredWorkshops/STTPs/FDPs.Shehas participatedin14National/InternationalConferences.She has worked as NBA Coordinator of the Computer EngineeringDepartmentofVJTIfor5years.Shehadwritten aproposalunderTEQIP IinJune2004for‘CreatingCentral ComputingFacilityatVJTI’.Rs.EightCroreweresanctioned bytheWorldBankunderTEQIP Ionthisproposal.Central Computing Facility was set up at VJTI through this fund which has played a key role in improving the teaching learningprocessatVJTI.
9001:2008
e ISSN: 2395 0056
p ISSN: 2395 0072