The document discusses using Google Cloud Machine Learning APIs to curate online content. It provides examples of analyzing images of people from Google+ contacts to identify labels like "hair", "face", and "person". It then sorts the labels and associated photos into potential guests for a party ("invited") and those that should be excluded. This is done by training a simple model and using it to make predictions about new images.
8. Confidential & ProprietaryGoogle Cloud Platform 8
So…. Why APIs?
{ Google Cloud Platform }
1. We want to offer businesses the tools to differentiate by offering a powerful set of APIs
that enable apps to see, hear and understand the world
2. Reduce your Time to Market (TMM) when launching your next-generation app
3. Provide you easy access to machine learning technology to give any developer the
freedom to work in the language and tools they want
4. Provide virtually limitless scalability to your application without needing to manage
back-end servers running deep learning
9. Pre-Trained Machine Learning Models
Fully trained ML models from Google Cloud that allow a general developer to
take advantage of rich machine learning capabilities with simple REST based
services.
11. Confidential & ProprietaryGoogle Cloud Platform 11
Features
Extract sentence, identify parts of
speech and create dependency parse
trees for each sentence
Identify entities and label by types such
as person, organization, location, events,
products and media
Understand the overall sentiment of a
block of text
Access via REST API. Text can be
uploaded in the request or integrated
with Google Cloud Storage
Syntax Analysis Entity Recognition
Sentiment Analysis Integrated REST API
13. Confidential & ProprietaryGoogle Cloud Platform 13
Faces: Faces, facial landmarks,
emotions
OCR: Read and extract text, with
support for > 10 languages
Photo credit Getty Images
Label: Detect entities from furniture to
transportation
Logos: Identify product logos
Landmarks & Image Properties
Detect landmarks & dominant
color of image
Safe Search: Detect explicit content -
adult, violent, medical and spoof
Cloud Vision API
Call API from anywhere, with support for embeddable images, and Google Cloud Storage
23. Main shellplus_contacts = get_plus_contacts()
print "Processing %d contacts" % len(plus_contacts)
for plus_id in plus_contacts:
plus_profile = get_plus_profile(plus_id)
image_uri = plus_profile['image']['url'].replace("?sz=50","?sz=250")
image_data = analyze_img(image_uri)
if image_data is not None:
print(image_uri)
if 'labelAnnotations' in image_data['responses'][0]:
for label in image_data['responses'][0]['labelAnnotations']:
print label['description']; label['score']; image_uri
24. get_plus_contacts: oAuth
storage = Storage('/home/almo/dev/keys/ex1/oAuth_credentials.dat')
credentials = storage.get()
if credentials is None or credentials.invalid:
PEOPLE_API='https://www.googleapis.com/auth/contacts.readonly'
flow = flow_from_clientsecrets('/home/almo/dev/keys/ex1/oAuth_key.json',
scope=[PEOPLE_API])
credentials = run_flow(flow, storage)
http = credentials.authorize(httplib2.Http())
service = build('people','v1',http=http)
request = service.people().connections().list(resourceName='people/me',
pageSize=500)