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

Translating customer reviews to French

A global e-commerce company is analyzing customer feedback from its English-speaking users. To support its French customer support team, the company needs to translate these reviews into French. As part of the NLP pipeline, your role is to automate the translation of reviews using the Hugging Face pipeline.

Bu egzersiz

Natural Language Processing (NLP) in Python

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

Egzersiz talimatları

  • Create a translator pipeline using the "Helsinki-NLP/opus-mt-en-fr" model.
  • Translate the provided review from English to French.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

from transformers import pipeline

# Create the translation pipeline
translator = pipeline(task="____", model="____")

review = "The hotel was clean and the staff were very friendly."

# Translate the review
translation = ____

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