<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 polyglot
Polyglot is a natural language pipeline that supports massive multilingual applications.
Free software
Step1:  Language Detection
Step2:  Tokenization
Step3:  Part of Speech Tagging
Step4:  Named Entity Recognition
Step5:  Polarity
Step6:  Embeddings
Step7:  Morphology
Step8:  Transliteration
<ASSISTANT_TASK:>
Python Code:
import polyglot
from polyglot.text import Text, Word
Explanation: polyglot
Polyglot is a natural language pipeline that supports massive multilingual applications.
Free software: GPLv3 license
Documentation: http://polyglot.readthedocs.org.
Features
Tokenization (165 Languages)
Language detection (196 Languages)
Named Entity Recognition (40 Languages)
Part of Speech Tagging (16 Languages)
Sentiment Analysis (136 Languages)
Word Embeddings (137 Languages)
Morphological analysis (135 Languages)
Transliteration (69 Languages)
Developer
Rami Al-Rfou @ rmyeid gmail com
Quick Tutorial
End of explanation
text = Text("Bonjour, Mesdames.")
print("Language Detected: Code={}, Name={}\n".format(text.language.code, text.language.name))
Explanation: Language Detection
End of explanation
zen = Text("Beautiful is better than ugly. "
           "Explicit is better than implicit. "
           "Simple is better than complex.")
print(zen.words)
print(zen.sentences)
Explanation: Tokenization
End of explanation
text = Text(u"O primeiro uso de desobediência civil em massa ocorreu em setembro de 1906.")
print("{:<16}{}".format("Word", "POS Tag")+"\n"+"-"*30)
for word, tag in text.pos_tags:
    print(u"{:<16}{:>2}".format(word, tag))
Explanation: Part of Speech Tagging
End of explanation
text = Text(u"In Großbritannien war Gandhi mit dem westlichen Lebensstil vertraut geworden")
print(text.entities)
Explanation: Named Entity Recognition
End of explanation
print("{:<16}{}".format("Word", "Polarity")+"\n"+"-"*30)
for w in zen.words[:6]:
    print("{:<16}{:>2}".format(w, w.polarity))
Explanation: Polarity
End of explanation
word = Word("Obama", language="en")
print("Neighbors (Synonms) of {}".format(word)+"\n"+"-"*30)
for w in word.neighbors:
    print("{:<16}".format(w))
print("\n\nThe first 10 dimensions out the {} dimensions\n".format(word.vector.shape[0]))
print(word.vector[:10])
Explanation: Embeddings
End of explanation
word = Text("Preprocessing is an essential step.").words[0]
print(word.morphemes)
Explanation: Morphology
End of explanation
from polyglot.transliteration import Transliterator
transliterator = Transliterator(source_lang="en", target_lang="ru")
print(transliterator.transliterate(u"preprocessing"))
Explanation: Transliteration
End of explanation
<END_TASK>