mapbox / gabbar

Guarding OpenStreetMap from harmful edits using machine learning
MIT License
19 stars 7 forks source link

Translating names to English for validation using external APIs #42

Closed bkowshik closed 7 years ago

bkowshik commented 7 years ago

NOTE: Posting here to document a potential idea.


In changeset 48269805, there was one feature that was modified:

screen shot 2017-05-23 at 12 56 03 pm

I gave Google Translate API a try to translate the new name 亚庇中央巴刹, back to English. The result was Kota Kinabalu. These two words match with the English name in the previous version of the feature, Pasar Kota Kinabalu Central.

'use strict';

const Translate = require('@google-cloud/translate');
const projectId = 'Insert project ID';
const translateClient = Translate({
    projectId: projectId
});

translateClient.translate('센트럴마켓', 'en')
.then((results) => {
    const translation = results[0];

    console.log(`Text: ${text}`);
    console.log(`Translation: ${translation}`);
})
.catch((err) => {
    console.error('ERROR:', err);
});
lukasmartinelli commented 7 years ago

I don't think that should fit into Gabbar but into other systems.

bkowshik commented 7 years ago

Yes @lukasmartinelli, an external system makes more sense. No next actions here. Closing.