Advent of 2024, Day 6 – Microsoft Azure AI – AI Services in Azure AI Foundry
This article is originally published at https://tomaztsql.wordpress.com
is Microsoft Azure AI series:
- Dec 01: Microsoft Azure AI – What is Foundry?
- Dec 02: Microsoft Azure AI – Working with Azure AI Foundry
- Dec 03: Microsoft Azure AI – Creating project in Azure AI Foundry
- Dec 04: Microsoft Azure AI – Deployment in Azure AI Foundry
- Dec 05: Microsoft Azure AI – Deployment parameters in Azure AI Foundry
In Azure AI Foundry, you can always gow to Azure AI Services, where you can create intelligent apps with different AI models. These services are simple and ready to use with relative low costs.
You will be greeted with four options:
- Speech – add to your apps the ability to hear, understand, and even talk to your customers with features like speech to text and text to speech, and speech translation features,
- Language + Translator – add to your apps the natural language capabilities and integrated them into apps, bots, and IoT devices. With the help of LLM you can redact sensitive data, segment long meetings into chapters, analyse health records, summarise emails, prioritise chats and orchestrate conversational bots on your custom intents with factual answers. All with the help of LLM-powered natural language processing capabilities
- Vision + Document – add to your apps the ability to read text, analyse images, process documents (invoices, receipts, identity documents, tax forms, credit cards, …), and detect hand-written text, extract tables and text forms using the capabilities of optical character recognition (OCR) and machine learning.
- Content Safety – embed to your app capabilities to detects harmful user-generated and AI-generated content in applications and services. It includes text and image APIs that allow you to detect harmful or inappropriate material.
For example, adding document translation, it is simple to test the translation service. There are multiple languages available and create an API keys to access the service. Even Python code is straightforward and available for you
import requests
import os
#Construct URL
endpoint = "<Your document translation endpoint>"
path = "/translator/document:translate"
url = endpoint + path
headers = {
"Ocp-Apim-Subscription-Key": "<Your resource key>"
}
# Define the parameters
# Get list of supported languages and code here: https://aka.ms/TranslatorLanguageCodes
params = {
"sourceLanguage": "<source language code>",
"targetLanguage": "<target language code>",
"api-version": "2023-11-01-preview"
}
# Include full path, file name and extension
input_file = "<full path to source file>"
output_file = "<full path to translated file>"
# Open the input file in binary mode
with open(input_file, "rb") as document:
# Define the data to be sent
# Find list of supported content types here: https://aka.ms/dtsync-content-type
data = {
"document": (os.path.basename(input_file), document, "<Your file content type>")
}
# Send the POST request
response = requests.post(url, headers=headers, files=data, params=params)
# Write the response content to a file
with open(output_file, "wb") as output_document:
output_document.write(response.content)
Tomorrow we will look more in details into Speech service in AI Services.
All of the code samples will be available on my Github.
Thanks for visiting r-craft.org
This article is originally published at https://tomaztsql.wordpress.com
Please visit source website for post related comments.