Created
December 10, 2019 12:08
-
-
Save colibie/bfd22b2bbacf28102c6c1c85721b7383 to your computer and use it in GitHub Desktop.
Holds function for detecting language using Azure Text Analytics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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