<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sanjay Dasgupta on Medium]]></title>
        <description><![CDATA[Stories by Sanjay Dasgupta on Medium]]></description>
        <link>https://medium.com/@yajnas1954?source=rss-1f0667956b1c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*HFf9HTyrhLUcD4Jz</url>
            <title>Stories by Sanjay Dasgupta on Medium</title>
            <link>https://medium.com/@yajnas1954?source=rss-1f0667956b1c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:32:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yajnas1954/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using Gemini to Create your own Indian Patent Database]]></title>
            <link>https://medium.com/@yajnas1954/using-gemini-to-create-your-own-indian-patent-database-3f8ca537e65d?source=rss-1f0667956b1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f8ca537e65d</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[patents]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[pymupdf]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Sanjay Dasgupta]]></dc:creator>
            <pubDate>Sun, 20 Apr 2025 06:02:34 GMT</pubDate>
            <atom:updated>2025-04-23T15:40:11.280Z</atom:updated>
            <content:encoded><![CDATA[<p>A DIY guide for independent patent agents and patent analysts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*NuGYfB2vn43wmtKkRLOHIA.png" /><figcaption>The Data Flow — From PDF to JSON</figcaption></figure><p>Several years ago, <a href="https://www.linkedin.com/in/subramaniam-vutha-243887a/">a good friend and well-known IPR lawyer</a> persuaded me to sign up for the Patent Agent exam, insisting that “more engineers should become patent agents.” So, in due course I became a registered Indian patent agent entitled to <em>practice before the Controller … transact all business … etc </em>(<a href="https://ipindia.gov.in/writereaddata/Portal/ev/sections/ps127.html">Sec 127</a>).</p><p>The first few meetings in my new avatar were interesting and memorable. But, like so many other things in life, the excitement of the new role wore off quickly. The many forms, voluminous documentation, elaborate processes, and long meetings were just not my cup of tea. So in another year or two I had disconnected from the world of patents almost completely — all except one tenuous thread: patent data.</p><h3>Patent Data as a Data Science Resource</h3><p>It is estimated that over 120 million patent applications exist in the world’s patent databases. All of this information is freely accessible, so, in addition to their primary purpose, they also constitute a valuable resource for Machine Learning and AI education, work, and research.</p><h4>Indian Patents</h4><p>The Indian Patent Office (IPO) presented another great data science opportunity. The IPO’s search portal <a href="https://iprsearch.ipindia.gov.in/PublicSearch/">inPASS</a> allows anyone to find Indian patents meeting a range of search criteria. But unlike other leading portals (e.g. <a href="https://patentscope.wipo.int/">PATENTSCOPE</a>, <a href="https://worldwide.espacenet.com/">Espacenet</a>), <em>inPASS</em> does not allow bulk downloads. This restriction is an unfair handicap for independent patent analysts and researchers who do not have access to a commercial patent database.</p><p>But a close look at the IPO’s website reveals that there is a work-around that anyone can use to create their own database of <a href="https://worldwide.espacenet.com/patent/help/bibliographic-data">bibliographic information</a>. Apart from inPASS, the IPO also <a href="https://ipindia.gov.in/writereaddata/Portal/ev/sections/ps11.html">publishes batches of patent applications</a> in electronic form at the end of every week. These weekly releases come in the form of editions of the <a href="https://search.ipindia.gov.in/IPOJournal/Journal/Patent">Official Journal of the Patent Office</a>. Editions of the journal (each a PDF booklet) contain bibliographic data for the patent applications being published.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*Pm2Gds4JTAFrCIhGmQsa0w.png" /><figcaption>An edition of the Official Journal of the Patent Office</figcaption></figure><p>These booklets are freely downloadable by anyone. So it should, in principle, be possible to extract the text, restructure it into domain-specific JSON records, and upload the JSONs into any database. This will enable custom searches with all the flexibility that any patent analyst may need.</p><h4>Harvesting Indian Patent Data</h4><p>So, creating a set of tools to prove that this can be done using <a href="https://en.wikipedia.org/wiki/Free_and_open-source_software">free open source software</a>, and getting the IPO’s one million odd records into a database became my pet hobby project. The following paragraphs describe the evolution of my pet project from a simple Python program (that required changes almost every week) to a robust AI-assisted agent that takes typos, unforeseen formats, and even layout changes in its stride.</p><p>The first version of my project was a simple Python program that used the <a href="https://pymupdf.readthedocs.io/">PyMuPdf</a> library to extract text from PDF files. It was only slightly better than a bumbling, faltering <em>proof of concept</em>. A toy that wasn&#39;t really up to the task at hand. The devil, as always, was in the details — of how the text was written. My program stumbled and fell over even if two spaces were found where one was expected!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*afrimbm7GdfJ5eeSPIcTiA.jpeg" /><figcaption>Logo of PyMuPdf Project</figcaption></figure><p>The oldest Journal files (circa 2005) were probably hand-typed from paper documents, so formatting and spelling errors were not uncommon. The IPO also seemed to be trying to improve matters by adjusting the formatting conventions continuously. But that increased my maintenance effort, and the program had to be changed almost every week. Sometimes I had to manually patch the program’s output to fix things the program could not handle. Other PDFs had errors that completely stumped my program, and I had to skip those files — which left a gap in the data stream. So, the information (in my database) from the early years is nowhere near perfect.</p><p>After some years the IPO seemed (from the pattern of errors) to be moving to OCR processes. That led to another round of painful changes to my program. But the thrill of seeing my database of patent information grow kept me motivated. At this point I had about 100,000 patent applications in my database — a small fraction of the IPOs million or so, but <a href="https://machinelearningmastery.com/much-training-data-required-machine-learning/">very respectable for many Machine Learning experiments</a>.</p><p>The data quality was getting better, but there were still troublesome patches that required manual intervention, and other aberrations that couldn’t be recovered at all. But my pet project was just regressing into a cat and mouse game — the goal posts seemed to move without warning and I would scramble to fix the code to match the challenge. This wasn&#39;t sustainable, something needed to change!</p><h3>The Promise of AI</h3><p>The emergence of <a href="https://en.wikipedia.org/wiki/Generative_artificial_intelligence">Generative AI</a> and <a href="https://en.wikipedia.org/wiki/Large_language_model">Large Language Models</a> in the past few years changed everything. LLMs can be used to make the process more robust, and able to handle changing layouts and unpredictable typos without external help.</p><p>Despite being slow, and therefore unsuitable in many practical situations, the improvements possible with Generative AI are truly remarkable. The following box (a snippet from the <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/prompt-gallery">prompt</a> used to process the raw text — even with typos and other uncertainties) clearly illustrates the power of Generative AI.</p><pre>The VALUE is trimmed to remove whitespace characters at both ends.<br>If the VALUE contains only a date, it should be rewritten in YYYY-MM-DD (ISO 8601) format.<br>If the VALUE contains only a country-name, it should be rewritten as a 2-letter (ISO 3166) code.<br>A country name in the INPUT TEXT may contain typos, or be abbrevited in an unusual way.<br>No other changes are allowed to be made on a VALUE.</pre><h4>Google’s Gemini 2.0 Flash</h4><p>Recently released LLMs (like Google’s <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models">Gemini 2.0 Flash</a>) are significantly faster, and Google’s <a href="https://ai.google.dev/gemini-api/docs/pricing">generous free usage quota</a> helps too. So when Google and Kaggle announced the <a href="https://www.kaggle.com/learn-guide/5-day-genai">5-Day Gen AI Intensive Course with Google</a> last month, I started developing an Gemini-assisted patent information extractor for the <a href="https://www.kaggle.com/competitions/gen-ai-intensive-course-capstone-2025q1">capstone project</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*yN2Rtnq0bYHd58mDdopdOw.png" /><figcaption>Logo of the Gemini Family</figcaption></figure><p>If you are wondering why this article features Gemini exclusively, here is a full disclosure: This article is a part of the submissions required for the <a href="https://rsvp.withgoogle.com/events/google-generative-ai-intensive_2025q1">5-Day Gen AI Intensive Course with Google</a> that concluded recently. That course required participants to use only Google’s Gemini family of LLMs. Readers interested in the contents of that course can still find all of the instructional material <a href="https://www.kaggle.com/learn-guide/5-day-genai">archived here</a>.</p><h3>Check out my Code</h3><p>You can see Gemini 2.0 Flash features in action in <a href="https://www.kaggle.com/code/yajnas54/genai-course-2025q1-capstone">the Kaggle notebook</a> containing the other part of my submission for the course. Happy reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f8ca537e65d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>