![Revisit consent button](../images/body-df29beacd7496220cc94.svg)
We value your privacy
We use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking "Accept All", you consent to our use of cookies.
Customise Reject All Accept All
Customise Consent Preferences ![](../images/body-2159bb67f3de8ad870eb.svg)
We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.
The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more
NecessaryAlways Active
Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.
  * Cookie
BCTempID
  * Duration
10 minutes
  * Description
No description available.


  * Cookie
__cf_bm
  * Duration
1 hour
  * Description
This cookie, set by Cloudflare, is used to support Cloudflare Bot Management. 


  * Cookie
AWSALBCORS
  * Duration
7 days
  * Description
Amazon Web Services set this cookie for load balancing.


  * Cookie
_cfuvid
  * Duration
session
  * Description
Cloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services


  * Cookie
li_gc
  * Duration
6 months
  * Description
Linkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.


  * Cookie
__hssrc
  * Duration
session
  * Description
This cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.


  * Cookie
__hssc
  * Duration
1 hour
  * Description
HubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.


  * Cookie
wpEmojiSettingsSupports
  * Duration
session
  * Description
WordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.


  * Cookie
BCSessionID
  * Duration
1 year 1 month 4 days
  * Description
Blueconic sets this cookie as a unique identifier for the BlueConic profile.


  * Cookie
_octo
  * Duration
1 year
  * Description
No description available.


  * Cookie
logged_in
  * Duration
1 year
  * Description
No description available.


  * Cookie
__Secure-YEC
  * Duration
past
  * Description
YouTube sets this cookie to stores the user's video player preferences using embedded YouTube video


  * Cookie
__eoi
  * Duration
6 months
  * Description
Description is currently not available.


  * Cookie
AWSALBTGCORS
  * Duration
7 days
  * Description
No description available.


  * Cookie
login-status-p
  * Duration
past
  * Description
Description is currently not available.


  * Cookie
AWSALBTG
  * Duration
7 days
  * Description
No description available.


  * Cookie
csrf_token
  * Duration
session
  * Description
No description available.


  * Cookie
token_v2
  * Duration
1 day
  * Description
Description is currently not available.


  * Cookie
D
  * Duration
1 year
  * Description
Description is currently not available.


  * Cookie
PHPSESSID
  * Duration
session
  * Description
This cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.


  * Cookie
VISITOR_PRIVACY_METADATA
  * Duration
6 months
  * Description
YouTube sets this cookie to store the user's cookie consent state for the current domain. 


  * Cookie
cookietest
  * Duration
session
  * Description
The cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.


  * Cookie
__Host-airtable-session
  * Duration
1 year
  * Description
This cookie is used to enable us to integrate the services of Airtable.


  * Cookie
__Host-airtable-session.sig
  * Duration
1 year
  * Description
This cookie is used to enable us to integrate the services of Airtable.


  * Cookie
m
  * Duration
1 year 1 month 4 days
  * Description
Stripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.


  * Cookie
BIGipServer*
  * Duration
session
  * Description
Marketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. 


  * Cookie
__cfruid
  * Duration
session
  * Description
Cloudflare sets this cookie to identify trusted web traffic.


  * Cookie
_GRECAPTCHA
  * Duration
6 months
  * Description
Google Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.


  * Cookie
__Secure-YNID
  * Duration
6 months
  * Description
Google cookie used to protect user security and prevent fraud, especially during the login process.


  * Cookie
cookieyes-consent
  * Duration
1 year
  * Description
CookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.


Functional
Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.
  * Cookie
lidc
  * Duration
1 day
  * Description
LinkedIn sets the lidc cookie to facilitate data center selection.


  * Cookie
brw
  * Duration
1 year
  * Description
No description available.


  * Cookie
brwConsent
  * Duration
5 minutes
  * Description
Description is currently not available.


  * Cookie
WMF-Uniq
  * Duration
1 year
  * Description
Description is currently not available.


  * Cookie
loom_anon_comment
  * Duration
1 year
  * Description
No description available.


  * Cookie
loom_referral_video
  * Duration
session
  * Description
Description is currently not available.


  * Cookie
VISITOR_INFO1_LIVE
  * Duration
6 months
  * Description
A cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.


  * Cookie
yt-remote-connected-devices
  * Duration
Never Expires
  * Description
YouTube sets this cookie to store the user's video preferences using embedded YouTube videos.


  * Cookie
ytidb::LAST_RESULT_ENTRY_KEY
  * Duration
Never Expires
  * Description
The cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.


  * Cookie
yt-remote-device-id
  * Duration
Never Expires
  * Description
YouTube sets this cookie to store the user's video preferences using embedded YouTube videos.


  * Cookie
yt-remote-session-name
  * Duration
session
  * Description
The yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.


  * Cookie
yt-remote-fast-check-period
  * Duration
session
  * Description
The yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.


  * Cookie
yt-remote-session-app
  * Duration
session
  * Description
The yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.


  * Cookie
yt-remote-cast-available
  * Duration
session
  * Description
The yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.


  * Cookie
yt-remote-cast-installed
  * Duration
session
  * Description
The yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.


  * Cookie
cp_session
  * Duration
3 months
  * Description
Codepen sets this cookie for Help systems found in the website.


  * Cookie
loid
  * Duration
1 year 1 month 4 days
  * Description
This cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.


Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.
  * Cookie
__hstc
  * Duration
6 months
  * Description
Hubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).


  * Cookie
hubspotutk
  * Duration
6 months
  * Description
HubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.


  * Cookie
_ga
  * Duration
1 year 1 month 4 days
  * Description
Google Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.


  * Cookie
_ga_*
  * Duration
1 year 1 month 4 days
  * Description
Google Analytics sets this cookie to store and count page views.


  * Cookie
__Host-psifi.analyticsTrace
  * Duration
6 hours
  * Description
Description is currently not available.


  * Cookie
__Host-psifi.analyticsTraceV2
  * Duration
6 hours
  * Description
Description is currently not available.


  * Cookie
_gh_sess
  * Duration
session
  * Description
GitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.


  * Cookie
YSC
  * Duration
session
  * Description
YSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.


  * Cookie
ajs_anonymous_id
  * Duration
1 year
  * Description
This cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.


  * Cookie
vuid
  * Duration
1 year 1 month 4 days
  * Description
Vimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. 


Performance
Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.
  * Cookie
AWSALB
  * Duration
7 days
  * Description
AWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.


  * Cookie
acq
  * Duration
past
  * Description
Description is currently not available.


  * Cookie
acq.sig
  * Duration
past
  * Description
Description is currently not available.


  * Cookie
ptc
  * Duration
2 years
  * Description
No description available.


Advertisement
Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.
  * Cookie
muc_ads
  * Duration
1 year 1 month 4 days
  * Description
Twitter sets this cookie to collect user behaviour and interaction data to optimize the website.


  * Cookie
guest_id_marketing
  * Duration
1 year 1 month 4 days
  * Description
Twitter sets this cookie to identify and track the website visitor.


  * Cookie
guest_id_ads
  * Duration
1 year 1 month 4 days
  * Description
Twitter sets this cookie to identify and track the website visitor.


  * Cookie
personalization_id
  * Duration
1 year 1 month 4 days
  * Description
Twitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.


  * Cookie
guest_id
  * Duration
1 year 1 month 4 days
  * Description
Twitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.


  * Cookie
bcookie
  * Duration
1 year
  * Description
LinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.


  * Cookie
__Secure-ROLLOUT_TOKEN
  * Duration
6 months
  * Description
YouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.


  * Cookie
yt.innertube::nextId
  * Duration
Never Expires
  * Description
YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.


  * Cookie
yt.innertube::requests
  * Duration
Never Expires
  * Description
YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.


  * Cookie
session_tracker
  * Duration
session
  * Description
This cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.


  * Cookie
edgebucket
  * Duration
session
  * Description
Reddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.


  * Cookie
did
  * Duration
1 year
  * Description
Arbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.


Uncategorised
Other uncategorised cookies are those that are being analysed and have not been classified into a category as yet.
No cookies to display.
Reject All Save My Preferences Accept All
Toggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation
[](https://towardsdatascience.com/)
Publish AI, ML & data-science insights to a global community of data professionals.
Sign in[Submit an Article](https://write.insightmediagroup.io)
[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)
* * *
[Write For TDS](https://towardsdatascience.com/submissions/)
[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search
[Data Science](https://towardsdatascience.com/category/data-science/)
# Customer Satisfaction Measurement with N-gram and Sentiment Analysis
Product reviews are an excellent source of information for qualified management decisions. Learn more about the right text mining...
[Petr Koráb](https://towardsdatascience.com/author/petrkorab/)
April 10, 20237 min read
### Product reviews are an excellent source of information for qualified management decisions. Learn more about the right text mining techniques.
![Photo by Freepik on Freepik](../images/000.jpeg)
Photo by [Freepik](https://www.freepik.com/free-photo/collage-customer-experience-concept_25053683.htm#query=customer%20satisfaction%20data&position=5&from_view=search&track=ais) on Freepik
Learn this step by step with the interactive [AI and Data Scientist](https://roadmap.sh/ai-data-scientist) roadmap.
## Introduction
Happy customers drive company growth. The five-word sentence explains everything about why we do our best to maximize customer satisfaction. Product reviews are one of the major data sources that large companies like [Amazon](https://www.amazon.com/gp/help/customer/display.html?nodeId=GL4WJF8BGV8VL6B8) and [Apple](https://www.apple.com/contact/feedback/#:~:text=To%20comment%20on%20a%20particular,and%20select%20the%20appropriate%20link.), middle-sized exporters including [Lentiamo](https://www.trustpilot.com/review/lentiamo.nl), and local companies running their Facebook pages collect. Reviews are typically collected repeatedly over time, and factors like quality shifts, marketing communications, and customer care friendliness impact the sentiment expressed by customers.
![Note: Image by author, based on the review of Karim \(2011\), Baker and Wurgler \(2006\), Merrin et al. \(2013\), and Eachempat et al. \(2022\)](../images/001.png)
Note: Image by author, based on the review of Karim (2011), Baker and Wurgler (2006), Merrin et al. (2013), and Eachempat et al. (2022)
The Business Intelligence (BI) role should be to analyze product reviews, identify potential problems, and develop hypotheses to solve them. In the next stage, these recommendations are scrutinized by other departments based on the company structure. _**This article will explain more closely the analytics of customer satisfaction measurement with product reviews data.**_
The-end-to end process includes:
  * How to make an exploratory analysis of time-series product reviews
  * How to quickly evaluate sentiment in product reviews over time
  * How to display the most frequent satisfaction factors over time


We'll work in Python, which most BI and data analysts routinely use.
## 2. Data
Getting unscraped product reviews data with a flexible data license is generally difficult. Synthetic data from [**Fake Reviews Dataset**](https://osf.io/tyue9/) distributed with [Attribution 4.0 International license](https://creativecommons.org/licenses/by/4.0/) is an excellent option in this case.
The data looks like this:
![Image 1. Fake Reviews Dataset](../images/002.png)
Image 1. Fake Reviews Dataset
The _text_ column contains product reviews, and _period_ marks the review date. The subset we'll work with contains 3848 reviews of clothing, shoes, and jewelry products.
## 3. Exploratory data analysis (EDA)
EDA in this type of dataset should discover the **completeness** of the dataset for each period of interest and the **presence of noise** that does not bring valuable information – digits and special characters. We try to avoid the situation of highly imbalanced datasets containing very few reviews in some periods and noisy datasets with too many digits and special characters (/, @, &,;, ? etc.).
**3.1. Checking for data completeness**
First, let's check the data for completeness for each period. We make annual comparisons and therefore summarise the reviews for each year:
python

```
import pandas as pd

# Calculate review frequencies by year
data['year'] = pd.DatetimeIndex(data['period']).year
rows_count = data.groupby('year', as_index=False).year.value_counts()
rows_count.columns=['year','reviews']

import matplotlib.pyplot as plt

# Generate a line plot
rows_count.plot.line(x='year',y = 'reviews')
plt.show()
```

A simple line pot shows the yearly review frequencies. It is not necessary to make any graph formatting here:
![Image 2. Yearly product review frequencies. Image by author.](../images/003.png)
Image 2. Yearly product review frequencies. Image by author.
* * *
> The dataset is not largely imbalanced. We have about 200 and more reviews per year, which makes a solid dataset for sentient and n-gram analyses.
**3.2. Calculating letter-to-other characters ratio**
Next, let's check if the data does not consist mainly of numbers and special characters, which could bias later text mining procedures.
python

```
import re

# Convert product reviews to a string
text = pd.Series.to_string(data['text'], index = False)

# Remove newline characters
text = re.sub('n', '', text)

# Calculate sum of numbers, letters, and spaces
numbers = sum(c.isdigit() for c in text)
letters = sum(c.isalpha() for c in text)
spaces  = sum(c.isspace() for c in text)
others  = len(text) - numbers - letters - spaces
```

We calculate _cleanness_ and _dirtiness_ (the opposite) metrics that show the ratios of letters to other characters (numbers, spaces, and special characters):
python

```
# Calculate metrics
dirtiness = ((numbers + others) / len(text)) * 100
cleanness = ((letters + spaces) / len(text)) * 100

print(dirtiness)
print(cleanness)
```

The print output is:
  * dirtiness is 8.77 %
  * cleanness is 91.22 %


> We have around 9 % of digits and special characters in the data. This volume of noise should not bias sentiment analysis in the later stage.
## 4. Customer satisfaction measurement
Text mining attempts to find out: (1) how the customers' sentiment developed over time and (2) which factors contributed to changes in customer satisfaction. We'll use [Arabica](https://pypi.org/project/arabica/), a Python library for time-series text mining, to explore both.
_**EDIT Jul 2023**_ _: Arabica has been updated. Check the_ _**documentation**_ _for the full list of parameters._
### 4.1. Sentiment analysis
Arabica offers `coffee_break` module for sentiment and breakpoint analysis. Its [documentation](https://arabica.readthedocs.io/en/latest/Breakpoint%20identification.html) provides more details about the models and methodology of sentiment evaluation.
This code cleans data from punctuation and numbers, removes other redundant strings (_"_  
_", "/n",_ and _"Another Long String"_ are used as examples), calculates sentiment for each review, aggregates the sentiment by year, and identifies two major break points in the sentiment time series:
python

```
from arabica import coffee_break

coffee_break(text = data['text'],
             time = data['period'],
             date_format = 'us',     # Use US-style date format to read dates
             preprocess = True,      # Clean data - digits and punctuation
             skip = ['<br />',       # Remove additional stop words
                     '/n',
             'Another Long String'],
             n_breaks = 2,           # 2 breakpoints identified
             time_freq = 'Y')        # Yearly aggregation
```

The line plot with sentiment and breakpoints:
![Image 3. Sentiment analysis with breakpoints. Image by author.](../images/004.png)
Image 3. Sentiment analysis with breakpoints. Image by author.
We can see fluctuations in sentiment over time. These changes are not rapid as sentiment varies [0.6: 0.7]. The higher value of sentiment, the better customers perceive the products (and the opposite).
> In 1991 and 2000, there were positive and negative breakpoints in sentiment. In the next stage, let's check what caused these shifts.
### 4.2. Factors driving customer satisfaction
We'll use a heatmap of n-gram-frequencies from the `cappuccino` module to visually derive the factors that influenced customers' sentiment. Read the [documentation](https://arabica.readthedocs.io/en/latest/Heatmap.html) for more technical details.
This code plots a heatmap of the eight most frequent bigrams (i.e., two consecutive words) in each year. The data pre-processing includes cleaning from English stopwords, numbers, and three unwanted strings (_"_  
_", "/n"_ , and _"Another Long String"_). Punctuation and blank rows are removed automatically:
python

```
from arabica import cappuccino

cappuccino(text = data['text'],
           time = data['period'],
           date_format = 'us',       # Use US-style date format to parse dates
           plot = 'heatmap',
           ngram = 2,                # N-gram size, 1 = unigram, 2 = bigram
           time_freq = 'Y',          # Aggregation period, 'M' = monthly, 'Y' = yearly
           max_words = 8,            # Display 8 most frequent bigrams for each period
           stopwords = ['english'],  # Remove English stopwords
           skip = ['<br />',         # Remove additional stop words
                   '/n',
           'Another Long String'],
           numbers = True,           # Remove numbers
           lower_case = True)        # Lowercase text
```

The bigram heatmap:
![Image 4. Bigram heatmap. Image by author.](../images/005.png)
Image 4. Bigram heatmap. Image by author.
Bigram frequencies indicate that:
  * _**2000s drop**_ (missing _"would recommend", "fits perfectly", and "fit perfect"_ in the top 8), and high frequencies of _"wide foot"_ and _"size fit"_ suggest that we might be selling products to people that do not fit their size of foot. Note that we removed stop words such as _"don't"_.


## Conclusions
This type of text-mining analytics should help make qualified **data-informed decisions** and improve the quality of our products and services. Based on the analytical results, we determine a set of hypotheses about what might be wrong and where is space for improvement.
From the text mining analysis in this article, we can see potential problems with product quality. The products fit worse our customers' current needs. Receiving the reviews in 2001, the analysts should formulate a set of problem hypotheses such as:
  * _The new shoes don't fit well._
  * _We don't sell wide-foot shoes, but customers demand them._
  * _There's a quality problem in the production of new products._


Many other potential problem hypotheses arise since you know your products better than anyone else. Other departments (Marketing, Customer Care, Logistics, ..) should find out where the problem is, then react with specific improvements, and fix the problem. The response, of course, depends on the company's size and structure and other firm-specific factors.
The jupyter notebook with the code and data is on my [GitHub](https://github.com/PetrKorab/Customer-Satisfaction-Measurement-with-N-gram-and-Sentiment-Analysis).
_Did you like the article? You can invite me_[ _for coffee_](https://www.buymeacoffee.com/petrkorab) _and support my writing. You can also subscribe to my_[ _email list_](https://medium.com/subscribe/@petrkorab) _to get notified about my new articles. Thanks!_
## References
Baker, M., Wurgler, J., 2006. Investor sentiment and the cross-section of stock returns. _Journal of Finance_ 61 (4).
Eachempati, P., Srivastava, P. R., Kumar A., Munoz, J., Dursun D., 2022. [Can customer sentiment impact firm value?](https://www.sciencedirect.com/science/article/abs/pii/S0040162521006995?via%3Dihub) An integrated text mining approach. _Technological Forecasting & Social Change_ 174 (1).
Karim, B., 2011. Corporate name change and shareholder wealth effect: empirical evidence in the French stock market. _Journal of Asset Management_ 12 (3).
Merrin, R. P., Hoffmann, A. O., Pennings, J. M., 2013. Customer satisfaction as a buffer against sentimental stock-price corrections. _Marketing Letters_ 24 (1).
## Register Now to Continue Reading
### Unlock Towards Data Science with a Free Account
All articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.
Register for freeSign in to your account
* * *
![](../images/body-9e78938b5e8b0a70213c.jpeg)
Written By
## [Petr Koráb](https://towardsdatascience.com/author/petrkorab/)
[See all from Petr Koráb](https://towardsdatascience.com/author/petrkorab/)
[Business Intelligence](https://towardsdatascience.com/tag/business-intelligence/)[Data Science](https://towardsdatascience.com/tag/data-science/)[Python](https://towardsdatascience.com/tag/python/)[Sentiment Analysis](https://towardsdatascience.com/tag/sentiment-analysis/)[Text Mining](https://towardsdatascience.com/tag/text-mining/)
Share This Article
  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fcustomer-satisfaction-measurement-with-n-gram-and-sentiment-analysis-547e291c13a6%2F&title=Customer%20Satisfaction%20Measurement%20with%20N-gram%20and%20Sentiment%20Analysis)
  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fcustomer-satisfaction-measurement-with-n-gram-and-sentiment-analysis-547e291c13a6%2F&title=Customer%20Satisfaction%20Measurement%20with%20N-gram%20and%20Sentiment%20Analysis)
  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fcustomer-satisfaction-measurement-with-n-gram-and-sentiment-analysis-547e291c13a6%2F&text=Customer%20Satisfaction%20Measurement%20with%20N-gram%20and%20Sentiment%20Analysis)


Towards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.
[Write for TDS](https://towardsdatascience.com/submissions/)
## Related Articles
  * [![](../images/006.jpg)](https://towardsdatascience.com/deploying-machine-learning-models-with-heroku-4dec1df87f71/)
## [Deploying Machine Learning Models with Heroku](https://towardsdatascience.com/deploying-machine-learning-models-with-heroku-4dec1df87f71/)
[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)
Don't just train, but also deploy: a step-by-step guide
[Avi Chawla](https://towardsdatascience.com/author/avi_chawla/)
September 10, 20228 min read
  * [![](../images/007.png)](https://towardsdatascience.com/how-to-build-decision-intelligence-software-four-lessons-from-launching-my-first-product-49cffd2c432c/)
## [How to build decision intelligence software](https://towardsdatascience.com/how-to-build-decision-intelligence-software-four-lessons-from-launching-my-first-product-49cffd2c432c/)
[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)
Four lessons from launching my first product
[Cameron Afzal](https://towardsdatascience.com/author/cameron.afzal/)
September 10, 20209 min read
  * [![](../images/008.jpeg)](https://towardsdatascience.com/from-messy-to-neat-with-python-pandas-91bc98b95d7f/)
## [From Messy to Neat with Python Pandas](https://towardsdatascience.com/from-messy-to-neat-with-python-pandas-91bc98b95d7f/)
[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)
A practical tutorial
[Soner Yıldırım](https://towardsdatascience.com/author/sonery/)
March 18, 20214 min read
  * [![](../images/009.png)](https://towardsdatascience.com/plotly-dashboards-in-python-28a3bb83702c/)
## [This is How I Create Dazzling Dashboards Purely in Python.](https://towardsdatascience.com/plotly-dashboards-in-python-28a3bb83702c/)
[Programming](https://towardsdatascience.com/category/programming/)
Plotly dash apps are the fastest way to build production-grade dashboards in python.
[Thuwarakesh Murallie](https://towardsdatascience.com/author/thuwarakesh/)
September 5, 20216 min read
  * [![](../images/010.png)](https://towardsdatascience.com/where-people-are-most-interested-in-data-visualization-and-data-science-16079ad706e0/)
## [Where people are most interested in Data Visualization and Data Science](https://towardsdatascience.com/where-people-are-most-interested-in-data-visualization-and-data-science-16079ad706e0/)
[Data Science](https://towardsdatascience.com/category/data-science/)
Today I extracted Google Trends data using R to find cities with most searches in 'Data Visualization' and 'Data science' as well as...
[Hannah Yan Han](https://towardsdatascience.com/author/yanhann10/)
September 9, 20173 min read
  * [![](../images/011.jpg)](https://towardsdatascience.com/plotting-maps-with-geopandas-428c97295a73/)
## [Plotting Maps with GeoPandas](https://towardsdatascience.com/plotting-maps-with-geopandas-428c97295a73/)
[](https://towardsdatascience.com/customer-satisfaction-measurement-with-n-gram-and-sentiment-analysis-547e291c13a6/)
Beginners Guide to Geospatial Data Plotting
[Ryan Lewis](https://towardsdatascience.com/author/rylewww/)
March 14, 20215 min read
  * [![](../images/012.png)](https://towardsdatascience.com/five-essential-things-you-must-know-to-learn-tableau-2b899403bfcb/)
## [Five essential things you must know to learn Tableau](https://towardsdatascience.com/five-essential-things-you-must-know-to-learn-tableau-2b899403bfcb/)
[Data Science](https://towardsdatascience.com/category/data-science/)
A guide with free resources for building your skills
[Brian Perron, PhD](https://towardsdatascience.com/author/b-r-i-a-n/)
June 9, 20225 min read
  * [![](../images/013.jpeg)](https://towardsdatascience.com/3-tips-you-need-to-be-successful-in-data-visualization-9b5225ab7afc/)
## [3 Tips You Need to Be Successful in Data Visualization](https://towardsdatascience.com/3-tips-you-need-to-be-successful-in-data-visualization-9b5225ab7afc/)
[Programming](https://towardsdatascience.com/category/programming/)
Your data is good - but you can make it better.
[Benjamin Nweke](https://towardsdatascience.com/author/benjaminnweke/)
May 18, 20226 min read
  * [![](../images/014.png)](https://towardsdatascience.com/how-to-get-into-data-science-without-a-degree-2f84516f1afd/)
## [How to Get Into Data Science Without a Degree](https://towardsdatascience.com/how-to-get-into-data-science-without-a-degree-2f84516f1afd/)
[Programming](https://towardsdatascience.com/category/programming/)
Advice from a Data Scientist in the same position
[Terence Shin, MSc, MBA](https://towardsdatascience.com/author/terenceshin/)
October 29, 20207 min read


  * [YouTube](https://www.youtube.com/c/TowardsDataScience)
  * [X](https://x.com/TDataScience)
  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)
  * [Threads](https://www.threads.net/@towardsdatascience)
  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)


[](https://towardsdatascience.com/)
Your home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.
Subscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)
© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)
####  Recommended Articles 
Close
  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607686/image?etag=1782161464448&width=500&height=500) How Relevance Models Foreshadowed Transformers for NLP ](https://towardsdatascience.com/how-relevance-models-foreshadowed-transformers-for-nlp/ "How Relevance Models Foreshadowed Transformers for NLP")
  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ "Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1")
  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ "The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs")
  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ "Does Your Company Have a Data Strategy?")


