CommencerCommencer gratuitement

Sentiment analysis on formatted text

In this exercise, you'll calculate the sentiment on the customer channel of call_2.wav (file).

You've split the customer channel and saved it to call_2_channel_2.wav (file).

But from your experience with sentiment analysis, you know it can change sentence to sentence.

To calculate it sentence to sentence, you split the split using NLTK's sent_tokenize() module.

But transcribe_audio() doesn't return sentences. To try sentiment anaylsis with sentences, you've tried a paid API service to get call_2_channel_2_paid_api_text which has sentences.

Cet exercice fait partie du cours

Spoken Language Processing in Python

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

from nltk.sentiment.vader import SentimentIntensityAnalyzer

# Create SentimentIntensityAnalyzer instance
sid = SentimentIntensityAnalyzer()

# Transcribe customer channel of call 2
call_2_channel_2_text = transcribe_audio(____)

# Display text and sentiment polarity scores
print(call_2_channel_2_text)
print(sid.____(call_2_channel_2_text))
Modifier et exécuter le code