ChristopherLucas / translateR

R Package for Cross-Language Topic Modeling
20 stars 17 forks source link

is it working with Google translate API v2 ? #2

Closed robocop-bob closed 10 years ago

robocop-bob commented 10 years ago

Hi Christopher,

I try examples attached to translate function but without success. I have Google API key and billing is opened .

my.api.key = "real google api key with biling opened"

translate(dataset = enron, content.field = 'email', google.api.key = my.api.key, source.lang = 'en', target.lang = 'de')

Output: no translation, EN in, EN out - should be DE

translate(content.vec = enron$email, google.api.key = my.api.key, source.lang = 'en', target.lang = 'de')

Output: NULL

Any help ?

Best regards Robert

ChristopherLucas commented 10 years ago

Hi Robert,

Thanks for using translateR.

Both of these examples work fine for me, I'm not able to replicate your error. I presume you first loaded the enron data with data(enron)? If so, can you paste the complete, verbatim R input and output rather your interpretation of it?

Best, Chris

ChristopherLucas commented 10 years ago

You can of course delete the line in which you assign the API key.

robocop-bob commented 10 years ago

Hi ,

I found my issue. My API KEY was restricted to defined IP address. All is working perfectly now. Thank you.

To find issue I used direct call from web application (output of this call showed me my mistake):

https://www.googleapis.com/language/translate/v2?key=INSERT-YOUR-KEY&q=hello%20world&source=en&target=de

More about Google API https://cloud.google.com/translate/v2/getting_started

Best regards Robert

ChristopherLucas commented 10 years ago

Thanks Robert, I'll add this to the documentation in the next iteration.