﻿1
00:00:00,110 --> 00:00:06,800
‫ChatGPT is an advanced natural language processing model that uses deep learning techniques to understand

2
00:00:06,800 --> 00:00:08,870
‫and generate human like texts.

3
00:00:09,800 --> 00:00:16,910
‫In simple words, if we ask anything to tell GPT, then it will provide us with an answer of our question,

4
00:00:16,910 --> 00:00:21,710
‫and that generated text sound like it's coming from a human.

5
00:00:22,160 --> 00:00:26,540
‫Now let's discuss how we can integrate ChatGPT with Jupyter Notebook.

6
00:00:26,540 --> 00:00:33,830
‫So by using the open AI Python package, we can connect our Jupyter notebook environment to the ChatGPT

7
00:00:33,830 --> 00:00:34,430
‫API.

8
00:00:34,940 --> 00:00:37,430
‫To get started with the ChatGPT API.

9
00:00:37,460 --> 00:00:40,130
‫First of all, you need an OpenAI account.

10
00:00:40,130 --> 00:00:44,240
‫If you don't have one, then you have to sign up in your OpenAI account.

11
00:00:44,240 --> 00:00:53,000
‫For this, you have to visit OpenAI website, which is openai.com, and here you have to log in or sign

12
00:00:53,000 --> 00:00:53,960
‫up to your account.

13
00:00:54,200 --> 00:00:57,650
‫Once you have created your account, navigate to the OpenAI dashboard.

14
00:00:57,650 --> 00:01:02,180
‫You can usually find dashboard or account link in the top right corner of the website.

15
00:01:03,020 --> 00:01:05,060
‫Click on it to access your dashboard.

16
00:01:05,990 --> 00:01:10,910
‫In the dashboard, you will find various sections and settings related to your OpenAI account.

17
00:01:11,360 --> 00:01:17,750
‫Look for the API keys or credentials section as this is where you can generate your API key.

18
00:01:17,930 --> 00:01:22,010
‫Click on the API keys or credentials section to expand it.

19
00:01:22,010 --> 00:01:25,070
‫Here you will have the option to create a new API key.

20
00:01:25,730 --> 00:01:30,680
‫Click on the Create New Key or Generate Key button to generate your API key.

21
00:01:31,460 --> 00:01:34,250
‫Once you have generated your API key, copy it.

22
00:01:34,250 --> 00:01:39,680
‫This key is essential for authenticating your request to the ChatGPT API.

23
00:01:40,130 --> 00:01:41,930
‫That's how we log in to OpenAI.

24
00:01:42,050 --> 00:01:45,500
‫Create an account and obtain your API key.

25
00:01:46,100 --> 00:01:51,680
‫Now let's move on to the next step integrating the ChatGPT API with Jupyter Notebook.

26
00:01:53,900 --> 00:02:00,830
‫With the Openeye Python package and a few lines of code, we can connect our Jupyter Notebook environment

27
00:02:00,830 --> 00:02:06,080
‫to the ChatGPT API to integrate the ChatGPT API with Jupyter Notebook.

28
00:02:06,110 --> 00:02:09,350
‫We will be using the OpenAI Python package.

29
00:02:09,380 --> 00:02:12,590
‫First, make sure that you have the package installed.

30
00:02:12,590 --> 00:02:18,110
‫You can do this by running pip install OpenAI in your Jupyter notebook environment.

31
00:02:18,380 --> 00:02:22,370
‫Which code I am using here is stored in this API file.

32
00:02:22,370 --> 00:02:26,450
‫I have provided a link of this file in the description of this video.

33
00:02:26,630 --> 00:02:30,920
‫If you want to use this code, then you have to download this code and upload it.

34
00:02:30,920 --> 00:02:35,450
‫From here we will open this file and now we have our codes ready.

35
00:02:35,480 --> 00:02:38,120
‫Let me explain you this code for you.

36
00:02:38,120 --> 00:02:42,890
‫So here you have to replace this API key with your actual API key.

37
00:02:43,100 --> 00:02:49,850
‫And then we have a function which is get GPT response that takes the prompt and the optional max token

38
00:02:49,850 --> 00:02:50,570
‫parameter.

39
00:02:51,110 --> 00:02:57,350
‫This function will communicate with ChatGPT API and return the response based upon the given prompt.

40
00:02:57,380 --> 00:03:01,490
‫Next we make the API response using completion create.

41
00:03:01,490 --> 00:03:09,500
‫Here our model is GPT 3.5 turbo and then message max tokens and the temperature.

42
00:03:10,280 --> 00:03:14,300
‫Experimenting with the temperature can achieve different styles of response.

43
00:03:14,300 --> 00:03:16,910
‫And at last our response.

44
00:03:17,840 --> 00:03:19,490
‫Now we will write our prompt.

45
00:03:20,270 --> 00:03:24,680
‫So first I will write what is ChatGPT?

46
00:03:25,580 --> 00:03:26,720
‫Let's run this code.

47
00:03:28,470 --> 00:03:34,230
‫And here you can see it has written that ChatGPT is a language model developed by OpenAI.

48
00:03:34,260 --> 00:03:40,260
‫It is based on the GPT three architecture, which uses deep learning techniques to generate human like

49
00:03:40,260 --> 00:03:42,750
‫text responses and so on.

50
00:03:43,020 --> 00:03:50,910
‫Now I will write my second prompt, which is how to treat outliers in machine learning.

51
00:03:51,540 --> 00:03:59,010
‫If I run this code here, you can see that it has actually given me four ways to treat outliers, which

52
00:03:59,010 --> 00:04:03,240
‫is removal, miniaturization, transformation, and binning.

53
00:04:03,750 --> 00:04:07,710
‫In the next prompt, I will write What is Game of Thrones?

54
00:04:07,920 --> 00:04:09,180
‫Let's run this code.

55
00:04:10,440 --> 00:04:15,930
‫And here you can see that the Game of Thrones is a popular fantasy television series based on the book

56
00:04:15,930 --> 00:04:19,410
‫series A Song of Ice and Fire by George Martin.

57
00:04:19,410 --> 00:04:25,650
‫So you can see that with the integration, we can use the power of ChatGPT within our Jupyter notebook.

58
00:04:25,650 --> 00:04:27,180
‫So that's all in this video.

59
00:04:27,210 --> 00:04:28,470
‫See you in the next one.

60
00:04:28,470 --> 00:04:29,130
‫Thank you.

