<?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[DVC — Data Version Control - Medium]]></title>
        <description><![CDATA[We deliver the best developer experience for machine learning teams by creating an ecosystem of open, modular ML tools. - Medium]]></description>
        <link>https://medium.com/dvc-data-version-control?source=rss----ce2e1b7aa37c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>DVC — Data Version Control - Medium</title>
            <link>https://medium.com/dvc-data-version-control?source=rss----ce2e1b7aa37c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:04:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/dvc-data-version-control" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Post-modern AI data stack]]></title>
            <link>https://medium.com/dvc-data-version-control/post-modern-ai-data-stack-f1955e534479?source=rss----ce2e1b7aa37c---4</link>
            <guid isPermaLink="false">https://medium.com/p/f1955e534479</guid>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Daniel Kharitonov]]></dc:creator>
            <pubDate>Tue, 24 Sep 2024 17:08:22 GMT</pubDate>
            <atom:updated>2024-09-24T17:08:22.423Z</atom:updated>
            <content:encoded><![CDATA[<h4>Peeking at up-and-coming data processing infrastructure</h4><p><strong>TL;DR</strong></p><blockquote>The data stack generation is determined by a blend of emerging technologies and the applications they enable. The author suggests that we are now entering a new phase of data stack development, characterized by the adoption of foundational models, generative processes, faster time-to-value, and reduced data demands.</blockquote><h3>topics covered</h3><ul><li><strong>Case scenarios</strong> to show what we are talking about.</li><li><strong>Modern data stack</strong>: where we are now.</li><li><strong>Post-modern data stack</strong>: where we are going.</li><li><strong>Case scenarios revisited</strong>: post-modern methods in action.</li></ul><h3>intro</h3><p>It’s been more than 15 years since modern data processing began, yet if you ask about the next-generation stack, you’re unlikely to get clear answers. For instance, Perplexity summarizes the “post-modern” stack as an “evolution” that “enhances data reliability,” while Flux .1 Pro envisions a futuristic data center that looks like it’s only missing the film crew from The Matrix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ItU1gr3NsrZwouIanQ3_w.jpeg" /><figcaption>Flux.1 Pro rendering of the “post-modern data stack”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9EATqdJK8UobIyUrn3gcg.png" /><figcaption>Perplexity screenshot explaining “post-modern data stack” as a marketing term.</figcaption></figure><p>Combined, these two sources hint towards data post-modernism as a purely marketing ploy. Yet there are some things in the air that cannot be dismissed as mere exercise in corporate advertisement. Let me quickly demonstrate what I am talking about:</p><p><strong>Case 1</strong>. Imagine you’re tasked with extracting “sales insights.” You have access to a wealth of corporate financials and market trends, along with hours of audio and video recordings of real customers interacting with sales reps.</p><p><strong>Case 2</strong>. Now, picture yourself working for a marketplace, responsible for building a consumer-facing product catalog. You’re managing a database with hundreds of thousands of SKUs, stock levels, and product descriptions, plus millions of product images provided by vendors. These images are of the variable quality, yet the catalog must conform to the common representational standards.</p><p>In both scenarios, it is likely the way you’d tackle these tasks would be vastly different from how you would have approached them just two years ago. This shift is a clear indication that something has changed, and a whiff of a quiet revolution in enterprise data processing.</p><p>So what exactly is going on?</p><h3>Where we are now — the <strong>modern stack</strong>.</h3><p>The hallmark of the modern data stack is its cloud-based architecture. This represents a massive leap from the local processing of earlier times, offering benefits such as limitless object storage, infinitely scalable computing power, and a dazzling array of modular components. Achieving this level of flexibility and scalability would have been nearly impossible under the old legacy systems.</p><p>So here are the main features of the modern data stack:</p><ul><li>Cloud-based SaaS with sharing, versioning, and data governance.</li><li>Scalable cloud data warehouses.</li><li>Primarily SQL-based data transformations.</li><li>ML and AI insights through integration with ML platforms.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eHJcM784MD2PlVj87lxKiw.png" /><figcaption>diagram drawn by the author</figcaption></figure><p>It quickly becomes evident that the majority of data processing in the “modern” stack takes place within the data warehouse, while machine learning operates more peripherally. A closer look at the AI/ML side of thinks reveals several key aspects:</p><ul><li>Dozens of custom ML models extracting features and feeding them to ensembles of decision making models in the “bottoms-up” fashion.</li><li>Data-hungry training algorithms.</li><li>Long times required to train these ML models from scratch.</li></ul><h3>What we love about the modern stack.</h3><p>The modern stack ushered us into the era of “Big Data.” Its defining accomplishment is the ability to “find the needle in a haystack,” meaning it can extract meaningful insights from vast volumes of structured data.</p><p>A well-designed processing stack is also a hallmark of solid engineering practices, ensuring proper data provenance tracking and data governance. This is crucial, as the entire process relies heavily on data, making effective management and oversight essential for success.</p><h3>What we hate about the modern stack.</h3><p>AI and ML are the relatively recent additions to modern stack, which is why it became permanently split into the older “SQL continent” and the newer “ML island”. This split drives a lot of complexity, including:</p><ul><li><strong>Engineering Qualifications</strong>: the official language of a data warehouse is SQL, the<em> lingua franca</em> of ML is Python. Good luck finding the engineers who can excel at both and interface two stack parts at once.</li><li><strong>Resource Management</strong>: Data Warehouses need CPUs, ML models need GPU clusters — two distinct resource needs.</li><li><strong>Large Unstructured Data: </strong>fitting multimodal objects like images and videos into traditional database rows is already tricky, and processing them through ML models adds another layer of complexity. The modern stack isn’t built to seamlessly accommodate such diverse data types into uniform tables.</li></ul><p>However, the fact that there are many things we don’t love about something does not necessarily mean there is a revolution brewing up. A paradigm shift requires both the “pending need” and the “technology overhang”.</p><h3>The pull and the push towards the change.</h3><p>The “push” towards change often stems from the inefficiencies in current practices — many of which we’ve already discussed. The “pull,” on the other hand, comes from the tailwinds outside the data stack, and in recent years, these forces have been driven by the rapid advancements in foundational model capabilities.</p><p>What are the implications of these tailwinds? Foundational AI models offer the potential to significantly reduce:</p><p>• <strong>Time to value in analytics</strong>: No longer is there a need to train models from scratch, speeding up the experimentation.</p><p>• <strong>Big Data requirements</strong>: These are increasingly managed and amortized by the large model providers, lightening the burden on individual organizations.</p><p>• <strong>Personnel qualifications</strong>: Fine-tuning foundational models is far simpler than building ML models from the ground up, reducing the demand for specialized talent.</p><p>• <strong>ML infrastructure costs</strong>: Using APIs is cost-effective, especially when considering the savings from not needing to maintain inference infrastructure.</p><p>More crucially, these advancements are not just theoretical — they’ve been sufficiently proven to create a growing technology overhang, one that continues to build momentum at an accelerating pace.</p><h3>The palliative solutions.</h3><p>As is often the case, the increasing divergence between enterprise data processing needs, which are shifting towards deep learning, has led to several intermediate solutions that attempt to bridge the gap. Among these:</p><p>• <strong>Data lakes</strong>: Designed to accommodate unstructured data by fitting it into table-like formats.<br> • <strong>ML “parks”</strong>: Add-ons attached to data warehouses to support machine learning processes.<br> • <strong>User-defined SQL functions</strong>: Allowing external ML/AI APIs to be called from within the warehouse environment.</p><p>While some of these solutions may seem effective in the short term, they are likely temporary fixes. In the long run, these stopgap measures will probably be phased out as more robust and integrated technologies emerge.</p><h3>The generational change.</h3><p>Today’s modern data stack is heavily centered around data wrangling in SQL. But what would remain if deep learning models processing unstructured data became the predominant method of data processing? As it turns out, not much.</p><p>Certainly, vectorized operations on columns won’t disappear. However, a more significant shift is that data objects should be accessible directly from where they reside — in cloud storage. There’s no need to extract audio, store it as binary columns, and replicate it across every table iteration. “Storage as ground truth” is perfectly valid for handling unstructured data.</p><p>Even more crucially, there’s less reason to cling to SQL itself. SQL was designed to efficiently manipulate columnar data, but as data processing shifts toward deep learning models and APIs, the importance of column-oriented language diminishes. In this new paradigm, data warehouses can function seamlessly under the control of Python or another general data-oriented language.</p><p>Lastly, the concept of “Big Data” as we know it can easily fade. Large foundational models already possess rich representations of the world, and fine-tuning them for specific tasks requires far less data than we once believed necessary. Consider this: a factory worker doesn’t need to see millions of demonstrations to learn a new operation. Similarly, a sufficiently advanced foundational model can be specialized for various tasks in a top-down manner with far less effort than previously thought.</p><h3>The post-modern stack.</h3><p>In light of our discussion, the shape of the post-modern data stack is surprisingly simple and intuitive.</p><p>Firstly, the post-modern stack eliminates the need for two distinct touchpoints for data access. While a data warehouse might still be used for backend operations, the frontend is streamlined, with a programming language like Python directly interacting with familiar object-oriented data structures like datasets. In this setup, data engineers can focus on AI/ML analytics without having to worry about translating these tasks into the underlying execution framework.</p><p>Secondly, unstructured data takes on a dominant role in this new architecture, rendering intricate access methods obsolete. Instead, cloud storage emerges as a perfectly adequate abstraction for storing unstructured data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qEV_Avm4ad4JWOkY-fDHIA.png" /><figcaption>diagram drawn by the author</figcaption></figure><p>Lastly, while the majority of analysis and data transformation in the post-modern stack is handled by large foundational models, yet these models are not a core component of the stack itself.</p><p>This is because these models are provided by external vendors and are typically only fine-tuned by end-users for specific tasks. Whether hosted on-premises or in the cloud, the heavy lifting of training these large models is offloaded, meaning large model training is not a native part of the data stack. This allows the stack to remain lightweight and efficient, while leveraging the power of advanced AI without the burden of managing complex model training infrastructure.</p><h3>Use cases revisited.</h3><p>We have opened this article with two use cases proved to be challenging in the current data processing paradigm. Let’s outline how trivial they are to solve in the post-modern world.</p><p><strong>Case 1</strong>. Extracting sales insights.</p><p>The bulk of input data comes from audios and videos capturing sales transactions. As a result, key insights are derived from multimodal foundational models, which analyze customer reactions to specific sales tactics. These insights, when combined with financial transaction data from structured tables, provide a comprehensive context for large language model (LLM)-based sales efficiency analysis. This fusion of unstructured and structured data enables a more nuanced understanding of sales performance and customer behavior.</p><p><strong>Case 2</strong>. Creating the product catalog.</p><p>In the old stack, product image curation required custom image classifiers, and data acquisition was an expensive process to gather additional product footage when needed.</p><p>In the new stack, however, the handling of product visuals is redefined as a generative task. Existing footage is now used to fine-tune generative image adapters, with a large generative AI (GenAI) network producing the necessary outputs. As a result, data engineers can shift their focus from the technical challenge of filtering through existing material to more strategic business requirements — such as ensuring the diversity, accuracy, and inclusivity of promotional content. This new approach greatly simplifies the process, allowing engineers to prioritize creative and ethical aspects over technical data wrangling and data acquisition processes.</p><h3>Conclusion.</h3><p>In essence, the post-modern stack is about streamlining workflows by enabling direct interaction with data through foundational models and using cloud storage as the core layer for managing diverse data types. This approach simplifies the stack by reducing reliance on legacy systems and complex data management processes.</p><p>As is often the case with technological advancements, this future is already here, though not yet evenly distributed. Many AI-first companies have already moved away from SQL for data management and curation, embracing a more flexible, model-driven approach. Meanwhile, other enterprises are adopting a more cautious strategy, extending the transition period as they weigh the benefits and challenges of this shift.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1955e534479" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dvc-data-version-control/post-modern-ai-data-stack-f1955e534479">Post-modern AI data stack</a> was originally published in <a href="https://medium.com/dvc-data-version-control">DVC — Data Version Control</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing DataChain]]></title>
            <link>https://medium.com/dvc-data-version-control/announcing-datachain-4cf9c38d7ce8?source=rss----ce2e1b7aa37c---4</link>
            <guid isPermaLink="false">https://medium.com/p/4cf9c38d7ce8</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[unstructured-data]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[multimodal]]></category>
            <dc:creator><![CDATA[DVC]]></dc:creator>
            <pubDate>Fri, 13 Sep 2024 14:36:40 GMT</pubDate>
            <atom:updated>2024-07-24T19:40:42.048Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3IucVmZC2WO83y1i.png" /><figcaption><em>DataChain: ⭐ the repo at </em><a href="https://github.com/iterative/datachain"><em>https://github.com/iterative/datachain</em></a></figcaption></figure><p>Author: <a href="https://www.linkedin.com/in/dmitryleopetrov/">Dmitry Petrov</a></p><p>As a DVC team, we are fortunate to have witnessed the recent transformations in ML and AI firsthand and admire the rise of unstructured data together with great libraries to handle it.</p><p>The tidal wave of new applications demanding access to images, video, audio, text, PDF documents, MRI scans, and other media types introduces a new challenge — unstructured data preparation and curation. It is no longer enough to designate and version a file folder as a dataset; the modern data stack demands the use of AI to create features and annotations and start the dataset formation from these features.</p><h3>AI’s new appetite for data</h3><p>While data has long been touted to be in the critical path for building AI, below are the novel requirements that we believe are here to stay:</p><p>🤖 <strong>AI-Driven Data Curation:</strong> There is a rapidly growing interest in data curation assisted with AI models. Technologies like LLMs judging their own outputs, or OpenAI’s DALL-E3 curating its own dataset are becoming a common practice, and frequently separate the good products from the great products.</p><p>🚀 <strong>Dataset scaling:</strong> In many GenAI use cases, millions and billions of images or text snippets are becoming routine. Wrangling and versioning the GenAI-era datasets takes an entirely new approach at the backend.</p><p>🐍 <strong>Python ubiquity:</strong> As Python emerged as a clear language of choice for AI workloads, it became painfully obvious that Python objects must be treated as 1st class citizens in the AI datasets. Using JSON to store every possible feature just no longer cuts it.</p><h3>What DataChain can do for you.</h3><p>We created DataChain to answer these challenges. Our high-level vision of serving the modern AI data stack drives the key product capabilities:</p><ol><li>Read data from cloud S3/GCS/Azure (or locally) and create persistent and versioned datasets with samples defined as sparse references to files or objects inside files. Examples are features within parquet or .tar archives, tiles within the bounding boxes in images, snippets within text blobs, etc.</li><li>Define data models in Python using <a href="https://docs.pydantic.dev/latest/">Pydantic</a> and store features as validated data objects with automatic serialization/deserialization.</li><li>Apply transformations to data using local ML models, external LLM calls, or custom Python code coupled with the ability to chain and optimize stages for execution.</li><li>Run inference code efficiently in parallel and out-of-memory, handling millions of files even on a laptop.</li><li>Use embedded databases under the hood (<a href="https://www.sqlite.org/">SQLite</a> in open-source version) to efficiently store Python objects and execute vectorized operations (such as similarity search) and analytical calls. DataChain hides all the complexity of dealing with databases.</li></ol><p>The result is a modern, Python-friendly, data-wrangling abstraction that can compose actions like AI inferences and metric computations at scale, and doubles as a building block to your data curation routine, or as a way to evaluate an existing AI application.</p><p>We believe that DataChain will serve as a solid foundation for new and upcoming unstructured data-wrangling libraries, as well as custom AI-driven curation solutions.</p><h3>Typical use examples</h3><pre>$ pip install datachain</pre><h3>LLM judging LLMs dialogues</h3><pre>from mistralai.client import MistralClient<br>from mistralai.models.chat_completion import ChatCompletionResponse, ChatMessage<br>from datachain import File, DataChain<br><br>PROMPT = &quot;Was this dialog successful? Answer in a single word: Success or Failure.&quot;<br><br>def eval_dialogue(file: File) -&gt; ChatCompletionResponse:<br>     client = MistralClient()<br>     return client.chat(<br>         model=&quot;open-mixtral-8x22b&quot;,<br>         messages=[ChatMessage(role=&quot;system&quot;, content=PROMPT),<br>                   ChatMessage(role=&quot;user&quot;, content=file.read())])<br><br>chain = (<br>   DataChain.from_storage(&quot;gs://datachain-demo/chatbot-KiT/&quot;, object_name=&quot;file&quot;)<br>   .map(response=eval_dialogue)<br>   .save(&quot;mistral_dataset&quot;)<br>)</pre><h3>Auto-deserializing LLM-responses to Pydantic</h3><pre>from datachain import DataChain, DataModel<br>from mistralai.models.chat_completion import ChatCompletionResponse<br><br>DataModel.register(ChatCompletionResponse)<br>chain = DataChain.from_dataset(&quot;mistral_dataset&quot;)<br><br># Iterating one-by-one: out of memory<br>for file, response in chain.iterate(&quot;file&quot;, &quot;response&quot;):<br>    # You work with Python objects<br>    assert isinstance(response, ChatCompletionResponse)<br><br>    status = response.choices[0].message.content<br>    print(f&quot;{file.get_uri()}: {status}&quot;)</pre><p>Output:</p><pre>gs://datachain-demo/chatbot-KiT/1.txt: Success <br>gs://datachain-demo/chatbot-KiT/10.txt: Success <br>gs://datachain-demo/chatbot-KiT/11.txt: Failure <br>...</pre><h3>Vectorized operations over Pydantic data fields</h3><p>In some cases, deserialization into a Python object can be skipped, and the computation can be executed directly within the underlying database.</p><pre># input tokens price: $2 per 1M tokens<br># output tokens proce: $6 per 1M tokens<br>cost = chain.sum(&quot;response.usage.prompt_tokens&quot;)*0.000002 \<br>      + chain.sum(&quot;response.usage.completion_tokens&quot;)*0.000006<br><br>print(f&quot;Spent ${cost:.2f} on {chain.count()} calls&quot;)</pre><p>Output:</p><pre>Spent $0.08 on 50 calls</pre><h3>Annotating cloud images with a local model</h3><p>Computer Vision use cases are especially sensitive to high-performance data downloads.</p><pre>import io<br>from PIL import Image<br>from datachain import DataChain<br>from transformers import PaliGemmaForConditionalGeneration, AutoProcessor<br><br>model = PaliGemmaForConditionalGeneration.from_pretrained(&quot;google/paligemma-3b-mix-224&quot;)<br>processor = AutoProcessor.from_pretrained(&quot;google/paligemma-3b-mix-224&quot;)<br><br>def process_image(file) -&gt; str:<br>   image = Image.open(io.BytesIO(file.read())).convert(&quot;RGB&quot;)<br>   inputs = processor(text=&quot;caption&quot;, images=image, return_tensors=&quot;pt&quot;)<br>   generate_ids = model.generate(**inputs, max_new_tokens=100)<br>   return processor.batch_decode(generate_ids, skip_special_tokens=True,<br>                                 clean_up_tokenization_spaces=False)[0]<br><br>chain = (<br>      DataChain.from_storage(&quot;gs://datachain-demo/newyorker_caption_contest/images&quot;)<br>      .limit(5)<br>      .map(scene=process_image)<br>      .save(&quot;image_captions&quot;)<br>)</pre><h3>Optimizations: parallelization and data caching</h3><p>Parallel execution and data caching play a critical role in the efficient data curation process.</p><pre>chain = (<br>   DataChain.from_storage(&quot;gs://datachain-demo/chatbot-KiT/&quot;,<br>                          object_name=&quot;file&quot;)<br>   .settings(parallel=4, cache=True)<br>   .limit(5)<br>   .map(response=eval_dialogue)<br>   .save(&quot;mistral_dataset&quot;)<br>)</pre><h3>DataChain needs your feedback!</h3><p>As usual in the open-source, we are providing this software for free, but we are also dependent on help from our community.</p><p><strong>First and foremost</strong>, we want you to try the product, let us know if it fits your data routine, and report any bugs or deficiencies that you may have seen. DataChain is still early in its lifecycle, so your feedback is crucial to the future of this product.</p><p><strong>Second</strong>, we need contributors! If you see a missing feature or an application for DataChain that could be built as an extension, we would be happy to see a pull request from you.</p><p><strong>Last, but not least</strong> — if you find DataChain useful, give us a star ⭐ It goes a long way for us.</p><p>⭐️ <a href="https://github.com/iterative/datachain">Star the repo!</a> ⭐️</p><p><em>Originally published at </em><a href="https://dvc.ai/blog/datachain-release"><em>https://dvc.ai</em></a><em> on July 23, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cf9c38d7ce8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dvc-data-version-control/announcing-datachain-4cf9c38d7ce8">Announcing DataChain</a> was originally published in <a href="https://medium.com/dvc-data-version-control">DVC — Data Version Control</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You Do the Math: Fine Tuning Multimodal Models (CLIP) to Match Cartoon Images to Joke Captions]]></title>
            <link>https://medium.com/dvc-data-version-control/you-do-the-math-fine-tuning-multimodal-models-clip-to-match-cartoon-images-to-joke-captions-2f03393e0b80?source=rss----ce2e1b7aa37c---4</link>
            <guid isPermaLink="false">https://medium.com/p/2f03393e0b80</guid>
            <category><![CDATA[multimodal-ai]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[contrastive-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Dave Berenbaum]]></dc:creator>
            <pubDate>Fri, 13 Sep 2024 14:12:01 GMT</pubDate>
            <atom:updated>2024-09-24T13:55:16.317Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="CLIP Multimodal Model" src="https://cdn-images-1.medium.com/max/447/1*dkQdvK_KTF_AaLSdJ8XZcg.png" /><figcaption>Image generated by DALL-E through ChatGPT</figcaption></figure><p>Multimodal models like CLIP have opened up new AI use cases by connecting complex objects like images to text descriptions that are easy to understand, generate, and parse. However, off-the-shelf models like CLIP may not be representative of the data typically seen in specific domains, in which case fine-tuning may be needed to adapt the model to that domain.</p><p>This post shows how to fine-tune the CLIP model on cartoon images from The New Yorker Magazine and joke captions for those cartoons. It is based on <a href="https://www.capcon.dev/">https://www.capcon.dev/</a>, a dataset for various tasks associated with The New Yorker’s cartoon contest. One of the tasks is to take a cartoon image and predict the appropriate caption from a list of possible captions. Let’s see how we can fine-tune CLIP for this task.</p><h3>Data</h3><p>The data is hosted and publicly available at gs://datachain-demo/newyorker_caption_contest, and it has two parts:</p><ol><li>images: A folder of JPEG files, each representing a cartoon image.</li><li>new_yorker_meta.parquet: A parquet file with metadata about the images, including multiple choices of captions for the image and the correct caption choice.</li></ol><p>To work with this data, we will use the open-source library <a href="https://github.com/iterative/datachain">datachain</a>, which helps to wrangle unstructured data like this into a more structured format (disclaimer: I helped develop datachain). All of the code used in this post is available in a <a href="https://github.com/iterative/datachain-examples/blob/main/multimodal/clip_fine_tuning.ipynb">Jupyter Notebook in GitHub</a>, or you can run it in <a href="https://colab.research.google.com/github/iterative/datachain-examples/blob/main/multimodal/clip_fine_tuning.ipynb">Colab</a>.</p><p>To start, we read both the images and metadata from their sources and then join them according to filename (which is available as a column in the metadata):</p><pre>from datachain import C, DataChain<br>from datachain.sql.functions import path</pre><pre>img_dc = DataChain.from_storage(&quot;gs://datachain-demo/newyorker_caption_contest/images&quot;, type=&quot;image&quot;, anon=True)<br>meta_dc = DataChain.from_parquet(&quot;gs://datachain-demo/newyorker_caption_contest/new_yorker_meta.parquet&quot;)<br>dc = img_dc.mutate(filename=path.name(C(&quot;file.path&quot;))).merge(meta_dc, on=&quot;filename&quot;)</pre><p>The code first creates a dataset img_dc from images in a directory, storing the essential information about each file, which we will use later to read the images. Then, it creates a dataset meta_dc from the parquet file of metadata. Finally, it merges these two based on the image filename. img_dc contains a column file.path with the full path to the file, and img_dc.mutate(filename=path.name(C(&quot;file.path&quot;))) extracts only the last part of that path, which matches the contents of the filename column in meta_dc. The merged dc dataset has both the file info and metadata for each image.</p><p>We can view a sample of the data by filtering and collecting the data like this:</p><pre>sample = dc.filter(C(&quot;file.path&quot;).endswith(&quot;/371.jpeg&quot;)).limit(1)<br>sample_results = list(sample.collect(&quot;file&quot;, &quot;caption_choices&quot;, &quot;label&quot;))</pre><p>This limits the data to the image ending in /371.jpeg and collects only the columns &quot;file&quot;, &quot;caption_choices&quot;, &quot;label&quot;. The resulting output includes an ImageFile (see below), a list of possible captions, and a label for the letter choice of the correct caption. You may end up with slightly different results since there are multiple rows per image with different caption choices.</p><pre>[(ImageFile(source=&#39;gs://datachain-demo&#39;, path=&#39;newyorker_caption_contest/images/371.jpeg&#39;, size=25555, version=&#39;1719848719616822&#39;, etag=&#39;CLaWgOCXhocDEAE=&#39;, is_latest=True, last_modified=datetime.datetime(2024, 7, 1, 15, 45, 19, 669000, tzinfo=datetime.timezone.utc), location=None, vtype=&#39;&#39;),<br>  [&quot;I feel like we&#39;ve gotten a little soft, Lex.&quot;,<br>   &quot;Hold on, the Senate Committee on Women&#39;s Health is getting out.&quot;,<br>   &quot;I know a specialist, but he&#39;s in prison.&quot;,<br>   &#39;Six rounds. Nine lives. You do the math.&#39;,<br>   &#39;Growth has exceeded our projections.&#39;],<br>  &#39;D&#39;)]</pre><p>We can get the image itself from the ImageFile object using its read() method, which you can see for yourself if you follow along in the <a href="https://github.com/iterative/datachain-examples/blob/main/multimodal/clip_fine_tuning.ipynb">notebook</a>. In this sample, we have a cartoon of a mouse pointing a gun at the cat, with the correct caption being option D, which reads, “Six rounds. Nine lives. You do the math.”</p><h3>Applying a base CLIP model</h3><p>We can apply CLIP to this data to predict the likelihood of each caption. This is similar to the base architecture of CLIP, which uses <em>contrastive learning</em> to take an image and discern the most likely caption from a batch of text captions (and vice versa). During training, CLIP gets batches of image-text pairs as input, with each image mapped to its text caption. For each batch, CLIP calculates the cosine similarity of each image to each text in the batch, so that it has not only the similarities of the matches but also of every mismatched image-text pair (see the image below). It then treats this as a classification problem where the match is considered the correct label and the mismatches are considered the incorrect labels. During inference, this can be used as a zero-shot predictor by feeding in an image and batch of captions, for which CLIP will return the probability of each caption. For a deeper dive into CLIP, see the original <a href="https://openai.com/index/clip/">OpenAI post</a> about it, or Chip Huyen has a nice summary of how it works <a href="https://huyenchip.com/2023/10/10/multimodal.html#contrastive_learning">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uYGtVk8a8bV5aYR2BSaqTw.png" /><figcaption>Image from <a href="https://openai.com/index/clip/">https://openai.com/index/clip/</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FgvS8VRtv04Bu3-Vbs-8jg.png" /><figcaption>Image from <a href="https://openai.com/index/clip/">https://openai.com/index/clip/</a></figcaption></figure><p>For the cartoon dataset, we can feed in our sample image and the caption choices to get back the probability that each is a correct match. Here’s how that looks in code:</p><pre>import clip<br>import torch</pre><pre>device = &quot;cuda&quot; if torch.cuda.is_available() else &quot;cpu&quot;<br>model, preprocess = clip.load(&quot;ViT-B/32&quot;, device=device)</pre><pre>image = example[0].read()<br>image = preprocess(image).unsqueeze(0).to(device)<br>text = clip.tokenize(example[1]).to(device)<br>logits_per_image, logits_per_text = model(image, text)<br>logits_per_image.softmax(dim=1)[0]</pre><p>First, we load the ViT-B/32 pre-trained model and image preprocessor onto the device. Then, we transform the image into the expected tensor input and tokenize the text captions to do the same. Next, we run the model on those transformed inputs to get the logit similarity scores of the image to each text, and finally run a softmax function to get a relative probability for each text caption.</p><p>The output shows that CLIP can already confidently predict the correct caption for this example, since caption D (the fourth caption) has a probability of 0.9844 (if you try this yourself, you may have different caption choices in your example, which may lead to different results):</p><pre>tensor([0.0047, 0.0013, 0.0029, 0.9844, 0.0067], grad_fn=&lt;SelectBackward0&gt;)</pre><h3>Creating a training dataset</h3><p>Now that we know how to apply CLIP to predict captions, we can build a training dataset for fine-tuning the model. Let’s get the similarity scores for a random 10 images (you can increase to a larger size but we will keep it small here to make it easy to quickly follow along on a laptop CPU). Here’s the code to do that:</p><pre>from datachain.torch import clip_similarity_scores</pre><pre>train_dc = dc.shuffle().limit(10).save(&quot;newyorker_caption_contest_train&quot;)<br>train_dc = train_dc.map(<br>    func=lambda img_file, txt: clip_similarity_scores(img_file.read(), txt, model, preprocess, clip.tokenize, prob=True)[0],<br>    params=[&quot;file&quot;, &quot;caption_choices&quot;],<br>    output={&quot;scores&quot;: list[float]}<br>)</pre><p>First, we shuffle and save 10 images from the dataset. Then, we use the map() method to to apply a function to each record and save the result as a new column. We use the utility function clip_similarity_scores, which performs the steps from the previous section in one line to get the caption probabilities. The input to the map() function is defined by params=[&quot;file&quot;, &quot;caption_choices&quot;], and the output column is defined by output={&quot;scores&quot;: list[float]}.</p><p>For training, we also need the ground truth of the correct captions, so we again use map() to calculate the index of the correct caption for each record, along with the CLIP probability of that caption so we can see how well baseline CLIP is performing:</p><pre>import string</pre><pre>def label_ind(label):<br>    return string.ascii_uppercase.index(label)</pre><pre>def label_prob(scores, label_ind):<br>    return scores[label_ind]</pre><pre>train_dc = (<br>    train_dc.map(label_ind, params=[&quot;label&quot;], output={&quot;label_ind&quot;: int})<br>    .map(label_prob, params=[&quot;scores&quot;, &quot;label_ind&quot;], output={&quot;label_prob&quot;: float})<br>)<br>train_dc = train_dc.save()</pre><p>We can run train_dc.avg(&quot;label_prob&quot;) to get the average probability of the correct caption for the training sample. The average will depend on the random samples in your training dataset, but you should see a much lower value than the sample image above, so it seems the other images are not so easy for baseline CLIP to correctly predict.</p><h3>Fine-tuning</h3><p>To fine-tune CLIP, we need to create a train() function to loop over the training data and update the model:</p><pre>def train(loader, model, optimizer, epochs=5):<br>    if device == &quot;cuda&quot;:<br>        model = model.float()<br>    loss_func = torch.nn.CrossEntropyLoss()</pre><pre>    for epoch in range(epochs):<br>        total_loss = 0<br>        for images, texts, labels in loader:<br>            optimizer.zero_grad()<br>            batch_loss = 0<br>            for image, text, label in zip(images, texts, labels):<br>                image = image.to(device).unsqueeze(0)<br>                text = text.to(device)<br>                label = label.to(device).unsqueeze(0)</pre><pre>                logits_per_image, logits_per_text = model(image, text)</pre><pre>                batch_loss += loss_func(logits_per_image, label)<br>            batch_loss.backward()<br>            optimizer.step()<br>            batch_loss = batch_loss.item()<br>            total_loss += batch_loss<br>        print(f&quot;loss for epoch {epoch}: {total_loss}&quot;)</pre><p>For each pairing of image to text captions, the function calculates the logit similarity scores, uses the correct label index to apply the loss function, and performs a backward pass to update the model.</p><p>This is very similar to how base CLIP works, except for one difference. Base CLIP expects each batch to contain image-text pairs, where each image has a single corresponding text, and CLIP must get incorrect texts from the other samples in the batch for contrastive learning (see the image above). With the cartoon dataset, each image already has not only the corresponding correct text caption, but also multiple incorrect text captions. Therefore, instead of relying on the other samples in the batch for contrastive learning, the function above relies only on the text captions choices provided for that image.</p><p>To feed the training data into this function, we need to generate a PyTorch dataset and data loader and pass the loader to the train() function along with an optimizer:</p><pre>from torch.utils.data import DataLoader</pre><pre>ds = train_dc.select(&quot;file&quot;, &quot;caption_choices&quot;, &quot;label_ind&quot;).to_pytorch(<br>    transform=preprocess,<br>    tokenizer=clip.tokenize,<br>)</pre><pre>loader = DataLoader(ds, batch_size=2)<br>optimizer = torch.optim.Adam(model.parameters(), lr=1e-4)<br>train(loader, model, optimizer)</pre><p>The code above selects the columns needed for training (&quot;file&quot;, &quot;caption_choices&quot;, &quot;label_ind&quot;), and then calls to_pytorch() with the CLIP preprocessor and tokenizer, which returns a PyTorch IterableDataset with the preprocessed image tensors, tokenized text, and label indices. Next, the code creates a PyTorch DataLoader and optimizer and passes them to train() to start training.</p><p>Since we are using a tiny dataset, we can quickly see the model fit to the sample and the loss decreases dramatically:</p><pre>loss for epoch 0: 5.243085099384018<br>loss for epoch 1: 6.937912189641793e-05<br>loss for epoch 2: 0.0006402461804100312<br>loss for epoch 3: 0.0009484810252615716<br>loss for epoch 4: 0.00019728825191123178</pre><p>This should set off alarm bells about overfitting, but for this exercise, it’s useful to see that train() is doing what we expect: learning the correct captions from the training dataset. We can confirm by calculating the predicted probability of the correct caption for each image in the training data using the fine-tuned model:</p><pre>train_dc = train_dc.map(<br>    func=lambda img_file, txt: clip_similarity_scores(img_file.read(), txt, model, preprocess, clip.tokenize, prob=True)[0],<br>    params=[&quot;file&quot;, &quot;caption_choices&quot;],<br>    output={&quot;scores_fine_tune&quot;: list[float]}<br>)</pre><pre>train_dc = train_dc.map(label_prob, params=[&quot;scores_fine_tune&quot;, &quot;label_ind&quot;], output={&quot;label_prob_fine_tune&quot;: float})</pre><p>The above code is the same that was used above to calculate the probability before fine-tuning. Running train_dc.avg(&quot;label_prob_fine_tune&quot;) outputs an average predicted probability &gt;0.99, so it looks like the fine-tuning worked as expected.</p><p>This is an artificial example but hopefully gives you an idea of how to fine-tune CLIP. To solve the task of predicting the correct caption in a more robust way, you would want to take a much larger sample and evaluate against a held-out sample of images and texts that hadn’t been seen during training. When trying that, you may find that CLIP does not perform so well at generalizing to the caption prediction problem, which should not be too surprising since CLIP was built to understand the contents of images rather than understanding jokes. CLIP relies on a relatively simple text encoder, and it may be worth exploring different text encoders for that task. This goes beyond fine tuning and this post, but now that you know how to train CLIP, you can try out this idea or bring your own ideas for how to adapt CLIP to your multimodal use cases.</p><p>You can find this blog post and more tutorials on our <a href="https://datachain.ai/blog/multimodal-clip-fine-tuning">blog at DataChain.ai</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f03393e0b80" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dvc-data-version-control/you-do-the-math-fine-tuning-multimodal-models-clip-to-match-cartoon-images-to-joke-captions-2f03393e0b80">You Do the Math: Fine Tuning Multimodal Models (CLIP) to Match Cartoon Images to Joke Captions</a> was originally published in <a href="https://medium.com/dvc-data-version-control">DVC — Data Version Control</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scalable PDF document processing with DataChain and Unstructured.io]]></title>
            <link>https://medium.com/dvc-data-version-control/scalable-pdf-documents-processing-with-datachain-and-unstructured-io-a2952b59dadf?source=rss----ce2e1b7aa37c---4</link>
            <guid isPermaLink="false">https://medium.com/p/a2952b59dadf</guid>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[unstructured-data]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Tibor Mach]]></dc:creator>
            <pubDate>Thu, 12 Sep 2024 13:50:55 GMT</pubDate>
            <atom:updated>2024-09-12T14:12:27.587Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Unstructrured.io and DataChain for PDF processing" src="https://cdn-images-1.medium.com/max/700/1*wLRDTniMpWMH9wdnISgv7w.png" /></figure><p><strong>Extract and parse text from documents and create vector embeddings in a scalable and distributed way (and less than 70 lines of code)</strong></p><p>Most organisations keep a large source of information in the form of various internal documents, call transcripts and other unstructured data. These data contain a lot of useful insights about customers, employees or the inner workings of the company. However, they remain largely untapped by data teams due to the difficulty of dealing with large quantities of data in unstructured formats.</p><p>Today, we will see how you can process a collection of documents in less than 70 lines of code, extract and parse text from them and create vector embeddings useful for downstream tasks (e.g. for RAG or as ML features). This approach is also scalable and you will benefit from easy versioning of the final datasets.</p><h3>Approach and tools</h3><p>We will work with a publicly available Google Storage bucket which contains a collection of Neurips conference papers (representing our internal company documents).</p><p><strong>For data processing we will use the </strong><a href="https://github.com/Unstructured-IO/unstructured"><strong>unstructured</strong></a><strong> Python library which contains a lot of useful functionality for unstructured data processing. They also offer an API to handle processing on their compute and offer some extra options and features on top of their FOSS offering. We will be using the API for partitioning to take advantage of advanced partitioning features.</strong></p><p>With unstructured we will:</p><ul><li>Easily ingest and partition each document using the <a href="https://docs.unstructured.io/api-reference/api-services/overview">Unstructured API</a></li><li>Clean the partitions</li><li>Create vector embeddings from the partitions</li></ul><p><strong>We will also use </strong><a href="https://github.com/iterative/datachain"><strong>DataChain</strong></a><strong>, which is an open-source Python data-frame library that helps ML and AI engineers to build a metadata layer on top of unstructured files. DataChain enables out-of-memory storage and processing with a Pythonic dataframe-like API that combines SQL-type operations with GPU/CPU acceleration and seamless scalability while also versioning and persisting datasets for reproducibility.</strong></p><p>With <a href="https://github.com/iterative/datachain">DataChain</a>, we will:</p><ul><li>Easily search and filter our data container to only load the documents we need</li><li>Scale up the document processing with unstructured.io to the level of our entire document collection</li><li>Save the results as versioned datasets in tabular format, ready for processing downstream</li></ul><p>Both libraries can be easily installed with pip.</p><pre>pip install &quot;unstructured[pdf,embed-huggingface]&quot; datachain</pre><p>(In this example we are using unstructured version 0.15.7)</p><p>For the Unstructured API, we will also install the python-dotenv library to load the API key and URL. To get the API key, you can follow this <a href="https://docs.unstructured.io/api-reference/api-services/free-api">guide</a> and get a free API key for up to 1000 document pages per month.</p><p>We then need to save a .env file with the following content in the location we will be running our code from:</p><pre>UNSTRUCTUREDAPI_KEY=&lt;YOUR_APIKEY&gt;<br>UNSTRUCTUREDAPIURL=https://api.unstructured.io/general/v0/general</pre><h3>Full working code</h3><p>Here you can have a look at the full code used in our example which you can run (and we will unpack in a second) This code will load our document collection with DataChain and create a DataChain UDF (user-defined function) process_pdf which will load, partition and clean the text and create vector embeddings using unstructured. It then saves (and automatically versions) the resulting dataset containing the embeddings, cleaned human-readable text and a reference key for all of the original documents.</p><pre>import os<br>from collections.abc import Iterator<br>from dotenv import load_dotenv<br><br>from datachain import DataChain, C, File, DataModel<br><br>from unstructured.partition.api import partition_via_api<br>from unstructured.cleaners.core import clean<br>from unstructured.cleaners.core import replace_unicode_quotes<br>from unstructured.cleaners.core import group_broken_paragraphs<br>from unstructured.embed.huggingface import (<br>    HuggingFaceEmbeddingConfig,<br>    HuggingFaceEmbeddingEncoder,<br>)<br><br>load_dotenv()<br><br><br># Define the output as a DataModel class<br>class Chunk(DataModel):<br>    key: str<br>    text: str<br>    embeddings: list[float]<br><br><br># Define embedding encoder<br><br>embedding_encoder = HuggingFaceEmbeddingEncoder(config=HuggingFaceEmbeddingConfig())<br><br><br># Use signatures to define UDF input/output (these can be pydantic model or regular Python types)<br>def process_pdf(file: File) -&gt; Iterator[Chunk]:<br>    # Ingest the file<br>    with file.open() as f:<br><br>        chunks = partition_via_api(<br>            file=f,<br>            metadata_filename=file.path,<br>            api_key=os.getenv(&quot;UNSTRUCTURED_API_KEY&quot;),<br>            api_url=os.getenv(&quot;UNSTRUCTURED_API_URL&quot;),<br>            content_type=&quot;pdf&quot;,<br>            strategy=&quot;fast&quot;,<br>            chunking_strategy=&quot;by_title&quot;,<br>        )<br><br>    # Clean the chunks and add new columns<br>    for chunk in chunks:<br>        chunk.apply(<br>            lambda text: clean(<br>                text, bullets=True, extra_whitespace=True, trailing_punctuation=True<br>            )<br>        )<br>        chunk.apply(replace_unicode_quotes)<br>        chunk.apply(group_broken_paragraphs)<br><br>    # create embeddings<br>    chunks_embedded = embedding_encoder.embed_documents(chunks)<br><br>    # Add new rows to DataChain<br>    for chunk in chunks_embedded:<br>        yield Chunk(<br>            key=file.path,<br>            text=chunk.text,<br>            embeddings=chunk.embeddings,<br>        )<br><br><br>dc = (<br>    DataChain.from_storage(&quot;gs://datachain-demo/neurips&quot;)<br>    .settings(parallel=-1)<br>    .filter(C.file.path.glob(&quot;*/1987/*.pdf&quot;))<br>    .gen(document=process_pdf)<br>)<br><br>dc.save(&quot;embedded-documents&quot;)<br><br>DataChain.from_dataset(&quot;embedded-documents&quot;).show()</pre><p>The resulting dataset will look like in the image below:</p><figure><img alt="DataChain table output" src="https://cdn-images-1.medium.com/max/1024/1*rzZFL8nPXeJv0yRGmCXxIA.png" /></figure><h3>How it works</h3><h3>Creating and saving the DataChain</h3><p>The following few lines of code are all that we need to load and select the right data in from our storage and to process them with unstructured.</p><pre>dc = (<br>    DataChain.from_storage(&quot;gs://datachain-demo/neurips&quot;)<br>    .settings(parallel=-1)<br>    .filter(C.file.path.glob(&quot;*/1987/*.pdf&quot;))<br>    .gen(document=process_pdf)<br>)</pre><p>Let’s unpack:</p><p>The from_storage and filter methods allow us to ingest the data from a bucket/storage container. Since DataChain uses lazy evaluation, no other files than those specified by the filter will be loaded, speeding up the process considerably. Setting parallel to -1 tells DataChain to make use of all CPUs/cores on the current machine, speeding things up once again.</p><p>This will create a DataChain metadata table containing all the information needed to process our PDF files without actually having to copy the files themselves or load them all to memory. Since DataChain operates on a metadata level, it can scale up billions of files without us having to worry about memory overflows.</p><p>The gen method allows us to modify the DataChain table and create new rows (potentially more than one per original table row) using DataChain UDF functions. Here, the UDF process_pdf does all the individual PDF processing with unstructured.</p><p>Finally, we save the table as a dataset by calling</p><pre>dc.save(&quot;embedded-documents&quot;)</pre><p>This will persist the table and version it (each time we call this command a new version is created automatically). We can then load and display it by the following command, optionally specifying the dataset version (more on that later).</p><pre>DataChain.from_dataset(&quot;embeddings&quot;).show()</pre><p>All that’s missing is the DataChain UDF definition, so let’s see how we do that.</p><h3>Defining the UDF</h3><p>The process_pdf UDF will take the original DataChain table and produce an output with embeddings of processed document chunks. We also want to keep the original text of each processed document chunk and a key by which we can link each chunk back to the original full document.</p><p>We first specify what we actually want to receive on the output of our UDF by defining the DataModel-based Chunk class and defining the output column types:</p><pre># Define the output as a DataModel class<br>class Chunk(DataModel):<br>    key: str<br>    text: str<br>    embeddings: list[float]</pre><p>Now we are ready to define the process_pdf function itself. We use Python signatures to specify the input and output. Here, File is a class used by DataChain to refer to the original file - a PDF document in our case. On the output we use Iterator since our function will produce multiple chunks (and so multiple rows in our DataChain table) per original file.</p><pre>def process_pdf(file: File) -&gt; Iterator[Chunk]:</pre><p>The rest of the function definition as well as the definition of embedding_encoder specifies how unstructured is used to process each individual PDF file. We are using <a href="https://docs.unstructured.io/api-reference/api-services/partition-via-api">partition_via_api</a> to take advantage of the more advanced &quot;by_similarity&quot; chunking strategy only offered in the API. If we are not interested in that, it is also possible to do the same using only the free open source unstructured library by replacing partition_via_api in the script above as follows:</p><pre>from unstructured.partition.pdf import partition_pdf<br><br>...<br><br>chunks = partition_pdf(file=f, chunking_strategy=&quot;by_title&quot;, strategy=&quot;fast&quot;)</pre><p>For more detail on data processing with unstructured you can check out the tutorial in the <a href="https://docs.unstructured.io/open-source/core-functionality/overview">unstructured documentation</a>. Here, we will just note that if some of our documents were scanned images or contained tables or other more complicated elements we would replace &quot;fast&quot; in the strategy parameter of partition_pdf or partition_via_api with &quot;hi-res&quot;. Then unstructuredwill be able to process that kind of data.</p><p>Finally, we want the UDF to produce new rows in our DataChain table and so we have it return the Chunk objects we specified above. Here, we use yield instead of return as each PDF file produces several Chunk objects.</p><pre># Add new rows to DataChain<br>    for chunk in chunks_embedded:<br>        yield Chunk(<br>            key=file.path,<br>            text=chunk.text,<br>            embeddings=chunk.embeddings,<br>        )</pre><h3>DataChain versioning and additional SaaS features</h3><p>Now, we have a versioned dataset with a new version automatically created by DataChain whenever we run the script above. By default, versions are numbered and we can always recall a particular version by specifying it as in this call:</p><pre>DataChain.from_dataset(&quot;embedded-documents&quot;, version=&lt;version number&gt;).show()</pre><figure><img alt="Comparison of two different versions of a DataChain dataset" src="https://cdn-images-1.medium.com/max/1024/1*ozx1_gjjXbzmAqg6RMjcfg.png" /><figcaption>An example comparison of two different versions of our dataset. We used slightly different data processing methods each time, resulting in different chunks as seem in the text column. In the SaaS version of DataChain, we can easily connect the dataset version with the exact script which created it.</figcaption></figure><p>In the SaaS version of DataChain we also provide lineage tracking for datasets, more robust dataset versioning and auditability, a managed on-demand compute including with GPU clusters to really scale up your workloads and a graphical user interface among other features.</p><p>DataChain SaaS is currently available as a private preview in our <a href="https://studio.dvc.ai/auth/sign-up">DVC Studio</a> platform right now, feel free to ask us about that at <strong>support@iterative.ai</strong>!</p><h3>Summary</h3><p>We have processed our collection of documents to create a dataset of embeddings in a scalable fashion. We could now proceed with optimizing the workflow, choosing the best way to preprocess our data by trying different parsing and data cleaning strategies, different embedding etc.</p><p>Unstructured provides many tools for such fine-tuning and dataset versioning with DataChain is a useful tool to compare the different iterations. With the DataChain SaaS it is also very easy to scale this up further with managed cluster compute and robust lineage and versioning capabilities. We will look at this in more detail next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2952b59dadf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dvc-data-version-control/scalable-pdf-documents-processing-with-datachain-and-unstructured-io-a2952b59dadf">Scalable PDF document processing with DataChain and Unstructured.io</a> was originally published in <a href="https://medium.com/dvc-data-version-control">DVC — Data Version Control</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running DVC on a SLURM cluster]]></title>
            <link>https://medium.com/dvc-data-version-control/running-dvc-on-a-slurm-cluster-9aa47ca8f58d?source=rss----ce2e1b7aa37c---4</link>
            <guid isPermaLink="false">https://medium.com/p/9aa47ca8f58d</guid>
            <category><![CDATA[biotechnology]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[data-version-control]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[slurm]]></category>
            <dc:creator><![CDATA[DVC]]></dc:creator>
            <pubDate>Thu, 21 Mar 2024 14:58:26 GMT</pubDate>
            <atom:updated>2024-03-21T14:57:33.514Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="DVC and SLURM integration" src="https://cdn-images-1.medium.com/max/1024/1*8nP_lnee1XhgLAgbPz64CQ.png" /><figcaption>Exscientia’s Dom Miketa and Luis Yanes solution for integrating DVC and SLURM</figcaption></figure><h3>Introduction</h3><p>For many ML projects, there comes a point when local development hits the wall and we need to scale up the underlying compute resources. Maybe the dataset grows too large for your primary workstation or the deep learning model requires several high-end GPUs. This should be a routine transition for ML developers, and one to which they shouldn’t have to give much thought. In this blog post, we’ll explain our approach to remote DVC experiments on a SLURM cluster and share some code to get you started.</p><p>We work at an AI-driven precision medicine company called <a href="https://www.exscientia.ai/">Exscientia</a>. Our goal is to change the way the world discovers and develops new medicines. The company is roughly evenly split between biologists and chemists on one side and technologists on the other, with your two authors belonging to the latter group; Dom is an AI research scientist and Luis is an engineer. This context is important to understand why we gravitated towards DVC in the first place, and why we scaled it up the way we did.</p><h3>Why DVC on SLURM?</h3><p>As demonstrated in <a href="https://en.wikipedia.org/wiki/Accelerate_(book)">research undertaken by the DevOps movement</a>, it’s hard to maintain consistent software delivery without well-designed tooling (like CI/CD) and a conducive developer culture (like PRs or working in small batches). Our domain is highly specific, but the same principles apply: to move fast while maintaining high quality, reliability and reproducibility, we need to adopt best DevOps practices. There are only so many hours in a day and you want to spend all of them on trying out new ideas and ideally none on setting up infrastructure. Good tooling optimises scientists’ efficiency and lets them run more experiments, each more thorough and exhaustive than would otherwise have been possible — all this while maintaining control over research code bases which can, if left unchecked, turn into precarious Jenga towers. Predictable code with clear standards also eases collaboration, the lifeblood of science. Consequently it’s much more important to pick an arbitrary standard than to obsess over any particular detail.</p><p>At Exscientia we provide researchers with project templates that automatically set up version control and CI/CD as well as QA tooling like Black, Ruff and Mypy. To coherently extend this setup to the joint realms of data science and ML, we integrated DVC. Our scientists can set up a fresh DVC-enabled repository with all the productivity tooling in just a few keystrokes and start experimenting right away. And because DVC transparently extends Git, there is less tool-induced context switching: users are always dealing with Git in some shape or form, rather than Git (for the code) and a database hidden behind a web service (for all the rest of it). Less context switching translates to less frustration and more flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*iD6UQMARf2c9tZCc.png" /></figure><p>To maintain a frictionless developer experience even as model sizes grow beyond the means of the humble laptop, we surveyed the organisation’s entire computational estate with a view towards designing an effective developer experience. Our platforms must support a number of teams with on-demand Jupyter or RStudio instances as well as workflow orchestration engines. We need to run large unsupervised jobs, interactive analyses and development sessions across many domains and technologies: data processing, ML model training and chemical simulations, each with different resource requirements. Finally, submitting a large workload should be a smooth and routine experience.</p><p>In the end, a cloud-deployed SLURM cluster fit the bill. It can efficiently scale compute resources while maintaining a user-friendly interface for job submission. As a bonus, many of our users are already familiar with SLURM from their past lives in academia. The principal mode of interaction is very simple: the user submits a Bash script describing exactly what they want to happen, including the exact resources required. SLURM will wait until such resources are available and then execute the job as instructed. Thanks to this highly general interface, the same computational resource, and its administrators, can support very diverse groups of users at the same time, reducing infrastructural complexity across the organisation.</p><h3>A sample project</h3><p>We’ll set up a <a href="https://github.com/Exscientia/rdvc-demo-project">basic project</a> for this demo and, to keep with the drug discovery theme, we will be predicting solubility of chemical compounds in water using only our recently open-sourced framework MolFlux.</p><p>The DVC pipeline consists of a featurisation stage, which loads the “ESOL” dataset consisting of pairs of molecules and their aqueous solubilities — how easily a molecule dissolves in water.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1Q-eBrCUYx6L7McH.png" /></figure><p>A few words about molecules and neural networks. Cheminformatics typically represents molecules as graphs, with atoms acting as the nodes and chemical bonds as the edges. There are several ways to feed molecular data to neural networks, each with its own pros and cons. GNNs can act directly on the molecular graph. You can also represent the graph as a string (most commonly using the SMILES format) and feed it to any sequence model such as a transformer.</p><p>In this example we’ll use a classic cheminformatics transformation called ECFP, or <a href="https://pubs.acs.org/doi/10.1021/ci100050t">extended connectivity fingerprint</a>. It’s essentially analogous to n-grams in NLP, which track whether a particular sequence of tokens appears in a text document. For example, does the 3-letter sequence “wea” appear in the Wikipedia article on blazers? Indeed it does, as part of “wear”.</p><p>Returning to ECFPs defined on molecular graphs, each “n-gram” is an atom and its immediate (e.g. 2-hop) neighbourhood. Since the “vocabulary” of all possible “n-grams” is finite, we can associate to each molecule a finite bit-vector (of the same length as the vocabulary) such that the choice of 0 or 1 indicates whether the corresponding “n-gram” is present in the molecule. This bit-vector is the ECFP fingerprint. And since it has a constant length, we can feed it into a large variety of ML algorithms, such as the MLP in the training stage.</p><p>We use DVC to configure and run the pipeline, decoupling the data featurisation step (where we convert molecules to ECFPs) from the model training step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*GsYNux4FrVWy5ipm.png" /></figure><p>DVC pipelines are useful to organise projects. As they are versioned in Git, you can reproduce complete workflows and results. Running a new experiment is a command away:</p><pre>dvc exp run</pre><p>This executes and tracks experiments in your repository without polluting it with unnecessary Git commits, branches, directories, etc. For more information and examples, see the <a href="https://dvc.org/doc/command-reference/exp/run">DVC documentation</a>.</p><p>It may not be immediately obvious, but our setup is highly modular. Head over to src/rdvc_demo_project/config/main.yaml to see just an example of configuration options we can tweak for each individual experiment. To start a much longer training run, execute</p><pre>dvc exp run -S model.config.trainer.max_epochs=100</pre><p>MolFlux was built to be explicitly config-driven and DVC’s <a href="https://dvc.org/doc/user-guide/experiment-management/hydra-composition">Hydra integration</a> exposes all of that flexibility out of the box.</p><h3>In the cloud</h3><p>Now that DVC experiments run on our local machine, we’d like to move them to the SLURM cluster. In this second repository, we share the source code to an internal tool we call <a href="https://github.com/exs-dmiketa/rdvc">rDVC</a> (for <em>remote</em> DVC). It is, by design, a very thin layer around dvc exp run and accepts all of its options and arguments. But on top of that it also recognises many of<a href="https://slurm.schedmd.com/sbatch.html">sbatch arguments and flags</a>, allowing it to control which computational resource inside the cluster will be used and for how long. For a full list of options consult rdvc run -help.</p><p>Let’s demonstrate how it works.</p><p>On its own, DVC knows nothing about your remote cluster, so we’ll need to start with a small amount of setup. Make sure you have cloned the sample project repo and installed the Python virtual environment using init_python_venv.sh. You will initialise your local rDVC config with</p><pre>rdvc init project</pre><p>Follow the wizard to set up default options for this project’s remote runs; they will be found in .rdvc/config.toml inside of the project repository. Depending on the cluster&#39;s setup, you may be able to choose the <em>instance type</em> allocated to your job. For the demo we have configured the cluster with t3.xlarge, g5.xlarge and g5.12xlarge. Our internal version of rDVC supports many more instance types and we encourage you to fork rDVC, redefine supported instance types and make the tool your own. For this demo, we pick g5.xlarge as the default instance as we want access to the GPU. But let&#39;s continue with the demo. To point rDVC at your SLURM cluster, we&#39;ll run the global initialisation script next:</p><pre>rdvc init global</pre><p>rDVC now knows how to contact SLURM, so let’s finish with configuration of the remote server:</p><pre>rdvc init remote</pre><p>Nothing stands between us and a remote GPU-powered experiment! Since rDVC is in many ways just a wrapper around dvc exp run, we can easily set off a run with modified parameters as</p><pre>rdvc run -S fabric=gpu</pre><p>When your run is finished you can pull it to your local repository with</p><pre>dvc exp pull origin</pre><p>and look at the results.</p><h3>Behind the scenes</h3><p>rDVC compiled a SLURM batch (or “sbatch”) script containing these instructions:</p><ol><li>Clone the project repo</li></ol><pre>#!/bin/bash<br><br>#SBATCH --output=&quot;.rdvc/logs/slurm-%j.out&quot;<br>#SBATCH --job-name=rdvc-run:rdvc-demo-project:main<br>#SBATCH --wckey=rdvc-demo-project<br>#SBATCH --mail-type=END,FAIL<br>#SBATCH --mail-user=&lt;email.address@domain.com&gt;<br>#SBATCH --constraint=t3.xlarge<br>#SBATCH --cpus-per-task=2<br>#SBATCH --nodes=1<br>#SBATCH --exclusive<br># Ensure bashrc is loaded<br>source &quot;${HOME}/.bashrc&quot;<br><br># Exit on failure http://redsymbol.net/articles/unofficial-bash-strict-mode/<br>set -euxo pipefail<br>IFS=$&#39;\n\t&#39;<br><br>export RDVC_JOB_REPO_NAME=&quot;rdvc-demo-project&quot;<br>export RDVC_JOB_REPO_URL=&quot;git@github.com:&lt;user&gt;/rdvc-demo-project.git&quot;<br>export RDVC_JOB_REPO_BRANCH=&quot;main&quot;<br>export RDVC_JOB_REPO_REV=&quot;&lt;git_hash&gt;&quot;<br><br>export RDVC_DIR=&quot;${RDVC_DIR:-${HOME}/.rdvc}&quot;<br><br># Prepare a directory for the current job<br>export RDVC_JOB_WORKSPACE_DIR=&quot;/tmp/rdvc-${SLURM_JOB_ID}&quot;<br>mkdir -p &quot;${RDVC_JOB_WORKSPACE_DIR}&quot;<br><br># Ensure cleanup after job finishes, regardless of exit status<br>function cleanup_job_dir(){<br>  echo &quot;Cleaning up the job directory.&quot;<br>  rm -rf &quot;${RDVC_JOB_WORKSPACE_DIR}&quot;<br>}<br><br>trap cleanup_job_dir EXIT<br><br># Create an insulated Git workspace for the current job<br>echo &quot;Creating Git workspace.&quot;<br>export RDVC_JOB_REPO_DIR=&quot;${RDVC_JOB_WORKSPACE_DIR}/${RDVC_JOB_REPO_NAME}&quot;<br>git clone --branch &quot;${RDVC_JOB_REPO_BRANCH}&quot; &quot;${RDVC_JOB_REPO_URL}&quot; &quot;${RDVC_JOB_REPO_DIR}&quot;<br>cd &quot;${RDVC_JOB_REPO_DIR}&quot; || exit<br><br># Ensure the job runs on the same revision as was submitted (even if the branch has moved on in the meantime)<br>git checkout &quot;${RDVC_JOB_REPO_REV}&quot;</pre><p>2. Install the Python virtual environment with init_python_venv.sh</p><pre># Install Python environment<br>echo &quot;Install Python environment.&quot;<br>./init_python_venv.sh<br><br>echo &quot;Activate Python environment.&quot;<br>source ./.venv/bin/activate<br><br># Setup links for the DVC cache shared among jobs and projects<br>dvc config --local cache.type hardlink,symlink,copy<br><br># Push results of experiments even if job fails<br>function cleanup_dvc(){<br> if [ &quot;$1&quot; != &quot;0&quot; ]; then<br>     # Push cache of all runs, including failed<br>     echo &quot;Job failed. Pushing run cache.&quot;<br>     dvc push --run-cache<br> else<br>     echo &quot;Job successfully finished.&quot;<br> fi<br><br> deactivate<br> cleanup_job_dir<br>}<br><br>trap &#39;cleanup_dvc $?&#39; EXIT</pre><p>3. Execute dvc exp run -S fabric=gpu</p><pre>export RDVC_JOB_EXP_RUN_OPTIONS_STRING=&quot;-S fabric=gpu&quot;<br>echo &quot;Executing DVC experiment.&quot;<br>eval &quot;dvc exp run --pull --allow-missing ${RDVC_JOB_EXP_RUN_OPTIONS_STRING}&quot;</pre><p>4. Push the experiment to the remote</p><pre># Push experiment to the remote and update the repository<br>echo &quot;Pushing DVC experiment to Git and DVC remotes.&quot;<br>dvc exp push $RDVC_JOB_REPO_URL</pre><p>This script is submitted to the cluster over SSH. You can view it in ~/.rdvc/submissions.</p><p>And that’s it! It’s so simple you could do it manually in an interactive SLURM session — and that happens to be a good way to debug issues. If your job fails, first consult its log over at ~/.rdvc/logs and then try to reproduce the submission script from an interactive session.</p><h3>Conclusion</h3><p>We shared two repositories: a simple DVC project and a tool for remote execution on SLURM clusters. The latter is universal — it knows nothing about the project! — and easily hackable. We highly recommend to fork and customise it to your team’s needs.</p><p><em>Originally published at </em><a href="https://dvc.ai/blog/dvc-slurm-cluster-exscientia"><em>https://dvc.ai</em></a><em> on March 11, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9aa47ca8f58d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dvc-data-version-control/running-dvc-on-a-slurm-cluster-9aa47ca8f58d">Running DVC on a SLURM cluster</a> was originally published in <a href="https://medium.com/dvc-data-version-control">DVC — Data Version Control</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dataset Factory: A Tool Chain for Computer Vision Datasets]]></title>
            <link>https://medium.com/dvc-data-version-control/dataset-factory-a-tool-chain-for-computer-vision-datasets-0aa28418ea85?source=rss----ce2e1b7aa37c---4</link>
            <guid isPermaLink="false">https://medium.com/p/0aa28418ea85</guid>
            <category><![CDATA[unstructured-data]]></category>
            <category><![CDATA[ml-engineering]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Jenifer De Figueiredo]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 22:19:12 GMT</pubDate>
            <atom:updated>2024-06-06T14:09:18.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3T0oHb4-7bFdyR278654rA.png" /></figure><p>The fast proliferation of analytical and Generative AI solutions is driving requirements for data versioning and data curation to the next level, where the dataset management tools must understand data and be able to use metadata for data curation. This goal is not achievable with the traditional MLOps toolchains that remain blind to the content of managed files. We solve this problem by introducing the next generation of Data-Centric AI software — DataChain.</p><p>We have been building DataChain for several years now and are happy to share some of the thinking and motivation that came into this product. For example, this paper written by our Technical Product Manager <a href="https://www.linkedin.com/in/danielkharitonov/">Daniel Kharitonov</a>, and Customer Success Engineer, <a href="https://www.linkedin.com/in/ryandarbyturner/">Ryan Turner</a> was published at <a href="https://iccv2023.thecvf.com/">2023 ICCV</a> and explains the challenges of building generative computer vision datasets at scale and the benefits of using a tool like DataChain.</p><figure><img alt="Dataset Factory: A Tool Chain for Generative Computer Vision Datasets" src="https://cdn-images-1.medium.com/max/936/1*SPGr2UGvEDk-vcrShgtBiA.jpeg" /><figcaption>Dataset Factory Poster Presented at ICCV 2023</figcaption></figure><p>The following table summarizes the problems faced when tackling massive Computer Vision projects and solved with our latest tool:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l--Zb0SxjI5SaJv8yTEDPA.png" /></figure><p>Read the full paper for a more in-depth discussion on the problems and solution as well as an example of the dataset factory approach using the LAION-5B dataset. While this paper focuses on a specific Computer Vision data use case, the same approach works for all Unstructured Data workflows including text, video, audio, GIS, and multi-modal. We would love to talk to you about your use cases and explore how we can help you master your unstructured data workflows.</p><p>Learn more at <a href="https://dvc.ai">DVC.ai</a>!</p><p><a href="https://www.linkedin.com/company/dvc-ai/">Follow DVC.ai on LinkedIn</a> to find more tutorial blog posts, videos, and upcoming online meetups!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0aa28418ea85" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dvc-data-version-control/dataset-factory-a-tool-chain-for-computer-vision-datasets-0aa28418ea85">Dataset Factory: A Tool Chain for Computer Vision Datasets</a> was originally published in <a href="https://medium.com/dvc-data-version-control">DVC — Data Version Control</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>