BaşlayınÜcretsiz Başlayın

Analyzing the sentiment of a review

Your team is building a tool to monitor customer sentiment in product reviews. As a first step, you're testing the sentiment of individual reviews using a pre-trained pipeline.

Bu egzersiz

Natural Language Processing (NLP) in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Initialize a pipeline for sentiment-analysis with the "distilbert-base-uncased-finetuned-sst-2-english" model.
  • Use the pipeline to classify the sentiment of review_text.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

from transformers import pipeline

# Define the sentiment analysis pipeline
classifier = ____

review_text = "The new update made the app much faster and easier to use!"

# Get sentiment prediction
result = ____

print(result)
Kodu Düzenle ve Çalıştır