<?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 Maria James on Medium]]></title>
        <description><![CDATA[Stories by Maria James on Medium]]></description>
        <link>https://medium.com/@mariajameskolamkuzhy?source=rss-3cf64db32fd4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kRGzp7JPLPnJsqob</url>
            <title>Stories by Maria James on Medium</title>
            <link>https://medium.com/@mariajameskolamkuzhy?source=rss-3cf64db32fd4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:16:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mariajameskolamkuzhy/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[BDI Meets Layered: Exploring Two Paths to Building Smart AI Agents]]></title>
            <link>https://medium.com/@mariajameskolamkuzhy/bdi-meets-layered-exploring-two-paths-to-building-smart-ai-agents-742d24e3c4a9?source=rss-3cf64db32fd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/742d24e3c4a9</guid>
            <dc:creator><![CDATA[Maria James]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 15:10:53 GMT</pubDate>
            <atom:updated>2025-07-01T15:13:02.661Z</atom:updated>
            <content:encoded><![CDATA[<ol><li><strong>INTRODUCTION</strong></li></ol><p>In the developing landscape of intelligent systems, the agent architectures are essential for enabling autonomous behavior and adaptive decision-making. Among these the Belief-Desire-Intention (BDI) architecture and Layered architecture are two well-known paradigms for creating rational agents.</p><p><strong>2. BDI ARCHITECTURE</strong></p><p><strong>2.1 Overview</strong></p><p>In the context of a virtual AI mentor for coding bootcamps, a BDI agent would represent the mentor’s thought enabling it to offer students individualized and useful advice.</p><p><strong>2.2 Use Case : Virtual AI mentors for coding bootcamps</strong></p><p><strong>2.2.1 Components:</strong></p><ul><li><strong>Belief:</strong> These stand for the AI mentor’s worldview and knowledge. The following values would be held by a mentor at a coding bootcamp</li><li><strong>Student Profile:</strong> Current student’s learning style (visual, auditory), past performance, completed modules, areas of difficulty, preferred programming languages, and level of coding proficiency</li><li><strong>Curriculum knowledge: </strong>The bootcamp’s structure, the courses that are offered, the learning goals for every module, necessary knowledge, and typical pitfalls in various coding topics are included.</li><li><strong>Problem-Solving Knowledge: </strong>various algorithms, data structures, debugging techniques, best coding practices, and common error messages and their fixes are examples of problem-solving knowledge.</li><li><strong>Desires:</strong> These are the aims the AI mentor wants to achieve. Desires for our AI mentor include:</li><li><strong>Student Success:</strong> The main objective is for the student to finish the bootcamp successfully, and submit it on time and meet their learning goals .</li><li><strong>Deep Understanding:</strong> The capacity to understand ideas deeply rather than merely memorize syntax and to help them master a concept.</li><li><strong>Problem-Solving Independence: </strong>to help the learner in acquiring the ability to resolve issues independently.</li><li><strong>Intentions: </strong>Goals that the AI mentor has made a commitment to accomplishing and has formulated a plan. For instance:</li><li>“Provide a visual explanation of Python loops.” (Intention resulting from a belief in the student’s learning style and a desire for “Deep Understanding”).</li><li>“Assist the student in debugging the SyntaxError.” (Intention resulting from a belief about the current error and a desire for “Error Correction”).</li><li>“Encourage the student following a failed test case.” (A desire for “Engagement” is the source of the intention).</li></ul><p><strong>2.2.2 Control flow and Decision Making Logic:</strong></p><ul><li><strong>Perceive environment: </strong>Inputs are constantly provided by the students to the AI mentor which includes students code submissions, errors and questions etc.</li><li><strong>Update Belief (Belief Revision): </strong>Based on the new inputs the mentor modifies the internal databases. For instance, if the student submits the correct code for a specific problem then the belief about their understanding is reinforced</li><li><strong>Generate Desires (Options Generation): </strong>The next step is where the mentor looks into the updated belief and the present intentions to find new possible desires. For instance, the mentor may feel compelled to “intervene with a hint” when it finds that the student is struggling for a prolonged period of time.</li><li><strong>Filter Desires to Form Intentions (Deliberation): </strong>The mentors choose those desires which are generated and committed to as intentions.</li><li><strong>Select Plans for Intentions (Means-End-Reasoning): </strong>The mentor finds a plan to achieve each chosen intention. For instance, the plan to help the students to debug the syntax error could be to highlight the line with error, explain the syntax error.</li><li><strong>Execute Plan (Action): </strong>The mentor carries out a select plan by performing actions in the environment that will have an impact on both the student and the learning environment, resulting in new percepts in the following cycle and then the entire process iterates.</li></ul><p><strong>2.2.3 How model handles Data Updates:</strong></p><p>The AI mentor can adjust and personalize its guidance because of the dynamic data updating which is a key component of BDI architecture.</p><ul><li><strong>Continuous Perception and Belief Revision: </strong>that happens through percepts from student activity like code submissions, error detection through tools that updates the belief and interaction history that is stored and continuously updates belief about the student.</li><li><strong>Dynamic Desire and Intention Formation:</strong> When beliefs are modified the deliberation and options generation are reassessed. This also includes conflict resolution that a new percept creates with an existing intention either dropping the existing intention or by modifying it.</li><li><strong>Adaptable Plan Execution:</strong> Plans are usually a sequence of actions but real time belief updates can affect how they are executed.</li><li><strong>Long — term Adaptation:</strong> Over time the AI mentor can develop a more accurate model for each student due to the impact of data updates on Beliefs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/0*qKZzLDGKLVnNCrnT" /></figure><p><strong>3. LAYERED ARCHITECTURE</strong></p><p><strong>3.1 Overview</strong></p><p>Layered architecture divides agent functionality into modular or hierarchical layers using reactive, deliberative and control layers to manage complexity, improve scalability and facilitate easier debugging and maintenance.</p><p><strong>3.2 Use Case: Smart energy consumption analysis with edge-cloud layers</strong></p><p><strong>3.2.1 Components:</strong></p><ul><li><strong>Perception / Data acquisition (Edge):</strong> includes components like smart meters, sensors, edge gateways or hubs that are used to directly collect raw energy consumption data from physical devices.</li><li><strong>Edge Processing / Pre — Processing:</strong> includes analytics modules. Lightweight edge ML models and communication manager that performs immediate data validation, filtering, aggregation and local anomaly detection.</li><li><strong>Communication Layer (Edge-Cloud Bridge): </strong>includes message brokers, API Gateways that provides secure and reliable data transmission.</li><li><strong>Cloud Data Processing:</strong> includes data ingestion services, data warehouse, stream processing and batch processing engines to store and process large volumes of data.</li><li><strong>Cloud Analytics and Intelligence:</strong> includes Machine learning platforms. Business intelligence tools to get insights and build predictive/prescriptive models and visualize trends.</li><li><strong>Application and User Interface:</strong> includes web/mobile applications that act as an interface for users to monitor usage and provide personalized recommendations like “Consider replacing your old refrigerator as it consumes a lot of electricity”.</li></ul><p><strong>3.2.2 Control Flow and Decision Making Logic:</strong></p><ul><li><strong>Bottom — Up (Data Flow): </strong>Sensor raw data (Layer 1) is pre — processed at edge (Layer 2) and safely sent to the cloud (Layer 3) for in-depth processing and analysis (Layer 4 &amp; 5). The Application layer (Layer 6) is used to display the insights.</li><li><strong>Top — Down (Control Flow): </strong>Commands are sent down through the cloud Analytics (Layer 5) and Communication (Layer 3) layers in response to user actions from the Application Layer (Layer 6).These commands reach edge devices (Layer 2) for local actuation (Layer 1), completing a feedback loop.</li><li><strong>Edge Layer:</strong> Focuses on local, reactive, rule — based decisions.</li><li><strong>Cloud Layer:</strong> Handle complex, predictive and prescriptive decisions.</li></ul><p><strong>3.2.3</strong> <strong>How model handles Data Updates:</strong></p><p>Data updates are continuous and handled at multiple layers for responsiveness and intelligence:</p><ul><li><strong>Real-time Stream: </strong>Edge devices use stream-based anomaly detection and rolling aggregations to process data instantly, saving bandwidth and allowing for quick local actions.</li><li><strong>Streaming Ingestion:</strong> Stream processing engines provide near real-time insights for dashboards and alerts.</li><li><strong>Batch Processing &amp; Model Retraining:</strong> batch jobs are periodically executed on updated historical data to refine long-term trends, generate comprehensive reports, and crucially, retrain complex Machine Learning models. This model has the capability to adapt to changing energy consumption patterns.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aYDBAoyYiEV6JW3L" /></figure><p><strong>4. COMPARATIVE ANALYSIS: BDI VS. LAYERED ARCHITECTURE</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*luzSCdA3HPNHA1B4QD6jdw.png" /></figure><p><strong>5. CONCLUSION</strong></p><p>Essentially, the Layered architecture offers the stable, scalable “body” for intricate, distributed systems, while the BDI architecture specifies the internal “mind” of an intelligent agent, permitting intentional and adaptive behavior. When combined, they offer complementary methods for creating complex AI systems that enable intelligent agents to function well inside organized, productive infrastructures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=742d24e3c4a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[t-SNE Explained Simply: Visualizing High-Dimensional Data with Intuition]]></title>
            <link>https://medium.com/@mariajameskolamkuzhy/t-sne-explained-simply-visualizing-high-dimensional-data-with-intuition-d67e76a582f8?source=rss-3cf64db32fd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d67e76a582f8</guid>
            <dc:creator><![CDATA[Maria James]]></dc:creator>
            <pubDate>Sat, 31 May 2025 14:43:41 GMT</pubDate>
            <atom:updated>2025-05-31T14:43:41.253Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine trying to understand a crowd of people from just a list of their features — age, height, weight, interests, hometown, and more. Now imagine being able to <strong>visually cluster</strong> these individuals based on similarities, even though each person has a dozen attributes. This is what <strong>t-SNE</strong> (t-distributed Stochastic Neighbor Embedding) helps us do: it turns <strong>high-dimensional data</strong> into <strong>visual patterns</strong> we can actually interpret.</p><p>t-SNE has become one of the most powerful tools for <strong>nonlinear dimensionality reduction</strong> and <strong>visualization</strong>, particularly useful for tasks like understanding word embeddings, exploring hidden layers in neural networks, or clustering customer behavior.</p><h3>What t-SNE Does?</h3><p>At its core, <strong>t-SNE finds a way to project data into a low-dimensional space (usually 2D or 3D)</strong> such that the <strong>clusters or groupings</strong> present in the high-dimensional space are preserved.</p><p>Example:</p><p>If you’re analyzing handwritten digits (like MNIST, which has 784-dimensional images), t-SNE can <strong>reduce them to just 2 dimensions</strong> while keeping similar digits close together, making them visually cluster by digit type (e.g., all 0s, all 1s, etc.).</p><h3>How t-SNE Works — Step-by-Step</h3><p>Let’s break it down.</p><h4>Step 1: Start with the High-Dimensional Space (Original Scatter Plot)</h4><p>Imagine your data points scattered in high dimensions. The goal is to <strong>capture how similar or dissimilar each point is to the others.</strong></p><p>To do this:</p><ol><li><strong>Measure the distance</strong> between each pair of points.</li><li>For each point, <strong>plot a normal distribution (Gaussian curve)</strong> centered on that point.</li><li><strong>Draw a line</strong> from the center point to the curve — the <strong>length of this line</strong> gives the <strong>unscaled similarity</strong>:</li></ol><ul><li>Nearby points → <strong>short line → high similarity</strong></li><li>Distant points → <strong>long line → low similarity</strong></li></ul><p>Using a <strong>normal distribution</strong> makes distant points nearly invisible (very low similarity), which helps t-SNE focus on local structure.</p><h4>Step 2: Scale Similarity Scores</h4><p>Now, we want these unscaled similarity scores to behave like <strong>probabilities</strong>. That means <strong>all similarities from a given point should sum to 1.</strong></p><p>To do this, we use:</p><p>\text{Scaled similarity} = \frac{\text{Unscaled score}}{\sum \text{Unscaled scores}}</p><p>This ensures that:</p><ul><li>Points in <strong>dense regions</strong> get narrow Gaussian curves (small σ), making only close neighbors have high similarity.</li><li>Points in <strong>sparse regions</strong> get wider curves, allowing more distant neighbors to be considered.</li></ul><blockquote><em>This is where </em><strong><em>perplexity</em></strong><em> comes in — it defines the </em><strong><em>effective number of neighbors</em></strong><em>. It’s a key hyperparameter that balances local vs global structure.</em></blockquote><p>Note: The similarity from <strong>A to B</strong> may not equal that from <strong>B to A</strong>, so we average them to build a <strong>symmetric similarity matrix</strong>.</p><p>Also, <strong>self-similarity is set to 0</strong>, since it’s not meaningful in clustering.</p><h4>Step 3: Project Points Randomly onto a Line (Low-Dimensional Space)</h4><p>Next, we <strong>randomly assign the same data points onto a number line</strong>. This is our starting point in the low-dimensional space.</p><p>We repeat the similarity calculation here too, <strong>but with a twist</strong>:</p><ul><li>Instead of a <strong>normal distribution</strong>, we use a <strong>t-distribution</strong> (specifically, a Student’s t-distribution with 1 degree of freedom).</li></ul><p>Why t-distribution?</p><p>It has <strong>heavier tails</strong>, which helps <strong>spread out</strong> dissimilar points, preventing them from clumping together in the center — a common issue in earlier methods.</p><h4>Step 4: Optimize to Match Similarities</h4><p>Now, we compare:</p><ul><li>The <strong>high-dimensional similarity matrix</strong> (from the scatter plot),</li><li>The <strong>low-dimensional similarity matrix</strong> (from the number line).</li></ul><p>They’re quite different at first. So, t-SNE:</p><ul><li><strong>Moves the points slightly</strong> in the low-dimensional space,</li><li><strong>Attracts</strong> points that are close in high-dim space,</li><li><strong>Repels</strong> those that are far apart,</li><li>Continues this process until the <strong>two similarity matrices match as closely as possible</strong>.</li></ul><p>This optimization is done using <strong>gradient descent</strong> on a cost function called <strong>Kullback-Leibler (KL) divergence</strong>, which measures the difference between the two distributions.</p><h3>Final Result: Clusters You Can See</h3><p>The end result is a beautiful 2D scatter plot where:</p><ul><li><strong>Points that were close</strong> in high dimensions are still close.</li><li><strong>Distinct clusters</strong> emerge naturally.</li><li>You can often <strong>visually identify patterns</strong> (like groups of similar images, words, or customers).</li></ul><h3>Conclusion</h3><p>t-SNE is a fantastic technique for making sense of high-dimensional data. It takes the complex relationships between data points and projects them into a space where humans can visually <strong>see patterns and clusters</strong> — a perfect blend of math and intuition.</p><p>Whether you’re exploring image data, word vectors, or complex customer attributes, t-SNE can help uncover <strong>hidden structure</strong> that might otherwise stay buried in hundreds of dimensions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d67e76a582f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Words to Vectors: Understanding Word Embeddings and Word2Vec in NLP]]></title>
            <link>https://medium.com/@mariajameskolamkuzhy/from-words-to-vectors-understanding-word-embeddings-and-word2vec-in-nlp-dc27ea4813de?source=rss-3cf64db32fd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc27ea4813de</guid>
            <dc:creator><![CDATA[Maria James]]></dc:creator>
            <pubDate>Sat, 01 Mar 2025 15:31:29 GMT</pubDate>
            <atom:updated>2025-03-01T15:31:29.830Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>INTRODUCTION</strong></h3><p>Imagine you’re teaching a robot to understand language. You say <strong>“King”</strong> and then <strong>“Queen”</strong>, expecting it to recognize the similarity. But to a machine, these words are just a bunch of letters!</p><p>Computers don’t “understand” words the way humans do — they need numbers. That’s where <strong>Word Embeddings</strong> come in! They convert words into numerical representations (vectors) in a way that <strong>captures meaning, context, and relationships between words</strong>. Let’s break it down in a fun way!</p><h3><strong>What Are Word Embeddings?</strong></h3><p>Think of words as points in a vast multi-dimensional space. Word embeddings map each word to a set of numbers (vectors) so that:</p><ul><li>Similar words have similar vectors.</li><li>Words used in similar contexts are placed close to each other.</li></ul><p><strong>Simple Analogy:<br></strong>Imagine a <strong>group of friends at a party</strong>:</p><ul><li>People with <strong>similar interests</strong> (e.g., movie lovers, gamers, techies) naturally <strong>stand close</strong> to each other.</li><li>Likewise, in word embeddings, words like <strong>“king” and “queen”</strong> or <strong>“dog” and “puppy”</strong> will have vectors that are close together.</li></ul><p><strong>How Does This Look Mathematically?</strong></p><p>Each word is represented as a list of numbers (vectors). For example:</p><p>“King” → [0.5, 1.2, -0.3, 0.8, …]</p><p>“Queen” → [0.52, 1.18, -0.35, 0.79, …]</p><p>“Apple” → [1.1, -0.3, 0.8, -1.2, …]</p><p>Since <strong>“king”</strong> and <strong>“queen”</strong> have similar meanings, their vectors are <strong>closer</strong> than unrelated words like <strong>“king” and “apple”</strong>.</p><p><strong>Distance &amp; Similarity in Word Embeddings</strong></p><p>The <strong>distance and direction between vectors</strong> define how similar words are.</p><ul><li><strong>Cosine Similarity</strong> helps measure how close two words are in meaning.</li><li>The smaller the angle between two word vectors, the <strong>more similar</strong> they are!</li></ul><p><strong>Example:<br></strong>The famous <strong>“King — Man + Woman = Queen”</strong> equation shows how embeddings capture relationships:</p><p>Vector(“King”) — Vector(“Man”) + Vector(“Woman”) ≈ Vector(“Queen”)</p><p><strong>Fun Analogy:</strong></p><p>Think of it like a <strong>recipe</strong>! If you take <strong>“King”</strong>, remove the <strong>“male” ingredient</strong>, and add the <strong>“female ingredient”</strong>, you get <strong>“Queen”</strong></p><h3><strong>How Do We Generate Word Embeddings?</strong></h3><p>Now that we know what word embeddings are, let’s dive into how they are created!</p><p>There are two popular approaches to generate word embeddings:</p><ol><li>Frequency-based Embeddings</li><li>Prediction-based Embeddings</li></ol><p><strong>1. Frequency-based Embeddings (TF-IDF)</strong></p><p>One simple way to create word embeddings is by looking at <strong>how often words occur</strong> in the text. The underlying idea is:<br><strong>“The more often a word appears, the more important it might be.”</strong></p><p>But wait… isn’t that a bit misleading?</p><p>If you’re reading a recipe blog about <strong>pizza</strong>, the word <strong>“pizza”</strong> will obviously appear more often than <strong>“mozzarella”</strong> or <strong>“pepperoni”</strong> — but does that make <strong>pizza</strong> more important?<br>Not really! What makes the content interesting are the <strong>rare and meaningful words</strong> like <strong>“mozzarella”</strong>, <strong>“pepperoni”</strong>, or <strong>“thin crust”</strong>.</p><p>That’s where <strong>TF-IDF</strong> comes in!</p><h4>TF-IDF (Term Frequency — Inverse Document Frequency)</h4><p>TF-IDF is like the <strong>secret sauce </strong>of word embeddings. It assigns importance to a word not just by how often it appears, but by how <strong>unique</strong> it is across the entire text.</p><p>👉 Here’s how it works:</p><ul><li><strong>TF (Term Frequency):</strong> How often does the word appear in the document?</li><li><strong>IDF (Inverse Document Frequency):</strong> How rare is the word across all documents?</li></ul><p><strong>Simple Rule:</strong></p><ul><li>Common words like <strong>“pizza”</strong> will get a <strong>low TF-IDF score</strong> (because they appear in almost every pizza-related blog).</li><li>Rare but meaningful words like <strong>“mozzarella”</strong> or <strong>“Neapolitan”</strong> will get a <strong>higher TF-IDF score</strong>.</li></ul><h4><strong>Fun Example</strong> 🍕🍔:</h4><p>Imagine you’re reading two different food blogs:</p><p><strong>Blog 1:</strong> <em>Best Pizza in Town</em></p><p><strong>Blog 2:<em> </em></strong><em>Burger Joint Reviews</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*Ltn11UG3I8BhclSYGHtq3A.png" /></figure><p>The word <strong>“Pepperoni”</strong> will get the <strong>highest score</strong> because it’s highly relevant to pizza and rarely appears in burger blogs.</p><p><strong>Why Is TF-IDF Important?</strong></p><p>It helps machines focus on <strong>what really matters</strong> in a document instead of just counting words mindlessly.</p><p>Without TF-IDF, search engines would treat <strong>“the”</strong> and <strong>“burger”</strong> with equal importance. With TF-IDF, the model knows that <strong>“burger”</strong> holds more meaning in the context of food reviews.</p><p>Frequency-based embeddings like TF-IDF give machines a <strong>basic understanding of word importance</strong>, but they don’t capture <strong>relationships between words</strong>. For that, we need something more powerful — and that’s where <strong>Prediction-Based Embeddings like Word2Vec</strong> come into play!</p><h4>2. Prediction-Based Embeddings: Learning Meaning from Context</h4><p>While <strong>TF-IDF</strong> focuses on word frequency, it doesn’t capture <strong>meaning</strong> or <strong>context</strong>. That’s where <strong>Prediction-Based Embeddings</strong> come in! 🚀</p><p>Instead of just counting words, these models <strong>predict</strong> a word based on its surroundings. Words that appear in similar contexts get <strong>similar vector representations</strong>.</p><p><strong>How Does This Work?</strong></p><p>Let’s say we have these two sentences:</p><p><strong>Sentence 1:</strong> <em>“The chef is slicing the vegetables.”<br></em> <strong>Sentence 2:</strong> <em>“The chef is preparing a delicious dish.”</em></p><p>A prediction-based model learns that <strong>“chef”</strong> is closely related to <strong>“slicing”</strong>, <strong>“preparing”</strong>, and <strong>“dish”</strong>, because they frequently appear together.</p><p><strong>Key Benefits:<br></strong> Helps understand <strong>how words are used in different contexts</strong>.<br>Separates words with similar meanings but different usage.</p><p>For example:</p><ul><li><strong>“Bank” (riverbank) vs. “Bank” (financial institution)</strong> — Context decides the meaning.</li><li><strong>“Apple” (fruit) vs. “Apple” (company)</strong> — These get different embeddings!</li></ul><p><strong>Why Prediction-Based Models Are Powerful?</strong></p><ul><li><strong>More accurate word relationships</strong> than frequency-based models.</li><li><strong>Handles synonyms &amp; context-based meanings</strong> better.</li><li><strong>Used in Word2Vec, GloVe, and FastText</strong> to generate high-quality word vectors.</li></ul><h3><strong>Why Use Neural Networks for Word Embeddings?</strong></h3><p>At first glance, generating word embeddings seems easy — you could just assign random numbers to each word. But would that really help a machine understand language?</p><p>Let’s consider an example to understand why <strong>random word values don’t work well</strong> and why <strong>Neural Networks are necessary</strong> for learning proper embeddings.</p><h4>The Problem with Random Assignments</h4><p>Imagine a simple system where each word gets an arbitrary number:</p><ul><li><strong>“Movie”</strong> → <strong>12.5</strong></li><li><strong>“Fantastic”</strong> → <strong>-8.3</strong></li><li><strong>“Amazing”</strong> → <strong>27.1</strong></li></ul><p>Now, consider these two sentences:<br> <em>“This movie is fantastic!”<br></em> <em>“This movie is amazing!”</em></p><p>Here, <strong>“fantastic” and “amazing” mean the same thing</strong>, but they have very different values! This means that learning how to use <strong>“fantastic”</strong> doesn’t help the model understand <strong>“amazing”</strong> — which is inefficient.</p><p>Neural Networks solve this by <strong>giving similar words similar embeddings</strong>, making it easier for models to generalize and understand language.</p><p><strong>Capturing Context &amp; Multiple Meanings</strong></p><p>Another issue is that the <strong>same word can have different meanings depending on context</strong>.</p><p>For example:</p><ul><li><em>“The bank of the river is beautiful.”</em></li><li><em>“I need to deposit money at the bank.”</em></li></ul><p>Here, <strong>“bank”</strong> means <strong>a riverbank</strong> in the first sentence and <strong>a financial institution</strong> in the second. If we only assign one number to “bank,” the model might get confused!</p><p><strong>Solution?</strong> Assigning a word <strong>multiple values based on its usage</strong> helps the Neural Network understand different contexts.</p><h3>How Does a Neural Network Generate Word Embeddings?</h3><p>Now that we know why Neural Networks are used for word embeddings, let’s break down <strong>how they actually work</strong> behind the scenes!</p><p><strong>Step 1: Inputs and One-Hot Encoding</strong></p><p>Neural networks learn embeddings by predicting words in a sentence.</p><p>Let’s take this example:<br>📄 <em>“Spiderman is amazing.”<br></em>📄 <em>“Batman is amazing.”</em></p><p>Here, we want the model to learn that <strong>“Spiderman”</strong> and <strong>“Batman”</strong> are related to <strong>“amazing”</strong> in a similar way.</p><p><strong>First, we represent words as numbers using one-hot encoding:</strong></p><p>Spiderman — [1, 0, 0, 0]</p><p>Batman — [0, 1, 0, 0]</p><p>Is — [0, 0, 1, 0]</p><p>Amazing — [0, 0, 0, 1]</p><p>Each word is represented as a <strong>binary vector</strong>, where only one position is <strong>1</strong> and the rest are <strong>0</strong>.</p><p><strong>Step 2: Neural Network with Weights &amp; Activations</strong></p><p>The neural network has:<br>1️ <strong>Input Layer:</strong> The one-hot vector of the word.<br>2️ <strong>Hidden Layer:</strong> Neurons that learn relationships between words.<br>3️<strong>Output Layer:</strong> Predicts the next word in the sentence.</p><p>Initially, <strong>weights</strong> are <strong>randomly assigned</strong> between words, meaning the network has no understanding of relationships yet.</p><p>💡 If we input “Spiderman” into the NN, the expected output should be <strong>“is”</strong> since “Spiderman is” is a common phrase. Similarly, inputting “Batman” should also predict “is”.</p><p>Over time, the network <strong>adjusts these weights</strong> so that similar words (like “Spiderman” and “Batman”) have similar internal representations.</p><p><strong>Step 3: Learning Word Embeddings</strong></p><p>After training on large amounts of text, the <strong>optimized weights</strong> of the input layer become the <strong>word embeddings!</strong></p><ul><li><strong>Words with similar meanings get similar embeddings</strong></li><li><strong>Unrelated words remain distant</strong></li></ul><p><strong>For example:<br></strong>If “Spiderman” and “Batman” often appear before “is amazing,” they will have similar numerical embeddings, allowing the NN to generalize relationships between them.</p><h3>Word2Vec: Revolutionizing Word Embeddings</h3><p>In 2013, Google introduced <strong>Word2Vec</strong>, a groundbreaking technique for generating word embeddings using a neural network. Unlike traditional word representations, Word2Vec learns word meanings based on <strong>context</strong> and <strong>semantic similarity</strong> — making NLP models smarter!</p><h4>Two Architectures of Word2Vec</h4><p>Word2Vec comes in <strong>two flavors</strong>, both using <strong>context to learn word meanings</strong>:</p><p><strong>1️. Continuous Bag of Words (CBOW)</strong> → <strong>Predicts the middle word from surrounding words</strong></p><ul><li>📄 <em>“The — — is barking.”</em> → Model predicts <em>“dog”</em></li><li>Learns fast but struggles with rare words.</li></ul><p><strong>2️. Skip-Gram</strong> → <strong>Predicts surrounding words from the middle word</strong></p><ul><li>📄 <em>“Dog” → [“The”, “is”, “barking”]</em></li><li>Works better for rare words but takes longer to train.</li></ul><p>Both methods use <strong>contextual relationships</strong> to learn embeddings, making words with similar meanings closer in vector space.</p><h4><strong>The Challenge: Large Datasets = Slow Training</strong></h4><p>Training Word2Vec on massive datasets (like <strong>Wikipedia or Google News</strong>) requires billions of word pairs!</p><p>The problem?</p><ul><li>Every word in the vocabulary needs activation functions and weight updates.</li><li>This makes training <strong>very slow and computationally expensive</strong>.</li></ul><h3>The Solution: Negative Sampling</h3><p>Instead of computing probabilities for <strong>all words in the vocabulary</strong>, Word2Vec simplifies the process with <strong>Negative Sampling</strong>.</p><p><strong>How does it work?</strong></p><ul><li>Instead of considering <strong>every possible word</strong>, the model picks a <strong>few correct words</strong> and <strong>a few random incorrect words</strong> (negative samples).</li><li>This drastically reduces computations, making training <strong>faster and more efficient</strong>.</li></ul><p><strong>Example:</strong></p><ul><li>If we want to learn that <strong>“dog”</strong> and <strong>“barking”</strong> are related, the model will compare “barking” against correct words (e.g., “dog”) and a <strong>few incorrect words</strong> (e.g., “apple,” “laptop”).</li><li>This helps the network <strong>focus on relevant relationships without unnecessary calculations</strong>.</li></ul><h3><strong>CONCLUSION</strong></h3><p>From simple word frequency techniques like TF-IDF to neural network-based embeddings like Word2Vec, the way we represent words in NLP has evolved dramatically. These advancements have paved the way for even more sophisticated models like GloVe, FastText, BERT, and GPT, which power modern AI applications — from chatbots and search engines to machine translation and voice assistants.</p><p>As NLP continues to advance, one thing is clear: understanding words through embeddings is the foundation of how machines comprehend human language.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc27ea4813de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Case Study on Ethics in AI]]></title>
            <link>https://medium.com/@mariajameskolamkuzhy/case-study-on-ethics-in-ai-d4aa726608a0?source=rss-3cf64db32fd4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4aa726608a0</guid>
            <dc:creator><![CDATA[Maria James]]></dc:creator>
            <pubDate>Sat, 14 Sep 2024 16:44:31 GMT</pubDate>
            <atom:updated>2024-09-14T16:44:31.956Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction:</strong></p><p>Ethics in AI ensures that artificial systems follow certain principles to judge what is good and wrong so that it respects human values and rights. The European Union provides a framework for managing AI applications at any level. AI systems should involve justifiability, fairness, accountability and transparency as these elements help guide the ethical development and deployment of AI technologies.</p><p>Deep fake technology is one such AI that is rapidly evolving to create hyper-realistic audio, video, and image content that mimics real people. While Deepfakes have potential applications, they also have the potential to undermine democracy, society, corporations, and people. In this case study we will explore the ethical implications of Deepfakes technology.</p><p><strong>Case Study:</strong></p><p>Imagine a teenager who comes across an explicit video of themself on social media or a video of a well-known celebrity using or promoting illicit drugs on their social media. These instances show how Deepfake technology can be used to influence public opinion and harm one’s reputation. At the heart of the issue is the potential for misuse.</p><p>Some of the core ethical principles relevant to deepfakes include:</p><ul><li>Privacy: The users’ do not have the right to manage who has access to their personal information and maintain certain levels of secrecy.</li><li>Accountability: When a Deepfakes are spread through social media or other online platforms tracing the original creator can be nearly impossible due to the technology’s ability to obscure the sources.</li><li>Justice: Justice becomes difficult when Deepfake victims lack equal access to resources, legal representation or other forms of support to fight misleading information.</li></ul><p>Among ethical issues raised by deepfake technology include:</p><ul><li>Psychological Impact: Deepfakes can have significant psychological influence on both personal and societal level. Individuals who fall prey to deepfake technology may have extremely traumatic experiences, particularly when non-consensual deepfake pornography or stuff that damages one’s reputation is involved. Extreme emotional pain, including feelings of helplessness, guilt, and embarrassment, is a common experience for such victims. Anxiety, sadness, and in certain situations, post-traumatic stress disorder (PTSD) can result from losing control over one’s reputation or image. Also, individuals who are aware about the creations and spread of deepfakes experience heightened anxiety, worrying that they could be targeted at any moment. This can lead to hypervigilance, where people constantly monitor their online presence or obsessively worry about their personal security.</li></ul><p>The trust that the public has in visual or audio evidence declines when it becomes harder to discern between authentic and fraudulent content. This erosion of trust can create widespread skepticism, leading to paranoia and doubt about what can be believed. Hence, Deepfakes have psychological effects that go well beyond the first shock of being the target or manipulator.</p><ul><li>Social Impact : The growing skepticism of media trust is made worse by deepfakes. In personal relationships deepfakes can be used to trick or control people which can result in disagreements, splits, or mistrust. For example, instance, a deepfake might depict someone cheating on a partner, which would ruin a relationship.</li></ul><p><strong>Conclusion:</strong></p><p>Beyond Psychological and social impacts, deepfakes can have wide-range of consequences that affect political, legal and economic spheres. The use of deepfakes challenges the core principles of ethics that should be addressed with legal systems and technological safety.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4aa726608a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>