ChristopherLucas / translateR

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

Language identification warning fail #11

Open geotheory opened 7 years ago

geotheory commented 7 years ago

Is this package still supported? If so please read on..

I get the following when running on a single string that I know is Arabic:

x2 = translate(content.vec = x,
+           google.api.key = 'xxx',
+           source.lang = 'ar',
+           target.lang = 'en')
Warning message:
The content appears to be in NA. However, the language code you provided suggests that the text
is in ARABIC. If you entered the wrong language code, stop the process. Otherwise, translateR
will treat the text as ARABIC.

So the function says it will continue but offers no way to do so. Is something broken?

ChristopherLucas commented 7 years ago

What is the content of x2? You mean it's empty?

geotheory commented 7 years ago

x2 reports NULL. x is just an Arabic text string that translates fine in Google Translate in browser. You can try with this x = 'أريد ترجمة هذا' - Arabic for "I want to translate this".

ChristopherLucas commented 7 years ago

Doesn't replicate for me. Are you sure your api key is good? IE, up to date, credit card info, etc?

screenshot from 2017-06-01 22-04-10

geotheory commented 7 years ago

Ah I was using an unauthorised key for this API, and didn't realise it's a paid service.

So now I'm testing on the Microsoft Azure free tier. But the process step to register at the Azure DataMarket looks out-of-date - see https://datamarket.azure.com/register?redirect=%2Fdeveloper%2Fapplications%2F . Do you know how I get my Azure app working? I have Subscription ID, key1 and key2 but not anything looks like client.id and client.secret. Any idea?

ChristopherLucas commented 7 years ago

Ah, so the Microsoft bindings broke recently when they made significant changes to their translation API. I won't have time to look into this soon but if you feel like poking around and figuring out how/where to GET/POST, it would be straightforward to fix.