Comments (8)
Hello, can you send example code in which exactly this error appears? Or can you please show the value of the translator
variable?
from translate.
import pandas as pd from translatepy.translators import GoogleTranslate df = pd.read_csv("ru-en.csv") translator = GoogleTranslate() df['short_description EN'] = df['short_description'].apply(str).apply(lambda x: translator.translate(x, 'en', 'ru'))
Importing the entire
translatepy
gives the same result and does not change the behaviour/error message. The column is entirely in Russian and does not have any Null values.
I guess that there is quite a lot of data in ru-en.csv
?
Then, this might be why you hit the NoResult
exception quite fast.
You should always use multiple translators, using translatepy.Translate
, to avoid hitting the rate limits.
from translate.
How is the data at this column ? It seems weird that only this one encounters issues.
from translate.
How is the data at this column ? It seems weird that only this one encounters issues.
actually there was an empty line, it's just it was buried inside the csv file and for some reason I needed to find it manually myself + a couple of other strange rows. Deleting it fixed the issue. I guess can't have any empty lines in a pandas column?
Thanks for all your help!
from translate.
How is the data at this column ? It seems weird that only this one encounters issues.
actually there was an empty line, it's just it was buried inside the csv file and for some reason I needed to find it manually myself + a couple of other strange rows. Deleting it fixed the issue. I guess can't have any empty lines in a pandas column?
Thanks for all your help!
translatepy will try not to make any request when there is nothing to translate to avoid hitting rate limits
from translate.
import pandas as pd
from translatepy.translators import GoogleTranslate
df = pd.read_csv("ru-en.csv")
translator = GoogleTranslate()
df['short_description EN'] = df['short_description'].apply(str).apply(lambda x: translator.translate(x, 'en', 'ru'))
Importing the entire translatepy
gives the same result and does not change the behaviour/error message. The column is entirely in Russian and does not have any Null values.
from translate.
(Also, don't run the translation every time you run the program and try to save the translated data)
from translate.
import pandas as pd from translatepy.translators import GoogleTranslate df = pd.read_csv("ru-en.csv") translator = GoogleTranslate() df['short_description EN'] = df['short_description'].apply(str).apply(lambda x: translator.translate(x, 'en', 'ru'))
Importing the entire
translatepy
gives the same result and does not change the behaviour/error message. The column is entirely in Russian and does not have any Null values.I guess that there is quite a lot of data in
ru-en.csv
?Then, this might be why you hit the
NoResult
exception quite fast.You should always use multiple translators, using
translatepy.Translate
, to avoid hitting the rate limits.
Thanks for the reply!
I do not think that the issue is related to the amount of data though. I ran the translation separately for each column (one of the columns had approx 5x times more text with the same number of rows), and it worked. However, it refuses to translate this one and throws this "NoResult" error.
Regarding the use of multiple translators: The first time I encountered this error, I was using multiple translators, but being more specific and picking GoogleTranslate worked for me and solved the issue. However, this time neither works. Maybe there is something problematic about this column, but I do not really see how it would be different from all the others that did get translated.
from translate.
Related Issues (20)
- The `example` function in `YandexTranslate` without translation HOT 7
- Bulk Translation support? HOT 2
- Missing spaces between tags when using translate_html HOT 2
- Bing Translator throwing error code 205 HOT 5
- Not accurate source language autodetection HOT 14
- Language auto detecting is broken in MyMemory HOT 3
- example() not working HOT 1
- Next: 3.0 HOT 24
- Different Translation on Yandex HOT 11
- Result mismatch Google Translate HOT 5
- MicrosoftTranslate.text_to_speech is not working HOT 8
- Is the DeepL split text correct? HOT 3
- [SERVER]: cannot import name 'General' from 'nasse.config' HOT 1
- the lang tr is not supported by deepl error (even though it has) HOT 1
- How to set timeout for Translate requesting? HOT 8
- Links and hashtags seem to change after translation HOT 10
- ReversoTranslator BUG HOT 7
- No module named 'translatepy.utils' (on Windows) HOT 2
- Traditional Chinese HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from translate.