Anúncio
relacionado a: microsoft translator text apiGrammarly's translation feature supports 19 of the world’s most widely spoken languages. Make writing in other languages feel seamless and efficient. Try it now.
Resultado da Busca
Translator Text API is a cloud-based machine translation service that can be used to build applications, websites, tools, or any solution requiring multi-language support. It offers features such as neural translation, transliteration, bilingual dictionary, and customization options.
A API de texto do Microsoft Translator é um serviço de tradução automática também conhecido como baseado em nuvem, usado para criar aplicativos, sites e ferramentas.
Microsoft Tradutor Text API é um serviço de tradução de máquina baseada em nuvem aka usado para construir aplicativos, websites e ferramentas.
28 de ago. de 2024 · Learn how to use the Text Translation API to translate text between language pairs across all supported languages and dialects. The API supports various methods such as translate, transliterate, detect, breakSentence, and dictionary.
- Overview
- Prerequisites
- Headers
- Set up your application
- Translate text
- Detect language
- Transliterate text
- Get sentence length
- Dictionary lookup (alternate translations)
- Dictionary examples (translations in context)
- GeneratedCaptionsTabForHeroSec
In this how-to guide, you learn to use the Translator service REST APIs. You start with basic examples and move onto some core configuration options that are commonly used during development, including:
•Translation
•Transliteration
•Language identification/detection
•Calculate sentence length
•Get alternate translations and examples of word usage in a sentence
•Azure subscription - Create one for free
•An Azure AI multi-service or Translator resource. Once you have your Azure subscription, create a single-service or a multi-service resource, in the Azure portal, to get your key and endpoint. After it deploys, select Go to resource.
•You can use the free pricing tier (F0) to try the service, and upgrade later to a paid tier for production.
•You need the key and endpoint from the resource to connect your application to the Translator service. Later, you paste your key and endpoint into the code samples. You can find these values on the Azure portal Keys and Endpoint page:
Important
Remember to remove the key from your code when you're done, and never post it publicly. For production, use a secure way of storing and accessing your credentials like Azure Key Vault. For more information, see the Azure AI services security.
To call the Translator service via the REST API, you need to make sure the following headers are included with each request. Don't worry, we include the headers in the sample code in the following sections.
Header Value Condition
•C#
•Go
•Java
•Node.js
•Python
1.Make sure you have the current version of Visual Studio IDE.
The core operation of the Translator service is to translate text. In this section, you build a request that takes a single source (from) and provides two outputs (to). Then we review some parameters that can be used to adjust both the request and the response.
•C#
•Go
•Java
•Node.js
•Python
Detect source language during translation
If you don't include the from parameter in your translation request, the Translator service attempts to detect the source text's language. In the response, you get the detected language (language) and a confidence score (score). The closer the score is to 1.0, means that there's increased confidence that the detection is correct. •C# •Go •Java •Node.js •Python
Detect source language without translation
It's possible to use the Translator service to detect the language of source text without performing a translation. To do so, you use the /detect endpoint. •C# •Go •Java •Node.js •Python
Transliteration is the process of converting a word or phrase from the script (alphabet) of one language to another based on phonetic similarity. For example, you could use transliteration to convert "สวัสดี" (thai) to "sawatdi" (latn). There's more than one way to perform transliteration. In this section, you learn how to use language detection us...
Get sentence length during translation
You can get character counts for both source text and translation output using the translate endpoint. To return sentence length (srcSenLen and transSenLen) you must set the includeSentenceLength parameter to True. •C# •Go •Java •Node.js •Python
Get sentence length without translation
The Translator service also lets you request sentence length without translation using the breaksentence endpoint. •C# •Go •Java •Node.js •Python
With the endpoint, you can get alternate translations for a word or phrase. For example, when translating the word "sunshine" from en to es, this endpoint returns "luz solar," "rayos solares," and "soleamiento," "sol," and "insolación."
•C#
•Go
•Java
•Node.js
•Python
After you've performed a dictionary lookup, pass the source and translation text to the dictionary/examples endpoint, to get a list of examples that show both terms in the context of a sentence or phrase. Building on the previous example, you use the normalizedText and normalizedTarget from the dictionary lookup response as text and translation respectively. The source language (from) and output target (to) parameters are required.
•C#
•Go
•Java
•Node.js
•Python
Learn how to use the Translator service REST APIs to translate text, detect languages, and more. Follow the how-to guide with code samples in C#, Go, Java, Node.js, and Python.
26 de set. de 2024 · Learn how to use the Translator service to translate text using a programming language of your choice or the REST API. Follow the steps to create a Translator resource, get your key and endpoint, and build a request with headers and parameters.
28 de ago. de 2024 · Version 3.0 of the Translator provides a modern JSON-based Web API. It improves usability and performance by consolidating existing features into fewer operations and it provides new features. Transliteration to convert text in one language from one script to another script. Translation to multiple languages in one request.