Explain language translation and text classification in NLP. Give examples.
Natural Language can be defined as any human readable language and for this another amazing module is there in Python that can be used in various purpose. Language Translation is another application where the power of NLP can be utilized.
For Language Translation task we are going to use the module GoogleTrans for the conversion of any language to the destination language the user choose.
from googletrans import Translator
translator= Translator()
sentence= input("Sentence to convert: ")
translatedSent= translator.translate(sentence, src='en', dest='hi')
print("Translated Sentence: ", translatedSent.text)
Text clarification is the process of categorizing the text into a group of words. By using NLP, text classification can automatically analyze text and then assign a set of predefined tags or categories based on its context. NLP is used for sentiment analysis, topic detection, and language detection. There is mainly three text classification approach-
In the rule-based approach, texts are separated into an organized group using a set of handicraft linguistic rules. Those handicraft linguistic rules contain users to define a list of words that are characterized by groups. For example, words like Donald Trump and Boris Johnson would be categorized into politics.
Reference: https://iq.opengenus.org/
https://www.analyticsvidhya.com
Comments
Leave a comment