Zacznij terazZacznij za darmo

Identify the language of a string

Sometimes you might need to analyze the sentiment of non-English text. Your first task in such a case will be to identify the foreign language.

In this exercise you will identify the language of a single string. A string called foreign has been created for you. It has been randomly extracted from the reviews dataset and may contain some grammatical errors. Feel free to explore it in the IPython Shell.

To ćwiczenie jest częścią kursu

Sentiment Analysis in Python

Zobacz kurs

Instrukcje do ćwiczenia

  • Import the required function from the language detection package.
  • Detect the language of the foreign string.

Interaktywne ćwiczenie praktyczne

Spróbuj tego ćwiczenia, uzupełniając ten przykładowy kod.

# Import the language detection function and package
from ____ import ____

# Detect the language of the foreign string
print(____(foreign))
Edytuj i uruchom kod