<?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 Jon White on Medium]]></title>
        <description><![CDATA[Stories by Jon White on Medium]]></description>
        <link>https://medium.com/@jon.white_74874?source=rss-383f36f89faa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DzJTkGf4cpg3wOu4It-y_A.jpeg</url>
            <title>Stories by Jon White on Medium</title>
            <link>https://medium.com/@jon.white_74874?source=rss-383f36f89faa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 05:44:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jon.white_74874/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[ChatGPT Ate My Side Project!…]]></title>
            <link>https://medium.com/@jon.white_74874/chatgpt-ate-my-side-project-80ec9a373936?source=rss-383f36f89faa------2</link>
            <guid isPermaLink="false">https://medium.com/p/80ec9a373936</guid>
            <category><![CDATA[text-davinci-003]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[youtube]]></category>
            <category><![CDATA[bible]]></category>
            <dc:creator><![CDATA[Jon White]]></dc:creator>
            <pubDate>Thu, 06 Jul 2023 05:19:03 GMT</pubDate>
            <atom:updated>2023-07-06T12:20:53.288Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*_QQJvITHzZZhdZyKvsDwaA.png" /></figure><p><strong>TLDR:</strong> A single “native” ChatGPT prompt replaced the core functionality of a Python application that used mostly NLP based pattern matching techniques/algorithms to annotate sermon transcripts with Bible verses and return time based deep links to the original YouTube video.</p><p>Developers have some serious refactoring to do. I’m no different than the majority of programmers today that currently use LLMs to generate, check and debug code but I’m experimenting with going a step further. I‘m curious about “native” prompting which intentionally structures prompts to use the transformer based architecture as a processing engine to solve problems. With a “native” prompt, a LLM user can pass in JSON with the prompt and the return text/answer will be well formed JSON. In other words, the LLM will function like an web service but without the backend code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*nHp1nzPDmc0uc4JkyTFuLg.jpeg" /></figure><h3><strong>The Example Problem</strong></h3><p>Some people want to hear a preacher teach on a specific Bible verse they are studying or just to hear a different perspective on that verse from a variety of speakers. YouTube search doesn’t index Bible verse mentions inside of videos so if you search “John 3:16”, YouTube will only return videos with that string (or close variations) in the title or the description metadata in the video. There are hundreds of thousands of video sermons on YouTube but not an easy way to query those sermons by specific Bible verse. A practical application for this functionality would be a mobile application that allows all members of a congregation read a Bible plan together that contains links to their Pastor teaching on the Bible verses.</p><h3><strong>The Pre-GPT Solution</strong></h3><p>To create a comprehensive index of Bible verses and their corresponding video mentions I wrote a<a href="https://github.com/compsage/chatgpt_ate_my_sideproject/blob/main/process_single_transcript_old_way.py"> Python script </a>that processes a transcript from YouTube line for line. Each line is compared with a database of valid Bible Books and verses along with different variations of how the verse may be referenced by the speaker. i.e. —<em> “Let’s turn to verse 16 of the 3rd chapter in the Gospel of John” == John 3:16</em>. The script currently accounts for ~30 different variations. It works like a regex on steroids that can find these variations in a wide variety of mentions. Once a hit is encountered the verse is recorded along with a deep link to the time in the YouTube video where it is mentioned. From there a downstream process indexes the verses and allows for efficient searching by verse (initial indexing done in Redis). Here is an <a href="https://github.com/compsage/chatgpt_ate_my_sideproject/blob/main/allRowsFlat.csv">example output csv</a> of the data that is indexed.</p><p><strong>The Good:</strong> The script returns the most important verses, doesn’t miss the obvious and it is fast… by Pythonic standards ;-)</p><p><strong>The Bad: </strong>Code Size: ~250 lines of code not counting imports of <strong>words2num</strong>, <strong>num2words</strong> and <strong>pythonbible</strong> libraries. And as with any rule-based system, it does not do well with the edge cases.</p><p><strong>The Ugly: </strong>Regexes, pattern matching, hard coded Bible book names, custom enumerations and other brute force techniques are implemented.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/0*oMELT-4KjdiQOXl-" /></figure><p><strong>The Hideous:</strong> <a href="https://spacy.io/api/matcher">spaCy Matcher</a> or even an earlier LLM probably would have been a much more elegant and better performing solution then implementing this all from scratch.</p><h3><strong>Post-GPT Solution</strong></h3><p>After going through a <a href="https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/">prompt engineering course</a> I got the bright, or crazy, idea to create a well crafted prompt that natively (without generating intermediate code) parses a json transcript and returns a json list of all annotated verses in that transcript with youtube deep link. The prompt was crafted to be: descriptive and detailed, create an expert persona, provide examples and specify constraints.</p><h3>The Prompt</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*nNxtMwQqI5MqHTr1Zj_P2A.png" /></figure><p><a href="https://github.com/compsage/chatgpt_ate_my_sideproject/blob/main/process_single_transcript_new_way.py">Sample code with prompt and text-davinci api call</a></p><p><a href="https://youtu.be/cS0baThnmG8">YouTube Video Processed as Example</a></p><h3>{input_json}</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*b1T4ZZrXkGgdtQr9" /></figure><h3>The Output JSON returned from text-davinci-003 WITHOUT additional post processing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/0*vdnwwU7jBVjnPeSh" /></figure><h3>Verses Returned from Both Solutions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ms__wx35ko7xjHQuJqA-sA.png" /><figcaption>text-davinci-003 finds significantly more verses with minimal false positives</figcaption></figure><h3>A Couple More Output Examples</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Rj4H0LHt8GFwz4OU" /><figcaption>Excellent annotation that picks ups on a mention of the actual verse in transcript</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*TT2-_H8syKK-wSrV" /><figcaption>This is a bad false positive but a “paraphrase” mention_type which can be filtered out.</figcaption></figure><p><strong>Also to note:</strong> Even though I specified that I only wanted correctly-formed JSON the model did return malformed JSON a couple times. I just caught the exception and continued. More prompt refinement may correct this.</p><p><strong>The Awesome: </strong>There was no need to augment any logic with patterns or Bible libraries. The only custom code is to json.load() the response from OpenAI to a dictionary to print. The prompt does all the work!</p><p><strong>The Good:</strong> The code with API call to OpenAI and the templated prompt is about 75 lines and it annotates more verses in a wider variety of cases. For example: When a verse is mentioned and the line says “let’s go back to verse one”, the model knows that it was referring to the previously mentioned book. It can also annotate paraphrases of verses along with direct mentions.</p><p><strong>The Bad:</strong> It’s slooooow…. You also have to chunk the requests because of the token size limits and each chunk sometimes takes minutes to process. In some rare cases the JSON comes back malformed. In those cases I throw the results away. This could probably be fixed by adding logic to detect and fix the json or strengthen the prompt to prevent this from happening.</p><h3>Initial Conclusion</h3><p>While this method is too inefficient and expensive to run at scale (I currently have tens of thousands of sermon transcripts) it was a fun experiment. I like the concept of native prompting in certain situations. One unfair advantage this use case has is that the text-davinci-003 clearly has a wealth of Biblical knowledge and has a comprehensive Biblical index across all mainline versions. In cases where false positives are not critical and mildly inconsistent results are acceptable this could be useful. Trying to get a prompt to do all the work also helps in discovering the limits of LLMs. Because of all the options available in prompting, especially the ability to define your own markup/template, I plan to continue to attempt to formulate single prompts to solve complete programming tasks. Shoot me a message if you thought this was awesome or an extreme waste of time or… both. Till next time ;-)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*RMomlJDaK5g7RLh-Dhzp_A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80ec9a373936" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Categorical Indexing: How to Beat Google at Search?]]></title>
            <link>https://medium.com/@jon.white_74874/categorical-indexing-how-to-beat-google-at-search-bb8707f8d13c?source=rss-383f36f89faa------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb8707f8d13c</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[search-engine-optimizati]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Jon White]]></dc:creator>
            <pubDate>Wed, 28 Dec 2022 14:33:28 GMT</pubDate>
            <atom:updated>2022-12-28T14:33:28.256Z</atom:updated>
            <content:encoded><![CDATA[<h3>The search market is ripe for disruption</h3><p><strong>With ~10 zetabytes of non-replicated data on the internet today, the information needs of an individual or even an organization are subatomic compared in size to what is available. </strong>It is challenging to scale reverse indexed page ranking algorithms and retrofit them to answer nuanced questions that users have across an ever broadening set of data modalities.</p><h4><strong>In many cases users would prefer 10 precise and rich answers in minutes instead of 10 million matches in milliseconds.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QacngLIdXSudhQr-f0Kd7Q.png" /><figcaption>There are only 86,400 seconds in a day!?!</figcaption></figure><p>One way to convert information into <em>knowledge</em> is to segment content by specific domains and/or question sets. <strong>Categorical Indexing makes multimodal content searchable in a bespoke but generalized way for specific domains.</strong></p><p>Instead of beating the dead horse of current search engine limitations, I’ll outline a simple application below that uses categorical indexing and do a lightning quick comparison of the results it produces with YouTube’s (Google’s) results.</p><h3>Steps to Create a Categorical Index</h3><ol><li>Identify a distinct community or subculture. — <strong>Who?</strong></li><li>Outline the synthesized information, or knowledge, that the community or subculture needs. — <strong>What?</strong></li><li>Pinpoint underlying data, organize it into information and design a computational processes that transmutes it into distinct identifying characteristics.</li><li>Encode the distinct analytic results into a custom but somewhat standardized format that is complementary to the specific domain.</li><li>Provide access to the synthesized knowledge with an opinionated interface that is geared toward serving the specific community.</li></ol><h3><strong>Trivial Example:</strong> Bible Based Lookups of YouTube Video Clips</h3><p>In this “Hello World” like example we created a categorical index that leverages one of the first books mass printed with indices, the Bible. This sample application recognizes the vernacular of Christian speakers which is somewhat of a predictable standard across the majority of Christian denominations. After specific types of trigger phrases are flagged, those specific sections of the video are added to a searchable index.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OQ4lNzVov3p_065V" /><figcaption>Interface to search the YouTube for Bible Verse Mentions (v4v)</figcaption></figure><p>Let’s <strong>walk through the aforementioned steps to create a categorical index for this use case. </strong>You can follow similar steps with your own communities of interest.</p><ol><li><strong>Who?</strong> — Christians that read and study the Bible.</li><li><strong>What? — </strong>Previously recorded commentary and perspectives from teachers of the Bible in communities Christians relate to.</li><li>Data for the analytic was pulled from YouTube video transcripts on channels where Christian teaching and preaching is present. The channels were derived from Wikipedia’s list of megachurches in the United States. The application codifies specific types of phrases from video transcripts on that channel that have a high probability of being Bible references.</li><li>Once identified, speaker phrases were mapped to specific verses of the Bible. For example, “Lets turn to the third chapter of the Gospel of John the sixteenth verse” was mapped to “John 3:16”. That is one of the multiple phrases that had to be identified and mapped to a verse address. <strong>Only phrases were indexed in this example </strong>but often times a scripture is referenced by a long story or the scripture text is shown on the screen when it is being mentioned by the speaker in the video. In the future, those occurrences could be added to the categorical index via a LLM and OCR on video frames respectably.</li><li>Deploy an interface that only takes Bible verses to search and retrieves content. The drop-downs currently used could be replaced by the ubiquitous search box with “fuzzy” text matching logic. Topic based searches are mapped to lists of related Bible verses which are in turn collated with the categorical index.</li></ol><h4>Unique Domain Characteristics</h4><p>One major advantage of this Christian sub-culture is that it is relatively straightforward to identify the data/information boundaries because:</p><ul><li>There is a specific set of distinct channels on YouTube with primarily Christian content. For the most part, every Church has a channel and posts predictable content.</li><li>There is a specific way that most speakers in Christian videos, especially Sunday sermons and podcasts, reference scriptures.</li><li>The Bible is a compilation of 66 standardized books which have been referenced the same way for hundreds of years.</li></ul><p>Interestingly enough, Google’s transcription algorithm is able to identify Bible verses directly from speech albeit the model can only recognize the most popular scriptures.<strong> This shows the promise of fine-tuning a LLM to identify phrases of interest even though most cases we encountered mapped the more direct phrases like “John Three Sixteen” to “John 3:16” in the transcript.</strong></p><h4>Comparative Results</h4><p>Below are the results of the same search of “John 3:16” on YouTube and Videos for Verses (v4v). <strong>v4v does not store any video content</strong> but returns hyperlinks to the exact moment in time a Bible verse is mentioned essentially using YouTube as a database.</p><h4><strong>YouTube results mostly find videos that contain the specified verse in the title and description of video metadata.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lXudzq7BXQiRfPfc" /><figcaption>YouTube Results… with an ad</figcaption></figure><h4><a href="https://beta.v4v.watch/"><strong>https://beta.v4v.watch</strong></a><strong> results are more precise and unlike YouTube, cover nuanced Biblical vernacular and provide links to the moment in the video the mention occurred.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*muexDzw7xiJYdW_X" /><figcaption>Results from querying the Categorical Index on v4v</figcaption></figure><p>Feel free to compare v4v results with YouTube and Google’s results. The v4v index certainly could be expanded to include other modalities like short form text from Twitter and YouVersion scripture images. <strong>That would enable interested parties to execute more nuanced and accurate searches against a broader corpus of content types.</strong></p><p>I hope this concept of Categorical Indexing has given you some ideas about how to possibly improve your applications or develop new ones to serve specific communities. I truly believe that many disruptive solutions can be produced by implementing the concepts outlined in this post. What community will you serve with an application that leverages Categorical Indexing?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb8707f8d13c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>