Giter Site home page Giter Site logo

mcw-analyzing-text-with-azure-machine-learning-and-cognitive-services's Introduction

Analyzing text with Azure Machine Learning and Cognitive Services

This workshop is archived and no longer being maintained. Content is read-only.

In this workshop, you help Contoso Ltd. build a proof of concept that shows how they can develop a solution that amplifies their agents' claims processing capabilities.

They would like to automatically classify each claim detail a customer types in as either home or auto, based on the text. This classification should be displayed in the claim summary, so an agent can quickly assess whether they are dealing with purely a home claim, an auto claim, or a claim with a mixture of the two.

They would also like to experiment with applying text analysis to the claim text. Contoso Ltd. knows most customers are either factual in their description (a neutral sentiment) or slightly unhappy (a more negative sentiment). They believe that negative sentiment can indicate that the claim text involves a more severe situation, which might warrant an agent's expedited review. Furthermore, they would like to understand any positive or negative opinions the customers have expressed in their responses, and quickly identify key concepts in the claims text. They would also like to detect the language of the claims and identify any personal information included by customers in their responses.

Next, they would like to summarize long claim text automatically. This summarization would enable the agent to get the gist before reading the full claim and quickly remind themselves of the context when revisiting it.

As a final step, they would like to organize the information generated from text classification, text analysis, and text summarization that can be then fed into their Agent portal.

November 2021

Target audience

Abstracts

Workshop

In this workshop, you learn to combine both pre-built artificial intelligence (AI) in the form of various Cognitive Services with custom AI in the form of services built and deployed with Azure Machine Learning service. You will learn to create intelligent solutions atop unstructured text data by designing and implementing a text analytics pipeline. You will learn how to build a binary classifier using a recurrent neural network that can be used to classify the textual data. You will also learn to build Automated Machine Learning models in Azure Machine Learning studio for the purposes of text classification. Finally, you learn how to deploy multiple kinds of predictive services using Azure Machine Learning and learn to integrate with the Text Analytics API from Cognitive Services.

At the end of this workshop, you will be better able to present solutions leveraging Azure Machine Learning service, and Cognitive Services.

Whiteboard design session

In this whiteboard design session, you work with a group to design a solution that combines both pre-built artificial intelligence (AI) in the form of Text Analytics API from Cognitive Services with custom AI in the form of services built and deployed with Azure Machine Learning services. You will learn to create intelligent solutions atop unstructured text data by designing and implementing a text analytics pipeline. You will discover how to build a binary classifier that can be used to classify the textual data. You will also learn how to deploy multiple kinds of predictive services using Azure Machine Learning and learn to integrate with the Text Analytics API from Cognitive Services.

At the end of this whiteboard design session, you will be better able to design solutions leveraging Azure Machine Learning services and Cognitive Services.

Hands-on lab

In this hands-on lab, you implement a solution that combines both pre-built artificial intelligence (AI) in the form of various Cognitive Services with custom AI in the form of services built and deployed with Azure Machine Learning service. In the lab, you work with unstructured text and learning how to develop analytics pipelines for various problems such as text summarization, text classification, sentiment analysis, opinion mining, key phrase extraction, and language and PII detection. You learn how to build and train a deep neural net for text classification. You will also learn to build Automated Machine Learning models in Azure Machine Learning studio for the purposes of text classification. Finally, you learn how to deploy multiple kinds of predictive services using Azure Machine Learning and learn to integrate with the Text Analytics API from Cognitive Services.

At the end of this hands-on lab, you will be better able to present solutions leveraging Azure Machine Learning services and Cognitive Services.

Azure services and related products

  • Azure Machine Learning service
  • Automated Machine Learning
  • Cognitive Services
  • Text Analytics API
  • TensorFlow
  • Keras
  • ONNX

Azure solutions

Machine Learning

Related references

Help & Support

We welcome feedback and comments from Microsoft SMEs & learning partners who deliver MCWs.

Having trouble?

  • First, verify you have followed all written lab instructions (including the Before the Hands-on lab document).
  • Next, submit an issue with a detailed description of the problem.
  • Do not submit pull requests. Our content authors will make all changes and submit pull requests for approval.

If you are planning to present a workshop, review and test the materials early! We recommend at least two weeks prior.

Please allow 5 - 10 business days for review and resolution of issues

mcw-analyzing-text-with-azure-machine-learning-and-cognitive-services's People

Contributors

amalgireesh avatar dawnmariedesjardins avatar dem108 avatar dzaremba90 avatar emilysaeli avatar hopero929 avatar joelhulen avatar kylebunting avatar microsoftopensource avatar msftgits avatar mwasham avatar romilbheda avatar shirolkar avatar timahenning avatar waltermyersiii avatar zoinertejada avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mcw-analyzing-text-with-azure-machine-learning-and-cognitive-services's Issues

Exercise-4 Task-2

  1. In Exercise-4 Task-2, while running the cells of notebook 05 Cognitive Services.ipynb instructions to be updated to replace the scoring URL in classifier_service_scoring_endpoint and summarizer_service_scoring_endpoint.

image

  1. Also few screenshots need to be updated in Exercise-3 Task-2 for creating Automated ML and Exercise-4 Task-1 for Text Analytics as UI got updated.

Apostrophes in code blocks - Trainer WDS

Hello,

Please correct the apostrophes displayed in the code blocks in the WDS trainer guide in the Preferred Solution section (June 2018 test fix branch).
image

Thank you,

Diana

issue while runnigng 03 Claim Classification

Hi,

I am having while running the 3 Claim Classification notebook where the Upload features and labels to the default blob store cell is getting stuck without any issue. please check on it on priority as we have a few scheduled labs next week.

image

Issue with Summarize

I have a similar issue to the one that already been opened.

I followed all the tasks in the lab (even tore down a workspace, created a new cluster, executed the init script, modified the Advanced Options for the new cluster, but I still keep getting "Cancelled" every time I try to execute Task 01 from 01 Summarize notebook.

Can't progress forward. 02 Deploy Summarizer Web Service is also giving errors. The same error of "can't find config.json" file that the other issue is pointing to... (#18)

issue w Dbrix

Before HOL-Task 2: Provision a Text Analytics API and Exercise-2 Task-1: Run notebook - 03 Claim Classification

  1. In Before HOL-Task 2: Provision a Text Analytics API, for resource Text Analytics UI has got updated with new name and logo i.e, Edge Module – Language Detection (Text Analytics).
    Please find the below screenshot:

image

  1. In Exercise-2 Task-1: Run notebook - 03 Claim Classification, while running the notebook cells to Load the trained model it's throwing an error mentioned below:
    OSError: SavedModel file does not exist at: ./outputs/final_model.hdf5/{saved_model.pbtxt|saved_model.pb}
    Please find the below screenshot for your reference:

image

Note: I have checked the TensorFlow library version. The TensorFlow version is 2.2.0 as given in the Labguide.

image

Error: Notebook 02 Deploy Summarizer Web Service

We’ve encounter a new issue in this same lab, while running the Notebook 02 “Deploy as Web Service”, cmd 15 is failing with error ‘no such file or directory’.

The gist of the issue is since the lab was last updated, Azure Machine Learning has changed the default path it uses to write out the AML Workspace config file (as used in Cmd 13) . It has changed from aml_config to ./.azureml

Verify links in HOLs

Folder and document names have been updated. Please check your HOL documents for links that use folder names in their path and make sure they are still valid and working.

Issue in Exercise 2

In Exercise - 2> Task 1> step 1, We tried executing the 03 Claim Classification.ipynb notebook with Python 3.8 - AzureML. But in Load the trained model (cell 26) step We are facing an error ERROR: OSError: SavedModel file does not exist at: ./outputs/final_model.hdf5/{saved_model.pbtxt|saved_model.pb}. Please look into this.

image

Before the HOL - Documentation Discrepancy with VM creation

Task 1, Step 2 instructs to Select Compute and then select Windows Server 2016 Datacenter and then
Step 6 states to Choose a size blade, select D4s_v3. This is not out of sync with instruction further down in the document on step 8 when it refers to NC6 (On the Create blade, review the summary and then select Create). SYnc up the documentation please. Few attendees cannot create DSVM due to limitations with their subscriptions.

Suggested Updates: Feedback Welcome

We are planning an update to be delivered before the calendar year end. We are considering the following changes in this update. Feedback welcome and appreciated.

MCW Cog Services & Deep Learning proposed Changes

Option A - Experience via Azure Databricks. Training within Databricks clusters only.
Option B - Experience via Azure Notebooks. Training locally and within Azure Batch AI.

Proposed changes:

  • Remove use of DSVM and the deprecated Azure ML Workbench.
  • Replace with a notebook experience (option A or B above) that uses the new AML Python SDK for experiments and model deployment.
  • Add content to both whiteboard design session and lab showing provisioning of AML resources using the AML Python SDK from a notebook.
  • Add content to both whiteboard design session and lab showing how to leverage AML during experimentation, for model performance logging and for model management.
  • Modify lab to deploy model to Azure Container Instance instead of AKS cluster (to save on provisioning time and lab costs).
  • Add content to the lab on how to use Azure Search and the related knowledge management capabilities.
  • Layer in AML's Auto ML for classification and automated model selection

Convert to ONNX ends in error

Following previous steps gives the following versions:
Keras version: 2.3.1
Tensorflow version: 2.0.0-beta1

Then the step Convert to ONNX in notebook 04 Deploy Classifier Web Service gives the following error:
Annotation 2019-11-15 164624

AttributeError: module 'tensorflow._api.v2.compat.v1' has no attribute 'disable_tensor_equality'

Need to update commands

Exercise 3:-Task:-1
When we run command 3 and 7 in notebook it shows an error. I ran the below mentioned command to define ta and then it works fine.
Commands are follow:-
import nltk
nltk.download('stopwords')

@DawnmarieDesJardins Please look into this ASAP, we have workshops running.

02 Summary Notebook Image Creation Issue

Issue on Cell 34:

new error for dbrix

It seems like there is a problem carving out an IP address. Also, why are these ACI images being deployed as an ACI group? Is that the default config?

Here's the Service Deploy failure from the Azure ML workspace window. I licked into the activity and couldn't find any additional logs. It looks lie the little ACI image created successfully though.

azureml error

I verified that I can create a Public IP inside my azure sub with the creds I used for the interactive login as well.

Exercise-2 Task 1: Run notebook - 03 Claim Classification, Tensorflow version mismatch.

In Exercise-2 Task 1: Run notebook - 03 Claim Classification, while running the first cell of 03 Claim Classification there is an note which is mentioned under step-2.

Note: Pay attention to the top of the notebook and check the TensorFlow library version. The TensorFlow version should be 2.2.0.

But I found mismatch with the Tensorflow version: 2.1.0 while performing the lab. Please find the below screenshot for your reference:

image

Updated HTML files

June test/fix has been QCd and merged. Please update HTML files to complete this one! 👍

Testing deployed service failed

Hi, I have an issue when I try to test the deployed service at cmd 38, notebook 02. I've made this notebook 2 weeks ago and it works perfectly then. So, here I let you the error:

**********************************************************************
  Resource punkt not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('punkt')
  
  For more information see: https://www.nltk.org/data.html

  Attempted to load tokenizers/punkt/PY3/english.pickle

  Searched in:
    - '/root/nltk_data'
    - '/opt/miniconda/nltk_data'
    - '/opt/miniconda/share/nltk_data'
    - '/opt/miniconda/lib/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
    - ''
*********************************************************************

After this error I installed the resource that I supposed to need, but I didn't get any change, here's the output:

[nltk_data] Downloading package punkt to /root/nltk_data...
[nltk_data]   Package punkt is already up-to-date!

**********************************************************************
  Resource punkt not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('punkt')
  
  For more information see: https://www.nltk.org/data.html

  Attempted to load tokenizers/punkt/PY3/english.pickle

  Searched in:
    - '/root/nltk_data'
    - '/opt/miniconda/nltk_data'
    - '/opt/miniconda/share/nltk_data'
    - '/opt/miniconda/lib/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
    - ''
**********************************************************************

So what should I do?

Thanks

P.S.: This also happens when I test the classifier service, but instead of requesting the download of the 'punkt' package, it asks for the 'stopwords' package. The same thing happens when you download it, as before.

December 2019 - content update

This workshop is scheduled for a content update. Please review the current workshop and provide update suggestions for review. Thanks!

Exercise 2: Task 3 - Getting issue while running notebook 02-Deploy Summarize Web service

Getting issue while running notebook 02-Deploy Summarize Web service.
Error:
{
"code": "AciDeploymentFailed",
"statusCode": 400,
"message": "Aci Deployment failed with exception: Error in entry script, ModuleNotFoundError: No module named 'gensim.summarization', please run print(service.get_logs()) to get details.",
"details": [
{
"code": "CrashLoopBackOff",
"message": "Error in entry script, ModuleNotFoundError: No module named 'gensim.summarization', please run print(service.get_logs()) to get details."
}
]
}
Refer the below screenshot:
image

Keras no longer supported

Notebook 3 yields an error as keras is no longer standalone supported. The fix is to update tensorflow to version 2.1 and change the first cell in Notebook 3 to the following (i.e. importing keras from tensorflow as submodules)

import string
import re
import os
import numpy as np
import pandas as pd
import urllib.request

import tensorflow as tf
print('Tensorflow version: ', tf.version)
from tensorflow import keras
from tensorflow.keras import models, layers, optimizers, regularizers
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Activation, Embedding, LSTM
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.preprocessing.sequence import pad_sequences

print('Keras version: ', keras.version)
print('Tensorflow version: ', tf.version)

import azureml.core
from azureml.core import Experiment, Workspace, Run, Datastore
from azureml.core.dataset import Dataset
from azureml.core.compute import ComputeTarget
from azureml.core.model import Model
from azureml.train.dnn import TensorFlow
from azureml.train.estimator import Estimator
from azureml.widgets import RunDetails

print("Azure ML SDK version:", azureml.core.VERSION)

Kind regards, Ernst

WDS Trainer Guide - Missing section

Design a proof of concept section has a subtitle Identifying duplicates in free-text claim data. (right after High-level architecture).
Preferred solution is missing that section

Hand-on Lab - Step by step

Line 501 - end
It looks like there should be a command in a grey box after #15, but the rest of the lab instructions are in that box. I don't know what code to remove to make that right.

Issue while creating Machine Learning Experimentation

In azure portal, Machine Learning Experimentation(preview) updated with Machine Learning Experimentation (Retiring) can you please update that in Hand-on-lab in Exercise 1: Setup Azure Machine Learning accounts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.