From c8a480e892681f5d49fb46a7e05b2fcf690a451e Mon Sep 17 00:00:00 2001 From: ZhouFang928 Date: Mon, 18 Sep 2017 15:24:45 +0800 Subject: [PATCH 1/6] Update SentimentAnalysisModelingKerasWithCNTKBackend.md Add a guide on how to install CNTK before installing Keras in section 3 CNTK Backend --- Docs/SentimentAnalysisModelingKerasWithCNTKBackend.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Docs/SentimentAnalysisModelingKerasWithCNTKBackend.md b/Docs/SentimentAnalysisModelingKerasWithCNTKBackend.md index 41d69e8..912f970 100644 --- a/Docs/SentimentAnalysisModelingKerasWithCNTKBackend.md +++ b/Docs/SentimentAnalysisModelingKerasWithCNTKBackend.md @@ -1,3 +1,4 @@ + # Sentiment Analysis using Deep Learning: Modeling - Keras with CNTK Backend The script that executes the below steps is [SentimentExtraction.py](https://github.com/Azure/MachineLearningSamples-SentimentAnalysis/blob/master/Code/SentimentExtraction.py) @@ -19,6 +20,10 @@ The IMDB movie dataset consists of moving reviews with positive and negative sen ## 3. CNTK Backend +If you do not have cntk installed, you can install it using +``` +pip install https://cntk.ai/PythonWheel/CPU-Only/cntk-2.2-cp35-cp35m-win_amd64.whl +``` If you do not have Keras installed, you can install it using ``` pip install keras From 29ee2c9ae92a6cabef7ef020d8ae2e467c865913 Mon Sep 17 00:00:00 2001 From: ZhouFang928 Date: Mon, 18 Sep 2017 15:39:46 +0800 Subject: [PATCH 2/6] Update scenario-sentiment-analysis-deep-learning.md The original ModelingAndEvaluation.md is not actually linked to the file related to execute SentimentExtraction.py. The original ModelingAndEvaluationDocker is actually a guide on model details and modeling with CNTK as Backend. Be good to specify the difference between executing on local and docker compute context. Now, I modify the names of the markdown files and corresponding python files. See if this is better. --- scenario-sentiment-analysis-deep-learning.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scenario-sentiment-analysis-deep-learning.md b/scenario-sentiment-analysis-deep-learning.md index 496cca5..645c091 100644 --- a/scenario-sentiment-analysis-deep-learning.md +++ b/scenario-sentiment-analysis-deep-learning.md @@ -26,7 +26,6 @@ Follow this link to the public GitHub repository: [https://github.com/Azure/MachineLearningSamples-SentimentAnalysis](https://github.com/Azure/MachineLearningSamples-SentimentAnalysis) - ## Introduction Sentiment analysis is a well-known task in the realm of natural language processing. Given a set of texts, the aim is to determine the sentiment of that text. The objective of this solution is to use CNTK as the backend for Keras (a model level library, providing high-level building blocks for developing deep learning models) and implement sentiment analysis from movie reviews. @@ -68,8 +67,8 @@ The order of Hands-on Labs to carry out the solution is as follows: | Order| File Name | Related Files | |--|-----------|------| | 1 | [`DataPreparation.md`](https://github.com/Azure/MachineLearningSamples-SentimentAnalysis/blob/master/Docs/SentimentAnalysisDataPreparation.md) | 'Data/sampleReviews.txt' | -| 2 | [`ModelingAndEvaluation.md`](https://github.com/Azure/MachineLearningSamples-SentimentAnalysis/blob/master/Docs/SentimentAnalysisModelingDocker.md) | 'Code/SentimentExtraction.py' | -| 3 | [`ModelingAndEvaluationDocker.md`](https://github.com/Azure/MachineLearningSamples-SentimentAnalysis/blob/master/Docs/SentimentAnalysisModelingKerasWithCNTKBackend.md) | 'Code/SentimentExtractionDocker.py' | +| 2 | [`ModelingAndEvaluationDocker.md`](https://github.com/Azure/MachineLearningSamples-SentimentAnalysis/blob/master/Docs/SentimentAnalysisModelingDocker.md) | 'Code/SentimentExtractionDocker.py' | +| 3 | [`ModelingAndEvaluationCNTK.md`](https://github.com/Azure/MachineLearningSamples-SentimentAnalysis/blob/master/Docs/SentimentAnalysisModelingKerasWithCNTKBackend.md) | 'Code/SentimentExtraction.py' | | 4 | [`Operationalization.md`](https://github.com/Azure/MachineLearningSamples-SentimentAnalysis/blob/master/Docs/SentimentAnalysisOperationalization.md) | 'Code/Operaionalization' | ## Conclusion From 8fdf8f90353e74d88ce9d54a7862ab076cee2648 Mon Sep 17 00:00:00 2001 From: ZhouFang928 Date: Mon, 18 Sep 2017 15:52:25 +0800 Subject: [PATCH 3/6] Update SentimentAnalysisOperationalization.md Add a comment on how to upgrade pip before installing azure-cli and azure-cli-ml. Add sudo before the installation command. --- Docs/SentimentAnalysisOperationalization.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Docs/SentimentAnalysisOperationalization.md b/Docs/SentimentAnalysisOperationalization.md index 667c2a1..f1a5d1e 100644 --- a/Docs/SentimentAnalysisOperationalization.md +++ b/Docs/SentimentAnalysisOperationalization.md @@ -1,4 +1,4 @@ -# Sentiment Analysis using Deep Learning: Operationalization +U# Sentiment Analysis using Deep Learning: Operationalization ## 1. Objectives @@ -25,12 +25,17 @@ If you encounter “locale.Error: unsupported locale setting” error, perform t ``` export LC_ALL=C ``` +Update pip to the latest: + +``` +sudo pip install –upgrade pip +``` Install azure-cli and azure-cli-ml using pip: ``` -pip install azure-cli -pip install azure-cli-ml +sudo pip install azure-cli +sudo pip install azure-cli-ml ``` In addition, change python default version and run the following commands. Local mode deployments run in docker containers on your local computer, whether that is your personal machine or a VM running on Azure. You can use local mode for development and testing. From 9f8479308c13b9343b366683dd4aec89d2e6de37 Mon Sep 17 00:00:00 2001 From: ZhouFang928 Date: Mon, 18 Sep 2017 16:16:33 +0800 Subject: [PATCH 4/6] Update SentimentAnalysisOperationalization.md fix a typo --- Docs/SentimentAnalysisOperationalization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/SentimentAnalysisOperationalization.md b/Docs/SentimentAnalysisOperationalization.md index f1a5d1e..afdd2e2 100644 --- a/Docs/SentimentAnalysisOperationalization.md +++ b/Docs/SentimentAnalysisOperationalization.md @@ -1,4 +1,4 @@ -U# Sentiment Analysis using Deep Learning: Operationalization +# Sentiment Analysis using Deep Learning: Operationalization ## 1. Objectives From a416e1075cc43d5e049064e85cd8e47fdabd4a91 Mon Sep 17 00:00:00 2001 From: ZhouFang928 Date: Mon, 18 Sep 2017 17:44:13 +0800 Subject: [PATCH 5/6] Update SentimentAnalysisOperationalization.md add step-by-step instructions. --- Docs/SentimentAnalysisOperationalization.md | 23 ++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Docs/SentimentAnalysisOperationalization.md b/Docs/SentimentAnalysisOperationalization.md index afdd2e2..e8556e4 100644 --- a/Docs/SentimentAnalysisOperationalization.md +++ b/Docs/SentimentAnalysisOperationalization.md @@ -25,10 +25,14 @@ If you encounter “locale.Error: unsupported locale setting” error, perform t ``` export LC_ALL=C ``` +Update azure to the latest: +``` +sudo pip install --upgrade azure +``` Update pip to the latest: ``` -sudo pip install –upgrade pip +sudo pip install –-upgrade pip ``` Install azure-cli and azure-cli-ml using pip: @@ -40,11 +44,28 @@ sudo pip install azure-cli-ml In addition, change python default version and run the following commands. Local mode deployments run in docker containers on your local computer, whether that is your personal machine or a VM running on Azure. You can use local mode for development and testing. +Create a bash_aliases file +``` +gedit ~/.bash_aliases +``` +Open your ~/.bash_aliases file and add the following and save it to home directory ``` alias python=python3 +``` +Source the ~/.bash_aliases file +``` source ~/.bash_aliases +``` +Setup azure ml environment +``` az ml env setup +``` +Source the file to set up your environment variables +``` source ~/.amlenvrc +``` +To always set these variables when you log in, copy the export commands into your .bashrc file +``` cat < ~/.amlenvrc >> ~/.bashrc ``` Upload the below files to the vm (you could use scp to perform the upload): From 45460ff56e7a1110b82e4fe14f9565434ed6d8de Mon Sep 17 00:00:00 2001 From: ZhouFang928 Date: Tue, 19 Sep 2017 12:15:37 +0800 Subject: [PATCH 6/6] Update SentimentAnalysisOperationalization.md specify Linux log in status --- Docs/SentimentAnalysisOperationalization.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Docs/SentimentAnalysisOperationalization.md b/Docs/SentimentAnalysisOperationalization.md index e8556e4..0a856a3 100644 --- a/Docs/SentimentAnalysisOperationalization.md +++ b/Docs/SentimentAnalysisOperationalization.md @@ -1,3 +1,4 @@ + # Sentiment Analysis using Deep Learning: Operationalization ## 1. Objectives @@ -25,21 +26,22 @@ If you encounter “locale.Error: unsupported locale setting” error, perform t ``` export LC_ALL=C ``` -Update azure to the latest: +Change to root ``` -sudo pip install --upgrade azure +sudo -i ``` Update pip to the latest: - ``` -sudo pip install –-upgrade pip +pip install –-upgrade pip +``` +Update azure to the latest: +``` +pip install --upgrade azure ``` - Install azure-cli and azure-cli-ml using pip: - ``` -sudo pip install azure-cli -sudo pip install azure-cli-ml +pip install azure-cli +pip install azure-cli-ml ``` In addition, change python default version and run the following commands. Local mode deployments run in docker containers on your local computer, whether that is your personal machine or a VM running on Azure. You can use local mode for development and testing. @@ -58,7 +60,8 @@ source ~/.bash_aliases ``` Setup azure ml environment ``` -az ml env setup +az ml env setup -n – g -l +az ml env set -g -n ``` Source the file to set up your environment variables ```