Sentiment Analysis of Restaurant Reviews Using Machine Learning Algorithms

preprint OA: closed
Full text JSON View at publisher

Abstract

Abstract This study conducts a comparative analysis of traditional and ensemble machine learning techniques for classifying sentiments in restaurant reviews. Utilizing a carefully selected dataset of customer feedback marked as either positive (Liked) or negative, we establish a reproducible process that encompasses text preprocessing (regex, converting to lowercase), stopword elimination (while retaining negations), stemming, and two feature extraction methods (Bag-of-Words and TF-IDF). We train and assess five classifiers: Gaussian Naive Bayes, Logistic Regression, Support Vector Machine (SVM), Random Forest, and XGBoost. The evaluation metrics include accuracy, precision, recall, F1-score, and confusion matrices, with robustness tested through cross-validation. This research underscores the balance between model complexity, computational demands, and classification effectiveness, offering visualization and an interactive prediction tool for practical use. Our contributions include (1) a thorough comparison of feature extraction techniques and classifiers on restaurant review data, (2) a comprehensive, reproducible codebase and evaluation framework, and (3) insights into model selection for business applications like automated feedback analysis and customer experience monitoring.
Full text 10,304 characters · extracted from preprint-html · click to expand
Sentiment Analysis of Restaurant Reviews Using Machine Learning Algorithms | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Sentiment Analysis of Restaurant Reviews Using Machine Learning Algorithms Kabir Kohli This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7832775/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract This study conducts a comparative analysis of traditional and ensemble machine learning techniques for classifying sentiments in restaurant reviews. Utilizing a carefully selected dataset of customer feedback marked as either positive (Liked) or negative, we establish a reproducible process that encompasses text preprocessing (regex, converting to lowercase), stopword elimination (while retaining negations), stemming, and two feature extraction methods (Bag-of-Words and TF-IDF). We train and assess five classifiers: Gaussian Naive Bayes, Logistic Regression, Support Vector Machine (SVM), Random Forest, and XGBoost. The evaluation metrics include accuracy, precision, recall, F1-score, and confusion matrices, with robustness tested through cross-validation. This research underscores the balance between model complexity, computational demands, and classification effectiveness, offering visualization and an interactive prediction tool for practical use. Our contributions include (1) a thorough comparison of feature extraction techniques and classifiers on restaurant review data, (2) a comprehensive, reproducible codebase and evaluation framework, and (3) insights into model selection for business applications like automated feedback analysis and customer experience monitoring. Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7832775","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":529804593,"identity":"924f76ec-8c6b-43ac-a64e-86a495e1b804","order_by":0,"name":"Kabir Kohli","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABDUlEQVRIiWNgGAWjYBACCQYehgMMDAkMBuyMDSABA34QmVBAjBZmqBZJEJVggF8LA0QLRMDA4ACYwq1Fsv3swcMVDGly5szMDcw8FfeMjc+vTvzwwIBBnl/sAFYt0jx5CQfPMOQYWzYzArWcKTYzu/F2swTQYYYzZydg1SLHkGNwsIGhInHDYaCW3LYEG7MbZzeAtCQY3Mahhf8NmhbjGWc3/8CnRVoCbEsOXIuZAX/vNry2SM54l3CwwSDN2ACo5fCfMwnGEjd4t1kkGEjg9IvE+dzDHxsqkuUMjrc/fDijIsGwv//s5ps/Kmzk+aWxa4EAaCwcgJgCVimBRzkG4D9AiupRMApGwSgYAQAAf4ZfVqt3necAAAAASUVORK5CYII=","orcid":"","institution":"University School of Automation and Robotics, GGSIPU","correspondingAuthor":true,"prefix":"","firstName":"Kabir","middleName":"","lastName":"Kohli","suffix":""}],"badges":[],"createdAt":"2025-10-11 07:23:14","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-7832775/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7832775/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":93641046,"identity":"31c526ae-a1e3-4d50-8c0b-84378c584733","added_by":"auto","created_at":"2025-10-16 02:43:15","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":166659,"visible":true,"origin":"","legend":"","description":"","filename":"SentimentAanResearchpaper.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7832775/v1/b351e1fbbf1c155b903b14b5.pdf"},{"id":93640398,"identity":"cce589e2-f56a-4f43-8b04-f8b854512ced","added_by":"auto","created_at":"2025-10-16 02:35:15","extension":"json","order_by":1,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":3396,"visible":true,"origin":"","legend":"","description":"","filename":"95ce3c5568544f8dbb5143d178cb6d43.json","url":"https://assets-eu.researchsquare.com/files/rs-7832775/v1/d373ca3c20ecfd4a8acde511.json"},{"id":97668578,"identity":"88e051cb-bc4c-4d8b-ba62-1d740469097b","added_by":"auto","created_at":"2025-12-08 09:25:50","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":231422,"visible":true,"origin":"","legend":"","description":"","filename":"SentimentAanResearchpaper.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7832775/v1_covered_8cdea22f-d96c-460c-8470-01645553036c.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Sentiment Analysis of Restaurant Reviews Using Machine Learning Algorithms","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"","lastPublishedDoi":"10.21203/rs.3.rs-7832775/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7832775/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"This study conducts a comparative analysis of traditional and ensemble machine learning techniques for classifying sentiments in restaurant reviews. Utilizing a carefully selected dataset of customer feedback marked as either positive (Liked) or negative, we establish a reproducible process that encompasses text preprocessing (regex, converting to lowercase), stopword elimination (while retaining negations), stemming, and two feature extraction methods (Bag-of-Words and TF-IDF). We train and assess five classifiers: Gaussian Naive Bayes, Logistic Regression, Support Vector Machine (SVM), Random Forest, and XGBoost. The evaluation metrics include accuracy, precision, recall, F1-score, and confusion matrices, with robustness tested through cross-validation. This research underscores the balance between model complexity, computational demands, and classification effectiveness, offering visualization and an interactive prediction tool for practical use. Our contributions include (1) a thorough comparison of feature extraction techniques and classifiers on restaurant review data, (2) a comprehensive, reproducible codebase and evaluation framework, and (3) insights into model selection for business applications like automated feedback analysis and customer experience monitoring.","manuscriptTitle":"Sentiment Analysis of Restaurant Reviews Using Machine Learning Algorithms","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-10-16 02:35:10","doi":"10.21203/rs.3.rs-7832775/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"58f38915-163c-4bc5-ac1e-998436f46114","owner":[],"postedDate":"October 16th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2025-12-04T19:53:24+00:00","versionOfRecord":[],"versionCreatedAt":"2025-10-16 02:35:10","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-7832775","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7832775","identity":"rs-7832775","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00