July 2018
Intermediate to advanced
474 pages
13h 37m
English
The following section walks through the steps to apply sentiment score to the dataset.
from textblob import TextBlobdef sentiment_score(chat): return TextBlob(chat).sentiment.polarity
from pyspark.sql.types import FloatTypesentiment_score_udf = F.udf(lambda x: sentiment_score(x), FloatType())
Read now
Unlock full access