|

|  How to Integrate Microsoft Azure Cognitive Services with Google Slides

How to Integrate Microsoft Azure Cognitive Services with Google Slides

January 24, 2025

Learn how to seamlessly integrate Microsoft Azure Cognitive Services into Google Slides and enhance your presentations with advanced AI capabilities.

How to Connect Microsoft Azure Cognitive Services to Google Slides: a Simple Guide

 

Set Up Microsoft Azure Cognitive Services

 

  • Create an account on Microsoft Azure if you don't have one. Navigate to the Azure Portal and search for Cognitive Services.
  •  

  • Create a new Cognitive Services instance. Choose the specific APIs you are interested in, like Text Analytics or Speech to Text.
  •  

  • Once created, navigate to the Keys and Endpoint section to copy the API Key and endpoint URL. You'll need these later.

 

Set Up Google Workspace API

 

  • Go to the Google Cloud Console, create a new project, and enable the Google Slides API for your project.
  •  

  • Navigate to the API & Services section and create new credentials. Choose 'OAuth 2.0 Client IDs' and configure the consent screen with necessary information.
  •  

  • Download the JSON file of your credentials and keep it safe as you will use it to authenticate your requests.

 

Install Required Libraries

 

  • Install the Python libraries needed to work with both Microsoft Azure and Google Slides APIs. Required packages might include `azure-cognitiveservices`, `gspread`, and `oauth2client`.

 

pip install azure-cognitiveservices-vision gspread oauth2client

 

Authenticate Google Slides API

 

  • Use the following Python code to authenticate and connect to the Google Slides API using your downloaded Google credentials JSON file.

 

import gspread
from oauth2client.service_account import ServiceAccountCredentials

scope = ["https://www.googleapis.com/auth/drive"]
creds = ServiceAccountCredentials.from_json_keyfile_name('path/to/credentials.json', scope)
client = gspread.authorize(creds)

 

Integrate with Microsoft Azure Cognitive Services

 

  • Use Azure Cognitive Services to process data directly from the content you want over Google Slides. Here is a sample code to connect and analyze text using Python.

 

from azure.cognitiveservices.language.textanalytics import TextAnalyticsClient
from msrest.authentication import CognitiveServicesCredentials

def authenticate_client():
    key = "YOUR_AZURE_KEY"
    endpoint = "YOUR_AZURE_ENDPOINT"
    credentials = CognitiveServicesCredentials(key)
    text_analytics_client = TextAnalyticsClient(endpoint=endpoint, credentials=credentials)
    return text_analytics_client

client = authenticate_client()

 

Process and Insert Data into Google Slides

 

  • With your connection set, you can now pull data from Azure Cognitive Services and integrate it into Google Slides using Google Slides API.
  •  

  • Here's an example of appending Cognitive Services analysis into a Google Slides' page:

 

response = client.sentiment(documents=[
    {"id": "1", "language": "en", "text": "Add your text here."}
])

sentiment_score = response.documents[0].score

# Fetch existing presentation
presentation = client.get_presentation('YOUR_PRESENTATION_ID')

# Manipulate and insert sentiment analysis result
slide = presentation.slides[0]
# Here you would use Google Slides API to update text box content

 

Testing and Final Adjustments

 

  • Run test cases to ensure that data is correctly processed and displayed on your Google Slides presentation.
  •  

  • Adjust code for edge cases, like API response errors, and handle accordingly.

 

Omi Necklace

The #1 Open Source AI necklace: Experiment with how you capture and manage conversations.

Build and test with your own Omi.

How to Use Microsoft Azure Cognitive Services with Google Slides: Usecases

 

Creating Intelligent Presentations with Azure and Google Slides

 

  • Leverage Azure Cognitive Services for Data Extraction: Use Azure's Cognitive Services to analyze text, speech, and images. This can include using Optical Character Recognition (OCR) to extract text from images or utilizing speech-to-text capabilities to transcribe spoken content. Azure provides advanced neural language models that can detect and summarize key points from large datasets.
  •  

  • Integrate Insights into Google Slides: After processing data with Azure, enrich your presentations with the extracted insights. Use Google Slides' API to automate the creation and population of slides. This can involve inserting text, images, and charts that reflect the findings from Azure's analysis, ensuring the presentation is both informative and visually appealing.
  •  

  • Enhance with Real-Time Updates: Set up a workflow where Azure's analysis is updated in real-time and automatically reflected in Google Slides. Using Microsoft Power Automate or custom scripts, trigger updates to a shared Google Slides deck whenever there's new input data processed by Azure. This ensures that collaborative presentations are always up-to-date with the latest information.
  •  

  • Utilize Text Analytics for Audience Engagement: Deploy Azure's Text Analytics to gauge audience feedback and sentiment from Q&A sessions or surveys. Integrate this data into your Google Slides to visualize audience reactions or to tailor subsequent presentation content, making the engagement more interactive and insightful.
  •  

 


# Example of using Azure Text Analytics and Google Slides API
def analyze_and_update_presentation(text_data, slide_deck_id):
    from azure.ai.textanalytics import TextAnalyticsClient
    from googleapiclient.discovery import build
    from azure.identity import DefaultAzureCredential
    from google.oauth2 import service_account

    # Azure Text Analytics setup
    credential = DefaultAzureCredential()
    text_analytics_client = TextAnalyticsClient(endpoint="https://<your-resource-name>.cognitiveservices.azure.com/", credential=credential)

    # Analyze text data
    response = text_analytics_client.analyze_sentiment([text_data])[0]
    sentiment_score = response.sentiment

    # Google Slides setup
    credentials = service_account.Credentials.from_service_account_file('path/to/credentials.json')
    slides_service = build('slides', 'v1', credentials=credentials)

    # Update Google Slide with sentiment score
    requests = [{
        'insertText': {
            'objectId': 'textbox-1',
            'insertionIndex': 1,
            'text': f'Sentiment Score: {sentiment_score}'
        }
    }]

    # Execute the request to update the slide
    slides_service.presentations().batchUpdate(presentationId=slide_deck_id, body={'requests': requests}).execute()

 

 

Automating Meeting Notes and Presentation Summaries with Azure and Google Slides

 

  • Capture Meeting Content with Azure Speech Services: Utilize Azure's Speech-to-Text API to transcribe meeting recordings. This powerful service allows you to convert spoken language into text, making it easier to capture verbatim details and key takeaways from meetings, which can later be used in presentations.
  •  

  • Generate Summaries with Azure Text Analytics: Employ Azure Text Analytics to summarize lengthy transcripts. The Text Summarization capability can be used to extract the most critical points from the transcription, creating concise and relevant summaries that can enhance the clarity and impact of your presentation.
  •  

  • Create Interactive Presentations with Google Slides API: After generating insightful summaries, leverage the Google Slides API to automate the creation of slides. This involves programmatically inserting summarized text, images, charts, and even voice notes into Google Slides, ensuring a dynamic and interactive presentation experience.
  •  

  • Real-Time Collaboration and Updates: Set up integration workflows to allow real-time updates to shared Google Slides. This can be achieved using Microsoft Power Automate or through scripting solutions that synchronize content changes in Azure with Google Slides, facilitating seamless collaboration among team members.
  •  

 


# Example of using Azure Speech-to-Text and Google Slides API
def transcribe_and_create_slides(audio_file_path, slide_deck_id):
    from azure.cognitiveservices.speech import SpeechConfig, SpeechRecognizer
    from googleapiclient.discovery import build
    from azure.identity import DefaultAzureCredential
    from google.oauth2 import service_account

    # Azure Speech Services setup
    speech_config = SpeechConfig(subscription="YourSubscriptionKey", region="YourRegion")
    audio_config = AudioConfig(filename=audio_file_path)
    speech_recognizer = SpeechRecognizer(speech_config=speech_config, audio_config=audio_config)

    # Perform speech-to-text
    result = speech_recognizer.recognize_once()
    transcription = result.text

    # Google Slides setup
    credentials = service_account.Credentials.from_service_account_file('path/to/credentials.json')
    slides_service = build('slides', 'v1', credentials=credentials)

    # Create slide with transcription
    requests = [{
        'createSlide': {
            'slideLayoutReference': {
                'predefinedLayout': 'TITLE_AND_BODY'
            },
            'placeholderIdMappings': [{
                'layoutPlaceholder': {
                    'type': 'TITLE',
                },
                'objectId': 'title-1'
            }, {
                'layoutPlaceholder': {
                    'type': 'BODY',
                },
                'objectId': 'body-1'
            }]
        }
    }, {
        'insertText': {
            'objectId': 'body-1',
            'insertionIndex': 0,
            'text': transcription
        }
    }]

    # Execute requests to update the presentation
    slides_service.presentations().batchUpdate(presentationId=slide_deck_id, body={'requests': requests}).execute()

 

Omi App

Fully Open-Source AI wearable app: build and use reminders, meeting summaries, task suggestions and more. All in one simple app.

Github →

OMI NECKLACE + OMI APP
First & only open-source AI wearable platform

a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded