TextClassification

Implemented with Microsoft Machine Learning Services

PowerShell Instructions


If you have deployed a VM using the 'Deploy to Azure' button on the Quick Start page, all the steps below have already been performed and your database on that machine has all the resulting tables and stored procedures. You can explore this solution in more detail by examining the folders and running Python or stored procedures to re-create the model, or skip to trying out the model in the included [Jupyter notebook](jupyter.html).

If you are configuring your own server, continue with the steps below to run the PowerShell script.

Setup


First, make sure you have set up your SQL Server by following these instructions. Then proceed with the steps below to run the solution template using the automated PowerShell file.

Execute PowerShell Script


Running this PowerShell script will create the data tables and stored procedures for the the operationalization of this solution in R in the TextClassification database. It will also execute these procedures to create full database with results of the steps – dataset creation, modeling, and scoring as described here.

  1. Log onto the machine that contains the SQL Server you wish to use.

  2. Install Git if it is not already present. During the install, check the box to add LFS support.

  3. Download TextClassificationSetup.ps1 to your computer.

  4. Open a command or PowerShell window as Administrator.

  5. CD to the directory where you downloaded the above .ps1 file and execute the command:

    .\TextClassificationSetup.ps1

  6. Answer the prompts if any.

This will make the following modification to your SQL Server:

  • Creates the SLQRUserGroup for running R and Python code.
  • Reconfigures SQL Server to allow running of external scripts.
  • Installs the latest SQL Server 2017 Cumulative Update if no updates have been installed (this solution requires at least CU1 to run successfully).
  • Clones the solution code and data into the c:\Solutions\TextClassification directory.
  • Creates the solution databases TextClassification_R and TextClassification_Py
  • Runs the solution workflow to populate all database tables.
If you wish to run the solution code on a different computer than SQL Server machine, see Setup for Local Code Execution.

Review Data


Once the PowerShell script has completed successfully, log into the SQL Server Management Studio to view all the datasets that have been created in the TextClassification_R or TextClassification_Py databases.
Hit Refresh if necessary.

Click here to view the details all tables created in this solution.