Powershell Module for Microsoft Cognitive Services


INTRODUCTION :

Microsoft Cognitive Services (formerly Project Oxford) are a set of RESTFul web APIs, SDKs and services available to developers to make intelligent, engaging and discoverable applications.

Further expanding the evolving portfolio of machine learning APIs with a vision for more personal computing experiences and enhanced productivity aided by systems that increasingly can see, hear, speak, understand and even begin to reason

Enabling developers to easily add intelligent features such as

  1. Emotion and video detection;
  2. Facial, Speech and Vision recognition;
  3. Speech and Language understanding  
  4. Image Analysis
  5. Web Searches
  6. Sentiment Analysis
  7. Entity Linking and much, much more!

I was so fascinated with the features provided, that I decided to write a Powershell module for Cognitive services ( And trust me this is just the Beginning 🙂 ) so that people can utilize it further in their day to day work and life.

apikey

FUNCTIONALITIES : 

Following are the functionalities I’ve written till date in  my module for Powershell cognitive services known as ProjectOxford

  1. Get-EntityLink –

    Recognizes a named-entity from given text and aligning a textual mention of the entity to an appropriate entry in a knowledge base, like Wikipedia.

    Get-EntityLink

  2. Get-ImageAnalysis –

    Returns information on visual content found in web hosted images. Like Color schemes, Face rectangles, Tags, caption (Small description of Image), head counts, Age & gender of people in Image, celebrity identification and much much more.

    Get-ImageAnalysis

  3. Get-AgeAndGender –

    Returns  Age and Gender of Faces identified in a local Image, and capable to draw rectangle around the faces in the image denoting their Age and Gender

    Get-AgeGender

  4. Get-KeyPhrase –

    Recognize Key phrases in a given text or string and Documents. Saves lots of time and avoid reading long documents 🙂

    Get-KeyPhrase

  5. Get-Emotion –

    Capable to detect the Emotion on the Faces identified in an Image on local machine, , and capable to draw rectangle around the faces in the image denoting their Emotion

    Get-Emotion

  6. Get-Celebrity –

    Capable to identify the Names and total numbers of Celebrities in a web hosted Image. It can identify many celebs from fields like Movies, Sports, Politics.

    Get-Celebrity

  7. Get-ImageText –

    Capable of extracting text from the web hosted Images, you need to just pass the Image URL as a parameter to this function and it will do the work for you.

    Get-ImageText

  8. Get-News –

    Returns NEWS items and headlines depending upon the categories you provide as a parameter, like Sports, Entertainment, Politics etc.

    Get-news

  9. Get-Sentiment –

    Recognizes Sentiment in an input string, that is positiveness or Negativeness in the string context.

    get-Sentiment

  10. Invoke-SpellCheck –

    Identify and Rectify spelling mistakes in an input String and display errors. Also generates all possible permutations of the correct sentence with correct spellings.

    Invoke-SpellCheck

  11. Search-Bing –

     

    Provides capability to search Bing and facilitate bing results in the powershell
    console.

    Search-bing

  12. Split-IntoWords –

     

    Provides capability of Inserting spaces in words that lack spaces, like URLS, Hashtags etc.

    Split-IntoWords

  13. Test-AdultContent –

    Identifies any Adult or Racy content on a web hosted Image and flags them with a Boolean value [$true/$false]

    Test-AdultContent

PREREQUISITES :

You need to do one-time registration for each Microsoft Cognitive Services API from HERE, before start using the module, because it won’t work without an API Key.

I would suggest to Save the API Keys into your Powershell $Profile so that it automatically loads every time the console is fired.

Below is a screenshot on – how to keep the API keys in your $Profile to make your life a bit easy😛

apikey

MODULE INSTALLATION :  

You can directly Install-Module from the PowerShell Gallery if you’ve the PowershellGet module, like in the below screenshot.

apikey

Below is the step how to download and install the module on your machine using Powershell.

Install

POWERSHELL SCRIPTS AND HELP : 

If you are willing to review code please follow the below link to my GitHub Profile – https://github.com/PrateekKumarSingh/ProjectOxford

And to understand each function in the module better you can use Get-Help FunctionName to view the Synopsis, Description

apikey

And Examples –

apikey

Let me know your Feedback or in case you come across any bugs. Hoping you find it useful 🙂

Prateek Singh

 

 

Advertisements

One thought on “Powershell Module for Microsoft Cognitive Services

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s