<?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[DeepKlarity - Medium]]></title>
        <description><![CDATA[DeepKlarity - Medium]]></description>
        <link>https://medium.com/deepklarity?source=rss----f4ddbd72c63c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>DeepKlarity - Medium</title>
            <link>https://medium.com/deepklarity?source=rss----f4ddbd72c63c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 08:18:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/deepklarity" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Use AI to Refactor and Learn New Concepts]]></title>
            <link>https://medium.com/deepklarity/how-i-use-ai-to-refactor-and-learn-new-concepts-cd292af30cf2?source=rss----f4ddbd72c63c---4</link>
            <guid isPermaLink="false">https://medium.com/p/cd292af30cf2</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ramakrishna Nakka]]></dc:creator>
            <pubDate>Fri, 21 Nov 2025 04:37:28 GMT</pubDate>
            <atom:updated>2025-11-21T04:37:27.053Z</atom:updated>
            <content:encoded><![CDATA[<p>Turning <a href="https://chatgpt.com/">ChatGPT</a> into a Teacher, Reviewer, and Coding Partner</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_97pXGYl8B_8-KAIU12KDA.jpeg" /><figcaption>A peek into the workflow — AI conversations, real code, and final insights.</figcaption></figure><h3>TL;DR</h3><p>if you’ve ever opened a new tech task and thought, <em>“I have no idea where to start,”</em> this article is for you.<br> I used ChatGPT as a <strong>teacher</strong>, <strong>code generator</strong>, <strong>debugging partner</strong>, and <strong>reviewer</strong> to scrape <strong>10,000 VS Code extensions</strong>, clean the dataset, and build a full <a href="https://react.dev/"><strong>React</strong></a><strong> + </strong><a href="https://danfo.jsdata.org/getting-started"><strong>Danfo.js</strong></a><strong> visualization dashboard</strong> — all while learning every concept from scratch.</p><p>This post shows <em>how</em> I learned, iterated, and validated each step with AI — so you can reuse the same workflow for your own projects.</p><h3>Why This Post — Who It’s For &amp; Why It Matters</h3><p>When I started this project, I had <strong>zero knowledge</strong> of web scraping, <a href="https://playwright.dev/docs/intro">Playwright</a>, parallelism, Danfo.js, or data visualization.<br> All I had was a large task, a deadline, and one powerful tool — <strong>AI</strong>.</p><p>This post is for anyone who has ever felt the same:</p><ul><li>You’re asked to build something you’ve never built before</li><li>You’re overwhelmed by new concepts</li><li>You don’t know how to break the task down</li><li>You want to learn fast <em>without cutting corners</em></li><li>And you want AI to help — but you don’t know <strong>how</strong> to use it effectively</li></ul><p>Most tutorials teach you <em>what</em> to do.<br> This blog teaches you <strong>how I learned to do it</strong> — using AI as a structured, reliable partner throughout the journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2DGZXwCMbFRfq0aGLILtJw.png" /><figcaption>Why AI-assisted learning is a repeatable system, not a one-time trick.</figcaption></figure><h3>High-Level Project Overview — The Two Big Parts</h3><p>Before diving into prompts, code, or mistakes, here’s the big picture of what I actually built — with ChatGPT guiding me through every step.</p><h4><strong>Part 1 — Scraping 10,000 VS Code Extensions</strong></h4><p>This was the “I have no idea how to do this” phase.</p><p>My goal:<br> Scrape <strong>10,000 extensions</strong> from the <a href="https://marketplace.visualstudio.com/search?target=VSCode&amp;category=All%20categories&amp;sortBy=Installs">VS Code Marketplace</a>, extract as much meaningful data as possible (name, rating, installs, publisher, categories, etc.), and store everything in a CSV.</p><p>With ChatGPT’s help, this part was broken into three stages:</p><ol><li><strong>Collecting all extension URLs</strong><br> → Using Playwright to visit each page and extract <strong>10k</strong> links</li><li><strong>Scraping each extension page</strong><br> → Best-practice selectors, resilient scraping, structured parsing</li><li><strong>Parallel scraping with auto-resume</strong><br> → 6 worker processes, batching, checkpoint saving</li></ol><p>This produced the main dataset: extensions_data.csv (~10MB, 21 columns)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cWGZOfGIoSdnnHyi.png" /><figcaption>The target: 10,000 extension detail pages, each with dozens of potential fields.</figcaption></figure><h4>Part 2 — Data Visualization with React + Danfo.js</h4><p>Once the dataset existed, the second phase began:<br> Building an <a href="https://huggingface.co/spaces/nkvrk3/data-analysis-of-vscode-marketplace">interactive dashboard</a> hosted on <a href="https://huggingface.co/docs/hub/spaces-overview">HuggingFace Spaces</a> that:</p><ul><li>Loads the CSV</li><li>Processes it using Danfo.js</li><li>Generates charts + insights</li><li>Shows patterns in publishers, categories, AI adoption, ratings, etc.</li></ul><p>This app used ChatGPT extensively for:</p><ul><li>Explaining Danfo.js</li><li>Generating React components</li><li>Optimizing charts</li><li>Reviewing UX</li><li>Fixing inconsistencies</li><li>Improving layout and structure</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*JqL6xiXeXNDA1njg.png" /><figcaption>One of the insights charts generated from the scraped 10k-extension dataset.</figcaption></figure><h3>How I Used AI Throughout the Project</h3><p><em>From teacher to planner to reviewer — how AI became a genuine partner in learning and building.</em></p><p>When I look back at this entire project — scraping 10,000+ VS Code extensions, cleaning the dataset, designing insights, and building a full visualization dashboard — it becomes clear that the real achievement wasn’t the technical stack.</p><p>The real achievement was learning <strong>how to work with AI like a teammate.</strong></p><p>A lot of articles say “AI helped me build XYZ.”<br> But this project taught me something deeper:</p><blockquote><strong><em>AI helped me learn, structure, debug, reason, design, and validate — all in one continuous cycle.</em></strong></blockquote><p>This section explains <em>how</em> I used AI, in the exact order and depth I actually experienced it It’s a complete, unified story of how AI became a multi-role collaborator during every phase of this project.</p><h4>1. AI as My Teacher — Learning Entire Domains From Zero</h4><p>I started the project without knowing:</p><ul><li>how web scraping works</li><li>how Playwright handles dynamic DOM</li><li>how parallel scraping or multiprocessing behaves</li><li>how to clean and normalize large datasets</li><li>how Danfo.js processes data in React</li><li>how chart libraries fit into React</li><li>how UX principles guide data storytelling</li></ul><p>So my first instinct was to ask AI:</p><blockquote><strong><em>“Explain scraping from scratch.<br> Explain selectors.<br> Explain how dynamic pages work.<br> Explain how Danfo.js compares to Pandas.<br> Explain how charts consume data.”</em></strong></blockquote><p>AI didn’t just give surface-level answers — it gave:</p><ul><li>analogies</li><li>deep explanations</li><li>warnings</li><li>mental models</li><li>pitfalls</li><li>examples</li><li>step-by-step breakdowns</li></ul><p>By the time I finished asking foundational questions, I wasn’t “copying code.”<br> I had a mental map of <em>how everything works</em>.</p><p>This was crucial because when you understand something, you can adapt, fix, and extend it — all of which I had to do later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*31DQQA1TRoR6vJGzWguH1w.png" /></figure><h4>2. AI as My Task Breakdown Partner — Turning Overwhelm into Clarity</h4><p>Having learned the basics, I was still staring at a massive task:</p><blockquote><strong><em>“Scrape 10,000 VS Code extensions, extract useful fields, clean the dataset, then build a complete visualization dashboard.”</em></strong></blockquote><p>It felt overwhelming until AI broke it down like a senior engineer:</p><ol><li><strong>Collect all extension URLs</strong></li><li><strong>Build a single-page scraper</strong></li><li><strong>Add data normalization</strong></li><li><strong>Add batching and auto-save</strong></li><li><strong>Add multiprocessing</strong></li><li><strong>Add resume-safety</strong></li><li><strong>Review &amp; clean dataset</strong></li><li><strong>Generate questions for insights</strong></li><li><strong>Translate questions into charts</strong></li><li><strong>Build visualization components</strong></li><li><strong>Add UX layers</strong></li><li><strong>Test &amp; validate</strong></li></ol><p>Suddenly, the project didn’t feel like a mountain anymore — it felt like a ladder.</p><p>The difference was perspective, not code.</p><p>This step proved one major thing:</p><blockquote><strong><em>AI’s planning ability is one of its most underrated strengths.</em></strong></blockquote><h4>3. AI as My Code Generator — But ONLY After the Concept Was Clear</h4><p>I never asked AI for code before understanding the idea behind it.</p><p>But once I understood the concept, I could ask with precision:</p><blockquote><strong><em>“Generate a robust Playwright script to scroll the entire VS Code marketplace and extract all extension URLs.”</em></strong></blockquote><p>And it generated the first version of <strong>collect_extension_links.py</strong></p><p>Then I asked:</p><blockquote><strong><em>“Generate a clean scraper that extracts all important fields from a single extension page.”</em></strong></blockquote><p>It produced the base of <strong>scraper_core.py</strong></p><p>Then:</p><blockquote><strong><em>“Add parallelism, checkpointing, batching, and resume support.”</em></strong></blockquote><p>Which became <strong>scrape_parallel.py</strong></p><p>The key lesson here?</p><blockquote><strong><em>AI-generated code is powerful when </em>you guide it<em> with good context and constraints.</em></strong></blockquote><p>I wasn’t copy-pasting blindly — I was reviewing, tweaking, and evolving that code through multiple iterations.</p><h4>4. AI as My Debugger — Diagnosing Errors I Didn’t Know How to Interpret</h4><p>When you scrape dynamic websites, you <em>will</em> hit problems:</p><ul><li>selectors break</li><li>elements load late</li><li>fields are missing</li><li>pages behave inconsistently</li><li>processes time out</li><li>multiprocessing causes collisions</li><li>transformations produce wrong patterns</li></ul><p>Each time something went wrong, I pasted the exact error:</p><blockquote><strong><em>“Here is the traceback. Diagnose the cause and suggest the fix.”</em></strong></blockquote><p>AI didn’t just fix the surface error. It taught me:</p><ul><li>why selectors were fragile</li><li>how to make them resilient</li><li>how to handle missing fields safely</li><li>how to add conditional parsing</li><li>how to retry intelligently</li><li>how to simplify async flows</li><li>how to detect memory leaks or improper wait conditions</li><li>how to prevent worker crashes in parallel mode</li></ul><p>Through this, I learned how real scraping workflows behave at scale.</p><p>This was one of the most important educational parts of the project.</p><h4>5. AI as My Dataset Reviewer — Finding Issues the Eye Can’t See</h4><p>Once I generated a few hundred rows, I uploaded them to AI:</p><blockquote><strong><em>“Find inconsistencies and suggest corrections in my scraping logic.”</em></strong></blockquote><p>AI spotted issues like:</p><ul><li>inconsistent rating formats</li><li>commas in download numbers</li><li>publishers with whitespace</li><li>categories split differently</li><li>missing tags fields</li><li>boolean-like fields stored as text</li><li>HTML artifacts in descriptions</li><li>differing page structures depending on the extension</li></ul><p>Then it suggested solutions <strong>inside the Python logic</strong>, not just the dataset.</p><p>This feedback loop is what made the <strong>final 10,000-row dataset trustworthy.</strong></p><h4>6. AI as My UX Designer — Making Charts Clean, Readable, and Professional</h4><p>This was one of the biggest surprises.</p><p>When I started building charts, the first versions were functional but not beautiful.<br> So I sent screenshots and asked:</p><blockquote><strong><em>“Review this chart like a senior UX designer and suggest improvements.”</em></strong></blockquote><p>AI analyzed each chart and suggested:</p><ul><li>better spacing</li><li>softer gridlines</li><li>consistent colors</li><li>more descriptive titles</li><li>fewer labels</li><li>more useful tooltips</li><li>removing distractive elements</li><li>improving hierarchy</li><li>adding card containers</li><li>refining typography</li><li>adding contextual subtitles</li></ul><p>These changes transformed my dashboard from “it works” to “this feels professional.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*96darIsEGDBrEPAnCYtNVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*VStQMgeKx_Nsr_Jgp2kStQ.png" /></figure><h4>7. AI as My Validator — Ensuring I Didn’t Blindly Trust Anything</h4><p>Perhaps the <em>most</em> important role AI played was as a <strong>second opinion</strong>.</p><p>Whenever the output looked suspicious — a chart pattern, a transformation, a selector, a number — I asked:</p><blockquote><strong><em>“Double-check this output.<br> Are you sure this is correct?<br> If uncertain, correct yourself and explain why.”</em></strong></blockquote><p>Or:</p><blockquote><strong><em>“List all assumptions you made in your previous answer.”</em></strong></blockquote><p>Or:</p><blockquote><strong><em>“Give me 3 possible reasons why this could be wrong.”</em></strong></blockquote><p>This meta-level validation prevented me from accepting incorrect logic and taught me a critical developer skill:</p><blockquote><strong><em>AI becomes 10× more accurate when you force it to verify itself.</em></strong></blockquote><p>This was the difference between an accurate dashboard and a misleading one</p><h4>The Real Impact of Using AI This Way</h4><p>By the end of the project, I realized something important:</p><blockquote><strong><em>AI didn’t replace the learning.<br> AI accelerated the learning.</em></strong></blockquote><p>It helped me think:</p><ul><li>more clearly</li><li>more structured</li><li>more purposefully</li><li>more critically</li></ul><p>And because I understood <em>how to use AI</em> — not just <em>how to ask it things</em> — the entire project transformed from something I didn’t know how to start into something I could build confidently.</p><h3>My Prompting System</h3><p>If there is one skill that amplified everything else in this project — scraping, debugging, cleaning, visualizing — it was learning <strong>how to prompt AI effectively</strong>.</p><p>The difference between a chaotic AI conversation and a high-quality, senior-engineer-level collaboration is <strong>the prompting system you use</strong>.</p><p>This is not a “list of prompts.”<br> This is the <strong>system</strong> that made AI reliable, accurate, and genuinely helpful.</p><h4>1. The Core 4-Part Prompt Formula (My Most Important Prompting Skill)</h4><p>Early in the project, I realized that vague prompts gave vague answers. When the task complexity grew — scraping parallelism, data inconsistencies, messy selectors, chart logic — I needed a consistent structure.</p><p>So I created this 4-part formula:</p><p><strong>1. Context</strong></p><p>Tell AI <em>what environment you’re in</em>, what you’ve done so far, and the purpose of the task.</p><p>Example:</p><blockquote><em>“I’m scraping VS Code extension pages with Playwright.<br> Each page has dynamic content and not all fields exist.”</em></blockquote><p><strong>2. Goal</strong></p><p>Tell AI <em>what outcome you want</em>, not what code to write.</p><p>Example:</p><blockquote><em>“I want a robust scraper that extracts 20+ fields with conditional fallbacks.”</em></blockquote><p><strong>3. Constraints</strong></p><p>Explain limitations, edge cases, and rules.</p><p>Example:</p><blockquote><em>“Some pages load slower.<br> Some fields are missing.<br> Avoid fragile selectors and handle null conditions safely.”</em></blockquote><p><strong>4. Output Format</strong></p><p>Specify exactly what form the answer should take.</p><p>Example:</p><blockquote><em>“Output only the final Python file, no explanation.”</em></blockquote><p>This single structure instantly improved accuracy.<br> It changed AI responses from “generic suggestions” to “actionable, senior-developer-quality answers.”</p><h4>2. The Prompt Templates I Used the Most</h4><p>Throughout the project, I reused a set of prompt types.<br> Here are the ones that genuinely shaped the outcome.</p><p><strong>A. Learning Prompt (When I Had No Knowledge)</strong></p><p>I used this whenever I entered a new domain — scraping, parallelism, Danfo.js, chart design.</p><p><strong>Template:</strong></p><blockquote><em>“I’m new to {topic}.<br> Explain it in simple steps, with examples, pitfalls, and the mental model behind it.”</em></blockquote><p>Why it works:<br> It turns AI into a patient teacher who gives conceptual depth, not surface instructions.</p><p><strong>B. Planning Prompt (Breaking Chaos Into Steps)</strong></p><p>Before scraping 10k extensions or designing dashboards, I asked:</p><p><strong>Template:</strong></p><blockquote><em>“Break {big task} into actionable steps.<br> Show prerequisites, hidden challenges, and dependencies.”</em></blockquote><p>Why it works:<br> It gives clarity, scope, and direction before writing a single line of code.</p><p><strong>C. Code-Generation Prompt (Only After Learning the Concept)</strong></p><p>Whenever I needed a file-level solution:</p><p><strong>Template:</strong></p><blockquote><em>“Generate clean, production-ready code for {task}.<br> Handle edge cases, missing data, and uncommon pages.<br> Output a complete file with imports.”</em></blockquote><p>Why it works:<br> It produces coherent files instead of disconnected fragments.</p><p><strong>D. Debugging Prompt (Fixing Errors Quickly)</strong></p><p>Every error, from selector failures to multiprocessing bugs, went here:</p><p><strong>Template:</strong></p><blockquote><em>“Here is the full error: </em><em>…<br> Diagnose the cause, explain why it happened, and provide corrected code.”</em></blockquote><p>Why it works:<br> AI acts like a debugger who understands the full context.</p><p><strong>E. Review and Improvement Prompt (AI as Senior Reviewer)</strong></p><p>I used this heavily during visualization:</p><p><strong>Template:</strong></p><blockquote><em>“Review this code/UI/dataset.<br> Rate it, list issues, and suggest improvements with reasons.”</em></blockquote><p>Why it works:<br> AI becomes a reviewer, not just a coder.</p><p><strong>3. The Self-Check Workflow — The System That Prevented Hallucinations</strong></p><p>The most important part of prompting wasn’t generating answers — it was <strong>verifying</strong> them.</p><p>I quickly learned that AI’s <em>first answer</em> is not always the best.<br> So I created a self-check system to make AI validate its own output.</p><p>This is the system:</p><p><strong>A. The “Double-Check” Prompt</strong></p><p>I used this almost every day.</p><p><strong>Template:</strong></p><blockquote><em>“Double-check your previous answer.<br> Correct anything uncertain and explain what changed.”</em></blockquote><p>Why it works:<br> AI becomes more careful and catches logical gaps.</p><p><strong>B. The “Assumption Exposure” Prompt</strong></p><p>Whenever something felt off:</p><p><strong>Template:</strong></p><blockquote><em>“List all assumptions you made while generating the last answer.”</em></blockquote><p>This was crucial during selectors, resume logic, and chart transformations.</p><p>Why it works:<br> AI reveals its blind spots — which are easy to fix once visible.</p><p><strong>C. The “Edge Case Generator” Prompt</strong></p><p><strong>Template:</strong></p><blockquote><em>“List edge cases where this code might fail.<br> Suggest how to handle each.”</em></blockquote><p>This uncovered:</p><ul><li>pages missing ratings</li><li>selectors not loading</li><li>nullable fields</li><li>category variations</li><li>slow-loading DOM</li><li>inconsistent datasets</li></ul><p><strong>D. The “Multiple Hypotheses” Prompt</strong></p><p>Whenever debugging logic wasn’t straightforward:</p><p><strong>Template:</strong></p><blockquote><em>“Give me 3 possible explanations for this issue.”</em></blockquote><p>This gave me different angles to investigate, like a senior engineer proposing multiple theories.</p><p><strong>E. The “Math/Logic Validation” Prompt</strong></p><p>Used especially in charts:</p><p><strong>Template:</strong></p><blockquote><em>“Validate that this chart logic correctly answers the question.<br> If not, explain what’s wrong and correct it.”</em></blockquote><p>This prevented misleading visualizations.</p><h4>4. Why This Prompting System Worked So Well</h4><p>Combining all these elements had a powerful effect:</p><ul><li>My prompts became precise</li><li>AI understood my context deeply</li><li>I got fewer hallucinations</li><li>Debugging became faster</li><li>Answers became consistent</li><li>AI-generated code was safer and more realistic</li><li>Visualizations became more accurate</li><li>Dataset inconsistencies were easier to detect</li></ul><p>But the biggest benefit was something else:</p><blockquote><strong><em>I learned how to think better.<br> And AI simply accelerated that thinking.</em></strong></blockquote><p>This entire project became a masterclass not in scraping or visualization — <br> but in <strong>how to learn, build, and verify using AI intelligently</strong>.</p><h3>Process: Data Cleaning &amp; Review — How AI Became My Dataset Quality Inspector</h3><p>Once the scraper was running reliably and producing rows, I thought the hard part was done.</p><p>It wasn’t.</p><p>The <strong>real issues</strong> only showed up when I looked at the CSV.</p><p>Data scraping is messy by nature — missing fields, unexpected formats, inconsistent types, and occasional HTML anomalies.<br> Instead of manually auditing all 10,000 rows, I turned ChatGPT into a <strong>data quality reviewer</strong>.</p><p>This section explains <em>how I learned to use AI to validate, clean, and fix my data pipeline step-by-step</em>.</p><h4>Step 1 — I Asked ChatGPT to Review a Small CSV Sample</h4><p>The first version of my dataset had only ~200 rows.<br> I uploaded a snippet and asked:</p><blockquote><strong><em>“Review this dataset. Rate its quality. Identify issues and propose fixes.”</em></strong></blockquote><p>This single prompt taught me more about <strong>data quality</strong> than any tutorial.</p><p>ChatGPT pointed out things I hadn’t even noticed:</p><p><strong>Real issues the AI found (examples):</strong></p><ul><li><strong>Ratings were inconsistent </strong>→ &quot;4.6&quot; ,&quot;4.6 out of 5&quot;</li><li><strong>Downloads count was messy </strong>→<strong> </strong>&quot;12,345,678&quot; ,&quot;12M&quot;</li><li><strong>Categories had mixed separators </strong>→<strong> </strong>&quot;AI, Tools&quot; ,&quot;AI | Tools&quot;</li><li><strong>Publisher names had odd whitespace </strong>→<strong> </strong>&quot;Microsoft\n&quot; ,&quot; IBM &quot;</li><li><strong>Tags varied by page structure </strong>→<strong> </strong>Some pages had a tags list, some didn’t</li></ul><p>This feedback was invaluable because <strong>I didn’t know what “clean” data should even look like</strong> before this.</p><h4>Step 2 — AI Suggested Fixes Directly in the Python Code</h4><p>After spotting problems, ChatGPT didn’t just say “fix it.”<br> It told me <em>how</em> and <em>where</em> to fix it in the scraping script.</p><p>For example, it suggested adding a <strong>safe numeric parser</strong>:</p><pre>def safe_number(v):<br>    if v is None or v == &quot;&quot;:<br>        return 0<br>    cleaned = str(v).replace(&quot;,&quot;, &quot;&quot;).strip()<br>    n = float(cleaned) if cleaned.replace(&quot;.&quot;, &quot;&quot;, 1).isdigit() else 0<br>    return n</pre><p>It suggested trimming publisher names:</p><pre>publisher = raw_publisher.strip() if raw_publisher else &quot;(unknown)&quot;</pre><p>And cleaning categories:</p><pre>categories = (<br>    raw_categories.replace(&quot;|&quot;, &quot;,&quot;).replace(&quot;/&quot;, &quot;,&quot;).replace(&quot;\\&quot;, &quot;,&quot;)<br>    if raw_categories else &quot;&quot;<br>)</pre><p>These improvements became part of your final scraper.</p><h4>Step 3 — AI Helped Me Perform “Data Spot Checks”</h4><p>Before running the full scrape, I asked:</p><blockquote><strong><em>“What 10 fields should I manually inspect to verify my scraper is correct?”</em></strong></blockquote><p>ChatGPT suggested a checklist:</p><ul><li><strong>Extension Name</strong> → check for missing or incorrect text</li><li><strong>Rating</strong> → ensure numeric format, not strings</li><li><strong>Reviews Count</strong> → ensure integers</li><li><strong>Downloads Count</strong> → no commas / text</li><li><strong>Publisher</strong> → trimmed + correct</li><li><strong>Categories</strong> → normalized separators</li><li><strong>AI-enabled flag</strong> → boolean</li><li><strong>Tags</strong> → consistently parsed</li><li><strong>Last updated date</strong> → valid ISO or clean string</li><li><strong>Extension URL</strong> → accessible and correct</li></ul><p>This gave me a <strong>manual QA workflow</strong> I didn’t even know to perform.</p><h4>Step 4 — AI Found Hidden Inconsistencies After Scaling to 10,000 Rows</h4><p>After the full scraping run (10 h 44 min), I uploaded a random sample:</p><blockquote><strong><em>“Find anomalies in these 50 random rows.”</em></strong></blockquote><p>ChatGPT spotted things like:</p><ul><li>Extensions without ratings</li><li>Extensions with huge install counts (needing float → int conversion)</li><li>Unexpected HTML artifacts in descriptions</li><li>Duplicate categories</li><li>Tags from deprecated fields</li><li>Boolean fields stored as &quot;True&quot; or &quot;YES&quot; or &quot;1&quot;</li><li>Publishers with special characters</li></ul><p>These insights led to final adjustments in scraper_core.py and the normalization logic in dataLoader.js.</p><h4>Step 5 — AI Helped Me Normalize the Entire Dataset</h4><p>The final cleaned dataset had:</p><ul><li>Consistent numeric columns</li><li>Clean strings</li><li>Unified category formatting</li><li>Standardized tags</li><li>Boolean fields normalized</li><li>Missing values handled</li><li>Publisher names deduplicated</li><li>No trailing whitespace</li><li>No malformed selectors</li></ul><p>ChatGPT essentially acted as a <strong>senior data engineer reviewing my pipeline.</strong></p><h3>Process: Visualization — How I Learned React + Danfo.js Through Iteration With AI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HzIO31RwYhr2E3hV.png" /></figure><p>By the time the dataset was clean, I had another challenge waiting:<br> <strong>I had never done data visualization using React + Danfo.js.</strong></p><p>And yet, my task was to build a full interactive dashboard hosted on HuggingFace — with charts, insights, metadata, UX polish, and smooth interactions.</p><p>Just like with scraping, I didn’t jump straight into coding.<br> I learned in loops:</p><ol><li>Ask ChatGPT to explain the concept</li><li>Ask it to show examples</li><li>Build a small component</li><li>Show it a screenshot</li><li>Ask for improvements</li><li>Apply and repeat</li></ol><p>This loop became the foundation of how I learned the entire visualization stack.</p><h4>Step 1 — I Asked ChatGPT to Teach Me Danfo.js + React Visualization</h4><p>I started with a beginner question:</p><blockquote><strong><em>“What is Danfo.js, how does it compare to Pandas, and how do I use it with React for CSV visualization?”</em></strong></blockquote><p>ChatGPT’s answer covered:</p><ul><li>What Danfo.js is (JS equivalent of Pandas)</li><li>How DataFrames work</li><li>How to load CSVs in React</li><li>How to filter, group, sort, and aggregate</li><li>How to integrate it with chart libraries</li><li>Best practices for state, memoization, and performance</li></ul><p>This gave me a mental model before touching any code.</p><h4>Step 2 — I Built the Foundation With AI Guidance</h4><p>I asked:</p><blockquote><strong><em>“Generate a React component that loads a CSV using Danfo.js and displays metadata.”</em></strong></blockquote><p>It produced the early version of:<strong>App.js ,</strong><strong>useMarketplaceDataset.js</strong></p><h4>Step 3 — I Asked ChatGPT to Generate Chart Components</h4><p>Once the data was loading correctly, I asked:</p><blockquote><strong><em>“Generate a clean, interactive chart for installs vs categories using </em></strong><a href="https://recharts.github.io/"><strong><em>Recharts</em></strong></a><strong><em> + Danfo.js.”</em></strong></blockquote><p>This became the first chart component.</p><p>Then I asked:</p><blockquote><strong><em>“Give me more charts based on important questions in the data.”</em></strong></blockquote><p>ChatGPT proposed:</p><ul><li>Market Opportunity Chart</li><li>Publisher Power Curve</li><li>AI Market Shift</li><li>Success Trajectory Map</li><li>Feature Influence Distribution</li><li>Evolution Scatter Visualization</li><li>Insights Snapshot</li></ul><p>These weren’t final — but they gave me a strong starting point.</p><h4>Step 4 — I Used ChatGPT as a UX Designer</h4><p>The first version of each chart worked…<br> but didn’t feel polished.</p><p>So I sent screenshots of each chart and asked:</p><blockquote><strong><em>“Review this chart as a data visualization expert.<br> Rate it and suggest improvements.”</em></strong></blockquote><p>This was one of the most valuable feedback loops in the entire project.</p><h4>Examples of actual improvements from AI reviews:</h4><p><strong>1. Better labels + readability</strong></p><p>ChatGPT suggested more descriptive titles:</p><ul><li>Instead of:<br> “Downloads by Category”</li><li>Use:<br> <strong>“Category Influence on Marketplace Downloads”</strong></li></ul><p><strong>2. Replace default colors</strong></p><p>AI improved color distinction and visual hierarchy.</p><p><strong>3. Add meaningful tooltips</strong></p><p>Especially for charts like Success Trajectory and Feature Influence.</p><p><strong>4. Reduce clutter</strong></p><p>It recommended removing unnecessary gridlines and thick borders.</p><p><strong>5. Improve spacing + card layout</strong></p><p>Leading to refined wrapper components like ChartCard.jsx.</p><p><strong>6. Add “active state” interactions</strong></p><p>Such as highlighting selected categories or publishers.</p><p>These fixes significantly improved chart clarity.</p><h4>Step 5 — AI Helped Validate Data Transformations</h4><p>Danfo.js transformations were new territory for me.</p><p>Whenever a chart looked off, I asked:</p><blockquote><strong><em>“Is my aggregation logic correct? Here’s the snippet.”</em></strong></blockquote><p>ChatGPT often caught mistakes like:</p><ul><li>Wrong sort direction</li><li>Type coercion issues</li><li>Using string numbers</li><li>Missing filters</li><li>Wrong grouping logic</li></ul><p>It explained:</p><ul><li>Why the bug happened</li><li>What the correct transformation should be</li><li>How to memoize the logic to prevent rerenders</li></ul><p>This taught me <strong>data transformation best practices</strong>, not just fixes.</p><h4>Step 6 — Final UX Polish With AI Review</h4><p>Before finishing each section, I asked:</p><blockquote><strong><em>“Review the entire dashboard as a UX expert.<br> Suggest ways to make it feel premium.”</em></strong></blockquote><p>ChatGPT recommended:</p><ul><li>A clean header (AppHeader.jsx)</li><li>Metadata panel toggling (DatasetMetaPanel.jsx)</li><li>Status banners (StatusBanner.jsx)</li><li>Loading blocks (LoadingState.jsx)</li><li>Error boundaries (ErrorBoundary.js)</li><li>Sectioned layout system</li><li>Better component naming conventions</li><li>Consistent spacing / margins / typography</li></ul><p>These additions made the app feel <strong>polished, structured, and professional</strong>.</p><h3>Testing &amp; Verification — How I Ensured There Were No Mistakes</h3><p>Learning with AI isn’t just about generating code or asking questions.<br> It’s also about learning <strong>how to verify</strong>, validate, and cross-check the outputs so you don’t blindly trust anything — especially when scraping 10,000 pages or building multi-layer visualizations.</p><p>In this section, I explain <strong>HOW</strong> I made sure everything worked correctly:</p><ul><li>The scraper</li><li>The dataset</li><li>The React components</li><li>The Danfo.js transformations</li><li>The charts</li><li>The UX interactions</li></ul><p>AI helped, but the <em>verification loop</em> was mine.</p><h4>Step 1 — Small-Run Testing Before Scaling Anything</h4><p>Before scraping 10,000 pages, I always ran small test batches:</p><ul><li><strong>5 extensions</strong></li><li>Then <strong>20 extensions</strong></li><li>Then <strong>200 extensions</strong></li></ul><p>For each batch, I checked:</p><ul><li>Are selectors valid?</li><li>Are any fields missing?</li><li>Does the script crash?</li><li>Does the output CSV look consistent?</li></ul><p>This prevented catastrophic failures during the 10-hour full scrape.</p><p><strong>AI helped by telling me what to test</strong>, but <em>I executed each step manually</em>.</p><h4>Step 2 — AI-Assisted Spot Checks on the CSV</h4><p>After generating a batch CSV, I uploaded a snippet and asked:</p><blockquote><strong><em>“Find inconsistencies in these rows. What looks wrong?”</em></strong></blockquote><p>AI flagged:</p><ul><li>Empty ratings</li><li>Downloads as strings</li><li>Categories with mixed separators</li><li>Publishers with odd whitespace</li><li>Tags missing on certain extensions</li></ul><p>But I didn’t stop there.<br> I manually opened the VS Code marketplace pages of a few entries and cross-checked:</p><ul><li>Does the rating match?</li><li>Are the installs correct?</li><li>Are the categories accurate?</li></ul><p>This manual step gave me <strong>trust</strong> in both the scraper and the AI’s review.</p><h4>Step 3 — Verifying Normalization Logic</h4><p>When ChatGPT suggested fixes (like safe numeric parsing or category normalization),<br> I didn’t just paste them in.</p><p>I checked:</p><ul><li>Does this conversion break edge cases?</li><li>What happens if the field is missing?</li><li>What if the string includes unexpected symbols?</li><li>Will this logic work for all 10,000 rows?</li></ul><p>Whenever I wasn’t sure, I asked AI:</p><blockquote><strong><em>“What are the edge cases for this function?”</em></strong></blockquote><p>It responded with detailed scenarios, which I then validated on real data.</p><p>This is how I ensured normalization in: extensions_data.csv</p><h4>Step 4 — Validating Parallel Scraping</h4><p>Parallel scraping is tricky.<br> Worker crashes, partial writes, I/O collisions — all are possible.</p><p>Before scraping 10k pages, I asked ChatGPT:</p><blockquote><strong><em>“Give me all the failure cases that can happen in parallel scraping.”</em></strong></blockquote><p>It told me to test:</p><ul><li>File locks</li><li>Process crashes</li><li>Partial data writes</li><li>Queue deadlocks</li><li>Long-running worker timeouts</li><li>Rate-limited pages</li><li>Missing selectors</li></ul><p>From there, I manually:</p><ul><li>Ran workers individually</li><li>Killed a worker mid-run</li><li>Simulated network errors</li><li>Interrupted the process and resumed</li></ul><p>This confirmed that the design of /scrape_parallel.pywas safe and resilient.</p><h4>Step 5 — Visual Validation (Charts &amp; Data Patterns)</h4><p>Once the data loaded into Danfo.js, I validated results visually.</p><p>For example:</p><ul><li>If the Publisher Power Curve showed “Microsoft: 10 installs,” that’s clearly wrong → something is broken.</li><li>If the AI Adoption chart showed 0% AI-enabled extensions → clearly wrong.</li><li>If the category distribution didn’t show expected dominance from “Programming Languages,” something was fishy.</li></ul><p>Charts act as <strong>visual sanity checks</strong>.</p><p>Whenever something looked off, I asked:</p><blockquote><strong><em>“Is my aggregation logic correct for this chart? Here is the code snippet.”</em></strong></blockquote><p>AI caught dozens of issues such as:</p><ul><li>Sorting in the wrong direction</li><li>Wrong grouping keys</li><li>Numeric strings not converted</li><li>Missing parseInt on values</li><li>Wrong filtering predicates</li></ul><h4>Step 6 — Screenshot-Based UI Testing</h4><p>I frequently screenshotted the dashboard and asked:</p><blockquote><strong><em>“Review this UI as a UX expert.<br> What looks wrong? What should be improved?”</em></strong></blockquote><p>AI noticed:</p><ul><li>Misaligned labels</li><li>Overcrowded legends</li><li>Clashing colors</li><li>Charts with too many ticks</li><li>Inconsistencies in spacing or font size</li></ul><h4>Step 7 — Double-Checking AI Answers (Avoiding Hallucinations)</h4><p>AI sometimes gave wrong instructions.</p><p>Whenever something felt “too perfect,” I used this prompt:</p><blockquote><strong><em>“Double-check your previous answer.<br> Are you completely confident this is correct?<br> If not, self-correct and tell me why.”</em></strong></blockquote><p>Or:</p><blockquote><strong><em>“Give me two alternative explanations for this issue.”</em></strong></blockquote><p>Or:</p><blockquote><strong><em>“Cross-verify your own logic and list potential weaknesses.”</em></strong></blockquote><p>These meta-prompts helped me:</p><ul><li>Catch hallucinations</li><li>Avoid incorrect selectors</li><li>Catch mistakes in complex aggregation logic</li><li>Prevent subtle bugs</li></ul><h4>Step 8 — Final Trust-but-Verify Loop</h4><p>The final dataset and dashboard were only considered “correct” after passing all checks:</p><p>✔ Data passed multiple AI reviews</p><p>✔ Random rows matched real marketplace pages</p><p>✔ Charts made logical sense</p><p>✔ No crashes in the UI</p><p>✔ No broken selectors in scraping</p><p>✔ No duplicates or malformed fields</p><p>✔ No inconsistent numeric formatting</p><p>✔ Meaningful patterns emerged</p><p>This combination of human validation + AI support is what made the project reliable.</p><h3>Design &amp; UX Decisions — How I Learned to Make the Dashboard Feel “Professional”</h3><p>When you build something technical — like a scraper, or a data pipeline — you don’t immediately think about UX.<br> At least I didn’t.</p><p>But when I moved into the visualization phase, I realized something important:</p><blockquote><strong><em>Good UX is not decoration — it is clarity.</em></strong><em><br> It decides whether insights feel obvious or confusing.</em></blockquote><p>And just like everything else in this project, I learned UX design <em>iteratively</em> with AI.</p><p>Below is exactly how I approached the UX of the visualization dashboard — how I structured it, how I improved it, and how ChatGPT shaped most of the decisions.</p><h4>Step 1 — AI Helped Me Understand Good Dashboard Structure</h4><p>I asked:</p><blockquote><strong><em>“How should I structure a data visualization dashboard for maximum clarity and readability?”</em></strong></blockquote><p>AI explained key principles:</p><ul><li>Group sections into <em>cards</em></li><li>Keep consistent padding &amp; spacing</li><li>Use a stable visual hierarchy</li><li>Limit the number of colors</li><li>Highlight the most important insight first</li><li>Use subtle animations only when necessary</li><li>Reduce text noise</li><li>Add metadata panels to help users understand context</li><li>Separate “Data Loading State” from “Charts Rendered State”</li></ul><p>This gave me the mental model for the entire dashboard layout.</p><h4>Step 2 — I Learned to Use a Component-Based Layout</h4><p>ChatGPT helped me create reusable UI components:</p><ul><li>ChartCard.jsx → for consistent chart containers</li><li>AppHeader.jsx → clean top-level branding &amp; metadata</li><li>DatasetMetaPanel.jsx → collapsible dataset schema</li><li>StatusBanner.jsx → warnings &amp; info</li><li>LoadingState.jsx → consistent skeleton loading</li><li>ErrorBoundary.js → protect the UI from crashes</li><li>Icon.jsx → visual cues everywhere</li></ul><p>These components made the final UI feel structured and intentional — not hacked together.</p><h4>Step 3 — I Used Screenshots to Improve Layout &amp; Spacing</h4><p>Every time a chart looked “off,” I took a screenshot and asked:</p><blockquote><strong><em>“Review this section as a senior UX designer.<br> What would you change?”</em></strong></blockquote><p>AI suggested improvements like</p><ul><li>Increasing top/bottom padding</li><li>Reducing left/right margin</li><li>Making chart titles more descriptive</li><li>Reducing font weight</li><li>Adding subtle background to separate sections</li><li>Aligning grid spacing</li><li>Using consistent font sizes</li><li>Improving color contrast</li></ul><p>These suggestions resulted in visibly better chart cards and smoother overall visual flow.</p><h4>Step 4 — Visual Hierarchy for Charts (This Was a Big Lesson)</h4><p>AI taught me a core concept:</p><blockquote><strong><em>The viewer’s eye should know what to look at first.</em></strong></blockquote><p>So I used hierarchy techniques like:</p><ul><li>A bold, concise <strong>title</strong></li><li>A softer <strong>subtitle</strong> explaining the insight</li><li>Labels with <strong>reduced opacity</strong></li><li>High-contrast colors only for primary data</li><li>Muted colors for supporting elements</li><li>Limited use of borders</li><li>Thin gridlines</li></ul><p>These charts became easier to scan and interpret — especially for first-time users.</p><h4>Step 5 — AI Helped Me Avoid “UX Overload”</h4><p>Some early drafts had:</p><ul><li>Too many legends</li><li>Too many labels</li><li>Too much text</li><li>Unnecessary boxes</li><li>Overly saturated colors</li></ul><p>AI advised:</p><ul><li>Remove data that doesn’t matter</li><li>Hide ticks that add no value</li><li>Use ellipses and truncation</li><li>Add tooltips instead of labels</li><li>Reduce the number of categories shown</li><li>Use ranking or sorting for better clarity</li></ul><p>Less noise = More insight.</p><h4>Step 6 — Accessibility &amp; Responsiveness</h4><p>AI also suggested:</p><ul><li>Using readable font sizes</li><li>Avoiding pure bright red/green contrasts</li><li>Adding aria-labels for interactive elements</li><li>Ensuring charts resize properly in ResponsiveContainer</li><li>Adding loading &amp; error states for screen readers</li></ul><p>I didn’t know these things before.<br> Now they are in every component.</p><h4>Step 7— The Biggest UX Lesson I Learned</h4><p>Throughout this project, ChatGPT repeated a theme:</p><blockquote><strong><em>“Your UI’s job is not to show data. It is to communicate insight.”</em></strong></blockquote><p>This changed how I wrote chart titles, tooltips, and descriptions.<br> I focused on <em>meaning</em>, not just <em>displaying numbers</em>.</p><h3>Key Pitfalls &amp; How AI Helped Me Avoid Them</h3><p><em>The mistakes that mattered, why they happened, and how AI guided me through them.</em></p><p>One of the most important parts of this project wasn’t writing code — it was learning how to navigate the things that went wrong.<br> Scraping 10,000 live pages, cleaning a messy dataset, and building a visualization dashboard is guaranteed to expose every weakness in your process.</p><p>But instead of getting stuck for hours, I used AI as a technical guide and diagnostic partner.</p><h4>1. Fragile Selectors — The Most Common Scraping Failure</h4><p><strong>The Problem</strong></p><p>Scrapers break when they rely on brittle CSS selectors that change without warning.<br> The VS Code Marketplace has inconsistent DOM patterns across extensions, so early on, I kept getting:</p><ul><li>missing fields</li><li>blank values</li><li>incorrect parsing</li><li>unexpected exceptions</li></ul><p>Even selectors that seemed “right” failed on 20% of pages.</p><h4>How AI Helped</h4><p>Every time a selector broke, I pasted the page’s HTML snippet and asked:</p><blockquote><strong><em>“Give me more stable selectors based on DOM semantics, not CSS chains.”</em></strong></blockquote><p>AI guided me toward patterns like:</p><ul><li>itemprop attributes</li><li>role-based selectors</li><li>stable inner element structures</li><li>fallback locators</li><li>optional chaining in extraction</li></ul><p>This reduced failure dramatically.</p><h4>The Lesson</h4><blockquote><strong><em>Scraping isn’t about extracting data — it’s about defending against everything that can change.</em></strong></blockquote><h4>2. Missing or Inconsistent Fields — The Hidden Data Trap</h4><p><strong>The Problem</strong></p><p>On the VS Code Marketplace:</p><ul><li>Some extensions have ratings,some don’t</li><li>Some have categories</li><li>Some have tags</li><li>Some have weird spacing</li><li>Some have old layouts</li><li>Some load content after JS executes</li></ul><p>This meant my first CSV came out with gaps, nulls, and mixed formats — silently corrupting analyses.</p><h4>How AI Helped</h4><p>I uploaded early subsets of the dataset and asked:</p><blockquote><strong><em>“Analyze this dataset and show me all inconsistencies.”</em></strong></blockquote><p>AI found things the naked eye simply wouldn’t:</p><ul><li>rating strings like “4.6 out of 5”</li><li>downloads like “1,234,567”</li><li>categories with inconsistent capitalization</li><li>tags stored as lists or strings</li><li>missing fields represented in three different ways</li></ul><p>Then AI suggested fixes directly inside the scraping logic, not just inside Python cleaning scripts.</p><h4>The Lesson</h4><blockquote><strong><em>A dataset doesn’t become “clean” because you collected it — it becomes clean because you review it.</em></strong></blockquote><h4>3. Data Type Problems — Numbers That Are Not Numbers</h4><p><strong>The Problem</strong></p><p>Numbers scraped from the web are never actually numbers:</p><ul><li>&quot;12,345&quot; → has commas</li><li>&quot;1.2M&quot; → shorthand formatting</li><li>&quot;Yes&quot; / &quot;True&quot; → ambiguous boolean</li><li>&quot;4.4&quot; → fine for floats, but some fields include text</li><li>&quot;Updated Nov 2024&quot; → needs parsing</li></ul><p>Early versions of charts misbehaved because they were “grouping strings,” not numbers.</p><h4>How AI Helped</h4><p>I asked AI to:</p><blockquote><strong><em>“Normalize all numeric-like fields for safe visualization.”</em></strong></blockquote><p>AI generated:</p><ul><li>safe integer parsing</li><li>float extraction</li><li>date normalization</li><li>flattening nested tags</li><li>unified booleans</li><li>consistent category strings</li></ul><p>These changes dramatically improved visualization logic later.</p><h4>The Lesson</h4><blockquote><strong><em>Before charts become accurate, your data types must become honest.</em></strong></blockquote><h4>4. Parallel Scraping Pitfalls — Where All Complexity Multiplies</h4><p><strong>The Problem</strong></p><p>Parallel workers introduced issues I didn’t anticipate:</p><ul><li>workers writing to the same file simultaneously</li><li>incomplete rows</li><li>corrupted lines</li><li>missing checkpoints</li><li>memory spikes</li><li>worker crashes</li><li>race conditions</li><li>partial saves</li></ul><p>When scraping 10,000 extensions, even a <strong>1% failure rate</strong> means <strong>100 broken entries</strong>.</p><h4>How AI Helped</h4><p>I described each crash and asked:</p><blockquote><strong><em>“Help me redesign this scraping architecture to be safe under concurrency.”</em></strong></blockquote><p>AI guided me toward:</p><ul><li>isolated temp files per worker</li><li>merging at the end</li><li>batching instead of constant writes</li><li>long-running checkpoint frequency</li><li>safe multiprocessing Queue usage</li><li>catching worker-level exceptions</li><li>graceful recovery on crash</li></ul><p>This made the scraper predictable and resilient.</p><h4>The Lesson</h4><blockquote><strong><em>Parallelism magnifies every mistake — design it intentionally or it will break silently.</em></strong></blockquote><h4>5. Misleading Chart Outputs — The Hardest Bug to See</h4><p><strong>The Problem</strong></p><p>Charts that look correct can still be logically wrong.</p><p>I encountered issues like:</p><ul><li>grouping before cleaning</li><li>summing strings instead of integers</li><li>category mismatches</li><li>sorting alphabetically instead of numerically</li><li>charts showing “insights” that were actually data errors</li></ul><p>These are the toughest issues because the visualization looks perfectly normal.</p><h4>How AI Helped</h4><p>I used this prompt repeatedly:</p><blockquote><strong><em>“Validate whether this chart logic correctly answers the question I asked.”</em></strong></blockquote><p>AI caught things like:</p><ul><li>reversed sort directions</li><li>cleaning missing categories <em>after</em> plotting</li><li>using wrong axis fields</li><li>plotting the wrong aggregated metric</li><li>incorrect bin sizes</li></ul><p>Each correction made the insights more trustworthy.</p><h4>The Lesson</h4><blockquote><strong><em>Visualization is only as correct as the assumptions behind it.</em></strong></blockquote><h4>6. UX Clutter — When a Dashboard Works But Feels Wrong</h4><p><strong>The Problem</strong></p><p>Early visualizations were technically correct but visually heavy:</p><ul><li>too many labels</li><li>inconsistent spacing</li><li>harsh gridlines</li><li>confusing colors</li><li>overlapping text</li><li>lack of hierarchy</li><li>low readability</li></ul><p>This didn’t come from code errors — it came from design decisions.</p><h4>How AI Helped</h4><p>I sent screenshots and said:</p><blockquote><strong><em>“Review this chart like a UX designer and suggest improvements.”</em></strong></blockquote><p>AI suggested:</p><ul><li>consistent margins</li><li>reducing label density</li><li>stronger card layout</li><li>softer gridlines</li><li>more meaningful titles</li><li>using tooltips instead of labels</li><li>simplifying color palette</li></ul><p>These changes made the dashboard feel clean and intentional.</p><h4>The Lesson</h4><blockquote><strong><em>Data visualization isn’t just coding — it’s communication.</em></strong></blockquote><h4>7. Overtrusting AI’s First Answer — The Subtle Danger</h4><h3>The Problem</h3><p>AI sometimes:</p><ul><li>misidentified DOM elements</li><li>assumed fields exist when they don’t</li><li>interpreted the dataset incorrectly</li><li>generated outdated syntax</li><li>gave overly optimistic logic</li><li>skipped edge cases</li></ul><p>If I trusted these blindly, the entire dataset could have been flawed.</p><h4>How AI Helped Me Fix This Mistake</h4><p>Ironically, AI helped me avoid mistakes <strong>caused by AI</strong> by using self-check prompts:</p><ul><li>“Double-check your answer.”</li><li>“List assumptions you made.”</li><li>“Give multiple explanations for this issue.”</li><li>“Generate edge cases.”</li><li>“Explain why this logic may fail.”</li></ul><p>These prompts made AI more careful and revealed its own uncertainties.</p><h4>The Lesson</h4><blockquote><strong><em>AI becomes dangerous when trusted blindly — and powerful when verified thoughtfully.</em></strong></blockquote><h4>8. The Biggest Pitfall of All — Thinking I Had to Know Everything First</h4><p>This project shattered the idea that I needed to learn everything before starting.</p><p>I didn’t know scraping.<br> I didn’t know parallelism.<br> I didn’t know Danfo.js.<br> I didn’t know React charting.<br> I didn’t know how datasets behave at scale.<br> I didn’t know how to build dashboards.</p><p>And yet I built everything.</p><p>Why?</p><p>Because AI let me <strong>learn while building</strong>, not before.</p><h4>The Lesson</h4><blockquote><strong><em>You don’t need to know everything to begin — you only need to know the next question to ask.</em></strong></blockquote><h4>Final Takeaway from This Section</h4><p>This section isn’t about warnings — it’s about showing the real-world mistakes that shaped the project.</p><p>The key learning wasn’t “how to avoid bugs.”<br> It was:</p><blockquote><strong><em>Mistakes become learning accelerators when AI helps you understand </em>why<em> they happened.</em></strong></blockquote><p>This learning fundamentally changed how I approach new concepts — and how confidently I can tackle them.</p><h3>Conclusion &amp; Next Steps — The New Skill I Gained Wasn’t Scraping or Visualization… It Was Learning With AI</h3><p>When I began this task, I didn’t know anything about:</p><ul><li>Scraping</li><li>Parallel Playwright</li><li>Data cleaning</li><li>Dataset normalization</li><li>Danfo.js</li><li>React-based visualization</li><li>UX</li><li>HuggingFace Spaces</li></ul><p>Yet I ended up building:</p><ul><li>A <strong>10,000-row dataset</strong></li><li>A <strong>parallel, resilient scraping pipeline</strong></li><li>A <strong>professional data visualization dashboard</strong></li><li>A <strong>clean, structured JavaScript codebase</strong></li><li>A <strong>repeatable AI-assisted learning workflow</strong></li></ul><p>And here’s the truth:</p><blockquote><strong><em>The most valuable thing I learned was not scraping or visualization.<br> The most valuable thing I learned was how to learn anything with AI.</em></strong></blockquote><p>That’s the real takeaway of this project.</p><h4>What This Journey Taught Me</h4><h4><strong>✔ You don’t need to know everything to start.</strong></h4><p>You just need to know the next question to ask.</p><h4>✔ AI is not “the answer.”</h4><p>It is a <strong>thinking partner</strong> — a teacher, reviewer, debugger, and designer.</p><h4>✔ Good prompting turns confusion into clarity.</h4><p>The first answer is rarely the right one.<br> But with iteration, review, and validation, you can reach precision.</p><h4>✔ Big tasks become easy when broken into loops.</h4><p>Learn → Try → Review → Fix → Scale.</p><h4>✔ Verification is essential.</h4><p>AI accelerates the process, but <em>your judgment</em> makes the final product trustworthy.</p><h4>What You Can Do Next</h4><p>If you’re a beginner reading this:</p><p><strong>1. Try something small today</strong></p><p>Build a tiny scraper or visualize a small CSV.<br> Use AI to guide you step-by-step.</p><p><strong>2. Don’t be afraid of making mistakes</strong></p><p>AI will help you fix them — and each mistake is a learning opportunity.</p><p><strong>3. Pick a topic you’re curious about</strong></p><p>Let AI walk you through it like a personal mentor.</p><p><strong>4. Build something end-to-end</strong></p><p>Even a simple project will teach you more than watching tutorials.</p><h4>A Final Thought</h4><p>There’s a shift happening in how people learn.</p><p>In the past, you had to:</p><ul><li>search endlessly</li><li>filter tutorials</li><li>read entire docs</li><li>debug alone</li></ul><p>Now you can learn in a loop with an intelligent partner who:</p><ul><li>explains</li><li>simplifies</li><li>reviews</li><li>corrects</li><li>refactors</li><li>and improves the way you think</li></ul><p>This project didn’t make me an expert in scraping or visualization.</p><p>It made me confident that I can tackle any new concept — <br> because I learned <strong>how to learn with AI</strong>.</p><p>And that is a skill that will compound for the rest of my career.</p><h3>Want to Continue This Journey?</h3><p>If you’re reading this blog and want more breakdowns like this — where I show <strong>how I learn</strong>, not just <em>what I built</em> — follow along:</p><blockquote><strong><em>“Follow me for more AI workflow breakdowns and real-world learning stories.”</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd292af30cf2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deepklarity/how-i-use-ai-to-refactor-and-learn-new-concepts-cd292af30cf2">How I Use AI to Refactor and Learn New Concepts</a> was originally published in <a href="https://medium.com/deepklarity">DeepKlarity</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top free-tier LLM API providers — November 2025]]></title>
            <link>https://medium.com/deepklarity/top-free-tier-llm-api-providers-november-2025-1287cc648205?source=rss----f4ddbd72c63c---4</link>
            <guid isPermaLink="false">https://medium.com/p/1287cc648205</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Dheeraj Kumar Anagandula]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 05:43:13 GMT</pubDate>
            <atom:updated>2025-11-12T05:43:12.313Z</atom:updated>
            <content:encoded><![CDATA[<h3>Top free-tier LLM API providers with reasonable quotas— November 2025</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*N7jBRmoCmzHsbjElACyPNw.png" /></figure><h3><em>Part 1:</em> The Best Recurring “Always-Free” Tiers</h3><p>This is the “true” free tier, perfect for hobbyists, students, and sustained projects. These providers offer quotas that refresh daily or monthly, allowing for continuous, low-volume use at no cost.</p><h4>1. Groq (GroqCloud)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*lAghyQyLAmnVhB3rIhRfpw.png" /></figure><p>Groq is the clear market leader for a recurring, high-performance free tier. Its 1,000 daily requests on SOTA models is 20x more generous than Google’s offering for its top model, making it viable for real applications.</p><p><strong>Setup:</strong></p><ol><li>Sign up at <a href="https://console.groq.com/home">GroqCloud</a>.</li><li>Generate an API key in the developer dashboard.</li></ol><blockquote>Note: The 10M token context of Llama 4 is limited to 128k on Groq’s API.</blockquote><h4>2. Google AI Studio (Gemini)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*3mFfqmIIG6WrOMcwpeFeHw.png" /></figure><p>Google structures its free offering with clear tiers. The flagship 2.5 Pro is limited to 50 RPD, which is ideal for “showroom” demos of its most advanced features. The real workhorse for developers is the <strong>Gemini 2.5 Flash-Lite, offering a generous 1,000 RPD</strong>. This high-speed, capable model provides a powerful and practical free solution, making it an excellent starting point for building real applications within the Google ecosystem</p><p><strong>Setup:</strong></p><ol><li>Sign in to <a href="https://aistudio.google.com/welcome">Google AI Studio</a>.</li><li>Generate an API key.</li></ol><blockquote><strong>Tip:</strong> Use the 1,000 RPD Flash-Lite for volume tasks; save your 50 RPD Pro calls for high-reasoning.</blockquote><h4>3. Mistral</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*8VJhjXr-qcvHna8mlZWSxg.png" /></figure><p>Mistral offers a massive <em>volume</em> of tokens per month, but throttles the speed to 1 request per second. This is logical: “Prototype all you want, but pay for production speed.” The biggest risk is the total lack of <em>official</em> documentation on these free limits; they could change at any time.</p><p><strong>Setup:</strong></p><ol><li>Sign up on <a href="https://v2.auth.mistral.ai/login?flow=8924768e-a9a4-428c-a636-9b943d5dfdfe">Mistral’s API platform.</a></li><li>Generate an API key.</li></ol><h4>4.OpenRouter</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*Zza-qPh3Yt44jI5BPoFgpQ.png" /></figure><p>OpenRouter provides a free base tier of <strong>50 RPD (Requests Per Day)</strong>. This “demo” tier is best suited for quick experiments and sampling the platform’s wide variety of models. Much like Google’s Pro tier, the initial limit is designed more for initial testing than for building a full application. Its main value is providing a single, unified API to try out many different models before committing.</p><p><strong>Setup:</strong></p><ol><li>Sign up at <a href="https://openrouter.ai/">OpenRouter.ai</a>.</li><li>Generate an API key.</li></ol><blockquote><strong>Note</strong>: Also provides a very small credit allowance to test paid models.</blockquote><h4>5. Vercel AI Gateway</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*yzEM2cj7FyXcDWuETRUO4g.png" /></figure><p><strong>The Recurring Credit.</strong> This isn’t a model provider, but a gateway. Vercel gives you $5 <em>every month</em> to spend on any API it’s connected to. This is the spiritual successor to the old OpenAI $5 free trial, but it <em>refreshes</em>. A fantastic, stable perk for Vercel users.</p><p><strong>Setup:</strong></p><ol><li>Have a <a href="https://vercel.com/blog/ai-gateway">Vercel account</a>.</li><li>Integrate the AI Gateway into your project.</li></ol><h3>Part 2: The Best One-Time Evaluation Credits (Free Trials)</h3><p>These are “free trials,” not “free tiers.” They are designed for short-term enterprise evaluation (PoCs) and expire once the one-time credit is used or a time limit is reached.</p><h4>1.BytePlus ModelArk</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*xZYC6UPQ13aaHKsJoBMa4w.png" /></figure><p><strong>The Per-Model Trial Credit.</strong> This is one of the most generous and well-structured trials. By giving you a separate 500k-token credit for <em>each model</em>, BytePlus actively encourages you to benchmark them at no cost. The “Free Tokens Only Mode” ensures you are not accidentally charged.</p><p><strong>Setup:</strong></p><ol><li>Sign up for a <a href="https://www.byteplus.com/en/product/modelark">BytePlus ModelArk</a> account.</li><li>Enable “Free Tokens Only Mode” in the dashboard.</li></ol><h4>2. Alibaba Cloud (Model Studio)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*CqAqC-4g4PPyDrAhsS-AKA.png" /></figure><p><strong>The Qwen Benchmarking Trial.</strong> This is very similar to BytePlus’s model. By offering a separate free quota for each model, Alibaba encourages you to test their proprietary Qwen models. It’s a generous trial for anyone benchmarking.</p><p><strong>Setup:</strong></p><ol><li>Sign up for an <a href="https://www.alibabacloud.com/en?_p_lc=1">Alibaba Cloud </a>(International) account.</li><li>Navigate to the Model Studio to access the free token quotas</li></ol><blockquote><strong>Note</strong>: Credit card required.Manually enable the “Free Quota Only” switch for each model to avoid accidental credit card charges.</blockquote><h4>3.AWS Bedrock</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*GbovvPEEWBRTIuN94C-zZQ.png" /></figure><p><strong>The Cloud Ecosystem “Onboarding”.</strong> This is not a free API tier; it’s a new customer acquisition bonus for the entire AWS platform. The $200 credit is generous, but the 6-month expiration date creates urgency, encouraging developers to deploy quickly and become paying customers.</p><p><strong>Setup:</strong></p><ol><li>Sign up for a new <a href="https://aws.amazon.com/bedrock/">AWS account </a>(after July 15, 2025).</li><li>Receive $100 credit.</li><li>Complete onboarding tasks (like making a Bedrock call) for the next $100.</li></ol><blockquote><strong>Note</strong>: Credit card Required.</blockquote><h4>4. Cohere</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*BPKIro5MJBig8ltiifkojw.png" /></figure><p><strong>The Transparent Enterprise Trial.</strong> This is the most professional and straightforward trial. It’s not for hobbyists. The 1,000-call limit is generous enough for a dev team to build and test a robust PoC for a RAG application (using Embed, Rerank, and Chat) before committing to a paid plan.</p><p><strong>Setup:</strong></p><ol><li>Sign up for a <a href="https://cohere.com/">Cohere account</a>.</li><li>Generate a Trial API key.</li></ol><blockquote><strong>Note</strong>: This is an evaluation period ,not a permanent free tier.</blockquote><p>That’s a wrap on the best free tiers out there. For my own projects, I find myself coming back to the <strong>Google AI Studio (Gemini)</strong> API most often.</p><p>If this article helped you, don’t forget to leave a clap!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1287cc648205" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deepklarity/top-free-tier-llm-api-providers-november-2025-1287cc648205">Top free-tier LLM API providers — November 2025</a> was originally published in <a href="https://medium.com/deepklarity">DeepKlarity</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Round-up  of  Free-tier AI Coding Tools — November 2025]]></title>
            <link>https://medium.com/deepklarity/round-up-of-free-tier-ai-coding-tools-november-2025-fa16dc1a543a?source=rss----f4ddbd72c63c---4</link>
            <guid isPermaLink="false">https://medium.com/p/fa16dc1a543a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ai-tools]]></category>
            <dc:creator><![CDATA[Dheeraj Kumar Anagandula]]></dc:creator>
            <pubDate>Mon, 03 Nov 2025 14:48:51 GMT</pubDate>
            <atom:updated>2025-11-03T14:51:02.879Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Best Free-tier AI Coding Tools Available Now<strong> — November 2025</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BzXQ8gs_3x6M-PNC-4V-eg.png" /></figure><p>Navigating the Best Free AI Coding Tools</p><h4><strong>1. </strong><a href="https://github.com/QwenLM/qwen-code/blob/main/README.md"><strong>Qwen Code + Cline</strong></a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*39lh_HcxZXP0VpMwVbx0gA.png" /></figure><p>Qwen3-Coder is excellent for solving smaller tasks and bugs quickly. The speed is very high.Install and configure via Cline for IDE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*LuQa2pbitywyZDSKqfHxRQ.png" /></figure><h4>Setup:</h4><ol><li><strong>Install Qwen-Code CLI</strong></li></ol><ul><li>npm install -g @qwen-code/qwen-code@latest</li></ul><ol><li>Authenticate via the browser popup (OAuth) when prompted by the CLI</li><li>Install VS Code Extension</li><li>Install the “Cline” extension from the VS Code Marketplace and select “Qwen Code” from the model dropdown menu</li></ol><blockquote><strong><em>Tip:</em></strong><em> Use </em><strong><em>qwen-coder-plus</em></strong><em> in “Plan” mode and </em><strong><em>qwen-coder-flash</em></strong><em> in “Act” mode for a smooth workflow.</em></blockquote><h4>2. <a href="https://marketplace.visualstudio.com/items?itemName=GitHub.copilot">GitHub Copilot Free</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rJ9X0Iy4_B7w-M9uoYdQJQ.png" /></figure><p>Access to two premium models included. Limited completions but works well for casual coding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*E3a2V6YDQ0GjzZaAZeSvQQ.png" /></figure><h4>Setup:</h4><ol><li><strong>Install GitHub Copilot</strong> Install the “GitHub Copilot” extension from the VS Code Marketplace.</li><li><strong>Sign In</strong> Sign in to your GitHub account when prompted by the extension.</li><li><strong>Start Coding</strong> You can start using the Copilot models immediately, which are available in the VS Code sidebar.</li></ol><blockquote><strong><em>Note:</em></strong><em> “Edit” mode may have bugs. It is recommended to use “Agent” and “Ask” modes instead.</em></blockquote><h4>3. <a href="https://codeassist.google/">Gemini Code Assist</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XK1iqegjkDmfZFlSRbqbUw.png" /></figure><p>Most generous free tier. 6,000 daily completions (180,000/month) far exceeds all competitors. Includes Gemini CLI for terminal coding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*QRoavTAHVOEVQYC6DsENDA.png" /></figure><h4>Setup:</h4><ol><li><strong>Install the Extension</strong> Install the “Gemini Code Assist” extension in your IDE (e.g., VS Code, JetBrains).</li><li><strong>Sign In</strong> Sign in using your personal Google account when prompted.</li></ol><blockquote><strong><em>Note:</em></strong><em> By default, your code is used for training. You must opt out of this daily in the extension’s settings if you wish to disable it.</em></blockquote><h4>4. <a href="https://cursor.com/download">Cursor</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UfNKPx47j7hJ88KF.png" /></figure><p><strong>Deepest codebase context.</strong> Indexes your entire project for full architectural awareness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*iqHNeM8xeH-L6u0m6NcGIw.png" /></figure><h4><strong>Setup:</strong></h4><ul><li><strong>Download &amp; Run the Installer</strong> Go to the official Cursor website (cursor.com) and download the correct version for your operating system (macOS, Windows, or Linux).</li><li><strong>Launch and Sign In</strong> Open the Cursor application from your applications menu or desktop. You will be prompted to sign in or create a new account to complete the setup.</li></ul><p>Thanks for reading! If you found this blog helpful, please leave a clap.</p><p>I personally like using <strong>GitHub Copilot,</strong> especially since it’s included with the <em>GitHub Student Developer Pack</em>.</p><p>I’d love to hear from you — feel free to share any other AI IDEs or extensions you use in the response below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa16dc1a543a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deepklarity/round-up-of-free-tier-ai-coding-tools-november-2025-fa16dc1a543a">Round-up  of  Free-tier AI Coding Tools — November 2025</a> was originally published in <a href="https://medium.com/deepklarity">DeepKlarity</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CID Characters as AI Agents: Prompts Collection]]></title>
            <link>https://medium.com/deepklarity/cid-characters-as-ai-agents-prompts-collection-fca23687267d?source=rss----f4ddbd72c63c---4</link>
            <guid isPermaLink="false">https://medium.com/p/fca23687267d</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Kartik Godawat]]></dc:creator>
            <pubDate>Sun, 29 Jun 2025 19:31:15 GMT</pubDate>
            <atom:updated>2025-06-29T19:31:14.942Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YEXH3vKnMfMXjIVn" /></figure><p>In the world of <a href="https://en.wikipedia.org/wiki/CID_(Indian_TV_series)"><em>CID</em></a><em> (an Indian crime TV series)</em>, no mystery went unsolved. The squad has incredible instincts, impeccable timing, and iconic one-liners that fans (including myself) still quote to this day. Believe it or not, <strong>their traits map surprisingly well to a software team comprising of AI Agents.</strong></p><p>I’ll list the peronas down, along with some famous dialogues from the series!</p><p>From crisis managers to forensic debuggers, here’s how the cast of <em>CID</em> would fit perfectly in the high-stakes world of AI agents.</p><h3>Agent-1 :: 👮‍♂️ ACP Pradyuman</h3><p><strong>Role:</strong> Project Manager / QA Manager / Bug Triage Commander</p><p><strong>Persona Traits</strong>: Strategic thinker, decision-maker, authority figure, calm under pressure.</p><p><strong>Why Useful</strong>: He can lead the team, make high-level decisions, and maintain a big-picture vision of the product. He’s great at assigning tasks and holding the team accountable.</p><h3><strong><em>Reinforce your agent persona with famous dialogues by ACP Pradyuman:</em></strong></h3><h3><strong>1. “Daya, kuch toh gadbad hai, .”</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*7fcf-0P6fBRYlm-e4Gi9Qw.png" /></figure><p>He doesn’t need logs — he <em>senses</em> something’s off. The hallmark of a QA lead who <strong>flags a broken feature before test cases even run.</strong></p><h3><strong>2. “Daya, darwaza tod do!”</strong></h3><p>When blockers hit hard, <strong>escalate fast</strong>. Break through stuck pipelines or approvals with bold decisions.</p><h3><strong>3. “Jab tak CID hai, tab tak criminals ki neend udhi rahegi!”</strong></h3><p><strong>No bug escapes his team</strong>. Regression, smoke, load — his QA coverage gives devs sleepless nights.</p><h3><strong>4. “Is laash ka muh toh ab <em>Salunkhe</em> hi kholwayega.”</strong></h3><p>He<strong> hands off critical defects for postmortem to the SRE/Data team</strong> (like Salunkhe). Time for deep Forencsics.</p><h3><strong>5. “Pata lagao, koi na koi suraag toh zaroor milega.”</strong></h3><p><strong>Encouraging his team to dig deeper </strong>when flaky tests or intermittent bugs appear.</p><h3><strong>6. “Yeh aise nahi batayega, ise Bureau le chalo.”</strong></h3><p>Bugs that don’t reveal themselves easily? <strong>Isolate bugs, run in sandbox, escalate with logs.</strong></p><h3>Agent-2 :: 🛠️ Senior Inspector Daya</h3><p><strong>Role:</strong> Incident Commander / Crisis Resolution Lead</p><p><strong>Persona Traits</strong>: Strong executor, reliable, hands-on, action-oriented.</p><p><strong>Why Useful</strong>: He’s the one you call to “break the doors” of technical challenges. Handles heavy lifting like backend systems, server ops, or resolving deployment blockers.</p><h3>Agent-3 :: 🧠 Senior Inspector Abhijeet</h3><p><strong>Role:</strong> Senior Developer / Legacy System Expert</p><p><strong>Persona Traits</strong>: Analytical, detail-oriented, calm, has deep experience, works well under stress.</p><p><strong>Why Useful</strong>: He can design system architecture, guide developers, and troubleshoot complex technical issues. He keeps the tech ship running smoothly.</p><h3>Agent-4 :: 🔬 Dr. Salunkhe</h3><p><strong>Role:</strong> RC Analyst/ Debug Analyst</p><p><strong>Persona Traits</strong>: Scientific, data-driven, methodical, sometimes sarcastic, loves lab work.</p><p><strong>Why Useful</strong>: Analyzes logs, metrics, and user data. Provides insights to help design better systems and find the root cause of problems. Challenges even ACP sometimes and forces the entire team to rethink.</p><h3>Agent-5 :: 🤝 Purvi, Sachin &amp; Pankaj</h3><p><strong>Role:</strong> QA Engineers / Bug Hunters / Internal Tools Maintainers</p><p><strong>Persona Traits:</strong></p><ul><li><strong>Purvi:</strong> Detail-oriented, composed, quietly assertive.</li><li><strong>Sachin:</strong> Logical, team-first mindset, often connects fragmented clues.</li><li><strong>Pankaj:</strong> Light-hearted, observant, ready to take on anything thrown his way.</li></ul><p><strong>Why Useful:</strong> This trio forms the backbone of test coverage and internal tools support. Purvi automates tests and spots user-side issues others miss. Sachin pieces together odd symptoms across features. Pankaj steps in anywhere, bringing comic relief and consistent delivery on edge case testing.</p><h3>🧩 Conclusion: The CID AI Squad is ready!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oSXJfiij1iVwqwfIeojf8A.png" /><figcaption>Visual Diagram of CID team as AI agents ^_^</figcaption></figure><p>The squad’s sharp instincts, legendary teamwork, and timeless one-liners make them the perfect blueprint for AI-driven problem solver agents.</p><p><strong>So the next time you’re stuck</strong> debugging a mystery bug, handling a production incident, or chasing down a flaky test — <strong>try launching your AI agents with these CID personas</strong>. Let them investigate, break barriers, find root causes, and bring that classic CID energy into your sprint.</p><p>Thank you for reading. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fca23687267d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deepklarity/cid-characters-as-ai-agents-prompts-collection-fca23687267d">CID Characters as AI Agents: Prompts Collection</a> was originally published in <a href="https://medium.com/deepklarity">DeepKlarity</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Training YOLO on Custom Datasets to Build Accurate and Efficient Object Detection Models]]></title>
            <link>https://medium.com/deepklarity/training-yolo-on-custom-datasets-to-build-accurate-and-efficient-object-detection-models-fd64007af04e?source=rss----f4ddbd72c63c---4</link>
            <guid isPermaLink="false">https://medium.com/p/fd64007af04e</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[yolov11]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Pratham]]></dc:creator>
            <pubDate>Wed, 18 Dec 2024 05:26:56 GMT</pubDate>
            <atom:updated>2024-12-18T05:26:56.127Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xaewZ_6YeJ4Y0aMAaDYNWQ.png" /></figure><p>Object detection has become a cornerstone of computer vision from finding applications in fields like autonomous driving, surveillance, healthcare services to niche areas such as wildlife monitoring and precision agriculture. Among the many frameworks available, the YOLO (You Only Look Once) family of models stands out for its speed and accuracy, making it a go-to choice for real-time applications.</p><p>Think about your desk — scattered pens, a stapler you can never find, and paper clips hiding in plain sight. What if you had a system that could quickly identify and organize all your stationery? That’s where YOLO comes in, a well-established and powerful tool for object detection.</p><p>In this blog, I’ll share my experience training a YOLO model to recognize and categorize stationery items. I’ll walk through how I prepared the custom dataset, trained the model, and evaluated its performance. Let’s explore how YOLO made it easier for me to organize my workspace!</p><h3><strong>Step 1: Download and import libraries.</strong></h3><p>Download the following libraries via pip:<br>1. <em>ultralytics.</em><br>2. <em>datasets</em> (if any datasets are to be imported from sources like huggingface).<br>3. <em>fire </em>(to take parameters from CLI).</p><pre>import os<br>import fire<br>from datasets import load_dataset<br>from ultralytics import YOLO<br>from config import YoloModels,Device</pre><p>Config is just a local<em> .py</em> file to change the device and the yolo model used.</p><h3><strong>Step 2 : Curate the dataset.</strong></h3><p>To train a YOLO model for detecting specific classes, the training data must include images and corresponding text files that specify the classes and their locations (bounding boxes). Classes, like [pen, pencil, sharpener], define what the model will detect. Bounding box data is stored in text files with the same name as the images but with a .txt extension. Each file contains [class_label, x_center, y_center, width, height].The class label is the integer value assigned to each of the classes and the other values are the center coordinates and dimensions of the bounding box normalized to decimal values between 0 and 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*-XqdsLKgccYHXE43llbVNQ.png" /><figcaption>one row from a labels .txt file.</figcaption></figure><p>Annotation tools like <a href="https://labelstud.io/">Label Studio</a> can simplify creating these text files. If you are using existing datasets from sources like <a href="https://huggingface.co/">Huggingface</a> or <a href="https://www.kaggle.com/">Kaggle</a>, ensure the bounding box data is in YOLO format. If not, convert it before training the model.</p><h3><strong>Step 3 : Train your model.</strong></h3><p>Before training your YOLO model, divide your dataset into training and validation sets to evaluate performance metrics effectively. Next, create a .yaml file that specifies the dataset&#39;s path, target classes, and paths to the training and validation sets that looks something like this.</p><pre># Dataset path<br>path: path\to\your\dataset<br><br># Directories for training and validation images and labels<br>train: path\to\train<br>val: path\to\val<br><br>#class names<br>names:<br>  0: pen<br>  1: pencil<br>  2: sharpener</pre><p>To train the model, refer to the following code:</p><pre>def train_yolo(data_yaml_path = &quot;your_yaml_file.yaml&quot;, n_epochs = 5, img_sz = 640, output_path=&quot;output/&quot;, name=&quot;train_xyz&quot;):<br>    &quot;&quot;&quot;<br>    Trains the yolov11 model with the custom dataset <br><br>    Args:<br>        data_yaml_path: The path to the yaml file for yolo training.<br>        n_epochs: Number of epochs to train the model for.<br>        img_sz: Size of the image.<br>        output_path: path to store the model in.<br>        name: provide the name of the train folder.<br>    &quot;&quot;&quot;<br>    <br>    model = YOLO(YoloModels.yolo11n)<br><br>    model.train(<br>        data = data_yaml_path,<br>        epochs = n_epochs,<br>        imgsz = img_sz,<br>        device = Device.cpu,<br>        project = output_path,<br>        name = name<br>    )</pre><p>The device parameter is used to provide the processor to be used for model training, you can use ‘cpu’ or ‘gpu’ depending on your available hardware.img_sz is the image size that all the images fed to the model are resized to for training. YoloModels is another local <em>.py</em> file which is used to take the yolo version as an input. You can hardcode “<em>yolo11n.pt</em>” for this instead or go through the <a href="https://docs.ultralytics.com/models/#featured-models">yolo documentation</a> and pick a version.</p><p>When training, remember: a larger dataset typically requires more epochs for good accuracy, while a smaller dataset may need careful tuning to prevent overfitting. Every training process generates two pre-trained models for performing inference on images: best.pt and last.pt, which are stored in the runs/detect/train/weights directory by default.</p><h3>Step 4: Evaluate performance metrics.</h3><p>Once the YOLO model finishes training, the results folder generated during the process provides valuable insights into its performance. Inside the folder, you’ll find a file named results.png that visualizes key metrics like precision, recall, mAP (mean average precision), and loss across epochs. By analyzing these charts, we can identify patterns, such as whether the model is overfitting or improving steadily, and make informed decisions about further training or dataset adjustments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*aDaeNBFJDyTp5Y1fH1yaiw.png" /></figure><h3><strong>Step 5: Perform Inference.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G6N0LDzkelmTjZtmP4EVLA.png" /></figure><p>Steps to Perform Inference:</p><ol><li><strong>Load the Model</strong>: Use the YOLO function from the ultralytics library to load your .pt model.</li><li><strong>Process the Input</strong>: Pass the image to the model for inference. The model will return predictions, including detected classes, bounding box coordinates, and confidence scores.</li><li><strong>Visualize Results</strong>: You can use the functions provided by Ultralytics to visualize the image with bounding boxes or simply use the show() function for a quick visualization.</li><li><strong>Save Output</strong>: Save the processed image in a specified output directory for easy retrieval and further reference.</li></ol><pre>def infer(pt_model=&quot;&quot;, output_path=&quot;results/&quot;, img=&quot;&quot;):<br>    os.makedirs(output_path, exist_ok=True)<br>    <br>    model = YOLO(pt_model)<br>    <br>    # Perform inference<br>    results = model(img)<br><br>    # Define a path to save the result<br>    output_image_path = os.path.join(output_path, &quot;result_image.jpg&quot;)<br><br>    # Save the result image to the output directory<br>    results[0].save(output_image_path)<br><br>    # Optionally, you can also display the image<br>    results[0].show()</pre><p>That’s it! Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd64007af04e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deepklarity/training-yolo-on-custom-datasets-to-build-accurate-and-efficient-object-detection-models-fd64007af04e">Training YOLO on Custom Datasets to Build Accurate and Efficient Object Detection Models</a> was originally published in <a href="https://medium.com/deepklarity">DeepKlarity</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How AI Simplifies My Daily Life: 5 Real-World Applications]]></title>
            <link>https://medium.com/deepklarity/how-ai-simplifies-my-daily-life-5-real-world-applications-cb4272a0fde7?source=rss----f4ddbd72c63c---4</link>
            <guid isPermaLink="false">https://medium.com/p/cb4272a0fde7</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Chaitanyamayi Pandey]]></dc:creator>
            <pubDate>Tue, 06 Aug 2024 09:31:16 GMT</pubDate>
            <atom:updated>2024-08-08T05:23:54.274Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey there!</p><p>As a technology enthusiast, I can’t help but marvel at how Artificial Intelligence (AI) has woven itself into the fabric of our daily lives. It’s no longer just a fancy buzzword; it’s something that genuinely makes our lives easier, more productive, and even healthier.</p><p>Today, I want to share with you five practical ways AI pops up in my day-to-day routine and how it impacts me and the people around me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AX-8OJLdjGk55hka4mI_ew.jpeg" /><figcaption>Image by DALL-E</figcaption></figure><h3>Personalized Recommendations</h3><p>One of the coolest ways AI makes a difference in my life is through personalized recommendations. Whether I’m browsing for a new outfit or binging on Netflix, AI algorithms are working behind the scenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ITsewMKdo04G2rH4afmbsw.png" /><figcaption>Image by DALL-E</figcaption></figure><p><strong>Platforms like </strong><a href="https://www.amazon.in/?&amp;tag=googhydrabk1-21&amp;ref=pd_sl_5szpgfto9i_e&amp;adgrpid=155259813593&amp;hvpone=&amp;hvptwo=&amp;hvadid=674893540034&amp;hvpos=&amp;hvnetw=g&amp;hvrand=15610504679364141069&amp;hvqmt=e&amp;hvdev=c&amp;hvdvcmdl=&amp;hvlocint=&amp;hvlocphy=9301536&amp;hvtargid=kwd-64107830&amp;hydadcr=14452_2316413&amp;gad_source=1"><strong>Amazon</strong></a><strong> and </strong><a href="https://www.netflix.com/in/"><strong>Netflix</strong></a><strong> analyze my past behavior, preferences, and interactions to suggest items or shows that I might like.</strong> It’s almost eerie how accurate these recommendations can get like they know me better than I know myself.</p><p><em>Just last week, Amazon suggested this stylish and practical backpack that’s perfect for carrying my textbooks and laptop around campus. And on Netflix, “The Staircase,” a gripping documentary about a real-life murder case, popped up as a recommendation. I ended up binge-watching the whole thing in a weekend!</em></p><h3>Virtual Assistants</h3><p>Virtual assistants are absolute game-changers! From setting reminders and sending texts to controlling smart home gadgets, Siri, Alexa, and Google Assistant have got it all covered. I usually start my day by saying,<strong><em> “Hey Google, do I have any meetings today?”</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*ZnJttQgO0OQ6nWdO6U68Hw.png" /><figcaption>Image by DALL-E</figcaption></figure><p>Last month, I was running late for a meeting and had a last-minute request to prepare a presentation. I asked <a href="https://assistant.google.com/">Google Assistant</a> to <strong><em>pull up my notes and draft a quick outline</em></strong>. By the time I arrived, everything I needed was ready to go.</p><p>In the evening, I ask <a href="https://www.alexa.com/">Alexa</a> to <strong><em>dim the lights</em></strong>, creating the perfect ambiance for winding down. These smart devices make everyday tasks so much easier and more convenient.</p><p><em>Throughout the day, they remind me of meetings, send texts, and find the fastest routes. In the evening, they set the perfect mood with just a voice command. These handy helpers make life smoother, freeing up time for the fun stuff.</em></p><h3>Healthcare and Fitness</h3><p>AI is revolutionizing healthcare and fitness in the coolest ways! With devices like Fitbits and health apps, it feels like I have a personal trainer and health coach right on my wrist, guiding me every step of the way.</p><p>When I go for a jog, my <a href="https://www.fitbit.com/global/in/home">Fitbit</a> is like my biggest cheerleader. It <strong><em>tracks every step</em></strong>, <strong><em>tells me when to speed up or slow down</em></strong>, and even<strong><em> congratulates me when I hit my goals</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*raMsZvxxDItJpGhFyYcs6w.png" /><figcaption>Image by DALL-E</figcaption></figure><p>After my workout, it offers <strong><em>personalized tips</em> </strong>to keep me motivated and improving. At night, it transforms into a sleep guru, <strong><em>analyzing my sleep patterns and suggesting ways to get better rest</em></strong>.</p><p><em>These smart gadgets make staying healthy exciting and interactive, helping me achieve my fitness goals in a fun and engaging way.</em></p><h3>Smart Home Devices</h3><p>While my home isn’t yet fully equipped with the latest smart home technology, I am excited about the potential benefits it could bring.</p><p>For instance, <strong>smart thermostats</strong> are one piece of technology that excites me. These devices can significantly enhance energy efficiency and comfort by learning from our behavior and adjusting the temperature automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CskuuJGgtmV7dMx7k0b9Vg.png" /><figcaption>Image by DALL-E</figcaption></figure><p><em>A friend of mine in Germany has a smart thermostat, and she constantly raves about how convenient it is. When she leaves for work, it lowers the temperature to save energy, and just before she returns, it warms up the house.</em> <em>This way, her home is always comfortable, and she saves on energy bills effortlessly.</em></p><p>Hearing about her experience makes me eager to see such technology become more accessible in India, where it could offer similar benefits.</p><h3>Personal Finance Management</h3><p>AI is transforming the way I manage my finances, making it more efficient and personalized.</p><p>Apps like Mint and YNAB (You Need A Budget) use AI to help track spending, create budgets, and provide insights into financial habits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V3OlY6fhNRHP7B9aBiRBvg.jpeg" /><figcaption>Image by DALL-E</figcaption></figure><p>For example, I use an app that analyzes my spending patterns and automatically categorizes my expenses. It alerts me when I’m overspending in a particular category and suggests adjustments to stay within my budget.</p><p>The app also provides personalized tips on saving money based on my financial behavior.</p><h3>The Future of AI</h3><p>As exciting as the current applications of AI are, the future holds even more fascinating possibilities.</p><p>One idea that excites me is<strong> AI’s potential in education.</strong></p><p><em>I can imagine an AI system that listens to my entire lecture along with me. By the end of the day, it would provide me with detailed, summarized notes tailored to my understanding and study preferences.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2TO-pViulDT12yAQzkFBfg.png" /><figcaption>Image by DALL-E via ChatGPT</figcaption></figure><p><strong>Think about how much easier studying would become.</strong> Instead of frantically scribbling notes and possibly missing important points, I could focus entirely on understanding the lecture. The AI would handle the note-taking, capturing every detail and nuance. After class, I’d receive a neatly organized summary of the key points, complete with highlights of the most important information, relevant resources for further reading, and even practice questions to test my understanding.</p><p><strong>This kind of personalized assistance could completely transform how I learn.</strong> It would make education more accessible and effective, helping me grasp complex topics more easily and making the whole process of learning much more efficient.</p><p>Thank you for reading! I hope you found these insights into how AI simplifies my daily life interesting and relatable.</p><p>I’d love to hear about your experiences with AI. What’s your favorite way AI helps you in your daily routine?</p><p>Share your stories and thoughts in the comments below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb4272a0fde7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deepklarity/how-ai-simplifies-my-daily-life-5-real-world-applications-cb4272a0fde7">How AI Simplifies My Daily Life: 5 Real-World Applications</a> was originally published in <a href="https://medium.com/deepklarity">DeepKlarity</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to handle iframe in Selenium (Python)]]></title>
            <link>https://medium.com/deepklarity/how-to-handle-iframe-in-selenium-python-2898fbf8e12f?source=rss----f4ddbd72c63c---4</link>
            <guid isPermaLink="false">https://medium.com/p/2898fbf8e12f</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[iframe]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[web-scraping]]></category>
            <dc:creator><![CDATA[Ayush Ranwa]]></dc:creator>
            <pubDate>Thu, 30 Jun 2022 13:27:41 GMT</pubDate>
            <atom:updated>2022-06-30T13:27:41.167Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to handle an iframe in Selenium (Python)?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lb8ogv8_lt1Ae4HRHCHmTg.jpeg" /><figcaption><a href="https://kinsta.com/blog/wordpress-iframe/">Image Source</a></figcaption></figure><h3><strong>What is an iframe?</strong></h3><p>An inline frame (iframe) is a HTML element that loads another HTML page within the document. An iframe is used in webpages where external content is displayed like vidoes, advertisements, Google Maps, etc.</p><p>iframe is supported by majority of the browsers: <em>Google Chrome, Mozilla Firefox, Safari, Microsoft Edge, Opera</em></p><h3>The need to handle iframe separately</h3><p>Let us try to print the text of &lt;h4&gt; tag text, shown below, using selenium.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*i7EZcerPzVyuPvCq0a44iQ.png" /><figcaption><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe">Code Source</a></figcaption></figure><p>Selenium python code for the above query would be:</p><pre>heading = driver.find_element(By.XPATH,&quot;//h4[<a href="http://twitter.com/class">@class</a>=&#39;output-heading&#39;]&quot;)</pre><pre>print(heading.text)</pre><p>The expected output should be:</p><pre>HTML Demo: &lt;iframe&gt;</pre><p>But actually we will get an error, stated below:</p><pre>Message: no such element: Unable to locate element: {&quot;method&quot;:&quot;xpath&quot;,&quot;selector&quot;:&quot;//h4[@class=&#39;output-heading&#39;]&quot;}<br>  (Session info: chrome=104.0.5112.20)<br>Stacktrace:<br>Backtrace:<br>	Ordinal0 [0x0030AF23+2207523]<br>	Ordinal0 [0x002A30E1+1781985].....</pre><p>The error reports that, the code is not able to locate the element by the respective xpath. This is because the element which is represented by the xpath is not part of the current webpage. The &lt;h4&gt; tag is part of an iframe.</p><p>Here comes the need to switch from parent frame to the required iframe.</p><h3><strong>How to find a &lt;iframe&gt; tag on a webpage?</strong></h3><ul><li>Right-click on the webpage and click on <strong>Inspect</strong>. Press <strong>Ctrl + F </strong>and type <strong>‘//iframe’</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*dNwAlWzEgLVp5FZ8NEPQJg.png" /></figure><ul><li>You will get the total number of &lt;iframe&gt; tags near the search bar. Current &lt;iframe&gt; will be highlighted in yellow. You can press <strong>Enter</strong> to iterate over all the &lt;iframe&gt; tags.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*vw-5yoXgRRyW0BNVAxdRag.png" /><figcaption><a href="https://kinsta.com/blog/wordpress-iframe/">Code Source</a></figcaption></figure><h3><strong>How to switch to an iframe in Selenium</strong></h3><h4>Approach #1: You can use the XPATH to locate a &lt;iframe&gt; tag</h4><pre>iframe = driver.find_element(By.XPATH, &quot;&lt;iframe&gt; XPATH&quot;)</pre><p>Then <strong>switch_to</strong> to <strong>&lt;iframe&gt;</strong></p><pre>driver.switch_to.frame(iframe)</pre><h4>Approach #2: Using Index</h4><p>An index represents the position of a particular iframe on a HTML page. If we have 10 iframes, and we want to switch to first, then we can give 0 as index or position of that iframe.</p><pre>driver.switch_to.frame(0)  # switching to first iframe<br>driver.switch_to.frame(1)  # switching to second iframe</pre><h3>Correctly fetching an element within iframe</h3><p>Now that we know how to switch frames, let’s try again.</p><p>First we switch to the respective iframe, using <em>XPATH.</em></p><pre>iframe = driver.find_element(By.XPATH,&quot;//iframe[contains(<a href="http://twitter.com/class">@class</a>,&#39;interactive&#39;)]&quot;)</pre><pre>driver.switch_to.frame(iframe)</pre><p>Now, as we have switched to the iframe, we can print the text of the &lt;h4&gt; tag.</p><pre>heading = driver.find_element(By.XPATH,&quot;//h4[<a href="http://twitter.com/class">@class</a>=&#39;output-heading&#39;]&quot;)</pre><pre>print(heading.text)</pre><p>Output:</p><pre>HTML Demo: &lt;iframe&gt;</pre><h3>How to switch back to parent iframe?</h3><p>To switch back to the <em>parent iframe</em> you can use the following line of code:</p><pre>driver.switch_to.parent_frame()</pre><h3>How to switch back to main web page?</h3><p>To switch back to the <em>main web page </em>you can use the following line of code:</p><pre>driver.switch_to.default_content()</pre><h3>How to handle dynamic iframe?</h3><ul><li>iframe properties can change dynamically on some web pages, such as iframe <em>id</em> or iframe <em>name </em>every time we reload a webpage, but the position of an iframe remains the same.</li></ul><pre><em>&lt;iframe id = ‘iframe_1234’&gt;…&lt;/iframe&gt;</em></pre><ul><li>Here, <em>‘iframe_’ </em>remains same but the numeric values may change with every page load.</li><li>To tackle this problem we can use the iframe <em>index</em> or iframe <em>xpath</em> to uniquely identify an iframe. For example, the below xpath refers to an unique iframe.</li></ul><pre>//iframe[@owner=&#39;archetype&#39;]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*vmedLf5whWt35Htqr2rAXg.png" /><figcaption><a href="https://kinsta.com/blog/wordpress-iframe/">Code Source</a></figcaption></figure><h3><strong>References</strong></h3><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe">: The Inline Frame element - HTML: HyperText Markup Language | MDN</a></li><li><a href="https://www.browserstack.com/guide/handling-frames-in-selenium">Handling iFrames in Selenium : Tutorial | BrowserStack</a></li></ul><h3>Conclusion</h3><p>While scraping webpages, we may encounter with iframes, and without switching it is not possible to interact with an iframe in Selenium. So, it is important to know how to switch between iframes using Selenium Python.</p><p>Hope this article helped you in understanding iframe handling in selenium.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2898fbf8e12f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deepklarity/how-to-handle-iframe-in-selenium-python-2898fbf8e12f">How to handle iframe in Selenium (Python)</a> was originally published in <a href="https://medium.com/deepklarity">DeepKlarity</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Training an ML classifier model]]></title>
            <link>https://medium.com/deepklarity/training-an-ml-classifier-model-fa346a51a31a?source=rss----f4ddbd72c63c---4</link>
            <guid isPermaLink="false">https://medium.com/p/fa346a51a31a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[fastai]]></category>
            <dc:creator><![CDATA[Prakharpandey]]></dc:creator>
            <pubDate>Thu, 08 Oct 2020 13:03:44 GMT</pubDate>
            <atom:updated>2020-10-08T13:03:44.310Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This blog is a <a href="https://medium.com/deepklarity/clean-or-messy-classifier-f7d81757be27">part of series <strong>Clean or Messy Classifier</strong></a> . Check out the entire series for detailed implementation of deploying a machine learning classifier into web app using various frameworks.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ckw00R7kE6zBNLqEWvUrfQ.png" /></figure><blockquote>In this article, We will discuss how two different libraries, namely FastaiV2 and Keras, can be used to train an image classification model.</blockquote><h3>Fastai V2</h3><p><strong>Dataset:<br></strong>To begin with training an ML model, the first step is collecting a <em>Dataset. I</em>n this project, we wanted our data as images of both, clean as well as messy surroundings. You can refer to <a href="https://medium.com/@archit.sharma_1893/creating-a-machine-deep-learning-dataset-from-google-images-using-selenium-e9e8ed2f0520">this </a>link for creating a good quality <em>Dataset </em>of images. Once the <em>dataset</em> was ready, we had to split it into <em>training</em> and <em>validation</em> set which was done by the following piece of code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*R9OTWHpNHIsoj0dyUYtGMQ.png" /></figure><p><strong>Loading the images:<br></strong>With the help of <em>‘ImageDataLoaders.from_name_func’ </em>we load all the images from a specified path and resizing it at the same time.</p><pre>dls = ImageDataLoaders.from_name_func(<br>    &#39;&#39;, get_image_files(path), valid_pct=0.15, seed=42,<br>    label_func=is_clean, item_tfms=Resize(224))</pre><p>The <em>‘is_clean’ </em>is a helper function imported from <em>utils </em>file that will help the model to know whether the image is clean or messy. Since, in our Dataset we had two kinds of images, clean and messy. Clean images were named as , ‘<em>Clean_1.jpg</em>’ i.e. the first letter is uppercase and messy images were named as, ‘<em>messy_1.jpg</em>’ i.e. the first letter is lowercase. This is how our model differentiated between a clean and a messy image. below given code is the <em>is_clean </em>function,</p><pre>def is_clean(x): <br>     return x[0].isupper()</pre><p><strong>Making a model learn from labelled data:</strong></p><pre>model = cnn_learner(dls, resnet18, metrics=error_rate)</pre><p>ResNet-18 is a CNN based architecture that is 18 layers deep.<br>Once the model was fitted, we used it to predict the responses for the images in the <em>validation dataset.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPqCsRZC9vGTfVw4rz6few.png" /></figure><p><strong>Testing the model in Test dataset:<br></strong>After getting results from validation data set, it was important to test the model in a Test data set to make an unbiased evaluation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xeKPbDvUvHc-Hx04GZGzQ.png" /></figure><p><strong>Saving the model:</strong></p><pre>os.makedirs(“models”, exist_ok=<strong>True</strong>)<br>model.export(‘models/model_v0.pkl’)</pre><h3>Keras</h3><p>For working with <em>Keras</em>, we used the approach of <em>Transfer Learning </em>for training a model. <em>Transfer Learning</em> is very popular in deep learning as it can train <em>deep neural networks</em> in a relatively less data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qnRvZWw6gGdWRjkXRVC4PA.png" /></figure><p><strong>Data Augmentation:</strong></p><p>Data Augmentation means to make data “greater” or “increase”. In Keras this is done by <em>ImageDataGenerator </em>function. This function basically accepts the batch of image and apply a series of random transformations to each image(including random rotation, resizing, shearing, etc.) in batch and then replace the original batch with the new, randomly transformed batch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*xrMEozYHe15EZ44FAhfq1A.png" /></figure><p>Similarly <em>validation_generator </em>is also made.</p><p><strong>Training the model:<br></strong>The model is trained using following piece of code</p><pre>model.fit(<br>        train_generator,<br>        epochs=EPOCHS,<br>        validation_data=train_generator)</pre><p><strong>Evaluating the model:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*OOHw5ADMUh57PPd2nCZ5Rw.png" /></figure><p><strong>Testing the model:<br></strong>Testing the model in a Test data set to make an unbiased evaluation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*fXyTU_nTa88IHUnRoBKXkw.png" /></figure><p><strong>Saving the model:</strong></p><pre>keras.models.save_model(model, &quot;models/keras_model.h5&quot;)</pre><h4>Loading the model</h4><p>There are various approaches to load a ML model for an end user product. To get the understanding of loading an ML model, you can refer to the links given below. The models discussed in this blogs are the same that we loaded.<br><a href="https://medium.com/@prakharpandey.13/building-a-rest-api-using-flask-to-deploy-a-machine-learning-model-on-a-back-end-server-a9645dbc8b6f"><strong>This link</strong></a> will show you how to load a model in a backend API and return appropriate response.<br><a href="https://medium.com/@prakharpandey.13/building-a-reactjs-front-end-to-interact-with-a-machine-learning-model-104b4fc8904d"><strong>This link</strong></a> will show you how to load a model in frontend of a web app using <em>tensorflowjs.</em></p><p><strong>Refer to this </strong><a href="https://github.com/deepklarity/clean-or-messy/tree/main/trainer"><strong>link</strong></a><strong> to download the model.</strong></p><p>That’s it for this article. Please comment and share if you face any issues or errors using this approach. If you have used an alternate approach please share.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa346a51a31a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deepklarity/training-an-ml-classifier-model-fa346a51a31a">Training an ML classifier model</a> was originally published in <a href="https://medium.com/deepklarity">DeepKlarity</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a REST API using Flask to deploy a Machine Learning Model on a back-end server]]></title>
            <link>https://medium.com/deepklarity/building-a-rest-api-using-flask-to-deploy-a-machine-learning-model-on-a-back-end-server-a9645dbc8b6f?source=rss----f4ddbd72c63c---4</link>
            <guid isPermaLink="false">https://medium.com/p/a9645dbc8b6f</guid>
            <category><![CDATA[base64]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Prakharpandey]]></dc:creator>
            <pubDate>Thu, 08 Oct 2020 13:01:51 GMT</pubDate>
            <atom:updated>2020-10-08T13:01:51.414Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This blog is a <a href="https://medium.com/deepklarity/clean-or-messy-classifier-f7d81757be27">part of series <strong>Clean or Messy Classifier</strong></a> . Check out the entire series for detailed implementation of deploying a machine learning classifier into web app using various frameworks.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*P3zEg0Av2-M__wwk4rP_2A.png" /></figure><h4>Why use a REST API to deploy a Machine learning(or deep learning) model?</h4><p>As a data scientist if you desire to showcase your work in a web app or a mobile app you will require a back-end server where your model is loaded that can interact with your front-end. This is possible with the help of a REST API. <br>Another advantage of REST API is that your model can be used by multiple developers working on different platforms such as web app or mobile app.</p><h4>About the model</h4><p>For this article, we used a simple image classification model that is trained to predict whether the surrounding in the image is clean or not.</p><p><strong>Working of the API:-</strong><br>When a POST request is made by any front-end server to this API, the following are the processes that take place:-<br>1) Firstly, it is checked whether the file is of valid extension(in this case- jpg, jpeg, or png) or a <em>base64 string</em>. <br>2) The image is saved inside a folder for future use.<br>3) The saved image is then passed to a function where a Machine Learning model predicts whether the surrounding in the image is clean or not.<br>4) Once the result is being computed, a <em>JSON</em> response is returned back to the front-end.</p><p><strong>NOTE</strong> — <br>While working with image classifier models we need to pass a <em>numpy</em> array (or pillow image if using a wrapper) for prediction. It&#39;s easy to convert an image into a <em>numpy</em> array but what if an image is sent in the form of a <em>base64 string </em>or<em> </em>a<em> base64 DataURI</em>?<br>So in this article, an easy approach to handle this issue is also explained.</p><h3><strong>Creating the API and deploying model is explained in the following stages:-</strong></h3><h4>1. Setting up the root directory, upload folder, model, and other constants.</h4><pre>app = Flask(__name__, root_path = &#39;cleanvsmessy/&#39;)<br>CORS(app)<br>api = Api(app)<br>model = load_learner(&#39;model/model_v0.pkl&#39;)<br>UPLOAD_FOLDER = &#39;uploads&#39;<br>app.config[&#39;UPLOAD_FOLDER&#39;] = UPLOAD_FOLDER<br>ALLOWED_EXTENSIONS = ([&#39;png&#39;, &#39;jpg&#39;, &#39;jpeg&#39;])<br>def is_allowed_filename(filename):<br>   return &#39;.&#39; in filename and filename.rsplit(&#39;.&#39;, 1)[1].lower() in ALLOWED_EXTENSIONS</pre><p>model is loaded using ‘<em>load_learner</em>’ which is a function provided in <em>fastai</em> to load a pre-trained model for inference.</p><h4>2. Logic for handling POST request</h4><p>This stage holds the logic of handling POST request. First, we will store the file from the request into a variable. Now the logic is divided into three conditions described below:-<br><strong>Condition 1</strong>- If the file received contains an empty filename then a <em>JSON</em> response is returned with an appropriate message with status code <em>400</em><br><strong>Condition 2</strong>- If the file and filename both are valid then we will first save the image to a folder and then call the <em>predict</em> function for the computation of cleanliness. The return from the <em>predict</em> function is returned as the <em>JSON</em> response with status <em>201</em>.<br><strong>Condition 3</strong>- If the file selected is not an image file then a <em>JSON</em> response is returned with an appropriate message with status code <em>400</em>.</p><pre>file = request.files[&#39;file&#39;]<br>if file.filename == &#39;&#39;:<br>   resp = jsonify({&#39;message&#39;: &#39;No file selected for uploading&#39;})<br>   resp.status_code = 400<br>   return resp<br>if file and is_allowed_filename(file.filename):<br>   filename = secure_filename(file.filename)<br>   file.save(os.path.join(app.config[&#39;UPLOAD_FOLDER&#39;], filename))<br>   path = UPLOAD_FOLDER + &#39;/&#39; + filename<br>   resp = predict(path)<br>   resp.status_code = 201<br>   return resp<br>else:<br>   resp = jsonify({&#39;message&#39;: &#39;Allowed file types are png, jpg, jpeg&#39;})<br>   resp.status_code = 400<br>   return resp</pre><p>After receiving a valid image, we simply save the image to the folder and call the <em>predict</em> function passing path of the image as an argument.</p><h4>3. Handling base64 string and Model function</h4><p>After receiving the image with a valid extension this is the final stage where we will pass the image to the model for the required results. The model loads an image and converts it into a <em>numpy</em> array which is passed as an argument for prediction. Now, the image can be a <em>base64 string</em>(or <em>base64 data URI</em>) or jpg(or any other valid extension), so both are explained below:-<br><strong>base64 string- </strong>First let us see how the image as <em>base64 DataURI</em> looks like. So here is an example-<br><strong><em>“data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAPACAYAAACl4s….”</em></strong><em><br></em>The encoded part after “<em>base64,” </em>is what we will use to first decode it using <em>b64decode</em> which can easily be converted into a <em>numpy</em> array.</p><pre>im = Image.open(BytesIO(base64.b64decode(image.split(&#39;,&#39;)[1])))<br>im.save(&#39;image.png&#39;)<br>image_np = np.array(im)</pre><p><strong>JPG, JPEG, or PNG image- </strong>Images with these extensions are directly saved and converted to <em>numpy</em> array.<br>Below given code is a predict function that uses the loaded model for prediction.</p><pre>def predict(img_path):<br>   img = Image.open(img_path)<br>   print(img)<br>   img_np = np.array(img)<br>   is_clean, _ ,probs = model.predict(img_np)<br>   prob = float(list(probs.numpy())[1])<br>   return {&quot;is_clean&quot;: is_clean , &quot;predictedVal&quot;: prob}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XFiGaCQfnilzRRxJWmc1vw.png" /><figcaption>API tested on postman</figcaption></figure><p>You can refer to <a href="https://medium.com/@prakharpandey.13/building-a-reactjs-front-end-to-interact-with-a-machine-learning-model-104b4fc8904d">this link</a> to know about sending a <em>POST</em> request of an image or a <em>DataURI</em> from a React frontend.</p><p><strong>The code for the above <em>Flask AP</em>I is available at this </strong><a href="https://github.com/deepklarity/clean-or-messy/tree/main/server"><strong>link</strong></a><strong>.</strong></p><p>That’s it for this blog. Please comment and share if you face any issues or errors using this approach. Please share if you have used an alternate approach.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9645dbc8b6f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deepklarity/building-a-rest-api-using-flask-to-deploy-a-machine-learning-model-on-a-back-end-server-a9645dbc8b6f">Building a REST API using Flask to deploy a Machine Learning Model on a back-end server</a> was originally published in <a href="https://medium.com/deepklarity">DeepKlarity</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Reactjs front-end to interact with a Machine Learning model]]></title>
            <link>https://medium.com/deepklarity/building-a-reactjs-front-end-to-interact-with-a-machine-learning-model-104b4fc8904d?source=rss----f4ddbd72c63c---4</link>
            <guid isPermaLink="false">https://medium.com/p/104b4fc8904d</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Prakharpandey]]></dc:creator>
            <pubDate>Thu, 08 Oct 2020 12:59:43 GMT</pubDate>
            <atom:updated>2020-10-08T12:59:43.874Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This blog is a <a href="https://medium.com/deepklarity/clean-or-messy-classifier-f7d81757be27">part of series <strong>Clean or Messy Classifier</strong></a> . Check out the entire series for detailed implementation of deploying a machine learning classifier into web app using various frameworks.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*XzxwddwQiWALBOFfVUbPBw.png" /></figure><h3>Why a web app for machine learning models?</h3><p>If you have been learning Machine Learning for a while now and have created some really cool models from detecting objects to recognizing voices, then you probably would want to showcase your work and effort. But showing someone your Jupyter Notebook isn’t really what you had in mind. Hence, creating a web app to compute results from your model and displaying it to the end-user is a great way to give your ML project a boost.</p><blockquote>In this article, following approaches for displaying a model’s prediction in front-end are discussed.<br>1) Model is loaded in a backend server.<br>2) Model is loaded as a tfjs model in frontend itself. Hence, getting rid of backend server.</blockquote><h3>About the Model</h3><p>For this article, we are using a <em>fastai</em> <em>classifier</em> model for prediction using a backend server. While for predicting results using frontend only, a <em>Keras</em> model converted to <em>TFJS</em> model is used. The model used is a simple image classifier that predicts the cleanliness of the surroundings in the image.</p><h3>About the Frontend</h3><p>The frontend is divided into three components discussed below:-<br>1) Uploading an image to the server.<br>2) Taking an image in real-time using the device’s camera and uploading it to the server.<br>3) Taking an image in real-time and predict using <em>TFJS</em> model loaded in frontend itself.<br>For creating the frontend, we are using React which is an open-source, JavaScript library for building user interfaces. If you are new to React you can refer to <a href="https://create-react-app.dev/docs/getting-started/">this</a> link for setting up with react and getting started.</p><h3>By uploading an image to the server</h3><p>To implement the idea of using a Machine learning model with a frontend webpage to display results, our first approach was to upload an image in the client-side and make an <em>Axios </em>post to fetch the results from the backend server where the model is loaded.<br><strong>Making an Axios post request:-</strong></p><pre>const { apiUrl } = window[‘config’]<br>axios.post(apiUrl, fd)<br>.then(res =&gt; {<br>...<br>})</pre><p><em>‘apiUrl’ </em>is a key<em> </em>imported from config.js holding the URL of the backend as value to pass in Axios. In this case, we used a deployed backend API server but a localhost server can also be used temporarily, just make sure that the localhost is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*J19AvNm2KyPosIWUchiJ3g.png" /></figure><h3>By taking an image in real-time using the device&#39;s camera and uploading it to the server</h3><p>For this approach, we had our image classifier model loaded in a backend server. To work with a camera functionality we made a component, ‘<em>camera</em>’. we used <a href="https://www.npmjs.com/package/react-html5-camera-photo">react-html5-camera-photo</a> to add a camera feature to the webpage. <br><strong>Note- If you are following the above link just know that this saves the image as a base64 DataURI.</strong></p><pre>return (<br>&lt;div&gt;<br>{<br>(dataUri)<br>? &lt;ImagePreview dataUri={dataUri}<br>isFullscreen={isFullscreen}<br>/&gt;<br>: &lt;Camera<br>onTakePhoto={(dataUri) =&gt; { handleTakePhoto(dataUri); }}<br>/&gt;<br>}<br>&lt;div&gt;&lt;h3&gt;The room is clean: {clean}&lt;/h3&gt;&lt;/div&gt;<br>&lt;div&gt;&lt;h3&gt;Confidence: {confidence}&lt;/h3&gt;&lt;/div&gt;<br>&lt;/div&gt;<br>)</pre><p>Axios post is similar as mentioned in the above approach. <br>In the backend server, we dealt with both, an image and a DataURI while building this project. So you can refer to <a href="https://medium.com/@prakharpandey.13/building-a-rest-api-using-flask-to-deploy-a-machine-learning-model-on-a-back-end-server-a9645dbc8b6f">this link</a> to know about how to handle such events in the backend.</p><h3>Taking an image in real-time and predict using <em>TFJS</em> model loaded in frontend itself.</h3><p>After setting up the camera and predicting using a backend server, we noticed a delay in fetching the response from the backend. Now the idea was to get rid of the API server and load the model into frontend itself. This is where <em>tensorflowjs</em>(<em>TFJS</em>) was really handy. <em>TFJS</em> is a library for machine learning in <em>JavaScript </em>through which ML model can be used directly in browser or node. We converted our <em>Keras </em>model<em> </em>to<em> TFJS </em>using the following piece of code in the terminal,<br>tensorflowjs_converter --input_format keras \<br> path/to/my_model.h5 \<br> path/to/tfjs_target_dir</p><h4>Loading the model to React:-</h4><pre>const model = await tf.loadLayersModel(‘/tfjs/model.json’)</pre><p><strong>Note-</strong> The function ‘<em>loadLayersModel</em>’ accepts a URL for the model as an argument but in our case, we had our model in our local machine. So to load a <em>tfjs</em> model from your machine make sure it is saved inside the <em>public</em> directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*2bjIIvT1ZyFr7U9sMvjl5g.png" /></figure><h4>This is how the end result was displayed in the frontend when used tfjs model:-</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YykQY81AnjnCg2B4Igf4sA.jpeg" /></figure><p><strong>The code for this project is available </strong><a href="https://github.com/deepklarity/clean-or-messy/tree/main/frontend"><strong>here.</strong></a></p><p>If you have any questions and ideas about what else could have been added or improved in the project please share.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=104b4fc8904d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deepklarity/building-a-reactjs-front-end-to-interact-with-a-machine-learning-model-104b4fc8904d">Building a Reactjs front-end to interact with a Machine Learning model</a> was originally published in <a href="https://medium.com/deepklarity">DeepKlarity</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>