<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pranay Pokala on Medium]]></title>
        <description><![CDATA[Stories by Pranay Pokala on Medium]]></description>
        <link>https://medium.com/@pranaypokala?source=rss-17d4583549ef------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Jd1XzNr1RXiwP1ovCydECQ.jpeg</url>
            <title>Stories by Pranay Pokala on Medium</title>
            <link>https://medium.com/@pranaypokala?source=rss-17d4583549ef------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 23:05:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pranaypokala/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Step into the Future: Building AI-Powered Chatbots with Amazon Bedrock]]></title>
            <link>https://medium.datadriveninvestor.com/step-into-the-future-building-ai-powered-chatbots-with-amazon-bedrock-554711a2a730?source=rss-17d4583549ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/554711a2a730</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Pranay Pokala]]></dc:creator>
            <pubDate>Wed, 10 Jul 2024 19:52:58 GMT</pubDate>
            <atom:updated>2024-08-07T02:53:48.628Z</atom:updated>
            <content:encoded><![CDATA[<p>As technology has advanced, we’ve shifted from communicating solely with humans to interacting with machines. This shift has been driven by various objectives and innovations. In the realm of chatbot development, Amazon has introduced a new service called Amazon Bedrock, designed to create generative AI applications and deploy them on the AWS cloud platform.</p><p>In this article, we will guide you through creating a chatbot using the knowledge base feature of Amazon Bedrock. We will begin by installing the necessary requirements. You can choose between two development environments:<a href="https://aws.amazon.com/cloud9/"> Amazon Cloud9</a>, which comes with pre-installed requirements, or your local terminal, which can be either Command Prompt or PowerShell on Windows.</p><p>If we choose the Windows Command Prompt, we need to install several requirements: AWS CLI, AWS CDK, and Docker.</p><p>To install the AWS CLI, you need to download the installer, which is located on the <a href="https://aws.amazon.com/cli/">Amazon command-line interface</a> website.</p><p>Once you download the .msi installer for Windows, install and run it. Once it is installed, open the command prompt and type to verify the AWS CLI is installed.</p><pre>aws --version</pre><p>To configure the AWS CLI after creating an IAM user, follow these essential steps to securely manage your AWS credentials. Begin by accessing the AWS Management Console and navigating to the IAM service. Here, you can create a new IAM user specifically for programmatic access, ensuring you allocate appropriate permissions such as “AdministratorAccess” to facilitate comprehensive control over AWS services.</p><p>Once the IAM user is created, AWS no longer displays the access key and secret key directly. Instead, you must generate these credentials using the “Create keys” option within the IAM user’s profile. After generating the keys, it is paramount to store them securely. Best practice involves saving them in a CSV file, which simplifies the AWS CLI configuration process later on.</p><p>To configure the AWS CLI, you need to use this command</p><pre>aws configure</pre><p>During the AWS CLI configuration process, you will be prompted to enter the access key ID and secret access key that you obtained earlier from the AWS Management Console. Additionally, the configuration wizard will ask you to specify the default AWS region where your CLI commands will execute. This region setting determines the AWS data center closest to your operations, optimizing latency and compliance with regional requirements.</p><p>Furthermore, you will need to select the desired output format for the AWS CLI responses. By default, the output format is set to JSON, which is structured and widely used for automated data processing. However, you have the flexibility to choose other formats, such as text, table, or YAML, based on your specific workflow and preference. This choice ensures that the AWS CLI outputs data in a format that best suits your operational needs, whether for scripting, reporting, or interactive use.</p><p>Configuring these settings correctly during the initial setup ensures that your AWS CLI commands operate efficiently within your chosen AWS region and deliver output in the format most compatible with your operational requirements.</p><p>Example configuration:</p><pre>AWS Access Key ID [None]: YOUR_ACCESS_KEY_ID<br>AWS Secret Access Key [None]: YOUR_SECRET_ACCESS_KEY<br>Default region name [None]: us-west-2<br>Default output format [None]: json</pre><p>The second requirement is installing AWS CDK (cloud development kit), which is developed using node.js, To install the CDK, we need to install node.js software.</p><p>To install, go to the <a href="https://nodejs.org/en">download page</a> of Node.js and download the LTS version for the Windows operating system. Run the installer and follow the steps to install it on the device. To verify the installation process, type the below commands in command prompt.</p><pre>node -v<br>npm -v</pre><p>After verification of Node.js software in the system, open the command prompt and type the below command to install the AWS CDK.</p><pre>npm install -g aws-cdk</pre><p>To verify the installation, type the command</p><pre>cdk --version</pre><p>The third step is to have Docker in your system. To install Docker, you need to install the software, which can be downloaded through the official <a href="https://www.docker.com/get-started/">Docker site</a>. Once it is downloaded, you can start Docker. To verify the Docker installation, you can type this command:</p><pre>docker --version</pre><p>To test the docker installation, you can run sample container:</p><pre>docker run hello-world</pre><p>Once Docker is successfully installed on your system, you can verify its functionality by running a command like docker run hello-world. This command downloads and runs a test image, confirming that Docker is operational and properly configured.</p><p>After confirming Docker’s installation, the next step is to clone a repository containing both the backend and front-end code necessary for building the contextual chatbot. The repository is publicly accessible and can be cloned using the following command:</p><pre>git clone https://github.com/aws-samples/amazon-bedrock-rag.git &amp;&amp; cd amazon-bedrock-rag</pre><p>This command downloads the repository to your local machine and navigates into the Amazon-Bedrock-Rag directory, where you can proceed with setting up and configuring the chatbot application components.</p><p>Once you have cloned the repository amazon-bedrock-rag into your local system, the next step involves navigating to the backend folder within this repository. This directory contains all the necessary packages and configuration files required to set up the backend infrastructure for your chatbot application.</p><p>To go backend folder type</p><pre>cd amazon-bedrock-rag/backend</pre><p>Install the required dependencies</p><pre>npm install <br>or <br>npm i</pre><p>Now, we need to install the backend application using cdk command</p><pre>cdk deploy --context allowedip=&quot;xxx.xxx.xxx.xxx/32&quot;</pre><p>Replace “xxx.xxx.xxx.xxx/32” with your system IP address, the IP address you can locate using the command prompt or using IP lookup services like <a href="https://www.whatismyip.com/">whatismyip.com</a> or <a href="https://www.ipchicken.com/">ipchicken.com</a>.</p><p>Once the deployment is complete, you will be able to see API Gateway URL and S3 bucket name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/0*hFNxgmpx_ki4zYMN.jpg" /><figcaption>Sample Output of the Deployment</figcaption></figure><p>Image Source: <a href="https://aws.amazon.com/blogs/machine-learning/build-a-contextual-chatbot-application-using-knowledge-bases-for-amazon-bedrock/">https://aws.amazon.com/blogs/machine-learning/build-a-contextual-chatbot-application-using-knowledge-bases-for-amazon-bedrock/</a></p><p>Save the URL, go to the S3 bucket console, and search for the bucket that you created. Once you find it, open it and insert the data you want. In this scenario, I am uploading a Python learning textbook, which is available on the internet. The uploaded files are visible to you once they are successfully uploaded.</p><p>Now, we completed the backend and database part, we are going to build a front end interface for our chatbot. Go to the command prompt and navigate to the folder where the Amazon Bedrock Rag files are, then go to the front-end folder using the cd command.</p><p>Again, install the dependencies required to build the front end platform using</p><pre>npm install</pre><p>After the installation, we have to start the application, To start, we have to use</p><pre>npm run start</pre><p>The server will start and give you a local host: port number URL, which is your application URL; copy the URL and paste it in the browser. The sample interface looks like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/0*4-4V7YY3vOTseyFr.jpg" /><figcaption>Sample Interface</figcaption></figure><p>Image Source: <a href="https://aws.amazon.com/blogs/machine-learning/build-a-contextual-chatbot-application-using-knowledge-bases-for-amazon-bedrock/">https://aws.amazon.com/blogs/machine-learning/build-a-contextual-chatbot-application-using-knowledge-bases-for-amazon-bedrock/</a></p><p>In the frontend interface of our chatbot application, there is an “API URL” column where we input the URL obtained during the deployment phase. This URL typically points to the API Gateway endpoint that serves as the entry point for our chatbot application’s backend services.</p><p>Once the URL is entered, you can proceed to ask questions in the adjacent column. For example, in my implementation of a Python training chatbot, I posed questions such as “What is Python?” and “What are the uses of Python?”</p><p>Here’s how the process flows:</p><p>User Interaction: You input a question into the frontend interface of the chatbot application.</p><p>Frontend-to-Backend Communication: The frontend component sends this question to the backend code of the application. This backend code is typically managed by AWS Lambda functions.</p><p>Backend Processing: Upon receiving the question, the AWS Lambda function activates. It uses the provided API URL to fetch the necessary information from the deployed backend services.</p><p>Utilization of Pretrained Models: Within the Lambda function, the question is processed using pretrained models, specifically leveraging the foundation model known as Claude. This model utilizes the Amazon OpenSearch service to search for answers within the content stored in an S3 bucket that we previously uploaded.</p><p>Response Delivery: Once the Claude model finds an answer based on the queried content in the S3 bucket, the Lambda function sends this answer back to the frontend interface.</p><p>Displaying the Answer: Finally, the frontend interface displays the retrieved answer to the user, completing the query-response cycle of the chatbot application.</p><p>This structured workflow ensures that users can interact seamlessly with the chatbot, receiving accurate and contextually relevant answers to their inquiries based on the underlying machine learning models and AWS services deployed in the backend.</p><p>Once the building is completed, the user wants to clean up the project because continuing to run might result in charges. To destroy the project, we need to navigate to the backend folder and use</p><pre>cdk destroy</pre><p>This will destroy all the dependencies, the S3 bucket, the knowledge base we created, and the OpenSearch service collection.</p><h4>Conclusion</h4><p>This article provides a comprehensive guide on how to create a contextual chatbot using Amazon Bedrock and various AWS services. By following these steps, you can build and deploy your own chatbot, leveraging generative AI capabilities and knowledge bases. This hands-on experience will not only help you understand the intricacies of chatbot development but will also provide a solid foundation for future projects.</p><h4>References</h4><ol><li><a href="https://aws.amazon.com/blogs/machine-learning/build-a-contextual-chatbot-application-using-knowledge-bases-for-amazon-bedrock/">https://aws.amazon.com/blogs/machine-learning/build-a-contextual-chatbot-application-using-knowledge-bases-for-amazon-bedrock/</a></li><li><a href="https://github.com/aws-samples/amazon-bedrock-rag">https://github.com/aws-samples/amazon-bedrock-rag</a></li><li><a href="https://docs.aws.amazon.com/cdk/v2/guide/home.html">https://docs.aws.amazon.com/cdk/v2/guide/home.html</a></li><li><a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html">https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html</a></li></ol><p>Visit us at <a href="https://www.datadriveninvestor.com/"><em>DataDrivenInvestor.com</em></a></p><p>Subscribe to DDIntel <a href="https://www.ddintel.com/"><em>here</em></a>.</p><p>Join our creator ecosystem <a href="https://join.datadriveninvestor.com/"><em>here</em></a>.</p><p>DDI Official Telegram Channel: <a href="https://t.me/+tafUp6ecEys4YjQ1">https://t.me/+tafUp6ecEys4YjQ1</a></p><p>Follow us on <a href="https://www.linkedin.com/company/data-driven-investor"><em>LinkedIn</em></a>, <a href="https://twitter.com/@DDInvestorHQ"><em>Twitter</em></a>, <a href="https://www.youtube.com/c/datadriveninvestor"><em>YouTube</em></a>, and <a href="https://www.facebook.com/datadriveninvestor"><em>Facebook</em></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=554711a2a730" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/step-into-the-future-building-ai-powered-chatbots-with-amazon-bedrock-554711a2a730">Step into the Future: Building AI-Powered Chatbots with Amazon Bedrock</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pooling Layer in CNN]]></title>
            <link>https://medium.com/@pranaypokala/pooling-layer-in-cnn-c8e128e869d8?source=rss-17d4583549ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8e128e869d8</guid>
            <category><![CDATA[max-pooling]]></category>
            <category><![CDATA[convolutional-neural-net]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[pooling-layer]]></category>
            <dc:creator><![CDATA[Pranay Pokala]]></dc:creator>
            <pubDate>Fri, 03 Jul 2020 07:34:06 GMT</pubDate>
            <atom:updated>2024-06-20T01:41:47.963Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pooling Layer in Convolutional Neural Network (CNN)</h3><h3><strong>CONVOLUTIONAL NEURAL NETWORK (CNN)</strong>:</h3><p>The convolutional neural network is the best neural network model for image-related problems. It can do image processing, classification, and segmentation. CNN started with alexnet in 2012; later, it has evolved with many different networks. It is also used in recommendation systems, natural language processing, object detection, face recognition, and many other applications. The advantage of CNN is that it automatically extracts features in an image without any manual work.</p><p>In CNN there are mainly 3 layers</p><ol><li>Input layer</li><li>The hidden layer</li><li>output layer</li></ol><p>1. Input Layer: This layer accepts the colored image as input</p><p>2.The hidden layer:</p><p>In this, there are 3 layers</p><ol><li>Convolution layer</li><li>RelU layer</li><li>Pooling layer</li></ol><h3><em>Architecture:</em></h3><p>In this CNN, all the architectural models are similar to each other. These involve the convolution layer, pooling layer, fully connected layer, and finally the softmax layer.</p><h3><strong>1.CONVOLUTION LAYER</strong></h3><p><strong><em>Convolution:</em></strong></p><p>In convolution, it takes an input image and applies filters to the image, then multiplies the input image with filters to get the new image. For example, consider the 5x5 image matrix, whose pixel values are 0 and 1 and the filter image matrix, which is 3x3. This 5x5 image matrix and 3x3 filter image matrix together perform a multiplication operation. This output is called a “feature map”. We perform multiple convolutions on images with several filters that give different feature maps. We further combine all feature maps to get a new image. Using different filters, we will carry out a variety of operations, including aspect detection, blur, and sharpen.</p><p><strong><em>Strides:</em></strong></p><p>Strides describe how many steps the convolution filter has to move in each step. Its default value is 1. We can give higher values to reduce overlap problems between fields. This can reduce the size of the feature map.</p><p><strong><em>Padding:</em></strong></p><p>Padding is the technique used to reduce the image dimensions, whereas the filter does not perfectly fit the input image. In padding, we can perform two operations: 1. we can pad the bits into zeros; this method is called zero-padding. 2. We can delete the part of the image where the filter is not exactly fitted; this method is called valid padding because it consists only valid padding bits.</p><h3><strong>2.ReLU layer</strong></h3><p><strong><em>Non-linear function:</em></strong></p><p>We can use different functions, such as tanh, sigmoid, and ReLU function. These functions are used to make all negative values changes to either zeros or positive values. In these functions, the ReLU function is most accurate because it makes all negative values into zeros and performance-wise, it is superior as well. The output of ReLU is f(x)=max (0, x).</p><h3><strong><em>3.Pooling layer:</em></strong></h3><p>The pooling layer is another block of CNN. It is mainly used for dimensionality reduction. This is one of the best technique to reduce overfitting problem. It is also used to detect edges, corners, etc. using multiple filters. There are two types of pooling.</p><ol><li>max pooling</li><li>avg pooling</li></ol><p><strong>1.max pooling:</strong></p><p>max pooling takes the highest value using filter size. For example, suppose our output image size is 4x4 By applying max pooling, the matrix changed to 2x2 matrix, where it considers 2x2 matrix block in the whole matrix and finds larger value placed in 2x2 matrix first block. likewise, it performs to the total matrix and gets an output matrix. Check the process in the below picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*0oSj1M6ohrPySyLBJfNL0A.png" /><figcaption>Image by author</figcaption></figure><p>In the above picture, if we take values 1, 1, 5, and 6,. By using max pooling, it chooses the highest value from the set, which is 6. So, this becomes the first value in the 2X2 kernel. The same process will be followed to fill all values in the matrix.</p><p><strong>2.avg pooling:</strong></p><p>avg pooling will calculate the average value for each block of values. Consider the above example, where the values are 1, 1, 5, and 6. Using avg pooling, the average value is calculated as 1+1+5+6/4=3.25. The same process is followed further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y7Ot4k6M-8SjV5De8jGv6Q.png" /><figcaption>Image by author</figcaption></figure><p>In these two, mostly max pooling is used because training gets faster and max pooling extract features better than avg pooling.</p><p>3. Output layer: This contains a fully connected layer followed by an activation function (softmax), which identifies the output classes.</p><p><strong><em>Fully connected layer:</em></strong></p><p>This layer output matrix is changed into vector form and sent to fully connected layers, just as a neural network would. In this layer, the vectors are assigned to each neuron, while layer neurons are connected with weights and bias. Finally, it produces the output matrix and the final layer to produce the output image with its class name. Softmax and Logistic layers are two-layer to produce the output of our CNN. The logistic layer is used for binary classification and the softmax layer is used for multiclass classification. This is the whole architecture of CNN, where we are using the transfer learning method to run retrained networks for CNN.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8e128e869d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>