This document discusses connecting a mood classification AI to Python. It covers converting a Pandas dataframe to a dictionary, using the Requests module to send HTTP requests to an AI, and integrating a mood classification AI with Python code by copying the code from the AI interface. The document concludes with an exercise to convert dataset rows to dictionaries, trigger the AI service, calculate accuracy and a confusion matrix.
8. Requests module in python
• This module helps you to send HTTP requests in python
• What are HTTP requests?
9. Requests module in python
• This module helps you to send HTTP requests in python
• How to use HTTP requests to interact with an AI?
10. Requests module in python
• This module helps you to send HTTP requests in python
• How to use HTTP requests to interact with an AI?
url: The http url to send request to
data: String containing the payload (features in case of AI)
11. Requests module in python
• This module helps you to send HTTP requests in python
• How to use HTTP requests to interact with an AI?
Example:
data: {“Sentence”: “I am sad”}
12. Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
13. Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
• Click on the integration tab in the monitor tab
14. Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
• Click on the integration tab in the monitor tab
• Select python from the drop down for connectors
15. Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
• Click on the integration tab in the monitor tab
• Select python from the drop down for connectors
• Copy paste the code into your repl account
16. Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
• Click on the integration tab in the monitor tab
• Select python from the drop down for connectors
• Copy paste the code into your repl account
17. Lets connect your AI with python
• Copy paste the code into your repl account
• Note that the code is a function, you have to call this function to get
the prediction
json.dumps() converts
dictionary to striing
Convert the output you
receive into readable format
18. Lets connect your AI with python
• Login to your Navigator accounts and select the mood AI
• Click on the integration tab in the monitor tab
• Select python from the drop down for connectors
• Copy paste the code into your repl account
• Upload the mood dataset into repl
19. Exercise
• Convert the mood dataset rows into dictionaries
• Trigger the AI service
• Calculate accuracy across all samples of the dataset
• Calculate the confusion matrix
20. Think about your projects
• Build a python application powered by AI
• Examples
• Chatbot
• Games
• Tanks and bots
• Black jack