<?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 Zhe LIN on Medium]]></title>
        <description><![CDATA[Stories by Zhe LIN on Medium]]></description>
        <link>https://medium.com/@wilson.linzhe?source=rss-19d843bdd9a8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QTNYfKWr5UDabagsHWCmXQ.jpeg</url>
            <title>Stories by Zhe LIN on Medium</title>
            <link>https://medium.com/@wilson.linzhe?source=rss-19d843bdd9a8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:10:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wilson.linzhe/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[SearchGPT: GPT with Real-Time Web Browsing]]></title>
            <link>https://medium.com/@wilson.linzhe/searchgpt-gpt-with-real-time-web-browsing-bb2fc79c0fd4?source=rss-19d843bdd9a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb2fc79c0fd4</guid>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[open-ai-api]]></category>
            <category><![CDATA[gpt-4]]></category>
            <category><![CDATA[langchain]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Zhe LIN]]></dc:creator>
            <pubDate>Sat, 02 Nov 2024 22:33:48 GMT</pubDate>
            <atom:updated>2024-11-02T22:33:48.296Z</atom:updated>
            <content:encoded><![CDATA[<p>GPT boasts an extensive knowledge base encompassing a diverse array of topics, though it primarily draws upon historical knowledge. In response to this limitation, OpenAI has enhanced its offerings by introducing plug-in for GPT-Plus users, and the GPT-4 was empowered to autonomously search the web for information, tailored to the specific inquiries of users. This means we can now pose questions to GPT that go beyond its pre-existing database — like inquiring about <em>tomorrow’s weather in Boston</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOw90NYZC5AW2t-sjJi4mA.png" /></figure><p>GPT’s response after searching:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wWiva9EILDZaAgAFb47IHw.png" /></figure><p>Since then, GPT can be connected to the Internet to obtain the latest information according to the needs of specific problems, enhancing the relevance and timeliness of the model for real-time data retrieval. This article is an implementation of this function built into GPT, and it is faster than the web browsing function that comes with GPT on the web.</p><p>You can consider it as a minimal back-end implementation of new Bing and Bard, representing a highly integrated combination of search engine functionality and AI-powered question answering.</p><p><strong>The complete code is available at GitHub: </strong><a href="https://github.com/Wilson-ZheLin/SearchGPT">SearchGPT</a>. Please give this project a ⭐ if you like it️.</p><h3>Function</h3><ul><li>Rapid real-time web search through <a href="https://serper.dev/">Serper (Google API)</a></li><li>Automatically adjusts web search and response language based on input</li><li><strong>Multi-threading</strong> to extract main content from web pages, reducing embedding costs</li><li>Semantic search with <a href="https://platform.openai.com/docs/guides/embeddings/what-are-embeddings">OpenAI Embedding</a> and <a href="https://www.trychroma.com/">ChromaDB</a></li><li>LLM responses generated with references and web sources</li><li>Supports customization of <a href="https://platform.openai.com/docs/models"><strong>models</strong></a>, <strong>AI</strong> <strong>roles</strong>, and <strong>output</strong> <strong>formats</strong></li><li>Matches each quoted sentence in the AI’s response to the <strong>title</strong>, <strong>snippet</strong>, <strong>and link of the source website</strong></li></ul><h3>Architecture and Roadmap</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mfgOuWXCwQsJFb--t7UVYQ.png" /></figure><h3>Demo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*vFy1OdNRyj4xrxThKX4_Ig.gif" /></figure><h3>Module</h3><h4>Search Engine Service 🔍</h4><p>Users who have experimented with GPT-4’s web browsing feature may have noticed that it utilizes Bing as its search engine. Registering for the search APIs of both Google and Bing involves a similar level of complexity. For those interested, detailed tutorials are available for guidance. Additionally, I’d like to recommend <a href="https://serper.dev/"><strong>Serper</strong></a>, another website offering Search Engine Results Pages (SERP) services.</p><p>The official slogan of Serper emphasizes its speed, affordability, and stability, which are key reasons for its selection and recommendation. Moreover, each new user receives 2,500 free API queries, an ample amount for development purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YHQvtg2mlFyHB7wbn2stYw.png" /></figure><p>Serper’s underlying search engine is Google. Below is an example of the JSON response returned by Serper:</p><pre>    {<br>      &quot;title&quot;: &quot;Apple&quot;,<br>      &quot;link&quot;: &quot;https://www.apple.com/&quot;,<br>      &quot;snippet&quot;: &quot;Discover the innovative world of Apple and shop everything iPhone, iPad, Apple Watch, Mac, and Apple TV, plus explore accessories, entertainment, ...&quot;,<br>      &quot;sitelinks&quot;: [<br>        {<br>          &quot;title&quot;: &quot;Support&quot;,<br>          &quot;link&quot;: &quot;https://support.apple.com/&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;iPhone&quot;,<br>          &quot;link&quot;: &quot;https://www.apple.com/iphone/&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;Apple makes business better.&quot;,<br>          &quot;link&quot;: &quot;https://www.apple.com/business/&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;Mac&quot;,<br>          &quot;link&quot;: &quot;https://www.apple.com/mac/&quot;<br>        }<br>      ],<br>      &quot;position&quot;: 1<br>    },<br>    {<br>      &quot;title&quot;: &quot;Apple Inc. - Wikipedia&quot;,<br>      &quot;link&quot;: &quot;https://en.wikipedia.org/wiki/Apple_Inc.&quot;,<br>      &quot;snippet&quot;: &quot;Apple Inc. is an American multinational technology company specializing in consumer electronics, software and online services headquartered in Cupertino, ...&quot;,<br>      &quot;attributes&quot;: {<br>        &quot;Products&quot;: &quot;AirPods; Apple Watch; iPad; iPhone; Mac&quot;,<br>        &quot;Founders&quot;: &quot;Steve Jobs; Steve Wozniak; Ronald Wayne&quot;,<br>        &quot;Founded&quot;: &quot;April 1, 1976; 46 years ago in Los Altos, California, U.S&quot;,<br>        &quot;Industry&quot;: &quot;Consumer electronics; Software services; Online services&quot;<br>      },<br>      &quot;sitelinks&quot;: [<br>        {<br>          &quot;title&quot;: &quot;History&quot;,<br>          &quot;link&quot;: &quot;https://en.wikipedia.org/wiki/History_of_Apple_Inc.&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;Timeline of Apple Inc. products&quot;,<br>          &quot;link&quot;: &quot;https://en.wikipedia.org/wiki/Timeline_of_Apple_Inc._products&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;List of software by Apple Inc.&quot;,<br>          &quot;link&quot;: &quot;https://en.wikipedia.org/wiki/List_of_software_by_Apple_Inc.&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;Apple Store&quot;,<br>          &quot;link&quot;: &quot;https://en.wikipedia.org/wiki/Apple_Store&quot;<br>        }<br>      ],<br>      &quot;position&quot;: 2<br>    },<br>...</pre><p>Besides Serper, another popular SERP API service provider is <a href="https://serpapi.com/"><strong>SerpApi</strong></a>. You can visit their official websites and use their playground feature to test the service with your own input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HI4trSiZ8iN85LnxuJfJcQ.png" /></figure><p>The author has introduced the following enhancements in this section. For the detailed code, please refer to the <a href="https://github.com/Wilson-ZheLin/GPT-4-Web-Browsing">GitHub</a>:</p><ol><li>Retrieve a minimum of 10 web links from Google’s search engine</li><li>Store the corresponding titles, abstracts, and URLs for future use</li><li>Implement Chinese and English language detection for inputs, enabling region-specific searches and delivering results in the detected language</li></ol><h4>Web Crawling 📑</h4><p>Key components in this section include:</p><ol><li>Usage of the same crawler package <strong>BeautifulSoup</strong> as featured in the OpenAI official cookbook</li><li>Integrated User-Agent for Windows and MacOS to circumvent most automated checks</li><li>Enhanced speed through <strong>multi-threading</strong> and requests with timeouts</li><li>Retain only the main content of the web pages and filter out short content to reduce the overhead in subsequent embedding processes</li></ol><p>Due to the length of the code, please refer to the <a href="https://github.com/Wilson-ZheLin/GPT-4-Web-Browsing">GitHub</a> for more details.</p><h4>Semantic Search and Reference Organization ℹ️</h4><p>The semantic search and model answering sections of the code utilize functions from the <strong>LangChain</strong>🦜🔗 library. LangChain is an open-source library designed for creating applications driven by language models, simplifying the process of integrating and developing code with large language models like GPT.</p><p>The core parts of this implementation are available on <a href="https://github.com/Wilson-ZheLin/GPT-4-Web-Browsing">GitHub</a> as well. Further information can be found in LangChain’s <a href="https://python.langchain.com/docs/get_started/quickstart">Official Documentation</a>.</p><p>This section’s principle involves <strong>vectorizing</strong> each word from web-crawled content, meaning every word is represented by a set of vectors. This vectorization process translates words into a <strong>format</strong> <strong>understandable by machines</strong>, <strong>with each vector abstractly representing the word’s meaning</strong>, enabling the machine to grasp the <strong>natural semantics</strong> of these vectorized words.</p><p>Given the token length limits in large models, like GPT-3.5-turbo-16k’s 16,000-token cap, it’s crucial to select webpage content most relevant to the query for input into the large language model.</p><p>For word vectorization, we use OpenAI’s official <strong>text-embedding-ada-002 </strong>model. However, there have been reports of this model encountering errors with Chinese text. Therefore, the code includes an alternative, <strong>text2vec-base-chinese</strong> from HuggingFace, which excels in processing Chinese and supports both Chinese and English. This model is currently commented out in the code but can be easily activated for those who require it.</p><p>Both models have their pros and cons. OpenAI’s embedding model is faster, about twice the speed of text2vec-base-chinese. On the other hand, text2vec-base-chinese is free, while OpenAI’s service costs $0.0001 per 1K tokens. Considering these factors, <strong>OpenAI’s Embedding</strong> model is generally recommended.</p><p>For vector database, <strong>ChromaDB</strong> is used, but those more comfortable with Pinecone can modify this to suit their preferences.</p><p>Please refer to <a href="https://github.com/Wilson-ZheLin/GPT-4-Web-Browsing">GitHub</a> for details.</p><h4>Prompt Template + LLM Answer 🚀</h4><p>To enhance user experience, this section features a streaming output for responses generated by the large model. The specific effects of this can be observed in the demo above. Once the relevant content retrieved from ChromaDB is formatted, it can be organized and submitted to the large model. Subsequently, GPT generates a response that includes a numbered reference list.</p><p>The following is the <strong>prompt template:</strong></p><p>As evident from the prompt template, the large model’s answer section allows for customization in <strong>AI roles</strong> and <strong>output formats</strong>, among other aspects.</p><h4>*Match quoted sentences in answers and their source website 📍</h4><p>Here is an example of a reference:</p><p>[1] URL: …</p><p>Quoted sentence: …</p><p>Answer in language: {language}</p><p>Query: {query}</p><p>Output Format: {format}</p><p>Please organize your output according to the Output Format. If the Output Format is empty, you can ignore it.</p><h3>Complete Code</h3><p><strong>The complete code is available at GitHub: </strong><a href="https://github.com/Wilson-ZheLin/SearchGPT">SearchGPT</a>. Please give this project a ⭐ if you like it️.</p><p>-END-</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb2fc79c0fd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transforming Data Analysis with AI Agent: Meet Streamline Analyst]]></title>
            <link>https://medium.com/@wilson.linzhe/transforming-data-analysis-with-ai-agent-meet-streamline-analyst-277ae014ded8?source=rss-19d843bdd9a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/277ae014ded8</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[gpt-4]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Zhe LIN]]></dc:creator>
            <pubDate>Tue, 13 Feb 2024 00:51:46 GMT</pubDate>
            <atom:updated>2024-02-13T00:51:46.867Z</atom:updated>
            <content:encoded><![CDATA[<p>The advent of Large Language Models (LLMs) has opened up new frontiers in artificial intelligence, enabling machines to understand, interpret, and response human-like text. This advancement has paved the way for <strong>AI Agents </strong>— intelligent systems designed to <strong>automate</strong> complex tasks, making them more efficient and accessible.</p><h4>The Role of AI Agents in Data Analysis</h4><p>AI Agents have the potential to transform how we approach data analysis. Traditionally, analyzing data has been a time-consuming process, requiring specialized knowledge and skills. From cleaning and preprocessing data to selecting the proper models and visualizing results, each step can be a bottleneck, slowing down insights and decision-making.</p><p>This is where AI comes into play. Imagine an AI Agent that can automate all these tedious tasks, reducing the workload on data analysts and empowering those without a background in data science to explore and utilize data effectively. This is not just a vision for the future — it’s a reality they’re creating with Streamline Analyst.</p><h4>Introducing Streamline Analyst</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2gOAm-vp6IFEqpEvz5tJw.png" /></figure><p>Streamline Analyst 🪄 is an advanced, open-source application powered by LLMs that streamlines the entire process of data analysis. It automates tasks from data cleaning to model validation, simplifying complex data tasks with precision.</p><p>Streamline Analyst offers a user-friendly interface where users only need to <strong>upload their data</strong>, <strong>select an analysis mode</strong>, and <strong>let the AI take over</strong>. Whether you’re preprocessing data, selecting features, partitioning data sets, visualizing, or selecting the best-fit models, Streamline Analyst automates these operations with precision and speed. All processed data and models are made available for download, offering a comprehensive, user-friendly data analysis toolkit.</p><p>Here are some screenshots of the functionality of the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fmz1cjtdKXwGXG9_EpGBMw.png" /><figcaption>Modeling and Results Visualization</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rjjfI1clB-iPXbKDTNpB0Q.png" /><figcaption>Automated Workflow Interface</figcaption></figure><h4>How to Use Streamline Analyst</h4><p>Since it is an LLM-driven data analysis agent, <a href="https://openai.com/blog/openai-api">OpenAI API key</a> is required to unlock its full capabilities (a GPT-4-capable API key is recommended). Then, simply upload your file, choose the desired analysis mode, and click ‘Start’.</p><p><strong>Demo link: </strong><a href="https://streamline.streamlit.app/">Streamline Analyst</a> 🚀</p><p><strong>The source code: </strong><a href="https://github.com/Wilson-ZheLin/Streamline-Analyst">GitHub</a></p><p>Can’t wait to see how it streamlines your data projects! Feedback and suggestions are always welcome. 🪄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=277ae014ded8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Discover Cobalt: The Most Beautiful Color Scheme for IntelliJ IDEA ☕️]]></title>
            <link>https://medium.com/@wilson.linzhe/cobalt-a-modern-color-scheme-for-intellij-idea-and-java-%EF%B8%8F-bb136d8f8e63?source=rss-19d843bdd9a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb136d8f8e63</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[color-scheme]]></category>
            <category><![CDATA[intellij-idea]]></category>
            <category><![CDATA[intellij]]></category>
            <dc:creator><![CDATA[Zhe LIN]]></dc:creator>
            <pubDate>Fri, 19 Jan 2024 06:29:28 GMT</pubDate>
            <atom:updated>2024-01-19T06:41:10.600Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SYfUy5fZn8ZrDfffaLWbvg.png" /><figcaption>A Peek at Cobalt</figcaption></figure><p><strong>Cobalt</strong> is a modern and elegant color scheme designed for IntelliJ IDEA and the Java language, drawing inspiration from the sleek <em>New UI</em> of Jet Brains IDEs. Dominated by a contemporary shade of blue, <strong>Cobalt </strong>is named after the rich, deep hue of cobalt blue — a color renowned in the realms of art and gemstones, symbolizing <em>depth</em> and <em>stability</em>.</p><h4>Comparison:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sVqKSWJ99Nn-0EOPvANtrw.png" /><figcaption>Cobalt for IntelliJ IDEA</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3SZ5sWQOwU4SvSY_U-n0bw.png" /><figcaption>IntelliJ IDEA’s native color scheme</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ImVFSFqSxonoxmvAAk3dQg.png" /><figcaption>Material Darker (it’s the #1 most downloaded theme)</figcaption></figure><p>We believe a simple color scheme can influence a developer’s mood, and enhance productivity and creativity. Hope you like it!</p><p><strong>How to use &amp; Download:</strong> <a href="https://github.com/Wilson-ZheLin/Cobalt">GitHub link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb136d8f8e63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kickstart Your Journey in MERN Full Stack Development with a Social Sharing Platform Project…]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@wilson.linzhe/kickstart-your-journey-in-mern-full-stack-development-with-a-social-sharing-platform-project-723939acdea7?source=rss-19d843bdd9a8------2"><img src="https://cdn-images-1.medium.com/max/2600/1*AimwPRotea9lwb2wSIf2-g.png" width="3332"></a></p><p class="medium-feed-snippet">Complete Code Included | Kickstart Your Journey in MERN Full Stack Development with a Social Sharing Platform Project</p><p class="medium-feed-link"><a href="https://medium.com/@wilson.linzhe/kickstart-your-journey-in-mern-full-stack-development-with-a-social-sharing-platform-project-723939acdea7?source=rss-19d843bdd9a8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@wilson.linzhe/kickstart-your-journey-in-mern-full-stack-development-with-a-social-sharing-platform-project-723939acdea7?source=rss-19d843bdd9a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/723939acdea7</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[mern]]></category>
            <category><![CDATA[full-stack]]></category>
            <dc:creator><![CDATA[Zhe LIN]]></dc:creator>
            <pubDate>Fri, 12 Jan 2024 04:44:33 GMT</pubDate>
            <atom:updated>2024-01-13T07:03:37.606Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Digital Image Processing in C (Chapter 10): Otus, Moving Average, and Region Growing]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-10-otus-moving-average-and-region-growing-cb6c4ee33728?source=rss-19d843bdd9a8------2"><img src="https://cdn-images-1.medium.com/max/1550/1*rhF1Mne4TA4s4bRTsztYJg.png" width="1550"></a></p><p class="medium-feed-snippet">Digital Image Processing Chapter 10: Otus, Moving Average, and Region Growing with Completed Code in C</p><p class="medium-feed-link"><a href="https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-10-otus-moving-average-and-region-growing-cb6c4ee33728?source=rss-19d843bdd9a8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-10-otus-moving-average-and-region-growing-cb6c4ee33728?source=rss-19d843bdd9a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb6c4ee33728</guid>
            <category><![CDATA[region-growing]]></category>
            <category><![CDATA[digital-image-processing]]></category>
            <category><![CDATA[moving-average]]></category>
            <category><![CDATA[otsu]]></category>
            <category><![CDATA[c-language]]></category>
            <dc:creator><![CDATA[Zhe LIN]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 03:58:04 GMT</pubDate>
            <atom:updated>2024-01-09T03:58:04.134Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Digital Image Processing in C (Chapter 9): Thresholding, Roberts, Prewitt, Sobel, and Edge…]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-9-thresholding-roberts-prewitt-sobel-and-edge-e7428405ede3?source=rss-19d843bdd9a8------2"><img src="https://cdn-images-1.medium.com/max/1444/1*aoZ7YteTGmhfdGuVpZJ28A.png" width="1444"></a></p><p class="medium-feed-snippet">Roberts, Prewitt, Sobel, Threshold, and Edge Detection with Completed Code in C</p><p class="medium-feed-link"><a href="https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-9-thresholding-roberts-prewitt-sobel-and-edge-e7428405ede3?source=rss-19d843bdd9a8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-9-thresholding-roberts-prewitt-sobel-and-edge-e7428405ede3?source=rss-19d843bdd9a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7428405ede3</guid>
            <category><![CDATA[edge-detection]]></category>
            <category><![CDATA[threshold]]></category>
            <category><![CDATA[digital-image-processing]]></category>
            <category><![CDATA[c-language]]></category>
            <category><![CDATA[sobel]]></category>
            <dc:creator><![CDATA[Zhe LIN]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 03:27:30 GMT</pubDate>
            <atom:updated>2024-01-09T03:27:30.758Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[LLM Application in Python: GPT-4 Enhanced with Real-Time Web Browsing]]></title>
            <link>https://medium.com/@wilson.linzhe/llm-application-in-python-gpt-4-enhanced-with-real-time-web-browsing-889ad8477b43?source=rss-19d843bdd9a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/889ad8477b43</guid>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[gpt-4]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[openai-api]]></category>
            <category><![CDATA[langchain]]></category>
            <dc:creator><![CDATA[Zhe LIN]]></dc:creator>
            <pubDate>Sun, 26 Nov 2023 20:45:06 GMT</pubDate>
            <atom:updated>2023-11-26T20:45:06.901Z</atom:updated>
            <content:encoded><![CDATA[<p>GPT-4 boasts an extensive knowledge base encompassing a diverse array of topics, though it primarily draws upon historical knowledge. In response to this limitation, OpenAI has enhanced its offerings by introducing plug-in for GPT-Plus users, and the GPT-4 was empowered to autonomously search the web for information, tailored to the specific inquiries of users. This means we can now pose questions to GPT that go beyond its pre-existing database — like inquiring about <em>tomorrow’s weather in Boston</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOw90NYZC5AW2t-sjJi4mA.png" /></figure><p>GPT’s response after searching:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wWiva9EILDZaAgAFb47IHw.png" /></figure><p>Since then, GPT can be connected to the Internet to obtain the latest information according to the needs of specific problems, enhancing the relevance and timeliness of the model for real-time data retrieval. This article is an implementation of this function built into GPT, and it is faster than the web browsing function that comes with GPT on the web.</p><p>You can consider it as a minimal back-end implementation of new Bing and Bard, representing a highly integrated combination of search engine functionality and AI-powered question answering.</p><p><strong>The complete code is available at GitHub: </strong><a href="https://github.com/Wilson-ZheLin/GPT-4-Web-Browsing">GPT-4 Enhanced with Real-Time Web Browsing</a>. Please give this project a ⭐ if you like it️.</p><h3>Function</h3><ul><li>Rapid real-time web search through <a href="https://serper.dev/">Serper (Google API)</a></li><li>Automatically adjusts web search and response language based on input</li><li><strong>Multi-threading</strong> to extract main content from web pages, reducing embedding costs</li><li>Semantic search with <a href="https://platform.openai.com/docs/guides/embeddings/what-are-embeddings">OpenAI Embedding</a> and <a href="https://www.trychroma.com/">ChromaDB</a></li><li>LLM responses generated with references and web sources</li><li>Supports customization of <a href="https://platform.openai.com/docs/models"><strong>models</strong></a>, <strong>AI</strong> <strong>roles</strong>, and <strong>output</strong> <strong>formats</strong></li><li>Matches each quoted sentence in the AI’s response to the <strong>title</strong>, <strong>snippet</strong>, <strong>and link of the source website</strong></li></ul><h3>Architecture and Roadmap</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mfgOuWXCwQsJFb--t7UVYQ.png" /></figure><h3>Demo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*vFy1OdNRyj4xrxThKX4_Ig.gif" /></figure><h3>Module</h3><h4>Search Engine Service 🔍</h4><p>Users who have experimented with GPT-4’s web browsing feature may have noticed that it utilizes Bing as its search engine. Registering for the search APIs of both Google and Bing involves a similar level of complexity. For those interested, detailed tutorials are available for guidance. Additionally, I’d like to recommend <a href="https://serper.dev/"><strong>Serper</strong></a>, another website offering Search Engine Results Pages (SERP) services.</p><p>The official slogan of Serper emphasizes its speed, affordability, and stability, which are key reasons for its selection and recommendation. Moreover, each new user receives 2,500 free API queries, an ample amount for development purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YHQvtg2mlFyHB7wbn2stYw.png" /></figure><p>Serper’s underlying search engine is Google. Below is an example of the JSON response returned by Serper:</p><pre>{<br>      &quot;title&quot;: &quot;Apple&quot;,<br>      &quot;link&quot;: &quot;https://www.apple.com/&quot;,<br>      &quot;snippet&quot;: &quot;Discover the innovative world of Apple and shop everything iPhone, iPad, Apple Watch, Mac, and Apple TV, plus explore accessories, entertainment, ...&quot;,<br>      &quot;sitelinks&quot;: [<br>        {<br>          &quot;title&quot;: &quot;Support&quot;,<br>          &quot;link&quot;: &quot;https://support.apple.com/&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;iPhone&quot;,<br>          &quot;link&quot;: &quot;https://www.apple.com/iphone/&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;Apple makes business better.&quot;,<br>          &quot;link&quot;: &quot;https://www.apple.com/business/&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;Mac&quot;,<br>          &quot;link&quot;: &quot;https://www.apple.com/mac/&quot;<br>        }<br>      ],<br>      &quot;position&quot;: 1<br>    },<br>    {<br>      &quot;title&quot;: &quot;Apple Inc. - Wikipedia&quot;,<br>      &quot;link&quot;: &quot;https://en.wikipedia.org/wiki/Apple_Inc.&quot;,<br>      &quot;snippet&quot;: &quot;Apple Inc. is an American multinational technology company specializing in consumer electronics, software and online services headquartered in Cupertino, ...&quot;,<br>      &quot;attributes&quot;: {<br>        &quot;Products&quot;: &quot;AirPods; Apple Watch; iPad; iPhone; Mac&quot;,<br>        &quot;Founders&quot;: &quot;Steve Jobs; Steve Wozniak; Ronald Wayne&quot;,<br>        &quot;Founded&quot;: &quot;April 1, 1976; 46 years ago in Los Altos, California, U.S&quot;,<br>        &quot;Industry&quot;: &quot;Consumer electronics; Software services; Online services&quot;<br>      },<br>      &quot;sitelinks&quot;: [<br>        {<br>          &quot;title&quot;: &quot;History&quot;,<br>          &quot;link&quot;: &quot;https://en.wikipedia.org/wiki/History_of_Apple_Inc.&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;Timeline of Apple Inc. products&quot;,<br>          &quot;link&quot;: &quot;https://en.wikipedia.org/wiki/Timeline_of_Apple_Inc._products&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;List of software by Apple Inc.&quot;,<br>          &quot;link&quot;: &quot;https://en.wikipedia.org/wiki/List_of_software_by_Apple_Inc.&quot;<br>        },<br>        {<br>          &quot;title&quot;: &quot;Apple Store&quot;,<br>          &quot;link&quot;: &quot;https://en.wikipedia.org/wiki/Apple_Store&quot;<br>        }<br>      ],<br>      &quot;position&quot;: 2<br>    },<br>...</pre><p>Besides Serper, another popular SERP API service provider is <a href="https://serpapi.com/"><strong>SerpApi</strong></a>. You can visit their official websites and use their playground feature to test the service with your own input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HI4trSiZ8iN85LnxuJfJcQ.png" /></figure><p>The author has introduced the following enhancements in this section. For the detailed code, please refer to the <a href="https://github.com/Wilson-ZheLin/GPT-4-Web-Browsing">GitHub</a>:</p><ol><li>Retrieve a minimum of 10 web links from Google’s search engine</li><li>Store the corresponding titles, abstracts, and URLs for future use</li><li>Implement Chinese and English language detection for inputs, enabling region-specific searches and delivering results in the detected language</li></ol><h4>Web Crawling 📑</h4><p>Key components in this section include:</p><ol><li>Usage of the same crawler package <strong>BeautifulSoup</strong> as featured in the OpenAI official cookbook</li><li>Integrated User-Agent for Windows and MacOS to circumvent most automated checks</li><li>Enhanced speed through <strong>multi-threading</strong> and requests with timeouts</li><li>Retain only the main content of the web pages and filter out short content to reduce the overhead in subsequent embedding processes</li></ol><p>Due to the length of the code, please refer to the <a href="https://github.com/Wilson-ZheLin/GPT-4-Web-Browsing">GitHub</a> for more details.</p><h4>Semantic Search and Reference Organization ℹ️</h4><p>The semantic search and model answering sections of the code utilize functions from the <strong>LangChain</strong>🦜🔗 library. LangChain is an open-source library designed for creating applications driven by language models, simplifying the process of integrating and developing code with large language models like GPT.</p><p>The core parts of this implementation are available on <a href="https://github.com/Wilson-ZheLin/GPT-4-Web-Browsing">GitHub</a> as well. Further information can be found in LangChain’s <a href="https://python.langchain.com/docs/get_started/quickstart">Official Documentation</a>.</p><p>This section’s principle involves <strong>vectorizing</strong> each word from web-crawled content, meaning every word is represented by a set of vectors. This vectorization process translates words into a <strong>format</strong> <strong>understandable by machines</strong>, <strong>with each vector abstractly representing the word’s meaning</strong>, enabling the machine to grasp the <strong>natural semantics</strong> of these vectorized words.</p><p>Given the token length limits in large models, like GPT-3.5-turbo-16k’s 16,000-token cap, it’s crucial to select webpage content most relevant to the query for input into the large language model.</p><p>For word vectorization, we use OpenAI’s official <strong>text-embedding-ada-002 </strong>model. However, there have been reports of this model encountering errors with Chinese text. Therefore, the code includes an alternative, <strong>text2vec-base-chinese</strong> from HuggingFace, which excels in processing Chinese and supports both Chinese and English. This model is currently commented out in the code but can be easily activated for those who require it.</p><p>Both models have their pros and cons. OpenAI’s embedding model is faster, about twice the speed of text2vec-base-chinese. On the other hand, text2vec-base-chinese is free, while OpenAI’s service costs $0.0001 per 1K tokens. Considering these factors, <strong>OpenAI’s Embedding</strong> model is generally recommended.</p><p>For vector database, <strong>ChromaDB</strong> is used, but those more comfortable with Pinecone can modify this to suit their preferences.</p><p>Please refer to <a href="https://github.com/Wilson-ZheLin/GPT-4-Web-Browsing">GitHub</a> for details.</p><h4>Prompt Template + LLM Answer 🚀</h4><p>To enhance user experience, this section features a <strong>streaming output</strong> for responses generated by the large model. The specific effects of this can be observed in the <strong>demo</strong> above. Once the relevant content retrieved from <strong>ChromaDB</strong> is formatted, it can be organized and submitted to the large model. Subsequently, GPT generates a response that includes a numbered reference list.</p><p>The following is the <strong>prompt template:</strong></p><pre>template: |<br>  Web search result:<br>  {context_str}<br>  <br>  Instructions: You are a/an {role}. Using the provided web search results, write a comprehensive and detailed reply to the given query. <br>  Make sure to cite results using [number] notation after the reference.<br>  At the end of the answer, list the corresponding references with indexes, each reference contains the urls and quoted sentences from the web search results by the order you marked in the answer above and these sentences should be exactly the same as in the web search results.<br>  Here is an example of a reference:<br>      [1] URL: ...<br>          Quoted sentence: ...<br>  <br>  Answer in language: {language}<br>  Query: {query}<br>  Output Format: {format}<br>  Please organize your output according to the Output Format. If the Output Format is empty, you can ignore it.</pre><p>As evident from the prompt template, the large model’s answer section allows for customization in <strong>AI roles</strong> and <strong>output formats</strong>, among other aspects.</p><h4>*Match quoted sentences in answers and their source website 📍</h4><p>The aim of this section is to enable users to trace the source of each quoted sentence in the large language model’s response by clicking on it. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xxnuK66hsCJovstgUSdVag.png" /></figure><p>The display output of each ‘reference card’ in the code is as follows, primarily utilizing <strong>regular expressions</strong> for this purpose.</p><pre>{<br>        &quot;titles&quot;: &quot;Tencent&#39;s Silent Pursuit of Global Gaming Domination - Niko Partners&quot;,<br>        &quot;snippets&quot;: &quot;Tencent is the world&#39;s largest games company and continuing to grow organically as well as through investments and acquisitions.&quot;,<br>        &quot;index&quot;: 1,<br>        &quot;sent&quot;: &quot;Tencent Games, a leading Chinese game developer and publisher, has been making significant strides in expanding its global market share. While China remains the largest gaming market for Tencent, the company has been actively pursuing international growth and aims to have half of its players overseas&quot;,<br>        &quot;url&quot;: &quot;https://nikopartners.com/tencents-silent-pursuit-of-global-gaming-domination/&quot;,<br>        &quot;source&quot;: &quot;While China is the largest gaming market in the world with 33% of PC and mobile games revenue derived from mainland China gamers, Tencent wants to be a global giant. The firm stated that its target is to have half of its players overseas, but we note that only 21% of its total games revenue in 2020 was from outside China.&quot;<br>    }</pre><p>Since GPT might not always respond precisely as per the provided examples, and many users may not require the feature to locate the source, this segment of the code is commented out by default.</p><h3>Complete Code</h3><p><strong>The complete code is available at GitHub: </strong><a href="https://github.com/Wilson-ZheLin/GPT-4-Web-Browsing">GPT-4 Enhanced with Real-Time Web Browsing</a>. Please give this project a ⭐ if you like it️.</p><p>-END-</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=889ad8477b43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Digital Image Processing in C (Chapter 8): Erosion, Dilation, Opening, Closing, Boundary…]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-8-erosion-dilation-opening-closing-boundary-5f505c731f19?source=rss-19d843bdd9a8------2"><img src="https://cdn-images-1.medium.com/max/1564/1*m8onsDPD3emuCppXuZZAqQ.png" width="1564"></a></p><p class="medium-feed-snippet">Erosion, Dilation, Opening and Closing Operations, Boundary Extraction and Connection with Complete Code in C</p><p class="medium-feed-link"><a href="https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-8-erosion-dilation-opening-closing-boundary-5f505c731f19?source=rss-19d843bdd9a8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-8-erosion-dilation-opening-closing-boundary-5f505c731f19?source=rss-19d843bdd9a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f505c731f19</guid>
            <category><![CDATA[dilation-and-erosion]]></category>
            <category><![CDATA[boundary-extraction]]></category>
            <category><![CDATA[c-language]]></category>
            <category><![CDATA[digital-image-processing]]></category>
            <dc:creator><![CDATA[Zhe LIN]]></dc:creator>
            <pubDate>Sun, 19 Nov 2023 23:28:32 GMT</pubDate>
            <atom:updated>2023-11-23T17:33:06.982Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Digital Image Processing in C (Chapter 7): Noise and Noise Reduction, Homomorphic and Band Stop…]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-7-noise-and-noise-reduction-homomorphic-and-band-stop-558de0d50c98?source=rss-19d843bdd9a8------2"><img src="https://cdn-images-1.medium.com/max/1684/1*fAr1ZD4agUPI-KALFLvhDQ.png" width="1684"></a></p><p class="medium-feed-snippet">Image Noise and Noise Reduction, Homomorphic Filter, and Band Stop Filter with Complete Code in C</p><p class="medium-feed-link"><a href="https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-7-noise-and-noise-reduction-homomorphic-and-band-stop-558de0d50c98?source=rss-19d843bdd9a8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-7-noise-and-noise-reduction-homomorphic-and-band-stop-558de0d50c98?source=rss-19d843bdd9a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/558de0d50c98</guid>
            <category><![CDATA[bandstop-filters]]></category>
            <category><![CDATA[noise-reduction]]></category>
            <category><![CDATA[digital-image-processing]]></category>
            <category><![CDATA[c-language]]></category>
            <dc:creator><![CDATA[Zhe LIN]]></dc:creator>
            <pubDate>Sat, 18 Nov 2023 22:27:58 GMT</pubDate>
            <atom:updated>2023-11-23T17:32:44.003Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Digital Image Processing in C (Chapter 6): Low Pass Filter and High Pass Filter]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-6-low-pass-filter-and-high-pass-filter-091f3f3d6df7?source=rss-19d843bdd9a8------2"><img src="https://cdn-images-1.medium.com/max/1570/1*nskLgqyO8ZEFakkTNa0CCQ.png" width="1570"></a></p><p class="medium-feed-snippet">Ideal, Butterworth, Gaussian  Low Pass Filter and High Pass Filter with Complete Code in C</p><p class="medium-feed-link"><a href="https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-6-low-pass-filter-and-high-pass-filter-091f3f3d6df7?source=rss-19d843bdd9a8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@wilson.linzhe/digital-image-processing-in-c-chapter-6-low-pass-filter-and-high-pass-filter-091f3f3d6df7?source=rss-19d843bdd9a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/091f3f3d6df7</guid>
            <category><![CDATA[c-language]]></category>
            <category><![CDATA[digital-image-processing]]></category>
            <category><![CDATA[gaussian-filter]]></category>
            <category><![CDATA[low-pass-filter]]></category>
            <category><![CDATA[high-pass-filter]]></category>
            <dc:creator><![CDATA[Zhe LIN]]></dc:creator>
            <pubDate>Sat, 18 Nov 2023 04:56:06 GMT</pubDate>
            <atom:updated>2023-11-23T17:32:52.646Z</atom:updated>
        </item>
    </channel>
</rss>