<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marie Claire Uwiringiyimana</title>
    <description>The latest articles on DEV Community by Marie Claire Uwiringiyimana (@marie_claireuwiringiyima).</description>
    <link>https://dev.to/marie_claireuwiringiyima</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4151862%2F6d4edba3-2fe3-4623-beed-e1a1064aaaf6.jpg</url>
      <title>DEV Community: Marie Claire Uwiringiyimana</title>
      <link>https://dev.to/marie_claireuwiringiyima</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marie_claireuwiringiyima"/>
    <language>en</language>
    <item>
      <title>From Pixels to Segmentation: My Journey into Computer Vision</title>
      <dc:creator>Marie Claire Uwiringiyimana</dc:creator>
      <pubDate>Tue, 13 Oct 2026 14:40:53 +0000</pubDate>
      <link>https://dev.to/marie_claireuwiringiyima/from-pixels-to-segmentation-my-journey-into-computer-vision-3lao</link>
      <guid>https://dev.to/marie_claireuwiringiyima/from-pixels-to-segmentation-my-journey-into-computer-vision-3lao</guid>
      <description>&lt;p&gt;A research-based learning journey exploring how computers process and interpret images, from pixels and RGB colour channels to mathematical kernels, image filters, object classification, detection, and segmentation. In this blog, I share the concepts I researched, the mathematical foundations I explored, and the key insights I gained while learning how computer vision works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Introduction&lt;/strong&gt;&lt;br&gt;
Computer vision is a field of artificial intelligence that enables computers to extract useful information from images and videos. A computer does not see an image as a person does; instead, it receives numerical values arranged in a grid.&lt;br&gt;
Image processing applies mathematical operations to these values to improve an image or reveal features such as edges and textures. Deep-learning models can then use these features for tasks such as image classification, object detection, and image segmentation (Gonzalez &amp;amp; Woods, 2018; Szeliski, 2022).&lt;br&gt;
&lt;strong&gt;2. Understanding Pixels and RGB Images&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;2.1 What is a pixel?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;A pixel&lt;/strong&gt;, meaning picture element, is the smallest individual sample in a digital image. An image consists of many pixels arranged in rows and columns.&lt;br&gt;
In an 8-bit grayscale image, each pixel usually stores an intensity value between &lt;strong&gt;0 and 255:&lt;br&gt;
    0: Black&lt;br&gt;
    255: White&lt;/strong&gt;&lt;br&gt;
    Values between 0 and 255: Different shades of gray&lt;br&gt;
A grayscale image can be represented mathematically as: I(x,y) &lt;br&gt;
Where:&lt;br&gt;
    &lt;strong&gt;(I)&lt;/strong&gt; represents the image.&lt;br&gt;
    &lt;strong&gt;(x)&lt;/strong&gt; represents the row position.&lt;br&gt;
    &lt;strong&gt;(y)&lt;/strong&gt; represents the column position.&lt;br&gt;
    &lt;strong&gt;(I(x,y))&lt;/strong&gt; represents the intensity of the pixel at that position.&lt;br&gt;
&lt;strong&gt;2.2 Understanding RGB images&lt;/strong&gt;&lt;br&gt;
RGB stands for Red, Green, and Blue. It is a colour model that represents colours by combining three colour channels.&lt;br&gt;
Each pixel in a standard 8-bit RGB image contains three values:&lt;br&gt;
                             &lt;strong&gt;I(x,y)= [R(x,y), G(x,y), B(x,y)]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Where:&lt;br&gt;
    &lt;strong&gt;R(x,y)&lt;/strong&gt; represents the red intensity.&lt;br&gt;
    &lt;strong&gt;G(x,y)&lt;/strong&gt; represents the green intensity.&lt;br&gt;
    &lt;strong&gt;B(x,y)&lt;/strong&gt; represents the blue intensity.&lt;br&gt;
Each channel usually ranges from 0 to 255.&lt;br&gt;
&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;RGB value&lt;/strong&gt;   &lt;strong&gt;Colour&lt;/strong&gt;&lt;br&gt;
(255, 0, 0) Red&lt;br&gt;
(0, 255, 0) Green&lt;br&gt;
(0, 0, 255) Blue&lt;br&gt;
(255, 255, 255) White&lt;br&gt;
(0, 0, 0)   Black&lt;br&gt;
(255, 255, 0)   Yellow&lt;/p&gt;

&lt;p&gt;An RGB image can therefore be represented as a three-dimensional array with dimensions: &lt;strong&gt;H×W×3&lt;/strong&gt;&lt;br&gt;
Where &lt;strong&gt;H&lt;/strong&gt; is the image height, &lt;strong&gt;W&lt;/strong&gt; is its width, and &lt;strong&gt;3&lt;/strong&gt; represents the RGB channels.&lt;br&gt;
&lt;strong&gt;2.3 Converting RGB to grayscale&lt;/strong&gt;&lt;br&gt;
Sometimes, image processing algorithms operate on grayscale images because they need intensity information rather than colour information.&lt;br&gt;
A common luminance-weighted conversion formula is:&lt;br&gt;
&lt;strong&gt;(Gray=0.299R+0.587G+0.114B)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Where &lt;strong&gt;(R), (G)&lt;/strong&gt;, and &lt;strong&gt;(B)&lt;/strong&gt; are the red, green, and blue channel values.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
Suppose a pixel has RGB values:&lt;br&gt;
&lt;strong&gt;R=100, G=150, B=200&lt;/strong&gt;&lt;br&gt;
Substituting these values:&lt;br&gt;
&lt;strong&gt;Gray = 0.299(100) + 0.587(150) + 0.114(200)&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Gray = 29.9 + 88.05 + 22.8&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Gray = 140.75 ~ 141&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The resulting grayscale pixel has an intensity of approximately 141.&lt;br&gt;
This weighted formula is associated with standard video luminance calculations, including ITU-R BT.601 (International Telecommunication Union, 2011).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Understanding Kernels and Filters&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;3.1 What is a kernel?&lt;/strong&gt;&lt;br&gt;
A kernel, also called a filter, is a small matrix of numerical values applied to an image to modify its appearance or extract useful features.&lt;br&gt;
For example, a 3×3 kernel contains nine values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;           [ 1  1  1 ]
      K =  [ 1  1  1 ]
           [ 1  1  1 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The kernel moves across the image. At each position, its values are multiplied by the corresponding neighbouring pixel values, and the results are added together.&lt;br&gt;
This operation is used for blurring, sharpening, edge detection, and other image-processing tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.2 General mathematical formula for convolution&lt;/strong&gt;&lt;br&gt;
A two-dimensional convolution can be expressed as:&lt;br&gt;
&lt;strong&gt;O(x, y) = Σᵢ Σⱼ K(i, j) I(x − i, y − j)&lt;/strong&gt;&lt;br&gt;
Where:&lt;br&gt;
    &lt;strong&gt;O(x,y)&lt;/strong&gt; is the output pixel.&lt;br&gt;
    &lt;strong&gt;I(x,y)&lt;/strong&gt; is the input image.&lt;br&gt;
    &lt;strong&gt;K(i,j)&lt;/strong&gt; represents the kernel values.&lt;br&gt;
    &lt;strong&gt;i,j&lt;/strong&gt; represent positions within the kernel.&lt;br&gt;
        &lt;strong&gt;∑&lt;/strong&gt; indicates summation over the kernel positions.&lt;br&gt;
Strict mathematical convolution flips the kernel before applying it. Some image-processing libraries instead perform cross-correlation, which uses the kernel without flipping it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.3 Common image kernels and filters&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;A. Average blur filter&lt;/strong&gt;&lt;br&gt;
Kernel&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                [ 1  1  1 ]
      K = 1/9 × [ 1  1  1 ]
                [ 1  1  1 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This filter calculates the average of a pixel and its eight neighbours. It smooths an image and reduces small details and noise.&lt;/p&gt;

&lt;p&gt;The output pixel is:&lt;br&gt;
&lt;strong&gt;O(x, y) = (1/9) Σᵢ₌₋₁¹ Σⱼ₌₋₁¹ I(x + i, y + j)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B. Large blur filter (15 × 15)&lt;/strong&gt;&lt;br&gt;
Kernel&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Large Blur Kernel (15 × 15)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;               [ 1  1  ...  1 ]
         1
K =  ─────── ×
       225     [ 1  1  ...  1 ]
               [ ⋮  ⋮   ⋱  ⋮ ]
               [ 1  1  ...  1 ]  ₁₅ₓ₁₅
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This filter averages 225 neighbouring pixels. It produces stronger smoothing than a 3×3 blur and removes more fine details.&lt;br&gt;
The output pixel is:&lt;br&gt;
&lt;strong&gt;O(x, y) = (1/225) Σᵢ₌₋₇⁷ Σⱼ₌₋₇⁷ I(x + i, y + j)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C. Sharpening filter&lt;/strong&gt;&lt;br&gt;
Kernel&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
      [  0  -1   0 ]
 K =  [ -1   5  -1 ]
      [  0  -1   0 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The sharpening filter strengthens the central pixel and subtracts the four directly adjacent pixels. This emphasizes local changes and makes details appear sharper.&lt;/p&gt;

&lt;p&gt;The output is:&lt;br&gt;
&lt;strong&gt;O(x, y) = 5I(x, y)&lt;br&gt;
          − I(x − 1, y) − I(x + 1, y)&lt;br&gt;
          − I(x, y − 1) − I(x, y + 1)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;D. Sobel X filter&lt;/strong&gt;&lt;br&gt;
Kernel&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     [ -1   0   1 ]
Gₓ = [ -2   0   2 ]
     [ -1   0   1 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Sobel X filter estimates intensity changes along the horizontal direction. It commonly highlights vertical edges in an image.&lt;/p&gt;

&lt;p&gt;The response is:&lt;br&gt;
&lt;strong&gt;Gₓ = Kₓ * I&lt;/strong&gt;&lt;br&gt;
Here, * denotes convolution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;E. Sobel Y filter&lt;/strong&gt;&lt;br&gt;
Kernel&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     [ -1  -2  -1 ]
Gᵧ = [  0   0   0 ]
     [  1   2   1 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Sobel Y filter estimates intensity changes along the vertical direction. It commonly highlights horizontal edges.&lt;br&gt;
The response is:&lt;br&gt;
&lt;strong&gt;Gᵧ = Kᵧ * I&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;F. Gradient magnitude filter&lt;/strong&gt;&lt;br&gt;
After calculating the Sobel X and Sobel Y responses, they can be combined to estimate the strength of an edge.&lt;br&gt;
&lt;strong&gt;G = √(Gₓ² + Gᵧ²)&lt;/strong&gt; &lt;br&gt;
Where:&lt;br&gt;
    &lt;strong&gt;Gₓ&lt;/strong&gt; is the horizontal gradient response.&lt;br&gt;
        &lt;strong&gt;Gᵧ&lt;/strong&gt; is the vertical gradient response.&lt;br&gt;
        &lt;strong&gt;G&lt;/strong&gt; is the gradient magnitude.&lt;br&gt;
Larger gradient magnitudes indicate stronger intensity changes, which often correspond to image edges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.4 Summary of common filters&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Filter&lt;/th&gt;
&lt;th&gt;Main purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Average blur&lt;/td&gt;
&lt;td&gt;Smooths an image and reduces small details.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large blur&lt;/td&gt;
&lt;td&gt;Produces stronger smoothing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sharpening&lt;/td&gt;
&lt;td&gt;Emphasizes details and local changes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sobel X&lt;/td&gt;
&lt;td&gt;Highlights predominantly vertical edges.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sobel Y&lt;/td&gt;
&lt;td&gt;Highlights predominantly horizontal edges.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gradient magnitude&lt;/td&gt;
&lt;td&gt;Combines edge responses to estimate edge strength.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;4. From Image Processing to Computer Vision&lt;/strong&gt;&lt;br&gt;
Traditional image-processing filters operate directly on pixel values. Modern computer-vision systems often use convolutional neural networks (CNNs), which learn useful filters from training data.&lt;br&gt;
Early network layers may learn edges and textures, while deeper layers combine these features into more complex patterns.&lt;br&gt;
Three important computer-vision tasks are image classification, object detection, and image segmentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.1 Image classification&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Question: What is in the image?&lt;/strong&gt;&lt;br&gt;
Image classification assigns one or more labels to an entire image.&lt;br&gt;
For example, a model might classify an image as:&lt;br&gt;
    A dog&lt;br&gt;
    A car&lt;br&gt;
    A building&lt;br&gt;
    A landscape&lt;br&gt;
Classification generally does not identify the precise location of each object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.2 Object detection&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Question:&lt;/strong&gt; What objects are present, and where are they located?&lt;br&gt;
Object detection identifies objects and estimates their locations, commonly using bounding boxes.&lt;br&gt;
For example, a traffic image might contain:&lt;br&gt;
                                       Three cars&lt;br&gt;
                                       Two pedestrians&lt;br&gt;
                                       One bicycle&lt;br&gt;
The model returns the object classes and their corresponding locations.&lt;br&gt;
&lt;strong&gt;4.3 Image segmentatio&lt;/strong&gt;n&lt;br&gt;
&lt;strong&gt;Question:&lt;/strong&gt; Which pixels belong to each object or region?&lt;br&gt;
Image segmentation assigns labels to individual pixels, allowing a computer to identify the precise regions occupied by objects.&lt;br&gt;
&lt;strong&gt;Two common forms are:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Semantic segmentation:&lt;/strong&gt; Assigns a class to every pixel, such as road, building, person, or vehicle.&lt;br&gt;
&lt;strong&gt;Instance segmentation:&lt;/strong&gt; Separates individual objects, including different objects belonging to the same class.&lt;br&gt;
For example, in a street photograph, segmentation can label the pixels belonging to roads, buildings, vehicles, and pedestrians.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.4 Comparing the three tasks&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Classification&lt;/td&gt;
&lt;td&gt;Image-level label&lt;/td&gt;
&lt;td&gt;"This is a street scene."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Object detection&lt;/td&gt;
&lt;td&gt;Labels and bounding boxes&lt;/td&gt;
&lt;td&gt;"There is a car at this location."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Segmentation&lt;/td&gt;
&lt;td&gt;Pixel-level labels or masks&lt;/td&gt;
&lt;td&gt;"These pixels belong to the car."&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The main difference is the level of spatial detail: classification identifies the overall content, detection locates objects, and segmentation identifies their regions at pixel level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. What I Learned&lt;/strong&gt;&lt;br&gt;
All of these things I learned about computer vision helped me understand how computers process and interpret images, from analyzing individual pixels and RGB colour channels to applying mathematical kernels and filters to extract useful visual information.&lt;br&gt;
Through these concepts and practical experiments, I learned how image filters can smooth images, sharpen details, and detect edges. I also understood the differences between image classification, object detection, and image segmentation, and how each technique helps computers understand visual information at a different level.&lt;br&gt;
Working with pretrained models also helped me recognize their limitations. I learned that models can produce incorrect predictions when an image contains information that differs from the patterns or categories learned during training. For this reason, confidence scores should not automatically be considered proof that a prediction is correct.&lt;br&gt;
Most importantly, this learning experience helped me connect mathematical concepts with practical applications. I realized that understanding computer vision requires not only learning the theory but also experimenting with real images, analyzing model outputs, and critically evaluating the results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Conclusion&lt;/strong&gt;&lt;br&gt;
Pixels and colour channels form the numerical foundation of digital images. RGB represents colour using red, green, and blue intensity values, while grayscale represents image intensity using a single channel.&lt;br&gt;
Kernels and filters apply mathematical operations to local groups of pixels. Blur filters smooth images, sharpening filters emphasize details, and Sobel filters estimate edge information.&lt;br&gt;
These fundamental operations help explain how computers process visual information. Building on this foundation, image classification identifies image content, object detection locates objects, and image segmentation assigns labels to individual pixels.&lt;br&gt;
Understanding these concepts provides a strong foundation for studying image processing, convolutional neural networks, and modern computer-vision applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. References&lt;/strong&gt; &lt;br&gt;
Gonzalez, R. C., &amp;amp; Woods, R. E. (2018). Digital image processing (4th ed.). Pearson.&lt;/p&gt;

&lt;p&gt;International Telecommunication Union. (2011). Studio encoding parameters of digital television for standard 4:3 and wide screen 16:9 aspect ratios (ITU-R Recommendation BT.601). &lt;a href="https://www.itu.int/rec/R-REC-BT.601" rel="noopener noreferrer"&gt;https://www.itu.int/rec/R-REC-BT.601&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sobel, I., &amp;amp; Feldman, G. (1968). A 3×3 isotropic gradient operator for image processing. Stanford Artificial Intelligence Project.&lt;/p&gt;

&lt;p&gt;Szeliski, R. (2022). Computer vision: Algorithms and applications (2nd ed.). Springer. &lt;a href="https://szeliski.org/Book/" rel="noopener noreferrer"&gt;https://szeliski.org/Book/&lt;/a&gt; &lt;/p&gt;

</description>
      <category>computervision</category>
      <category>ai</category>
      <category>python</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>From Words to Vectors: Understanding Word Embeddings with FastText</title>
      <dc:creator>Marie Claire Uwiringiyimana</dc:creator>
      <pubDate>Wed, 30 Sep 2026 13:04:30 +0000</pubDate>
      <link>https://dev.to/marie_claireuwiringiyima/from-words-to-vectors-understanding-word-embeddings-with-fasttext-7no</link>
      <guid>https://dev.to/marie_claireuwiringiyima/from-words-to-vectors-understanding-word-embeddings-with-fasttext-7no</guid>
      <description>&lt;p&gt;When I started learning Natural Language Processing (NLP), one question I had was, "How can a computer work with words when computers understand numbers better than human language?"&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;word embeddings&lt;/strong&gt; come in. Word embeddings are a way of representing words as numerical vectors. Instead of giving a machine only the word "cat," we represent it using a list of numbers. These numbers allow machine-learning models to work with words mathematically and learn relationships between them [1].&lt;/p&gt;

&lt;p&gt;For example, a word could have a representation like&lt;/p&gt;

&lt;p&gt;cat → [0.21, 0.45, -0.13, 0.72, ...]&lt;/p&gt;

&lt;p&gt;A real embedding can contain hundreds of numbers. The important thing is not what one individual number means, but the position of the whole vector in the vector space. Words that have similar meanings or are used in similar contexts can have similar vector representations [1].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Do Word Embeddings Matter?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before learning about embeddings, I looked at one-hot encoding. With one-hot encoding, every word is represented using a vector containing mostly zeros and one value of 1.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;cat → [1, 0, 0]&lt;br&gt;
dog → [0, 1, 0]&lt;br&gt;
banana → [0, 0, 1]&lt;/p&gt;

&lt;p&gt;This tells the computer that the words are different, but it does not show that "cat" and "dog" are more related than "cat" and "banana."&lt;/p&gt;

&lt;p&gt;Word embeddings provide a better representation because they can learn relationships between words from how those words are used in text. They also use dense vectors with fewer dimensions than a vocabulary-sized one-hot representation, making them more useful for machine-learning applications [1].&lt;/p&gt;

&lt;p&gt;This is important for NLP tasks such as text classification, sentiment analysis, search, machine translation, and other applications that need numerical representations of language [1].&lt;/p&gt;

&lt;p&gt;A famous example of relationships captured by word embeddings is:&lt;/p&gt;

&lt;p&gt;king - man + woman ≈ queen&lt;/p&gt;

&lt;p&gt;This does not mean that every embedding model will produce this exact result, but it shows how vector representations can capture useful relationships between words [2].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Embedding Method I Chose: FastText&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FastText is based on the skip-gram approach and extends the idea of word embeddings by using subword information. Instead of looking at a word only as a complete unit, FastText also represents a word using character n-grams [3].&lt;/p&gt;

&lt;p&gt;A character n-gram is simply a group of consecutive characters.&lt;/p&gt;

&lt;p&gt;For example, parts of:&lt;/p&gt;

&lt;p&gt;playing&lt;/p&gt;

&lt;p&gt;can include:&lt;/p&gt;

&lt;p&gt;pla&lt;br&gt;
lay&lt;br&gt;
ayi&lt;br&gt;
yin&lt;br&gt;
ing&lt;/p&gt;

&lt;p&gt;The exact n-grams depend on the model settings.&lt;/p&gt;

&lt;p&gt;This is useful because related words often share parts of their spelling:&lt;/p&gt;

&lt;p&gt;play&lt;br&gt;
played&lt;br&gt;
playing&lt;br&gt;
player&lt;br&gt;
plays&lt;/p&gt;

&lt;p&gt;FastText can learn information from these shared character patterns. This is especially useful for rare words and words that were not directly seen during training [3].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Python Experiment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used the gensim Python library to train a small FastText model on a few example sentences. The model was configured with 100-dimensional word vectors, a context window of 3, and the Skip-gram approach.&lt;/p&gt;

&lt;p&gt;After training, I used most_similar() to find the words closest to “playing”. In my experiment, “plays” had the highest similarity score, followed by “played”, “love”, “scored”, and “player”. The similarity scores show how close their learned vector representations are.&lt;/p&gt;

&lt;p&gt;I also inspected the vector generated for “playing”. The model represents the word as a list of numerical values rather than as text. Since I used vector_size=100, the complete representation contains 100 values.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Found Interesting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I then tested “playingly”, a word that was not included in my original training sentences. FastText was still able to generate a vector for it. This helped me understand one of the main advantages of FastText: it uses character n-grams (subword information) to build word representations. This means the model can make use of parts of a word, even when the complete word was not seen during training [3][4].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The screenshots below show the actual code and outputs from my Jupyter Notebook.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F75b1bt6le64ywfqaxulq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F75b1bt6le64ywfqaxulq.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp0orp97vgbb65ozdst7y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp0orp97vgbb65ozdst7y.png" alt=" " width="800" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;            **Figure 1**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;What I Learned&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before working with embeddings, I thought a vector was simply a list of numbers and did not understand how those numbers could represent language.&lt;/p&gt;

&lt;p&gt;One thing I learned is that we should not try to give every individual number a specific human meaning. The whole vector is what matters.&lt;/p&gt;

&lt;p&gt;I also initially found character n-grams confusing. I was thinking about words as complete units, but FastText showed me that words can also be understood through smaller pieces. For example, words such as "play," "played," "playing," and "player" share many character patterns.&lt;/p&gt;

&lt;p&gt;This made me understand why FastText can be useful for languages and datasets containing rare words, different word forms, or words that may not appear frequently in the training data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Word embeddings provide a way to connect human language with machine learning by representing words as numerical vectors. Instead of treating every word as completely independent, embeddings can capture relationships based on how words are used.&lt;/p&gt;

&lt;p&gt;FastText extends this idea by using character n-grams, allowing it to learn from smaller parts of words. My small Python experiment helped me see this concept in practice rather than only reading about it.&lt;/p&gt;

&lt;p&gt;My main takeaway is simple:&lt;/p&gt;

&lt;p&gt;Words&lt;br&gt;
  ↓&lt;br&gt;
Context + subword information&lt;br&gt;
  ↓&lt;br&gt;
Numerical vectors&lt;br&gt;
  ↓&lt;br&gt;
Compare relationships.&lt;br&gt;
  ↓&lt;br&gt;
NLP applications&lt;/p&gt;

&lt;p&gt;For me, the biggest lesson was that word embeddings are not just about converting words into numbers. They are about creating numerical representations that allow machines to work with relationships in language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;[1] IBM. What Are Word Embeddings?&lt;/p&gt;

&lt;p&gt;[2] Mikolov, T., Chen, K., Corrado, G., &amp;amp; Dean, J. (2013). Efficient Estimation of Word Representations in Vector Space.&lt;/p&gt;

&lt;p&gt;[3] Bojanowski, P., Grave, E., Joulin, A., &amp;amp; Mikolov, T. (2017). Enriching Word Vectors with Subword Information.&lt;/p&gt;

&lt;p&gt;[4] Gensim Documentation. FastText Model and Similarity Operations.&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>machinelearning</category>
      <category>python</category>
    </item>
    <item>
      <title>word embedding project</title>
      <dc:creator>Marie Claire Uwiringiyimana</dc:creator>
      <pubDate>Wed, 30 Sep 2026 12:33:06 +0000</pubDate>
      <link>https://dev.to/marie_claireuwiringiyima/word-embedding-project-1jao</link>
      <guid>https://dev.to/marie_claireuwiringiyima/word-embedding-project-1jao</guid>
      <description>&lt;p&gt;w&lt;/p&gt;

</description>
    </item>
    <item>
      <title>word embedding project</title>
      <dc:creator>Marie Claire Uwiringiyimana</dc:creator>
      <pubDate>Wed, 30 Sep 2026 09:45:03 +0000</pubDate>
      <link>https://dev.to/marie_claireuwiringiyima/word-embedding-project-26jn</link>
      <guid>https://dev.to/marie_claireuwiringiyima/word-embedding-project-26jn</guid>
      <description></description>
    </item>
  </channel>
</rss>
