This repository provides examples and code samples demonstrating how to leverage Azure Language Solutions to solve natural language processing (NLP) tasks using various Azure services.
Azure Language Solutions offer a wide range of powerful NLP capabilities that enable developers to build intelligent applications for language understanding and processing. This repository aims to guide you through the usage of different Azure services for language-related tasks. You can use it as a quick guide to start running a service fast.
Before you get started with the examples, ensure you have the following prerequisites:
-
An Azure account: If you don't have one, you can sign up for a free trial at azure.com/free.
-
Azure Text Analytics service and Azure Translator service: To explore translation capabilities, set up the services in your Azure portal. Obtain the endpoint and key credentials. You can also use the Azure Cognitive Services multi-service instance. Cognitive Services is a product bundle that enables customers to access multiple services with a single API key. [https://azure.microsoft.com/en-us/products/ai-services]
-
Required libraries: Install the necessary libraries using pip by running the following command in your terminal:
pip install azure-ai-textanalytics azure-ai-translation python-dotenv
The repository is organized into different directories, each representing a specific use case or language service. Here's an overview of what you'll find in each directory:
-
TextAnalytics: This directory contains Python code samples for using Azure Text Analytics to perform tasks such as sentiment analysis, key phrase extraction, and entity recognition.
-
Translation: In this directory, you'll find examples showcasing Azure Translator for text translation in various languages.
-
(Other directories): In the future, we plan to expand the repository to include additional language services, such as Speech-to-Text, Language Understanding, and more.
-
Clone the repository, and set up environment variables:
For each example directory (e.g., TextAnalytics or Translation), create a
.env
file and add the necessary credentials:# Text Analytics COG_SERVICE_ENDPOINT=your_cog_service_endpoint COG_SERVICE_KEY=your_cog_service_key # Translator TRANSLATOR_ENDPOINT=your_translator_endpoint TRANSLATOR_KEY=your_translator_key
Replace
your_cog_service_endpoint
,your_cog_service_key
,your_translator_endpoint
, andyour_translator_key
with the actual values from your Azure services. -
Have fun :-)