<?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: Joy</title>
    <description>The latest articles on DEV Community by Joy (@joy_1o1).</description>
    <link>https://dev.to/joy_1o1</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%2F4151835%2F885b57f1-4ce8-45f3-8280-75dbd4eb19c8.jpg</url>
      <title>DEV Community: Joy</title>
      <link>https://dev.to/joy_1o1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joy_1o1"/>
    <language>en</language>
    <item>
      <title>Exploring Other Large Language Models for Improving Kinyarwanda Text Generation</title>
      <dc:creator>Joy</dc:creator>
      <pubDate>Mon, 26 Oct 2026 16:46:02 +0000</pubDate>
      <link>https://dev.to/joy_1o1/exploring-other-large-language-models-for-improving-kinyarwanda-text-generation-514p</link>
      <guid>https://dev.to/joy_1o1/exploring-other-large-language-models-for-improving-kinyarwanda-text-generation-514p</guid>
      <description>&lt;h1&gt;
  
  
  Choosing the Best Open-Source Model for Text Generation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Text generation is an important task in Natural Language Processing (NLP). It allows computers to generate text from a prompt. For example, when we write “The people of Kicukiro say”, a language model can predict what words should come next.&lt;/p&gt;

&lt;p&gt;In our project, we studied GPT-2 and compared it with a tiny GPT model that our group built from scratch. Our tiny GPT was trained on Kinyarwanda news from the KINNEWS dataset.&lt;/p&gt;

&lt;p&gt;Our experiments showed that GPT-2 can generate fluent English, but it struggles to continue a sentence correctly in Kinyarwanda. Our tiny GPT generates text that looks more like Kinyarwanda, but its sentences do not always make sense.&lt;/p&gt;

&lt;p&gt;GPT-2 has 124 million parameters and was trained mainly on English text. Our tiny GPT has about 0.82 million parameters and was trained on approximately 24 million characters of Kinyarwanda news. This showed us that both model size and training data are important for text generation.&lt;/p&gt;

&lt;p&gt;The next step is to find a better language model that can generate useful text and follow instructions. In this blog, I compare four open-weight models and choose the one that is most suitable for improving our project.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Models We Considered
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Model 1: Qwen3-4B-Instruct-2507
&lt;/h3&gt;

&lt;p&gt;Qwen3-4B-Instruct-2507 was developed by the Qwen team at Alibaba. It has 4 billion parameters and supports a context length of up to 262,144 tokens. It uses the Apache 2.0 licence.&lt;/p&gt;

&lt;p&gt;This model is designed to follow instructions, understand text, and generate helpful responses. It also has multilingual capabilities and can handle many different tasks.&lt;/p&gt;

&lt;p&gt;One advantage is that it does not require a separate thinking mode to generate its answers. This makes its output easier to use when we want a direct response.&lt;/p&gt;

&lt;p&gt;However, it is larger than our original GPT-2 model, so it needs more memory and computing power. We also need to test its Kinyarwanda output instead of assuming that it will always generate correct Kinyarwanda.&lt;/p&gt;

&lt;h3&gt;
  
  
  Model 2: Qwen3-1.7B
&lt;/h3&gt;

&lt;p&gt;Qwen3-1.7B is another model from Alibaba's Qwen team. It has approximately 1.7 billion parameters and uses the Apache 2.0 licence. Its standard context length is around 32,768 tokens.&lt;/p&gt;

&lt;p&gt;Its main advantage is its smaller size compared with Qwen3-4B. This can make it easier to run and faster to test on a computer with limited memory.&lt;/p&gt;

&lt;p&gt;It can follow instructions and generate text, making it useful for small NLP applications. However, its smaller size may affect the quality of some responses.&lt;/p&gt;

&lt;p&gt;This model would be a good choice if our main concern was reducing memory use. We would still need to compare its Kinyarwanda generation with the output from the larger model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Model 3: Llama 3.2-3B-Instruct
&lt;/h3&gt;

&lt;p&gt;Llama 3.2-3B-Instruct was developed by Meta. It has approximately 3 billion parameters and a context length of up to 128,000 tokens. It uses the Llama 3.2 Community Licence.&lt;/p&gt;

&lt;p&gt;This model is designed for tasks such as text generation, summarisation, and following instructions. It is relatively small compared with many larger language models.&lt;/p&gt;

&lt;p&gt;One advantage is that it can generate conversational text and follow user instructions. However, its licence has specific terms, and access to its model files may require accepting Meta's conditions. Its officially supported languages also do not include Kinyarwanda.&lt;/p&gt;

&lt;p&gt;This means it is worth considering, but its licence and language limitations make it less convenient for our project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Model 4: SmolLM3-3B
&lt;/h3&gt;

&lt;p&gt;SmolLM3-3B was developed by Hugging Face and its contributors. It has approximately 3 billion parameters and supports a standard context length of 65,536 tokens, with extensions available for longer contexts. It uses the Apache 2.0 licence.&lt;/p&gt;

&lt;p&gt;The model is designed for instruction following, text generation, and reasoning. It is also released with information about its training process, which makes it interesting for learning and research.&lt;/p&gt;

&lt;p&gt;Its size makes it a possible option for running on a GPU with limited memory. However, its documented multilingual support focuses on six languages: English, French, Spanish, German, Italian, and Portuguese. Kinyarwanda is not among them.&lt;/p&gt;

&lt;p&gt;For our project, we would need to test whether it produces useful Kinyarwanda text before choosing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Comparison Table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Developer&lt;/th&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;th&gt;Context length&lt;/th&gt;
&lt;th&gt;Licence&lt;/th&gt;
&lt;th&gt;Main strength&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3-4B-Instruct-2507&lt;/td&gt;
&lt;td&gt;Alibaba Qwen team&lt;/td&gt;
&lt;td&gt;4B&lt;/td&gt;
&lt;td&gt;262,144 tokens&lt;/td&gt;
&lt;td&gt;Apache 2.0&lt;/td&gt;
&lt;td&gt;Instruction following and multilingual text generation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3-1.7B&lt;/td&gt;
&lt;td&gt;Alibaba Qwen team&lt;/td&gt;
&lt;td&gt;1.7B&lt;/td&gt;
&lt;td&gt;32,768 tokens&lt;/td&gt;
&lt;td&gt;Apache 2.0&lt;/td&gt;
&lt;td&gt;Smaller size and lower memory needs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Llama 3.2-3B-Instruct&lt;/td&gt;
&lt;td&gt;Meta&lt;/td&gt;
&lt;td&gt;3B&lt;/td&gt;
&lt;td&gt;128,000 tokens&lt;/td&gt;
&lt;td&gt;Llama Community Licence&lt;/td&gt;
&lt;td&gt;Conversational text and instruction following&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SmolLM3-3B&lt;/td&gt;
&lt;td&gt;Hugging Face and contributors&lt;/td&gt;
&lt;td&gt;3B&lt;/td&gt;
&lt;td&gt;65,536 tokens by default&lt;/td&gt;
&lt;td&gt;Apache 2.0&lt;/td&gt;
&lt;td&gt;Efficient text generation and transparent training details&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Context lengths are the models' documented limits. A longer context does not automatically mean better text generation.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The Model Chosen
&lt;/h2&gt;

&lt;p&gt;I would choose &lt;strong&gt;Qwen3-4B-Instruct-2507&lt;/strong&gt; to improve our text-generation project.&lt;/p&gt;

&lt;p&gt;The first reason is its instruction-following ability. We want a model that can receive a prompt and generate a response in the requested format. For example, we could ask it to continue a Kinyarwanda news sentence, produce a short news paragraph, or rewrite text more clearly.&lt;/p&gt;

&lt;p&gt;The second reason is its multilingual capability. Our notebook showed that GPT-2 struggles with Kinyarwanda partly because its tokenizer breaks many Kinyarwanda words into smaller pieces. The Kinyarwanda example required about 1.7 times as many tokens as the English example. Qwen3 may handle this task better, but we must test it because multilingual support does not guarantee accurate Kinyarwanda.&lt;/p&gt;

&lt;p&gt;The third reason is that it uses the Apache 2.0 licence and its Hugging Face model page provides access to the model files without the gated-access process required by some other models. We can load it directly in a notebook rather than depending on a paid text-generation API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can it run on free Google Colab?
&lt;/h3&gt;

&lt;p&gt;Qwen3-4B-Instruct-2507 is a realistic model to test on a free Google Colab T4 GPU with 16 GB of GPU memory. Its 4-billion-parameter size makes local inference more practical than using a much larger model. The exact memory use depends on the precision, context length, and generation settings.&lt;/p&gt;

&lt;p&gt;For our first test, we should use a moderate prompt length and generate a limited number of new tokens. If memory becomes a problem, we can try a quantized version.&lt;/p&gt;

&lt;p&gt;The model itself does not require a paid API key. However, free Colab GPU access is not guaranteed at all times, and Colab still requires a Google account. We should also check the model's licence terms before using it in a published application.&lt;/p&gt;

&lt;h3&gt;
  
  
  How will it improve our project?
&lt;/h3&gt;

&lt;p&gt;We can compare Qwen3 with GPT-2 and our tiny GPT using the same Kinyarwanda prompts. For example, we can use the prompt:&lt;/p&gt;

&lt;p&gt;"Abaturage bo mu Kicukiro bavuga ko..."&lt;/p&gt;

&lt;p&gt;We can then compare the generated text for language quality, sentence meaning, grammar, repetition, and whether it follows the prompt.&lt;/p&gt;

&lt;p&gt;We should keep the prompts and generation settings as similar as possible. We can also test English prompts to compare performance across languages.&lt;/p&gt;

&lt;p&gt;Our tiny GPT is still valuable because it helps us understand how a transformer works and how training data affects the results. Qwen3 would be an additional model for comparison, not a replacement for the lessons we learned from building our own model.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Conclusion
&lt;/h2&gt;

&lt;p&gt;Our experiments showed that generating text is not only about having a large model. The model's training data, tokenizer, and ability to follow instructions also affect the result.&lt;/p&gt;

&lt;p&gt;Qwen3-4B-Instruct-2507 is my preferred option because it combines a manageable model size, instruction following, multilingual capabilities, and an Apache 2.0 licence. It is also practical to test on a free Colab T4 GPU, although actual memory use must be checked.&lt;/p&gt;

&lt;p&gt;Most importantly, we should not assume that it will automatically produce perfect Kinyarwanda. We need to test it with real Kinyarwanda prompts and compare the results with GPT-2 and our tiny GPT. These tests will help us decide whether it is a useful improvement for our project.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;OpenAI. &lt;em&gt;Language Models are Unsupervised Multitask Learners&lt;/em&gt; (2019). &lt;a href="https://openai.com/index/better-language-models/" rel="noopener noreferrer"&gt;https://openai.com/index/better-language-models/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Qwen Team. &lt;em&gt;Qwen3-4B-Instruct-2507 model card&lt;/em&gt;. Hugging Face. &lt;a href="https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507" rel="noopener noreferrer"&gt;https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Qwen Team. &lt;em&gt;Qwen3-1.7B model card&lt;/em&gt;. Hugging Face. &lt;a href="https://huggingface.co/Qwen/Qwen3-1.7B" rel="noopener noreferrer"&gt;https://huggingface.co/Qwen/Qwen3-1.7B&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Meta. &lt;em&gt;Llama 3.2 model card and licence information&lt;/em&gt;. &lt;a href="https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/MODEL_CARD.md" rel="noopener noreferrer"&gt;https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/MODEL_CARD.md&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hugging Face. &lt;em&gt;SmolLM3-3B model card&lt;/em&gt;. &lt;a href="https://huggingface.co/HuggingFaceTB/SmolLM3-3B" rel="noopener noreferrer"&gt;https://huggingface.co/HuggingFaceTB/SmolLM3-3B&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hugging Face. &lt;em&gt;Transformers documentation&lt;/em&gt;. &lt;a href="https://huggingface.co/docs/transformers" rel="noopener noreferrer"&gt;https://huggingface.co/docs/transformers&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Vaswani, A. et al. &lt;em&gt;Attention Is All You Need&lt;/em&gt; (2017). &lt;a href="https://arxiv.org/abs/1706.03762" rel="noopener noreferrer"&gt;https://arxiv.org/abs/1706.03762&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>nlp</category>
      <category>textgeneration</category>
      <category>llm</category>
      <category>generativeai</category>
    </item>
    <item>
      <title>What I Learned in My First Computer Vision Class: How a Computer Sees</title>
      <dc:creator>Joy</dc:creator>
      <pubDate>Tue, 13 Oct 2026 12:41:15 +0000</pubDate>
      <link>https://dev.to/joy_1o1/what-i-learned-in-my-first-computer-vision-class-how-a-computer-sees-hd4</link>
      <guid>https://dev.to/joy_1o1/what-i-learned-in-my-first-computer-vision-class-how-a-computer-sees-hd4</guid>
      <description>&lt;p&gt;This week I learned about computer vision. I knew nothing about it before. In this post I share what I learned in simple words. I hope it helps other beginners too.&lt;/p&gt;

&lt;h2&gt;
  
  
  A computer does not see a picture. It sees numbers.
&lt;/h2&gt;

&lt;p&gt;When I look at a photo, I know what it is in one second. A computer cannot do this. It only sees numbers.&lt;/p&gt;

&lt;p&gt;A photo is made of small squares called &lt;strong&gt;pixels&lt;/strong&gt;. Each pixel has three numbers: red, green and blue. Each number goes from 0 (none) to 255 (full). So a photo with 400 rows and 600 columns has 400 × 600 × 3 = &lt;strong&gt;720,000 numbers&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the notebook, I looked at one pixel from the photo. It was &lt;code&gt;[106, 99, 91]&lt;/code&gt;. The three numbers are close to each other and not very high, so the colour is a dark grey. Another pixel was &lt;code&gt;[4, 16, 40]&lt;/code&gt;. The numbers are very small, so it is almost black.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filters help the computer find edges
&lt;/h2&gt;

&lt;p&gt;An &lt;strong&gt;edge&lt;/strong&gt; is a place where dark suddenly changes to bright, like the side of a bus.&lt;/p&gt;

&lt;p&gt;To find edges, we use a &lt;strong&gt;filter&lt;/strong&gt;. A filter is a small grid of numbers called &lt;strong&gt;weights&lt;/strong&gt;. You put it on top of the pixels, multiply each pixel by its weight, and add all the results. For example, the Sobel filter is:&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
-2  0  2
-1  0  1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It does "right side minus left side". If both sides are the same, the answer is 0, so there is no edge. If the left side is dark and the right side is bright, the answer is big, so there is an edge.&lt;/p&gt;

&lt;p&gt;I also tried a blur filter. It has 25 weights of 0.04, so it takes the average of 25 pixels and makes the photo soft.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;blur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ones&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;
&lt;span class="n"&gt;sobel_x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CNN: the computer learns its own filters
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;CNN&lt;/strong&gt; (Convolutional Neural Network) does not use filters that a person writes. It starts with random weights, makes a guess, and checks the right answer. Then it changes the weights a little. After thousands of photos, it finds good filters by itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three main tasks
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Classification:&lt;/strong&gt; one name for the whole photo&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Detection:&lt;/strong&gt; a box around each object&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Segmentation:&lt;/strong&gt; a label for every pixel&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I tried all three with a small YOLO model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Classification.&lt;/strong&gt; On a sample photo of two men, the model said "suit" with only 34.7%. It cannot say "two people", because it can only choose from 1,000 names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Detection.&lt;/strong&gt; On a bus photo, the model found 1 bus and 4 people. There is a setting called &lt;code&gt;conf&lt;/code&gt;, the confidence threshold. With &lt;code&gt;conf=0.9&lt;/code&gt; I got only the bus. The people disappeared, because the model was less than 90% sure about them. With a low threshold I get more boxes, but some can be wrong. This is the same problem as in medical screening: too many false alarms, or too many missed cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Segmentation.&lt;/strong&gt; The model made a mask for every object. I counted the pixels: the bus had 92,230 pixels, and the stop sign only 644. Segmentation can tell me how much of the photo each object covers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing with my own photos
&lt;/h2&gt;

&lt;p&gt;This was my favourite part. I tested two photos from the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A miss: ibiraha.&lt;/strong&gt; Ibiraha is a street food in Rwanda. The model said &lt;strong&gt;"pineapple"&lt;/strong&gt; [91.9%]. The food is golden and has many pointy corners, so the model thought it looked like a pineapple. The model has never seen ibiraha, and it cannot say "I don't know". It must choose one of its 1,000 names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A hit: a street in Kigali.&lt;/strong&gt; In this photo there are motorbikes, cars and people in daylight. The detector found [person,motorcycle, car]. These are things the model saw many times in training.&lt;/p&gt;

&lt;h2&gt;
  
  
  When models fail
&lt;/h2&gt;

&lt;p&gt;A model only knows what it was trained on. To test this, I made my Kigali street photo harder in four ways. Then I ran the detector on each version.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Objects found&lt;/th&gt;
&lt;th&gt;People found&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Original&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very dark&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Upside down&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Low resolution&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Blurry&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;What I saw:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The original photo gave 8 objects and 4 people. This is a good result.&lt;/li&gt;
&lt;li&gt;In the dark photo, the model lost some objects, but it still found most of them.&lt;/li&gt;
&lt;li&gt;The upside down, low resolution and blurry photos gave &lt;strong&gt;0 objects&lt;/strong&gt;. The model found nothing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt; Upside down photos have the same pixels, but the model never saw streets in this position in training. In the low resolution and blurry photos, the edges and small details are gone, and the model needs them to recognise cars and people.&lt;/p&gt;

&lt;p&gt;This is a real problem. Cheap phone cameras, dusty lenses and bad light are common in many places in Africa. A model trained only on clear photos can fail there.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;A computer sees only numbers. A filter helps to find patterns in them.&lt;/li&gt;
&lt;li&gt;A model only knows what it was trained on.&lt;/li&gt;
&lt;li&gt;A high confidence does not mean the answer is correct.&lt;/li&gt;
&lt;li&gt;Local data matters. A model trained on photos from other countries can fail on our food, roads and crops.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is why computer vision for Africa needs African data. For my next step, I want to collect about 100 photos of Rwandan food and train a small model that knows ibiraha.&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>computervision</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>I Tried to Teach a Computer "Apple" (It Thought It Was a Fruit, an iPhone, and a Vector)</title>
      <dc:creator>Joy</dc:creator>
      <pubDate>Wed, 30 Sep 2026 12:37:57 +0000</pubDate>
      <link>https://dev.to/joy_1o1/i-tried-to-teach-a-computer-apple-it-thought-it-was-a-fruit-an-iphone-and-a-vector-3bhj</link>
      <guid>https://dev.to/joy_1o1/i-tried-to-teach-a-computer-apple-it-thought-it-was-a-fruit-an-iphone-and-a-vector-3bhj</guid>
      <description>&lt;p&gt;Hello, DEV Community! 🙌 It’s my first time writing here. &lt;/p&gt;

&lt;p&gt;As I was studying how models handle text today, I ran into a funny realization: &lt;strong&gt;computers don't understand human words at all. They only understand numbers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So how do we explain to a model that a cat is a pet, an apple can be a fruit or a tech company?&lt;/p&gt;

&lt;p&gt;Here is what I learned today about &lt;strong&gt;Word Embedding&lt;/strong&gt;, explained from a pure logic and geometry perspective!&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The First step: Making a Massive List(One-Hot Encoding)
&lt;/h2&gt;

&lt;p&gt;If you ask a beginner programmer how to turn words into numbers, the most obvious idea is to give every single word a simple code or an index in a giant list. &lt;/p&gt;

&lt;p&gt;Imagine taking an entire dictionary of 100,000 words and marking &lt;code&gt;1&lt;/code&gt; for the word you want and &lt;code&gt;0&lt;/code&gt; for everything else.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cat&lt;/code&gt; = &lt;code&gt;[1, 0, 0, 0, ...]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dog&lt;/code&gt; = &lt;code&gt;[0, 1, 0, 0, ...]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apple&lt;/code&gt; = &lt;code&gt;[0, 0, 1, 0, ...]&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why this fails:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;It Wastes Endless Space:&lt;/strong&gt; You end up creating massive arrays full of useless zeros just to represent one tiny word. RIP RAM. 🪦&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Computers Got Zero "Street Smarts":&lt;/strong&gt; In pure math, these simple list positions have nothing in common. To the computer, &lt;code&gt;cat&lt;/code&gt; has as much in common with &lt;code&gt;dog&lt;/code&gt; as it does with &lt;code&gt;banana&lt;/code&gt;. It has no idea that two animals belong together.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  2. The Solution: Giving Words Map Coordinates
&lt;/h2&gt;

&lt;p&gt;Instead of a giant empty list, researchers like Mikolov et al. at Google introduced &lt;strong&gt;Word Embedding&lt;/strong&gt; (such as Word2Vec and GloVe).&lt;/p&gt;

&lt;p&gt;Think of it like plotting points on a map. In physics or math class, you plot points using X, Y, and Z coordinates. Word embedding does the exact same thing, except instead of 3 directions, they use 50 to 300 invisible dimensions!&lt;/p&gt;

&lt;p&gt;These dimensions represent hidden concepts like &lt;em&gt;is_animal&lt;/em&gt;, &lt;em&gt;is_food&lt;/em&gt;, &lt;em&gt;is_tech&lt;/em&gt;, or &lt;em&gt;grammatical_type&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"cat"&lt;/strong&gt; gets coordinates near animal concepts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"dog"&lt;/strong&gt; gets coordinates right next to "cat".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"apple"&lt;/strong&gt; gets pulled into a coordinate spot sitting right in between the fruit neighborhood and the iPhone neighborhood!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How does the computer learn these coordinates? By sliding a "context window" across millions of sentences on the internet. It observes which words consistently live as neighbors in the same sentences so if words appear in similar contexts, they get pulled toward the same coordinates in vector space.&lt;/p&gt;

&lt;p&gt;Because the computer reads millions of sentences, it notices which words "live" in the same neighborhoods.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Math Geometry Magic
&lt;/h2&gt;

&lt;p&gt;Because every word becomes a point in space, we can measure how close two words are by calculating the angle or distance between their points. &lt;/p&gt;

&lt;p&gt;If two words point in nearly the exact same direction, they share similar meanings!&lt;/p&gt;

&lt;h3&gt;
  
  
  Doing Algebra with Words
&lt;/h3&gt;

&lt;p&gt;My discovery today was that you can actually do math equations with word coordinates:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;King - Man + Woman = Queen&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This famous vector arithmetic concept was demonstrated in the original Word2Vec paper by Mikolov et al. (2013)."&lt;/p&gt;

&lt;p&gt;If you start at the coordinate for &lt;strong&gt;King&lt;/strong&gt;, subtract the "male" direction, and add the "female" direction, your new coordinate in space lands right on &lt;strong&gt;Queen&lt;/strong&gt;. 🤯&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Learning that word embedding are just coordinate maps helped me bridge the gap between machine language (a.k.a  math) and human language. &lt;/p&gt;

&lt;h2&gt;
  
  
  In any case, word embedding are nothing but high dimensional maps that make words street-smart. The idea of understanding text via coordinates really clicked with me!
&lt;/h2&gt;

&lt;h2&gt;
  
  
  References &amp;amp; Further Reading
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mikolov, T., Chen, K., Corrado, G., &amp;amp; Dean, J. (2013).&lt;/strong&gt; &lt;em&gt;Efficient Estimation of Word Representations in Vector Space.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/1301.3781" rel="noopener noreferrer"&gt;arXiv:1301.3781&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pennington, J., Socher, R., &amp;amp; Manning, C. D. (2014).&lt;/strong&gt; &lt;em&gt;GloVe: Global Vectors for Word Representation.&lt;/em&gt; &lt;a href="https://nlp.stanford.edu/projects/glove/" rel="noopener noreferrer"&gt;Stanford NLP&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alammar, J. (2019).&lt;/strong&gt; &lt;em&gt;The Illustrated Word2Vec.&lt;/em&gt; &lt;a href="https://jalammar.github.io/illustrated-word2vec/" rel="noopener noreferrer"&gt;jalammar.github.io&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>machinelearning</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
