<?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 Dyna Joshy on Medium]]></title>
        <description><![CDATA[Stories by Dyna Joshy on Medium]]></description>
        <link>https://medium.com/@joshydyna?source=rss-6ec701225235------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*G0s63foboejfGbDn3Mt3bw.jpeg</url>
            <title>Stories by Dyna Joshy on Medium</title>
            <link>https://medium.com/@joshydyna?source=rss-6ec701225235------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:11:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joshydyna/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[Why Small Language Models (SLMs) Are the Future]]></title>
            <link>https://medium.com/@joshydyna/why-small-language-models-slms-are-the-future-6c152910ff5c?source=rss-6ec701225235------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c152910ff5c</guid>
            <category><![CDATA[natural-language]]></category>
            <category><![CDATA[small-language-model]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Dyna Joshy]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 15:05:03 GMT</pubDate>
            <atom:updated>2026-08-12T15:05:03.104Z</atom:updated>
            <content:encoded><![CDATA[<p>If the past few years were defined by the race to build the biggest, most monolithic Large Language Models (LLMs) possible, 2026 is rapidly becoming the year of the <strong>Small Language Model (SLM)</strong>.</p><p>While hundred-billion-parameter behemoths like GPT-4 grab the mainstream headlines, a quiet revolution is happening in enterprise tech.</p><p>Engineering teams, startup founders, and data scientists are realizing a crucial truth: you<strong> do not</strong> need a model that has read the entire internet just to extract invoice data, analyze sentiment, or run a customer service chatbot.</p><p>Companies are actively pivoting away from massive, generalized cloud models. Instead, they are turning to lean, highly optimized SLMs like Meta’s <strong>Llama 3 8B</strong> and Microsoft’s <strong>Phi-3</strong> can be fine-tuned and run entirely locally.</p><p>Here is why the future of practical AI is getting smaller, faster, and remarkably more focused.</p><h3>1. The Cost and Compute Crisis</h3><p>LLMs are prohibitively expensive to operate at scale. They require massive clusters of high-end GPUs (like H100s) and rely heavily on cloud-based inference, which introduces ongoing token-based fees and heavy bandwidth overhead.</p><p>SLMs, which typically sit comfortably under the 10-billion parameter mark, flip this economic model on its head.</p><ul><li><strong>Local Execution:</strong> Models like Phi-3 (which has variations as small as 3.8 billion parameters) are so efficient that they can run locally on a consumer-grade laptop, a smartphone or an edge device.</li><li><strong>Reduced Latency:</strong> By removing the round-trip API call to a hyperscaler cloud, SLMs offer near-instantaneous inference which is a critical requirement for real-time applications like autonomous agents and wearable tech.</li><li><strong>Predictable Budgets:</strong> Running a fine-tuned SLM on your own infrastructure means no surprise API bills at the end of the month.</li></ul><h3>2. The Data Privacy Mandate</h3><p>For industries handling highly sensitive data like healthcare, finance, and legal services sending proprietary information to a third-party API is a massive compliance risk.</p><p>By utilizing open-weight SLMs, companies can achieve “air-gapped AI.” A fine-tuned Llama 3 8B model can be deployed on a company’s secure, on-premises servers. This means customer PII, internal codebases, and financial records never leave the organization’s firewall.</p><h3>3. Specialists vs. Generalists</h3><p>LLMs are built to be generalists. They can write a poem about a toaster in the style of Shakespeare, translate ancient Greek, and debug Python code. But most businesses don’t need a polymath; they need a specialist.</p><p>When a 7-billion parameter SLM is highly fine-tuned on high-quality, domain-specific data, it can match and sometimes even exceed the performance of a massive LLM on that specific task. Whether it is categorizing medical symptoms or parsing legal contracts, a specialized SLM is vastly more efficient than a generalized giant.</p><figure><img alt="SLMs explained" src="https://cdn-images-1.medium.com/max/1024/1*UhqHFIrjlM8qnZomNt7ASg.png" /><figcaption>SLMs explained</figcaption></figure><h3>Running an SLM Locally</h3><p>To see exactly why developers love these smaller models, here is a practical Python example.</p><p>Using the Hugging Face transformers library, you can download Microsoft&#39;s Phi-3, load it into local memory using optimized data types (like bfloat16), and run a domain-specific extraction task—all without making a single external API call.</p><pre># 1. Define the Small Language Model<br># Phi-3-mini is a highly capable ~3.8B parameter model perfect for local execution<br>model_id = &quot;microsoft/Phi-3-mini-4k-instruct&quot;<br><br># 2. Load the tokenizer and model<br>tokenizer = AutoTokenizer.from_pretrained(model_id)<br># We use bfloat16 to reduce memory footprint, allowing it to easily fit on a consumer GPU<br>model = AutoModelForCausalLM.from_pretrained(<br>    model_id, <br>    torch_dtype=torch.bfloat16, <br>    device_map=&quot;auto&quot;,<br>    trust_remote_code=True<br>)<br><br># 3. Create a lightweight inference pipeline<br>slm_pipeline = pipeline(<br>    &quot;text-generation&quot;, <br>    model=model, <br>    tokenizer=tokenizer<br>)<br><br># 4. Construct a Domain-Specific Prompt<br># SLMs thrive when given highly specific, narrow instructions<br>prompt = &quot;&quot;&quot;<br>You are an expert financial extraction tool. Extract the company name and revenue from the text. Format the output as JSON.<br>In Q3, Horizon Tech reported a stellar revenue of $4.2 million, exceeding expectations despite market headwinds.<br>&quot;&quot;&quot;<br><br># 5. Run inference<br>output = slm_pipeline(<br>    prompt, <br>    max_new_tokens=50, <br>    return_full_text=False,<br>    temperature=0.1 # Low temperature for highly deterministic, factual output<br>)<br>print(&quot;\n--- Model Output ---&quot;)<br>print(output[0][&#39;generated_text&#39;].strip())</pre><p>The era of “bigger is always better” is ending. As we move deeper into the age of integrated AI, the winners will not necessarily be those who rent the largest models, but those who strategically deploy the smartest, fastest and most secure ones.</p><p>The future of AI isn’t just massive server farms; it is running right there on your local machine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c152910ff5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rewriting the Future of Real Estate Valuation]]></title>
            <link>https://medium.com/@joshydyna/the-end-of-traditional-property-valuation-enter-spatial-ai-9af4b7d80fdf?source=rss-6ec701225235------2</link>
            <guid isPermaLink="false">https://medium.com/p/9af4b7d80fdf</guid>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[spatial-ai]]></category>
            <category><![CDATA[google-earth]]></category>
            <dc:creator><![CDATA[Dyna Joshy]]></dc:creator>
            <pubDate>Sat, 01 Aug 2026 04:16:07 GMT</pubDate>
            <atom:updated>2026-08-01T05:30:11.147Z</atom:updated>
            <content:encoded><![CDATA[<p>What if your mortgage underwriter could literally see what your neighbourhood will look like in ten years?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S7_PQPamtPnypOMm8R4ZpA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@afaiz?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Abdulla Faiz</a> on <a href="https://unsplash.com/photos/high-angle-photography-of-red-and-white-buildings-at-daytime-edkIZtm6QcY?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>The intersection of generative artificial intelligence and spatial mapping is creating a new paradigm for property investment. We are entering an era where financial institutions can use generative spatial data to visualize urban development and predict property values before ground is even broken.</p><p>Here is a deep dive into how tools like<a href="https://earth.google.com/web"> <strong>Google Earth</strong></a>’s integrated AI are fuelling the spatial finance revolution.</p><h3>The Next Frontier of Alternative Data</h3><p>Historically, visualizing the future of a physical space was the exclusive domain of architects and city developers. However, generative AI in mapping tools isn’t just for urban planners anymore. Today, it is the next frontier of alternative data for real estate investors and FinTech risk modelling.</p><p>By merging the visual power of Google Earth’s AI with the financial forecasting of FinTech, analysts can effectively bridge the gap between current reality and future possibilities.</p><h3>The Catalyst: Google Earth’s AI Workflow</h3><p>The ability to instantly render architectural, environmental and infrastructural changes directly onto real-world map views is now seamlessly accessible via the web. This straightforward workflow turns abstract ideas into immediate, impactful visuals:</p><ul><li><strong>Capturing the Baseline:</strong> Users can open an existing project or create a new one in Google Earth on the web, then click “Create image” in the toolbar to capture their current map view as the base image input.</li><li><strong>Prompting the Vision:</strong> In the text box, users describe the exact changes they want to visualize. For example, analysts could visualize an empty lot as a community park with a playground and walking trails.</li><li><strong>Rendering Infrastructure:</strong> Prompts can easily introduce sustainable developments, such as showing a street with more trees and dedicated bike lanes, or rendering a hillside with a small solar farm installation.</li><li><strong>Iterating the Model:</strong> Users can continuously refine the result by clicking “Refine image” and adding a new text prompt to update the generation.</li><li><strong>Preserving Data:</strong> Finally, clicking “Save to Project” adds the generated image as a media attachment to a placemark within the map project for future reference and sharing.</li></ul><h3>Pricing in the Future</h3><p>For FinTech and alternative risk modelling, the implications are massive. Being able to dynamically generate and evaluate physical scenarios , even imagining an entire downtown area with futuristic buildings allows underwriters to visually factor in neighbourhood revitalization before it occurs.</p><p>It represents a leap from static, historical data analysis to dynamic, visual forecasting. In the highly competitive world of real estate valuation, seeing the future first is the ultimate competitive advantage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9af4b7d80fdf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Wi-Fi Router Can Read Your Heartbeat]]></title>
            <link>https://medium.com/@joshydyna/your-wi-fi-router-can-read-your-heartbeat-d86165585096?source=rss-6ec701225235------2</link>
            <guid isPermaLink="false">https://medium.com/p/d86165585096</guid>
            <category><![CDATA[thriller]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[signal]]></category>
            <dc:creator><![CDATA[Dyna Joshy]]></dc:creator>
            <pubDate>Mon, 13 Jul 2026 10:14:40 GMT</pubDate>
            <atom:updated>2026-07-15T18:54:00.196Z</atom:updated>
            <content:encoded><![CDATA[<p>It started with a single scene in the cybercrime thriller <em>Pritam &amp; Pedro (2026)</em>.</p><p>On the screen, someone’s heart rate and breathing were being actively monitored. There was no clinical setup. There was no camera. There wasn’t even a smartwatch or a chest strap in sight.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/206/1*YMxtup8fs4JeBvLI10OtcQ.jpeg" /><figcaption>Prtiam &amp; Pedro</figcaption></figure><blockquote><em>As someone in tech, this scene just hit differently. I had to know: was this just TV magic or is this actually real?</em></blockquote><p>It turns out, the reality is far more fascinating than fiction.</p><p>When we think of health monitoring, we immediately picture wearables — rings, watches, and bands packed with optical sensors and accelerometers. But a quick deep-dive reveals that the hardware required to monitor human vitals might already be sitting on a dusty shelf in your living room.</p><p>Your Wi-Fi router is entirely capable of doing this passively.</p><p>Here is how the invisible tech works:</p><ul><li><strong>The Signal Bounce:</strong> Your router constantly blasts radio waves to communicate with your phone, laptop, and smart TV. These signals bounce off walls, furniture, and people.</li><li><strong>The Subtle Disruption:</strong> Every time you inhale, exhale, or your heart beats, your body subtly alters the physical space around it. These micro-movements disrupt the radio waves.</li><li><strong>Channel State Information (CSI):</strong> Routers use CSI to understand the physical environment and optimize signal delivery. By extracting this specific data layer, engineers can see exactly how the environment is changing on a millimeter level.</li><li><strong>Machine Learning (ML):</strong> By feeding this noisy CSI data into ML algorithms, the system can filter out the environmental noise and isolate the distinct, rhythmic patterns of human breathing and heartbeats.</li></ul><h3>Everything Connects</h3><p>One fleeting scene from a cybercrime thriller and you are constantly reminded that the underlying architecture of our world connects in unexpected ways. It definitely does.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d86165585096" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The End of the Free Data Buffet]]></title>
            <link>https://medium.com/@joshydyna/the-end-of-the-free-data-buffet-a419241f68b7?source=rss-6ec701225235------2</link>
            <guid isPermaLink="false">https://medium.com/p/a419241f68b7</guid>
            <category><![CDATA[writer]]></category>
            <category><![CDATA[fairness]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[cloudflare]]></category>
            <dc:creator><![CDATA[Dyna Joshy]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 17:56:00 GMT</pubDate>
            <atom:updated>2026-07-03T17:57:04.105Z</atom:updated>
            <content:encoded><![CDATA[<p>For the past few years, the relationship between AI developers and web publishers has been largely one-sided. Foundation models and AI search agents have relied heavily on scraping the open web, often ingesting premium articles, blogs and creative work without offering compensation or even a click-through in return.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6FN6ZI7BuKwo81C2RQ06xA.jpeg" /><figcaption>Photo by Ron Lach from Pexels.com</figcaption></figure><p>But the era of unchecked data harvesting is coming to an abrupt halt.</p><p>Cloudflare is stepping in with new measures that give website owners unprecedented control over how AI companies access their content, actively encouraging AI providers to pay publishers when their work is utilized. Here is a closer look at how the internet’s most prominent infrastructure company is rewriting the rules of engagement.</p><h3>The New Default: Blocking the Bots</h3><p>Historically, publishers faced a difficult dilemma: block web crawlers and lose valuable search engine visibility, or allow them and watch their content be absorbed into AI training datasets for free.</p><p>Cloudflare is decoupling that ultimatum. Starting September 15, 2026, the company will block mixed-use web crawlers by default on all ad-supported websites. These specific crawlers are the ones that combine traditional search indexing with AI training or AI agent data collection.</p><p>While website owners will retain the ability to manually change these settings, the new strict defaults will automatically apply to new Cloudflare customers, new websites, and all existing free users. Cloudflare has stated that the primary goal is to ensure publishers remain visible in standard search engines without inadvertently granting free access to AI training or agent services.</p><h3>Introducing the “Pay Per Use” Web</h3><p>Blocking the bots is only half the strategy; the other half is creating a new economy. Cloudflare is not just building walls; it is installing toll booths.</p><p>The company is expanding its monetization tools by introducing a “Pay Per Use” model. This framework allows publishers to earn actual revenue when AI companies generate value from their content, rather than just compensating them for the initial server fetch.</p><p>To kickstart this ecosystem, Cloudflare is launching with two initial partners:</p><ul><li><strong>Ceramic.ai:</strong> Opted-in publishers will be paid whenever their original content surfaces in Ceramic’s AI-driven search results.</li><li><strong>You.com:</strong> Creators will receive compensation when this AI engine accesses a piece of their premium content to answer user queries.</li></ul><h3>A Sustainable Future for the Web</h3><p>As AI-generated traffic continues to command a larger share of global web activity, the traditional ad-based revenue models that keep publishers afloat are under severe threat. Cloudflare asserts that these new infrastructure changes are fundamentally designed to forge a more sustainable relationship between the people who create the web’s content and the AI companies that rely on it.</p><p>The internet is shifting from a landscape of open scraping to a negotiated marketplace. For creators, writers, and journalists, this might just be the lifeline the industry has been waiting for.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a419241f68b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Gemma-3 OCR Without Cloud Dependencies]]></title>
            <link>https://medium.com/@joshydyna/running-gemma-3-ocr-without-cloud-dependencies-bc6e7850d271?source=rss-6ec701225235------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc6e7850d271</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[gemma-3]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[optical-character-recogn]]></category>
            <dc:creator><![CDATA[Dyna Joshy]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 18:28:08 GMT</pubDate>
            <atom:updated>2026-07-15T18:50:29.073Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve spent any time building Document AI pipelines, you know the standard playbook: a user uploads an image, you ship it off to a cloud API like AWS Textract or OpenAI’s vision endpoints and you wait for the structured JSON to return to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mctCirAxY_n_rHozhtwvA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@growtika?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Growtika</a> on <a href="https://unsplash.com/photos/3d-render-of-cloud-computing-concept-Am6pBe2FpJw?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>For a while, this was fine. But as soon as you start dealing with sensitive data think like healthcare records, legal contracts, or internal financial invoices the “just send it to the cloud” approach hits a massive compliance and privacy roadblock. Not to mention, the API costs at scale can quickly devour your project’s budget.</p><p>We needed a way to extract text and semantic meaning from images securely, reliably, and entirely on our own hardware. Enter <strong>Gemma-3</strong>.</p><h3>1. The Power of Local Multimodal AI</h3><p>Google’s Gemma-3 family shifted the landscape by treating visual reasoning as a first-class citizen. Unlike older OCR tools like Tesseract which are great for clean, typed text but stumble on complex layouts or noisy backgrounds Gemma-3 is a true multimodal language model.</p><p>It doesn’t just “read” the pixels; it understands the context.</p><p>For our pipeline, the <strong>Gemma-3 12B model</strong> became the sweet spot. It comfortably fits on a single consumer-grade GPU (or even a high-end Mac via unified memory), boasts a massive 128K context window, and handles zero-shot document OCR with the kind of accuracy we used to only see from heavy cloud models.</p><h3>2. The Stack: Keeping it Hermetic</h3><p>To build a robust, offline OCR application, you need to minimize friction. We didn’t want to manage a sprawling PyTorch cluster if we didn’t have to. The modern local AI stack is surprisingly lean:</p><ul><li><strong>The Engine:</strong> <strong>Ollama</strong>. It abstracts away the complex model loading and handles quantization natively.</li><li><strong>The Model:</strong> gemma3:12b. Powerful enough for complex vision tasks, small enough for local inference.</li><li><strong>The Wrapper:</strong> A lightweight <strong>Python</strong> script using the Ollama client and Pillow for image handling.</li></ul><p>By keeping the stack simple, we ensure that the entire system can be containerized, deployed in an air-gapped environment, and scaled laterally across local hardware without pinging a single external server.</p><h3>3. The Engine Room: Writing the Extraction Logic</h3><p>The beauty of using a multimodal LLM for OCR is that you aren’t just getting a raw string of text. You can use prompt engineering to dictate exactly <em>how</em> you want that text structured.</p><p>Here is the battle-tested snippet we use to pass a document to Gemma-3 and force it to return clean, markdown-formatted text:</p><pre>import ollama<br>import os<br><br>def extract_text_from_image(image_path):<br>    &quot;&quot;&quot;<br>    Passes an image to local Gemma-3 to extract and format text.<br>    &quot;&quot;&quot;<br>    if not os.path.exists(image_path):<br>        raise FileNotFoundError(f&quot;Cannot locate image at {image_path}&quot;)<br><br>    print(f&quot;Processing {image_path} via local Gemma-3...&quot;)<br>    <br>    # The prompt dictates the structure of our OCR output<br>    system_prompt = (<br>        &quot;You are an expert OCR system. Extract all text from the provided image. &quot;<br>        &quot;Preserve the structural layout, use markdown for headings and lists, &quot;<br>        &quot;and do not include any conversational filler in your response.&quot;<br>    )<br><br>    try:<br>        response = ollama.chat(<br>            model=&#39;gemma3:12b&#39;,<br>            messages=[{<br>                &#39;role&#39;: &#39;user&#39;,<br>                &#39;content&#39;: system_prompt,<br>                &#39;images&#39;: [image_path]<br>            }]<br>        )<br>        return response[&#39;message&#39;][&#39;content&#39;]<br>    <br>    except Exception as e:<br>        return f&quot;OCR Pipeline Failed: {str(e)}&quot;<br><br># Example Usage:<br>extracted_markdown = extract_text_from_image(&#39;./scanned_invoice_001.jpg&#39;)<br></pre><p><strong><em>Note:</em></strong><em> To run this, you simply need Ollama installed on your machine and to pull the model via the terminal using </em><em>ollama run gemma3:12b</em></p><h3>4. The Results: Speed, Security, and Structure</h3><p>Moving our OCR pipeline to a local Gemma-3 instance felt like taking the training wheels off.</p><ol><li><strong>Absolute Privacy:</strong> Because the images never leave the local environment, we completely bypassed the usual security audits required for cloud integrations.</li><li><strong>Semantic Formatting:</strong> Older OCR tools would often smash columns of text together. Gemma-3 understands the visual hierarchy of a document, returning perfectly formatted markdown tables and bulleted lists.</li><li><strong>Cost Efficiency:</strong> Our variable monthly API bill dropped to zero. We are now constrained only by our hardware compute limits, not a cloud provider’s pricing tiers.</li></ol><p>Running advanced vision AI locally is no longer a theoretical research project; it is a practical, deployable solution. If you are still shipping your sensitive documents to a cloud endpoint just to read the text, it might be time to bring your pipeline home.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc6e7850d271" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A time when NLP Challenged Everything I Knew]]></title>
            <link>https://medium.com/@joshydyna/a-time-when-nlp-challenged-everything-i-knew-4bc97c965a6d?source=rss-6ec701225235------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bc97c965a6d</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[sentiment-classification]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Dyna Joshy]]></dc:creator>
            <pubDate>Wed, 01 Jul 2026 18:31:53 GMT</pubDate>
            <atom:updated>2026-07-01T18:34:20.773Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A_vtM9VmnBiWq8q9y9ElhQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@steve_j?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Steve A Johnson</a> on <a href="https://unsplash.com/photos/a-computer-circuit-board-with-a-brain-on-it-_0iV9LmPDn0?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>If there is one thing you learn during your first year as an AI Developer, it’s the sinking feeling of looking at a confusion matrix and realizing your model is fundamentally misunderstanding human nuance. This was exactly the challenge I faced when fine-tuning a Natural Language Processing (NLP) model for a behavioural utility.</p><p>The goal was to categorize text into specific emotional states, but the data was messy and the semantics were ambiguous. Words like “hopeful” were popping up in positive contexts, but also heavily polluting the noisy labels for “depression” and “anxiety”. This is the story of how a rigorous training pipeline took this model to a final fine F1-score.</p><p>In the real world, a critical component of achieving high accuracy is always the refinement of the training and validation datasets. Even with clean data, the model was making frustrating misclassifications. Words like “amazing” or “hopeful” were sometimes being predicted as negative labels. Instead of just throwing more data at the problem , a rookie mistake I made plenty of times early on for which we implemented a targeted correction strategy.</p><p>With the data primed, we configured the fastText model to handle the complexities of mood classification. The hyperparameter selection was deliberate:</p><ul><li><strong>Vector Dimension (</strong><strong>dim=100):</strong> Increased to 100 to capture nuanced semantic relationships.</li><li><strong>Context (</strong><strong>wordNgrams=2):</strong> Bigrams allowed us to distinguish between phrases like &quot;happy&quot; and &quot;not happy&quot;.</li><li><strong>Learning Rate (</strong><strong>lr=0.8):</strong> A relatively high rate accelerated convergence and forced the model to adapt strongly to our verified correction samples.</li><li><strong>Epochs (</strong><strong>epoch=50):</strong> Extended cycles ensured convergence on the refined data.</li><li><strong>Loss (</strong><strong>loss=&#39;softmax&#39;):</strong> Optimal for our mutually exclusive multi-class task.</li></ul><pre>import fasttext<br><br>print(&quot;Training fastText model with high-capacity configuration...&quot;)<br>model = fasttext.train_supervised(<br>    input=&quot;train_high_acc.txt&quot;, <br>    dim=100,           # Capture nuanced semantic relationships<br>    wordNgrams=2,      # Distinguish phrases via bigrams<br>    lr=0.8,            # High rate to adapt to correction samples<br>    epoch=50,          # Extended cycles for convergence<br>    loss=&quot;softmax&quot;     # Optimal for mutually exclusive classes<br>)<br><br>results = model.test(&quot;valid_split.txt&quot;)<br>print(f&quot;Validation Metrics - Samples: {results[0]}, Precision: {results[1]:.4f}, Recall: {results[2]:.4f}&quot;)<br><br>print(&quot;Quantizing model for memory-constrained environments...&quot;)<br>model.quantize(input=&quot;train_high_acc.txt&quot;, retrain=True)<br><br>#saving the model<br>model.save_model(&quot;mood_classifier_production.ftz&quot;)</pre><p>A model that only works on a massive server isn’t always useful in production environments. To prepare this model for efficient deployment in memory-constrained or mobile environments, we applied quantization. This compressed the weight matrices, reducing the model size without sacrificing significant accuracy and the final artifact was saved in the FastText Compressed (.ftz) format.</p><p>It proved a lesson to fully internalize: in NLP, treating the data with as much care as the hyperparameters is the true secret to high accuracy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bc97c965a6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>