microsoft-translator

Microsoft Translator Text API breaks notranslate spans

偶尔善良 提交于 2021-01-27 19:20:30
问题 I'm using the Microsoft Translator Text API to translate some sentences. My sentences contains some parts of text that I need to not being translated. To achieve this I using <span class="notranslate"></span> by wrapping not translatable text. It works good in most cases, by in some cases MT API breaks this spans. Examples (Input -> Output): some <span class="notranslate">1</span> text -> деякий 1 текст some <span class="notranslate">1</span> another text -> деякий <span class="notranslate">1

Translator Text API | Microsoft Azure | Always ERROR 401000

冷暖自知 提交于 2020-07-21 04:07:40
问题 I tried to test Microsoft Translator API Text v3.0 but failed with 401 Access denied. I do standard cURL requests (HTTP POST) using PHP 7.3. $key = "************************"; // secret key here (from the Azure Portal) $host = "https://api.cognitive.microsofttranslator.com"; $path = "/translate?api-version=3.0"; $params = "&to=en&from=bg"; $text = "За мен лично хора, които задават такива въпроси са несъобразителни."; $requestBody = array( array( 'Text' => $text, ), ); $content = json_encode(

Can Microsoft Translator Service take context as a parameter for translation?

大憨熊 提交于 2020-01-25 07:27:06
问题 I am wondering if Microsoft Translator Service can take context as a parameter for translation. For example, I want to translate the word "run" as in "run a computer program", but not "run on a track". 回答1: Translate with context Retrieve the translated phrase that aligns with the word in question: https://docs.microsoft.com/azure/cognitive-services/translator/word-alignment Be prepared for the operation to fail: There aren't always 1:1 translations of individual words. Works only from and to

Category IDs for Microsoft Translator

♀尐吖头ヾ 提交于 2020-01-07 06:24:19
问题 Are there other category IDs for Microsoft Translator besides tech, speech and generalnn? Where can I find them? 回答1: Valid category values are <blank> or "general", "tech", "speech", "generalnn" or a custom category identifier you copied from the Hub overview page. The result is not necessarily different for every language pair. 来源: https://stackoverflow.com/questions/44630374/category-ids-for-microsoft-translator

“The remote server returned an error: NotFound” Translator API Windows phone 8

◇◆丶佛笑我妖孽 提交于 2020-01-06 07:56:19
问题 I'm trying to figure out a way to make working the tutorial from MSDN blog I found on using Microsoft Translator (Azure marketplace) on a Windows Phone 8 app. here it is the link: http://blogs.msdn.com/b/translation/p/windowsphone8.aspx . I'm using exactly the same code and sometimes I receive a: "The remote server returned an error: NotFound" I really don't understand what I have to do! Can someone help me to find a stable way to use that translation API on Windows phone ? thanks. 回答1: Per

Microsoft Translator API - notranslate trimming leading space?

早过忘川 提交于 2019-12-25 11:58:14
问题 Moving a question from the old MSDN forum here as it appears to be still open. https://social.msdn.microsoft.com/Forums/en-US/ce8c4eae-ad14-4835-8537-fc3870538bbe/translator-api-notranslate-trimming-leading-space?forum=microsofttranslator Is this a known bug, or intentional for any reason? Are there any workarounds for this issue so that the API does not strip white spaces? More examples: 回答1: Translator trims leading and trailing space, and compresses any other white space to a single space.

How to use HubUpload Post api?

我是研究僧i 提交于 2019-12-13 22:47:41
问题 im looking at api opened by Microsoft Translator Hub (Microsoft Translator Hub Api Swagger Link) and i cant figure out how to use the upload file part. The other operation ive managed to do but i cant figure out how to use the HubUpload operation. For HubUpload/Get public void GetStatusHubUpload(string accessToken) { var client = new RestClient("https://hub.microsofttranslator.com/api/HubUpload/Get"); var request = new RestRequest(Method.GET); request.AddParameter("trackingId", /*Integer*/);/

CORS support for Microsoft Azure Translate API?

旧巷老猫 提交于 2019-12-13 19:59:57
问题 This is a question related to https://social.msdn.microsoft.com/Forums/en-US/6e856136-9a39-4b98-a53d-7f8bce08e3a6/cors-support-for-bing-translate-api Does the Microsoft Azure Translate API support CORS now? 回答1: The Microsoft Translator Text API appears to at least minimally now support CORS, in that it does at least seem to send the Access-Control-Allow-Origin header in responses: $ curl -i -H 'Origin: http://example.com' \ 'https://api.microsofttranslator.com/v2/http.svc/Translate?appid=foo

Microsoft translator error

扶醉桌前 提交于 2019-12-13 07:02:33
问题 I am trying to use microsoft translator and each time I am trying to create LanguageServiceClient I get an error. try { // Add the http header string headerValue = GetAccessToken(); HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty(); httpRequestProperty.Method = "POST"; httpRequestProperty.Headers.Add("Authorization", headerValue); TranslatorService.LanguageServiceClient client = new TranslatorService.LanguageServiceClient(); using (OperationContextScope scope =

Microsoft translator azure are returning null with PHP API

你。 提交于 2019-12-13 03:45:25
问题 The output is null, PHP version is 5.6. I added the line to the PHP.INI file. I have tried with the HTTP and HTTP's but it still shows the null. I updated the host address to include the API call URL as shown in the azure control panel. And there is not much information about people receiving this error. <?php // NOTE: Be sure to uncomment the following line in your php.ini file. // ;extension=php_openssl.dll // ********************************************** // *** Update or verify the