sloria / TextBlob

Simple, Pythonic, text processing--Sentiment analysis, part-of-speech tagging, noun phrase extraction, translation, and more.
https://textblob.readthedocs.io/
MIT License
9.05k stars 1.13k forks source link

Textblob translation returns both original and translated sentence #400

Open shubheshswain91 opened 2 years ago

shubheshswain91 commented 2 years ago

I am facing a problem with the translation

from textblob import TextBlob from textblob.translate import NotTranslated

text = TextBlob("Explanation\nWhy the edits made under my username Hardcore Metallica Fan were reverted? They weren't vandalisms, just closure on some GAs after I voted at New York Dolls FAC. And please don't remove the template from the talk page since I'm retired now.89.205.38.27") text = text.translate(from_lang='en', to='de') print(text)

Result: TextBlob("Explanation Why the edits made under my username Hardcore Metallica Fan were reverted? Erklärung Warum wurden die unter meinem Benutzernamen Hardcore Metallica Fan vorgenommenen Änderungen rückgängig gemacht? They weren't vandalisms, just closure on some GAs after I voted at New York Dolls FAC. Es waren keine Vandalismen, sondern nur die Schließung einiger GAs, nachdem ich bei New York Dolls FAC abgestimmt hatte. And please don't remove the template from the talk page since I'm retired now.89.205.38.27 Und bitte entfernen Sie die Vorlage nicht von der Diskussionsseite, da ich jetzt im Ruhestand bin.89.205.38.27")

It is giving me the original as well as the translated version. Also, it's giving me results in some XML format like ",&# " etc.