You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Authors: Fidan Boylu Uz, Yan Zhang, Mario Bourgoin
Acknowledgements: Mathew Salvaris
Deploying Python models for real-time scoring using Azure Machine Learning
In this repository there are a number of tutorials in Jupyter notebooks that have step-by-step instructions on (1) how to train a machine learning model using Python; (2) how to deploy a trained machine learning model throught Azure Machine Learning (AzureML). The tutorials cover how to deploy models on following deployment target:
Overview
This scenario shows how to deploy a Frequently Asked Questions (FAQ) matching model as a web service to provide predictions for user questions. For this scenario, “Input Data” in the architecture diagram refers to text strings containing the user questions to match with a list of FAQs. The scenario is designed for the Scikit-Learn machine learning library for Python but can be generalized to any scenario that uses Python models to make real-time predictions.
Design
The scenario uses a subset of Stack Overflow question data which includes original questions tagged as JavaScript, their duplicate questions, and their answers. It trains a Scikit-Learn pipeline to predict the match probability of a duplicate question with each of the original questions. These predictions are made in real time using a REST API endpoint.
The application flow for this architecture is as follows:
The client sends a HTTP POST request with the encoded question data.
The webservice extracts the question from the request
The question is then sent to the Scikit-learn pipeline model for featurization and scoring.
The matching FAQ questions with their scores are then piped into a JSON object and returned to the client.
An example app that consumes the results is included with the scenario.
Copy sample_workspace_conf.yml to a new file, workspace_conf.yml, and fill in each field. This will keep secrets out of the source code, and this file will be ignored by git.
Create the Python az-ml-realtime-score virtual environment using the environment.yml:
conda env create -f environment.yml
Activate the virtual environment:
source activate az-ml-realtime-score
The remaining steps should be done in this virtual environment.
Login to Azure:
az login
You can verify that you are logged in to your subscription by executing
the command:
az account show -o table
Start the Jupyter notebook server:
jupyter notebook
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repositories using our CLA.