Google Machine Learning API’s

Though subject of AI and Machine learning is not new and many solutions exists and pre date solutions provided by Google (& IBM watson, AWS etc).

Google ( & other providers) have defintely made it very easy and convenient for consumption of AI and Machine learning solutions in business application.

Google provides massive dataset to train machine learning models and its platform is readily available for use.

SAP itself is providing AI and Machine Learning on its platform and integrating it in its native applications, however since SAP Netweaver version, SAP products are web application server enabled and with currently cloud based SAP solutions, , invoking REST Web services is native ability in the existing enterprise software solutions and these are readily poised to take AI & Machine Learning Models provided by Google .

One example of it could be uploading image and using “google cloud vision” image analysis use the results to query the database for similar or corresponding or related products and ordering details to be shown to consumer.

Quick demonstration of Google Machine Learnings Natural Language API’s is provided for say,

  • Translation of speech into another language text via speech-to-text then translation and having the results spoen back to you
  • Talking apps
  • Identification of sentiment within text, such as from Twitter feeds or company or product reviews

Shared below are some of the test results.

Easy Stuff - Text to Speech

Let’s see how can different voices be rendered for say Hello and Welcome. Can i offer you something to drink ? Would you like to have a cup of coffee ?

Female US English
Female British English
Male US English

More Easy Stuff - Language Translation

Let’s see how google translation works on It is not easy to give medicines to animals, no matter how difficult it could be , it is very gratifying to see ailing animal become healthy

German Translation

## [1] "Es ist nicht einfach, Tieren Medikamente zu geben, egal wie schwierig es auch sein mag, es ist sehr erfreulich, kranke Tiere gesund werden zu sehen"

Hindi Translation

Table 1: Translated Text
Hindi
जानवरों को दवाएं देना आसान नहीं है, इससे कोई फर्क नहीं पड़ता कि यह कितना मुश्किल हो सकता है, यह बीमार जानवर स्वस्थ होने के लिए बहुत प्रसन्न होता है

Dutch Translation

## [1] "Het is niet eenvoudig om medicijnen aan dieren te geven, hoe moeilijk het ook is, het is zeer verheugend om zieke dieren gezond te zien worden"

Did the dutch translated correctly ?, translate it back to english to compare with original

For text Het is niet eenvoudig om medicijnen aan dieren te geven, hoe moeilijk het ook is, het is zeer verheugend om zieke dieren gezond te zien worden language detected is: **en

## [1] "It is not easy to give medicines to animals, no matter how difficult it is, it is very pleasing to see sick animals become healthy"

More Building Blocks - Let’s see if the Female US English speech to text works

## [1] "hello and welcome can I offer you something to drink would you like to have a cup of coffee"

The translation is hello and welcome can I offer you something to drink would you like to have a cup of coffee and the confidence in translation is 98.76 %

Google NLP Natural Language Processing API

Understand the sentiment of Text documents, news articles, blog posts, customer reviews or chat conversations happening in chat bot.

  • Entity Analysis
    • Get Information about people, places or common nouns used in the text
  • Syntax Analysis
    • Get syntax of the text , parts of speech
  • Sentiment Analysis
    • Scores Sentiment of the text, between -1.0 (negative sentiment) and 1.0 (positive sentiment).
  • Category Analysis
    • Category of the text.

using random text form wikipedia to test

Olympics are popular all over world. Great Britain has competed in athelitics in world events. Solomon Wariso (born 11 November 1966 in Portsmouth) is a retired English sprinter who competed primarily in the 200 and 400 metres.[1] He represented his country at two outdoor and three indoor World Championships and is the British record holder in the indoor 4 x 400 metres relay.

Do you agree with Google API thinking that above text belongs to category alongs its confidence (1.00 means 100%) /Sports/International Sports Competitions/Olympics, 0.98

Google API thinks the language of the text is en

what is the sentiment of the text ?

## # A tibble: 1 x 2
##   magnitude score
##       <dbl> <dbl>
## 1       1.5   0.5

What entities are recognized in the text ?

## [[1]]
## # A tibble: 13 x 9
##    name   type   salience mid   wikipedia_url  magnitude score beginOffset
##    <chr>  <chr>     <dbl> <chr> <chr>              <dbl> <dbl>       <int>
##  1 athel~ OTHER   0.0342  <NA>  <NA>                 0     0            67
##  2 Briti~ <NA>   NA       <NA>  <NA>                NA    NA           321
##  3 count~ LOCAT~  0.00601 <NA>  <NA>                 0     0           250
##  4 Engli~ OTHER   0.0139  <NA>  <NA>                 0     0           161
##  5 Great~ LOCAT~  0.0528  /m/0~ https://en.wi~       0     0            37
##  6 Olymp~ EVENT   0.169   <NA>  <NA>                 0.9   0.9           0
##  7 Ports~ LOCAT~  0.0137  /m/0~ https://en.wi~       0     0           136
##  8 recor~ PERSON  0.0207  <NA>  <NA>                 0     0           329
##  9 Solom~ ORGAN~  0.0165  /g/1~ https://en.wi~       0     0            95
## 10 sprin~ PERSON  0.410   <NA>  <NA>                 0     0           169
## 11 world  OTHER   0.210   <NA>  <NA>                 0     0            30
## 12 World~ EVENT   0.00961 <NA>  <NA>                 0.1   0.1         290
## 13 world~ EVENT   0.0342  <NA>  <NA>                 0     0            81
## # ... with 1 more variable: mention_type <chr>