Skip to content

Instantly share code, notes, and snippets.

@colibie
Created December 10, 2019 12:08
Show Gist options
  • Save colibie/bfd22b2bbacf28102c6c1c85721b7383 to your computer and use it in GitHub Desktop.
Save colibie/bfd22b2bbacf28102c6c1c85721b7383 to your computer and use it in GitHub Desktop.
Holds function for detecting language using Azure Text Analytics
let get_language = async function (documents) {
let body = JSON.stringify(documents);
let url = endpoint + pathForLanguages;
let params = {
headers: {
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': subscription_key
}
};
let data = await axios.default.post(url, body, params)
return data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment