<?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 Vibhu Jawa on Medium]]></title>
        <description><![CDATA[Stories by Vibhu Jawa on Medium]]></description>
        <link>https://medium.com/@vibhujawa?source=rss-93f37a34c189------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mvvWeixZRAe7u5pkG408wg.jpeg</url>
            <title>Stories by Vibhu Jawa on Medium</title>
            <link>https://medium.com/@vibhujawa?source=rss-93f37a34c189------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 14:04:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vibhujawa/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[RAPIDS Memory Manager Pool: Speed up your memory allocations]]></title>
            <link>https://medium.com/rapids-ai/rapids-memory-manager-pool-speed-up-your-memory-allocations-3bc53929066a?source=rss-93f37a34c189------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bc53929066a</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[rmm]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[rapid]]></category>
            <dc:creator><![CDATA[Vibhu Jawa]]></dc:creator>
            <pubDate>Mon, 12 Dec 2022 17:55:52 GMT</pubDate>
            <atom:updated>2022-12-12T17:57:41.685Z</atom:updated>
            <content:encoded><![CDATA[<p>By: <a href="https://medium.com/u/93f37a34c189?source=post_page-----be9909eeed2--------------------------------">Vibhu Jaw</a>a and <a href="https://medium.com/@rgelhau">Randy Gelhausen</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VkLiJ1IcaecIzNu8opb7Hg.jpeg" /><figcaption>Go Faster with RMM</figcaption></figure><h4>What is the RAPIDS Memory Manager (RMM)?</h4><p>When you’re processing large amounts of data, memory management is crucial. It’s true for CPUs and GPUs alike. In the RAPIDS ecosystem, we created the open source “RAPIDS Memory Manager” (<a href="https://docs.rapids.ai/api/rmm/stable/">RMM</a>) package to manage memory on the GPU throughout an end to end workflow.</p><h4>Using the RMM Pool Allocator</h4><p>In RAPIDS and PyData libraries (cuDF, cuML, cuGraph, CuPy, Numba) we often use RMM to create and share a single pool (per GPU). This is because device memory allocations are relatively slow and RMM performs a single, large allocation of memory “up front,” avoiding the latency of per-computation memory allocations mid-workflow.</p><p>Check out the single GPU example below where we see a <strong>4.6 x speedup</strong> just by switching on the RMM pool.</p><p><em>Without RMM POOL</em></p><pre>import cudf</pre><pre>%%timeit <br>def create_dummy_frame(n_rows, n_val_columns):<br>    df = cudf.DataFrame({&#39;group&#39;: [&#39;A&#39;, &#39;B&#39;,<br>                                   &#39;C&#39;, &#39;D&#39;,<br>                                   &#39;E&#39;, &#39;F&#39;,<br>                                   &#39;G&#39;, &#39;H&#39;]})<br>    # here we create new columns<br>    # for each operations we make 1 or more <br>    # cudaMalloc calls  <br>    for n in range(n_val_columns):<br>        df[f&#39;val_{n}&#39;] = [1, 2, 3, 4,<br>                          5, 6, 7, 8]<br>    df = df.repeat(n_rows//8)                                   <br>    return df<br><br>n_rows = 10_000_000<br>n_val_columns = 100<br>df = create_dummy_frame(n_rows, n_val_columns)<br># Use the `groupby()` <br># method to find the mean value for each group<br>mean_values = df.groupby(&#39;group&#39;).mean()</pre><pre>759 ms ± 126 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)</pre><p><em>With RMM POOL</em></p><pre># Setting up RMM POOL<br>import rmm<br>rmm.reinitialize(pool_allocator = True,<br>                 initial_pool_size = 10e9)<br>import cudf</pre><pre># No code blocks changed below<br>%%timeit<br>def create_dummy_frame(n_rows, n_val_columns):<br>    df = cudf.DataFrame({&#39;group&#39;: [&#39;A&#39;, &#39;B&#39;,<br>                                   &#39;C&#39;, &#39;D&#39;,<br>                                   &#39;E&#39;, &#39;F&#39;,<br>                                   &#39;G&#39;, &#39;H&#39;]})<br>    # here we create new columns<br>    # rmm has pre-allocated memory so <br>    # cudf uses memory readily available<br>    for n in range(n_val_columns):<br>        df[f&#39;val_{n}&#39;] = [1, 2, 3, 4,<br>                          5, 6, 7, 8]   <br>    df = df.repeat(n_rows//8)                                   <br>    return df<br><br>n_rows = 10_000_000<br>n_val_columns = 100<br>df = create_dummy_frame(n_rows, n_val_columns)<br># Use the `groupby()` <br># method to find the mean value for each group<br>mean_values = df.groupby(&#39;group&#39;).mean()<br></pre><pre>168 ms ± 1.54 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)</pre><p>Want to use RMM in a cluster of GPUs? Dask-CUDA makes that easy. Here’s an example.</p><pre>from dask_cuda import LocalCUDACluster<br>from dask.distributed import Client<br># RMM pool size to initialize each worker with <br># Can be an integer (bytes), float (fraction of total device memory),<br># string (like &quot;5GB&quot; or #&quot;5000M&quot;)<br># or None to disable RMM pools.<br>cluster = LocalCUDACluster(rmm_pool_size=&#39;5GB&#39;)<br>client = Client(cluster)</pre><p>In short, RMM helps RAPIDS manage GPU memory as efficiently as possible, but there’s much more than “it’s a pool of memory” to RMM. <a href="https://docs.rapids.ai/api/rmm/stable/">RMM</a> allows you to allocate device memory in a highly configurable way. (Check out <a href="https://github.com/rapidsai/rmm#available-resources">rmm#available-resources</a> for information about all the memory resources that RMM can use). Next week, we’ll walk you through how to manage spilling and using RMM on a cluster of GPUs. In the meantime, reach out to us on Twitter<a href="https://twitter.com/RAPIDSai"> @RAPIDSAI</a>, check the RMM<a href="https://docs.rapids.ai/api/rmm/stable/basics.html"> API docs</a>, our<a href="https://github.com/rapidsai"> GitHub</a> page, or kick the tires on RAPIDS over at <a href="https://www.paperspace.com/">Paperspace</a> or <a href="https://aws.amazon.com/pm/sagemaker/?trk=8987dd52-6f33-407a-b89b-a7ba025c913c&amp;sc_channel=ps&amp;s_kwcid=AL!4422!3!536324338680!e!!g!!sagemaker%20studio&amp;ef_id=EAIaIQobChMIlJrhmPPn-wIVKQ2tBh2lWg7TEAAYASAAEgLhEvD_BwE:G:s&amp;s_kwcid=AL!4422!3!536324338680!e!!g!!sagemaker%20studio">SageMaker Studio</a>.</p><p>We recommend reading this excellent <a href="https://developer.nvidia.com/blog/fast-flexible-allocation-for-cuda-with-rapids-memory-manager/">blog post</a> by Mark Harris for a deep technical dive about the internals RMM allocator.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bc53929066a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/rapids-memory-manager-pool-speed-up-your-memory-allocations-3bc53929066a">RAPIDS Memory Manager Pool: Speed up your memory allocations</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accelerating Topic modeling with RAPIDS and BERT models]]></title>
            <link>https://medium.com/rapids-ai/accelerating-topic-modeling-with-rapids-and-bert-models-be9909eeed2?source=rss-93f37a34c189------2</link>
            <guid isPermaLink="false">https://medium.com/p/be9909eeed2</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[topic-modeling]]></category>
            <category><![CDATA[open-source-software]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Vibhu Jawa]]></dc:creator>
            <pubDate>Tue, 15 Mar 2022 14:01:08 GMT</pubDate>
            <atom:updated>2022-09-12T19:57:46.488Z</atom:updated>
            <content:encoded><![CDATA[<p>By: <a href="https://medium.com/u/93f37a34c189">Vibhu Jawa</a> and <a href="https://medium.com/u/fb42ef5d7312">Mayank Anand</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/0*jRTe8f9xmQN3SCCX" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/0*Z0DSqWW5ZpGDZUIN" /></figure><blockquote>In the time since this blog post was released, the <a href="https://github.com/MaartenGr/BERTopic/">BERTopic</a> library has added initial support for cuML. We recommend using cuML directly with BERTopic, which you can do by following the example below drawn from <a href="https://maartengr.github.io/BERTopic/faq.html#can-i-use-the-gpu-to-speed-up-the-model">the BERTopic documentation</a>.</blockquote><pre>from bertopic import BERTopic<br>from cuml.cluster import HDBSCAN<br>from cuml.manifold import UMAP</pre><pre># Create instances of GPU-accelerated UMAP and HDBSCAN<br>umap_model = UMAP(n_components=5, n_neighbors=15, min_dist=0.0)<br>hdbscan_model = HDBSCAN(min_samples=10, gen_min_span_tree=True)</pre><pre># Pass the above models to be used in BERTopic<br>topic_model = BERTopic(umap_model=umap_model, hdbscan_model=hdbscan_model)<br>topics, probs = topic_model.fit_transform(docs)</pre><blockquote>The following is the full, original blog.</blockquote><pre><strong>TLDR: </strong>This blog covers “Topic modeling” using <a href="https://rapids.ai/">RAPIDS</a>, <a href="https://numba.pydata.org/">Numba</a>, <a href="https://docs.cupy.dev/">CuPy</a>, <a href="https://huggingface.co/">HuggingFace</a>, and <a href="https://pytorch.org/">PyTorch</a> to do text processing, Deep Learning based embedding creation, dimensionality reduction, and clustering all on NVIDIA GPUs in an order of magnitude less time than on CPUs.</pre><p>Most of the text data in the wild is unlabelled and topic modeling is often the first tool that a data scientist deploys to make sense of it all. <a href="https://en.wikipedia.org/wiki/Topic_model">Topic modeling</a> is an unsupervised machine learning technique that automatically analyzes text data to determine clusters of words and phrases based on their commonality.</p><p>From e-commerce companies using topic modeling to do auto product categorization to SaaS (Software as service) companies using it to automate issue ticket mapping to provide effective customer service, to streaming companies using it to recommend better content to even bioinformatic researchers using it to extract hidden knowledge and relations in the exponentially growing bioinformatics data, the use cases of topic modeling run deep and wide. Check out this <a href="https://medium.com/@fatmafatma/industrial-applications-of-topic-model-100e48a15ce4">blog</a> to learn more about the industrial application of topic modeling.</p><p>This blog showcases how the GPU-accelerated Python ETL, Machine Learning, and Deep Learning ecosystems integrate together to accelerate the topic modeling workflows end-to-end. We’ll introduce the BERTopic algorithm for topic modeling, and compare the CPU vs GPU implementations of each of the algorithm stages. Using RAPIDS, Numba, CuPy, and PyTorch together, you’ll see how to accelerate your custom workflows and we’ll show that it is possible to reduce the labeling process from over an hour on CPU to just four minutes on GPU, on the canonical news headline data set.</p><h3><strong>BERTopic:</strong></h3><p>BERTopic is a topic modeling technique that leverages transformers and class-based TF-IDF to create dense clusters allowing for easily interpretable topics while keeping important words in the topic descriptions.</p><p>This diagram summarizes the BERTopic algorithm:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yx09EkpyaYlfaeZu" /></figure><p>See this more detailed <a href="https://towardsdatascience.com/topic-modeling-with-bert-779f7db187e6">article</a> and the associated <a href="https://github.com/MaartenGr/BERTopic">library</a> to learn more.</p><h3><strong>Speedup Snapshot:</strong></h3><p>Check out the snapshot below to see how each bit of the workflow is accelerated on GPUs.</p><p><strong>Dataset: </strong>We use the <a href="https://www.kaggle.com/therohk/million-headlines/data">news headlines dataset</a>, containing 1,226,258 headlines published over an eighteen-year period.</p><p><strong>Hardware: </strong>We use a single 32 GB V100 GPU and an Intel Xeon 2698 with 40 Physical (80 virtual) Cores for all given execution times.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fairtable.com%2Fembed%2FshrYZa5KCkdb4s1We&amp;display_name=Airtable&amp;url=https%3A%2F%2Fairtable.com%2FshrYZa5KCkdb4s1We&amp;image=https%3A%2F%2Fstatic.airtable.com%2Fimages%2Foembed%2Fairtable.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=airtable" width="800" height="533" frameborder="0" scrolling="no"><a href="https://medium.com/media/3fa06b30568a548142cc05353d1d61c4/href">https://medium.com/media/3fa06b30568a548142cc05353d1d61c4/href</a></iframe><h3>Workflow Steps</h3><p>Now we’ll go into details of each of the <em>s</em>teps of this workflow and show how GPUs can be easily plugged into them yielding big speedups along the way.</p><h4>Step 1: Embedding Creation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/0*9KmfFLinOhYWRi0M" /></figure><p>The first step of the algorithm is to create document embeddings using a DL-based transformer model. Embedding creation has two stages:</p><ol><li>Tokenization</li><li>Transformer model-based Deep Learning</li></ol><p><strong>Tokenization:</strong></p><p>We first need to tokenize our strings to make them ingestible to the Transformer based Deep Learning model. Tokenization is accelerated using the <a href="https://docs.rapids.ai/api/cudf/nightly/api_docs/api/cudf.core.subword_tokenizer.SubwordTokenizer.__call__.html#cudf.core.subword_tokenizer.SubwordTokenizer.__call__">SubwordTokenizer</a> from RAPIDS cuDF.</p><p>The advantages of using <a href="https://docs.rapids.ai/api/cudf/nightly/api.html?highlight=subword_tokenize#cudf.core.column.string.StringMethods.subword_tokenize">cudf subword tokenizer</a>include:</p><ul><li>The tokenizer itself is about <a href="https://gist.github.com/VibhuJawa/8fca51b80bd433178a5e5ea9e2eb926d">324x faster</a> than HuggingFace’s Fast CPU-based RUST tokenizer <a href="https://huggingface.co/transformers/model_doc/bert.html?highlight=berttokenizerfast#transformers.BertTokenizerFast">BertTokenizerFast.batch_encode_plus</a>.</li><li>Tokens are extracted and kept in GPU memory and then used in subsequent tensors, all without leaving GPU memory, avoiding expensive copies and transfers.</li></ul><p>This end-to-end translates to taking <strong>0.033s</strong> on the GPU compared to <strong>18.7s </strong>with a multi-core CPU implementation. For the technical details, check out the embedding extraction code <a href="https://github.com/rapidsai/rapids-examples/blob/main/cuBERT_topic_modelling/embedding_extraction.py">here</a>.</p><p><strong>Transformer Based Deep Learning model:</strong></p><p>We use all-MiniiLM-L6-v2 from the HuggingFace library as an English language model trained specifically for semantic similarity tasks, which works well for most use-cases. This is the default in BERTopic but can be switched to any model appropriate for your use case.</p><p>We get a <strong>7.87x speedup </strong>using GPU for model inference vs. multi-threaded CPU implementation, speeding up embedding creation from 496s to 63s</p><h4><strong>Step 2. Dimensionality Reduction with UMAP</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PKUYoOrJb97BXS-z" /></figure><p>Clustering algorithms suffer the <a href="https://en.wikipedia.org/wiki/Curse_of_dimensionality">Curse of Dimensionality</a> in high dimensional space, so we first need to reduce the dimensionality of the embeddings that we generated.</p><p>The BERTopic algorithm relies on the <a href="https://umap-learn.readthedocs.io/en/latest/how_umap_works.html">UMAP</a> (Uniform Manifold Approximation and Projection) algorithm to reduce dimensionality. We use cuML’s <a href="https://docs.rapids.ai/api/cuml/stable/api.html#umap">UMAP</a> to accelerate this on GPU.</p><p>Compared to the multi-threaded CPU implementation, RAPIDS is <strong>27.7x</strong> faster on GPU, reducing the computation time from <strong>2718s</strong> to <strong>98s</strong>.</p><p>To learn more about UMAP with cuML, check out this <a href="https://arxiv.org/pdf/2008.00325.pdf">paper</a> by the RAPIDS team!</p><h3><strong>Step 3. Clustering (HDBSCAN) (4.1 times faster with RAPIDS) :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/0*EpxceOY56wWmpggs" /></figure><p><a href="https://hdbscan.readthedocs.io/en/latest/how_hdbscan_works.html">HDBSCAN</a> (Hierarchical Density-Based Spatial Clustering of Applications with Noise) is a clustering algorithm based on DBSCAN. It first performs DBSCAN over varying epsilon values and integrates the result to find a clustering that gives the best stability over epsilon. This allows HDBSCAN to find clusters of varying densities (unlike DBSCAN) and be more robust to parameter selection.</p><p>We use cuML’s <a href="https://docs.rapids.ai/api/cuml/nightly/api.html#hdbscan">HDBSCAN</a> to accelerate it on the GPU. We are currently <strong>4.1x faster</strong> when clustering on the 5-dimensional dataset obtained from UMAP, reducing computation time from <strong>382s</strong> to <strong>92s</strong>. On larger dimensionality, GPUs can be up to <strong>29x</strong> faster and we are currently working on bringing similar speedups to lower dimensions too.</p><p>To learn more about HDBSCANwith cuML, check out this <a href="https://developer.nvidia.com/blog/gpu-accelerated-hierarchical-dbscan-with-rapids-cuml-lets-get-back-to-the-future/">blog</a>.</p><h4><strong>Step 4. Topic Creation with Class-Based TF-IDF</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/0*ZjQd_Zp0cPaBTf1Z" /></figure><p>So far, we successfully reduced the dimensions and cluster documents, which is great, but how do we know what people are talking about in those documents? Or a better question would be, how do we extract content-based topics based on the cluster of documents given to us?</p><p>For doing just this, BERTopic highlights a very useful approach, a variant of TF-IDF known as c-TF-IDF or class-based TF-IDF. As described <a href="https://maartengr.github.io/BERTopic/algorithm/algorithm.html#3-create-topic-representation">here</a>, applying TF-IDF on a set of documents, we get the relative importance of words between documents, but if we group all documents with the same cluster-ID, we get the scores for words within a cluster. The words with the highest scores will represent the theme of that cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nCTeTQ5a4kR6o1QZ" /></figure><p>We accelerate class-based TF-IDF on GPUs by writing a thin <a href="https://github.com/rapidsai/rapids-examples/blob/main/cuBERT_topic_modelling/ctfidf.py">wrapper</a> on cuML’s <a href="https://docs.rapids.ai/api/cuml/nightly/api.html?highlight=tf%20idf#cuml.feature_extraction.text.TfidfVectorizer">TF-IDF</a> vectorizer. This gives us a <strong>7.9x</strong> speedup over scikit-learn’s CPU implementation, reducing the time from <strong>15.2s</strong> to <strong>1.92s</strong>.</p><p>Check out this <a href="https://medium.com/rapids-ai/accelerating-tf-idf-for-natural-language-processing-with-dask-and-rapids-6f6e416429df">blog</a> to learn more about TF-IDF at scale with cuML.</p><h4><strong>Step 5. Topic Representation with Numba and CuPy</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/0*8KrHfymzot-5v67C" /></figure><p>We could be combing through billions of documents and can potentially obtain millions of words in a cluster, but from the user perspective, only the top few words are essential to get an idea of what’s being talked about in a particular cluster. Keeping that in mind, we choose the words with the highest c-TF-IDF scores for each topic.</p><p>The implementation essentially boils down to getting the top n values from each matrix row we obtain from the Topic creation step. We do this by leveraging <a href="https://cupy.dev/">CuPy</a> and <a href="https://numba.pydata.org/">Numba</a> together (Check out the code at the <a href="https://github.com/rapidsai/rapids-examples/blob/main/cuBERT_topic_modelling/utils/sparse_matrix_utils.py">link</a>). This reduces the computation time from <strong>8.2s</strong> to <strong>0.602s</strong>, giving a<strong> </strong><strong>12.5x </strong>speedup.</p><p>To learn more about Numba and how it can accelerate UDFs on GPUs, check out docs <a href="http://numba.pydata.org/numba-doc/latest/cuda/%20t">here</a> and learn how CuPy accelerates standard array functions <a href="https://docs.cupy.dev/en/stable/">here</a>.</p><h3><strong>Putting It All together:</strong></h3><p>When we put it all together, we get <strong>12.5 </strong>times speedup when using GPUs end to end vs. just using the GPU for Deep Learning.</p><blockquote>When comparing end-to-end CPU (Intel Xeon 2698 with 40 Physical Cores, 80 virtual cores) , end-to-end GPU (32GB Nvidia V100 GPU) is <strong>14.2</strong> times faster. This translates to the workflow taking only 4.2 minutes on GPU vs over an hour on the CPU.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dcP3Aa_8HcxRxi8G" /></figure><p>The documentation and library code is at this <a href="https://github.com/rapidsai/rapids-examples/tree/main/cuBERT_topic_modelling">link</a>. Give it a go.</p><p>The internal and external API of our implementation closely follows BERTopic API so it should just be a line change for default workflow and extending it to your use case should be straightforward too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MB0r2L_lFJZEfqEM" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/01120f161aa7f75fe942576a5b5027c0/href">https://medium.com/media/01120f161aa7f75fe942576a5b5027c0/href</a></iframe><h3><strong>Wrap Up</strong></h3><p>We’ve demonstrated that NVIDIA GPUs can provide massive acceleration for various parts of a topic modeling-based workflow, which is a mix of ETL, traditional machine learning, and deep-learning by at least an order of magnitude. So whether your workflow is pure ETL, machine learning or deep learning, or a mix of these, you will probably see performance gains by using GPUs.</p><p>Furthermore, this workflow is an excellent example of how so many open source libraries like HuggingFace Transformers, PyTorch, CuPy, and Numba integrate seamlessly with the NVIDIA RAPIDS ecosystem enabling acceleration of diverse workflows on GPUs.</p><p>If RAPIDS has caught your eye, please check out the <a href="https://github.com/rapidsai">GitHub page</a> or visit the <a href="https://rapids.ai/">website</a>. Is there something you want to try out with RAPIDS but are unsure how to begin? Just ask us! Contributions in the form of questions, issues, feature requests, pull requests are always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be9909eeed2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/accelerating-topic-modeling-with-rapids-and-bert-models-be9909eeed2">Accelerating Topic modeling with RAPIDS and BERT models</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accelerating TF-IDF for Natural Language Processing with Dask and RAPIDS]]></title>
            <link>https://medium.com/rapids-ai/accelerating-tf-idf-for-natural-language-processing-with-dask-and-rapids-6f6e416429df?source=rss-93f37a34c189------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f6e416429df</guid>
            <category><![CDATA[tf-idf]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Vibhu Jawa]]></dc:creator>
            <pubDate>Thu, 16 Sep 2021 20:26:05 GMT</pubDate>
            <atom:updated>2021-09-16T23:54:38.934Z</atom:updated>
            <content:encoded><![CDATA[<p>By: <a href="https://medium.com/u/2b86c77f7096">Anirban Das</a> and <a href="https://medium.com/u/93f37a34c189">Vibhu Jawa</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SbYJ91S927H-xbmd" /></figure><p><a href="https://en.wikipedia.org/wiki/Tf%E2%80%93idf">Term frequency-inverse document frequency <strong>(TF-IDF)</strong></a> is a scoring measure widely used in information retrieval (IR) or summarization used to reflect how relevant a term is in a given document. TF-IDF is a widely used Natural Language Processing (NLP) technique in <a href="https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.121.1424&amp;rep=rep1&amp;type=pdf">document retrieval</a>, <a href="https://journal.binus.ac.id/index.php/comtech/article/view/3746">summarization</a>,<a href="https://www.researchgate.net/profile/Shahzad-Qaiser/publication/326425709_Text_Mining_Use_of_TF-IDF_to_Examine_the_Relevance_of_Words_to_Documents/links/5b4cd57fa6fdcc8dae245aa3/Text-Mining-Use-of-TF-IDF-to-Examine-the-Relevance-of-Words-to-Documents.pdf"> text classification</a>, and <a href="https://ieeexplore.ieee.org/abstract/document/7754750">document clustering</a>. (For more details check out this <a href="https://www.kdnuggets.com/2018/08/wtf-tf-idf.html">blog</a> post).</p><p>In this blog post, we will show how to use NVIDIA GPUs to accelerate TF-IDF end-to-end pipelines using <a href="http://rapids.ai/">RAPIDS</a> and <a href="http://dask.org/">Dask</a>. We also compare the RAPIDS and Dask GPU-based approach with a multi-CPU<a href="https://spark.apache.org/docs/latest/mllib-feature-extraction.html"> Apache Spark approach</a> and a single CPU <a href="https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.TfidfVectorizer.html">scikit learn approach</a>.</p><p>Apache Spark is commonly used to do <a href="https://spark.apache.org/docs/latest/mllib-feature-extraction.html">TF-IDF</a> at scale; for reference check out Oracle’s A-team <a href="https://www.ateam-oracle.com/tf-idf-implementation-comparison-with-python">blog</a>, where they benchmarked a multi CPU Apache Spark-based pipeline with scikit-learn. This blog post extends that comparison to include a GPU-based solution.</p><h3><strong>Workflow Details</strong></h3><p>The workflow across all the three pipelines looks like the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9_xLp9x8RyZ_XUFnhBMmQ.png" /></figure><h3><strong>Code</strong></h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b30e216f145df196112c9445f5c73023/href">https://medium.com/media/b30e216f145df196112c9445f5c73023/href</a></iframe><h3><strong>Dataset</strong></h3><p>For benchmarking, we used the PC products subset of the <a href="https://s3.amazonaws.com/amazon-reviews-pds/readme.html">Amazon Customer Reviews Dataset</a>. The compressed parquet files on disk are ~11GB containing about 21 million reviews.</p><h3><strong>Results</strong></h3><p>It took RAPIDS+Dask only 25 seconds to read, clean up, and vectorize the entire dataset, while Spark took 482 seconds, and scikit-learn took 2,115 seconds.</p><p>Thus the end-to-end latency with RAPIDS cuML+Dask on 6 NVIDIA V100 GPUs sees a <strong>19.25x </strong>improvement over Apache Spark on 40 physical cores (80 virtual cores of an Intel Xeon 2698) and an <strong>84x</strong> improvement over scikit-learn.</p><p>Check out the below table for details on how much each component was accelerated:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PCyrIZemfX_mxSIJ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ENVG23gb3071v8KE" /></figure><p>The benchmarking code, setup, and details can be found at the <a href="https://github.com/rapidsai/rapids-examples/tree/main/tfidf-benchmark/">link</a>.</p><h3><strong>Wrap Up</strong></h3><p>This workflow is just one example of leveraging GPUs for accelerating end-to-end natural language processing. Accelerated TF-IDF can be used to make NLP pipelines like document indexing, summarization, and text clustering much faster. Do let us know how you are going to use RAPIDS to accelerate your workflows!</p><p>Our team at RAPIDS has been hard at work constantly adding features and improving performance. See our documentation <a href="https://docs.rapids.ai/api/cudf/nightly/api_docs/">docs page</a>, and if you see something missing, we <a href="https://github.com/rapidsai/cudf/issues/new?assignees=&amp;labels=%3F+-+Needs+Triage%2C+feature+request&amp;template=feature_request.md&amp;title=%5BFEA%5D">welcome feature requests </a>on GitHub!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f6e416429df" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/accelerating-tf-idf-for-natural-language-processing-with-dask-and-rapids-6f6e416429df">Accelerating TF-IDF for Natural Language Processing with Dask and RAPIDS</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[State of the art NLP at scale with RAPIDS, HuggingFace and Dask]]></title>
            <link>https://medium.com/rapids-ai/state-of-the-art-nlp-at-scale-with-rapids-huggingface-and-dask-a885c19ce87b?source=rss-93f37a34c189------2</link>
            <guid isPermaLink="false">https://medium.com/p/a885c19ce87b</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[text-processing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Vibhu Jawa]]></dc:creator>
            <pubDate>Wed, 09 Sep 2020 17:41:28 GMT</pubDate>
            <atom:updated>2022-09-23T19:06:50.748Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Run State of the Art NLP Workloads at Scale with RAPIDS, HuggingFace, and Dask</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E99P4x4anW9ziECVSqO1xQ.png" /></figure><pre><strong>TLDR: Learn how to use RAPIDS, HuggingFace, and Dask for high-performance NLP. See how to build end-to-end NLP pipelines in a fast and scalable way on GPUs. This covers feature engineering, deep learning inference, and post-inference processing.</strong></pre><h3><strong>Introduction</strong></h3><p>Modern natural language processing (NLP) mixes modeling, feature engineering, and general text processing. Deep learning NLP models can provide fantastic performance for tasks like named-entity recognition (NER), sentiment classification, and text summarization. However, end-to-end workflow pipelines with these models often struggle with performance at scale, especially when the pipelines involve extensive pre- and post-inference processing.</p><p>In our <a href="https://medium.com/rapids-ai/gpu-text-processing-now-even-simpler-and-faster-bde7e42c8c8a">previous blog post</a>, we covered how <a href="https://rapids.ai/">RAPIDS</a> accelerates string processing and feature engineering. This post explains how to leverage <a href="https://rapids.ai/">RAPIDS</a> for feature engineering and string processing, <a href="https://huggingface.co/">HuggingFace</a> for deep learning inference, and <a href="https://dask.org/">Dask</a> for scaling out for end-to-end acceleration on GPUs.</p><h3>An NLP pipeline often involves the following steps:</h3><ul><li><strong>Pre-processing</strong></li><li><strong>Tokenization</strong></li><li><strong>Inference</strong></li><li><strong>Post Inference Processing</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/0*eCtirKVYGeEZjmg4" /><figcaption>NLP workflow using Rapids and HuggingFace</figcaption></figure><h4><strong>Pre-Processing:</strong></h4><p>Pre-Processing for NLP pipelines involves general data ingestion, filtration, and general reformatting. With the RAPIDS ecosystem, each piece of the workflow is accelerated on GPUs. Check out our<a href="https://medium.com/rapids-ai/gpu-text-processing-now-even-simpler-and-faster-bde7e42c8c8a"> recent blog</a> where we showcased these capabilities in more detail.</p><p>Once we have pre-processed our data, we need to tokenize it so that the appropriate machine learning model can ingest it.</p><h4><strong>Subword Tokenization:</strong></h4><p>Tokenization is the process of breaking down the text into standard units that a machine can understand. It is a fundamental step across NLP methods from traditional like <a href="https://docs.rapids.ai/api/cuml/nightly/api.html?highlight=count#cuml.feature_extraction.text.CountVectorizer">CountVectorizer</a> to advanced deep learning methods like <a href="https://arxiv.org/pdf/1706.03762.pdf">Transformers</a>.</p><p>One approach to tokenization is breaking a sentence into words. For example, the sentence, “I love apples” can be broken down into, “I,” “love,” “apples”. But this delimiter based tokenization runs into problems like:</p><ol><li>Needing a large vocabulary as you will need to store all words in the dictionary.</li><li>Uncertainty of combined words like “check-in,” i.e., what exactly constitutes a word, is often ambiguous.</li><li>Some languages don’t segment by spaces.</li></ol><p>To solve these problems, we use a subword tokenization. <a href="https://www.thoughtvector.io/blog/subword-tokenization/">Subword tokenization</a> is a recent strategy from machine translation that breaks into subword units, strings of characters like “ing”, “any”, “place”. For example, the word “anyplace” can be broken down into “any” and “place” so you don’t need an entry for each word in your vocabulary.</p><p>When <a href="https://arxiv.org/pdf/1810.04805.pdf">BERT</a>(Bidirectional Encoder Representations from Transformers) was released in 2018, it included a new subword algorithm called <a href="https://paperswithcode.com/method/wordpiece">WordPiece</a>. This tokenization is used to create input for NLP DL models like BERT, Electra, DistilBert, and more.</p><h4><strong>GPU Subword Tokenization</strong></h4><p>We first introduced the GPU BERT subword tokenizer in a previous <a href="https://medium.com/rapids-ai/preprocess-your-training-data-at-lightspeed-with-our-gpu-based-tokenizer-for-bert-language-models-561cf9c46e15">blog</a> as part of CLX for cybersecurity applications. Since then, we migrated the implementation into RAPIDS <a href="https://docs.rapids.ai/api/cudf/nightly/">cuDF</a> and exposed it into a subword tokenizer. This tokenizer takes a series of strings and returns tokenized cupyarrays/pytorch/tensorflow tensors :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1eaa239bbdfd29c8c2d7437b71087c6b/href">https://medium.com/media/1eaa239bbdfd29c8c2d7437b71087c6b/href</a></iframe><h3>Advantages of cuDF’s GPU subword Tokenizer:</h3><p>The advantages include:</p><ol><li>The tokenizer itself is up to<a href="https://gist.github.com/VibhuJawa/27e288a6c11b696c09c5b000cac1df67"> <strong>483x faster</strong></a> than HuggingFace’s Fast RUST tokenizer <a href="https://huggingface.co/transformers/model_doc/bert.html?highlight=berttokenizerfast#transformers.BertTokenizerFast">BertTokeizerFast.batch_encode_plus</a>.</li><li>Tokens are extracted and kept in GPU memory and then used in subsequent tensors, all<strong> without leaving GPUs and avoiding expensive CPU copies</strong>.</li></ol><p>Once our inputs are tokenized using the subword tokenizer, they can be fed into NLP DL models like BERT for inference.</p><h3><strong>HuggingFace Overview:</strong></h3><p><a href="https://huggingface.co/transformers/">HuggingFace</a> provides access to several pre-trained transformer model architectures ( BERT, GPT-2, RoBERTa, XLM, DistilBert, XLNet…) for Natural Language Understanding (NLU) and Natural Language Generation (NLG) with over 32+ pre-trained models in 100+ languages.</p><p>In our workflow, we used <a href="https://huggingface.co/dslim/bert-base-NER">BERT</a> and <a href="https://huggingface.co/distilbert-base-cased">DISTIILBERT</a> from HuggingFace to do <a href="https://en.wikipedia.org/wiki/Named-entity_recognition">named entity recognition.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w9WCIHyMuQ9h5Pee" /><figcaption>Example of NER in action from <a href="https://huggingface.co/dslim/bert-base-NER">https://huggingface.co/dslim/bert-base-NER</a></figcaption></figure><h3><strong>Combining RAPIDS, HuggingFace, and Dask:</strong></h3><p>This section covers how we put RAPIDS, HuggingFace, and Dask together to achieve lightning-fast performance at a 10TB scale factor with 136 V100 GPUs while using a<strong> near state of the art NER model. </strong>We expect to see even better results with A100 as A100&#39;s BERT inference speed is up to <a href="https://developer.nvidia.com/deep-learning-performance-training-inference">6x</a> faster than V100&#39;s.</p><p>In this workflow, we are given 26 Million synthetic reviews, and the task is to find the competitor company names in the product reviews for a given product. We then return the review id, product id, competitor company name, and the related sentence from the online review. To get a competitor’s name, we need to do NER on the reviews and find all the tokens in the review labeled as an organization.</p><p>Our previous <a href="https://github.com/rapidsai/gpu-bdb/blob/main/gpu_bdb/queries/q27/gpu_bdb_query_27.py">implementation</a> relied on spaCy for NER but, spaCy currently needs your inputs on CPU and thus was slow as it required a copy to CPU memory and back to GPU memory. With the new cudf.core.subword_tokenizer, we can go<strong> from </strong><strong>cudf.string.series to subword tensors without leaving the GPU </strong>unlocking many new SOTA language models<strong>.</strong></p><p>In this task, we experimented with two of HuggingFace’s models for NER fine-tuned on <a href="https://www.clips.uantwerpen.be/conll2003/ner/">CoNLL 2003(English)</a> :</p><ol><li><a href="https://huggingface.co/dslim23/bert-base-cased-NER-conll-2003">Bert-base-model</a>: This model gets an f1 of 91.95and achieves a speedup of <strong>1.7 x over spaCy</strong>.</li><li><a href="https://huggingface.co/distilbert-base-cased">Distil-bert-cased model</a>: This model gets an f1of 89.6 (<a href="https://arxiv.org/pdf/1910.01108.pdf">97% of the accuracy of BERT</a> ) and achieves a speedup of <strong>2.5x over spaCy</strong></li></ol><p>Research by <a href="https://arxiv.org/pdf/1909.06058.pdf">Zhu, Mengdi et al. (2019)</a> showcased that BERT-based model architectures achieve near state art performance, significantly improving the performance on existing public-NER toolkits like spaCy, NLTK, and StanfordNER.</p><blockquote>For example, the bert-base<strong> </strong>model on average across datasets achieves a 13.63% better F1 than spaCy, so <strong>not only did we get faster but also reached near state of the art performance</strong>.</blockquote><p>Check out the workflow code <a href="https://github.com/rapidsai/gpu-bdb/blob/main/gpu_bdb/queries/q27/gpu_bdb_query_hf_27.py">here</a>.</p><h3><strong>Conclusion</strong>:</h3><p>This workflow is just one example of leveraging GPUs to do end to end accelerating natural language processing. With <a href="https://docs.rapids.ai/api/cudf/nightly/api_docs/api/cudf.core.subword_tokenizer.SubwordTokenizer.__call__.html#cudf.core.subword_tokenizer.SubwordTokenizer.__call__">cudf.core.subword_tokenizer</a> now, most of the <a href="https://github.com/huggingface/transformers/tree/master/examples#the-big-table-of-tasks">NLP</a> tasks such as question answering, text-classification, summarization, translation, token classification are all within reach for an end to end acceleration leveraging RAPIDS and HuggingFace.</p><p>Stay tuned for more examples and in, the meantime, see our documentation <a href="https://docs.rapids.ai/api/cudf/nightly/api.html#strings">docs page</a>, and if you see something missing, we <a href="https://github.com/rapidsai/cudf/issues/new?assignees=&amp;labels=%3F+-+Needs+Triage%2C+feature+request&amp;template=feature_request.md&amp;title=%5BFEA%5D">welcome feature requests </a>on GitHub!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a885c19ce87b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/state-of-the-art-nlp-at-scale-with-rapids-huggingface-and-dask-a885c19ce87b">State of the art NLP at scale with RAPIDS, HuggingFace and Dask</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NLP and Text Processing with RAPIDS: Now Simpler and Faster]]></title>
            <link>https://medium.com/rapids-ai/gpu-text-processing-now-even-simpler-and-faster-bde7e42c8c8a?source=rss-93f37a34c189------2</link>
            <guid isPermaLink="false">https://medium.com/p/bde7e42c8c8a</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[dataframes]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Vibhu Jawa]]></dc:creator>
            <pubDate>Tue, 11 Aug 2020 19:45:00 GMT</pubDate>
            <atom:updated>2021-01-26T21:19:36.721Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*Y56mDOqdLjxbQavr" /></figure><p>By: <a href="https://medium.com/u/93f37a34c189">Vibhu Jawa</a> and <a href="https://medium.com/u/4fd80bb59f1e">Randy Gelhausen</a></p><pre><strong>TL;DR:</strong> Google famously noted that “<em>speed isn’t just a feature, it’s the feature</em>,” This is not only true for search engines but all of RAPIDS. In this blog, we will showcase performance improvements for string processing across <a href="https://docs.rapids.ai/api/cudf/nightly/">cuDF</a> and <a href="https://docs.rapids.ai/api/cuml/stable/api.html">cuML</a>, which enables acceleration across diverse text processing workflows.</pre><h3>Introduction:</h3><p>In our <a href="https://medium.com/rapids-ai/show-me-the-word-count-3146e1173801">previous post</a>, we showed basic text pre-processing with RAPIDS. Since then, we have come a long way in speed improvements, memory reductions, and API simplification.</p><h4>Here’s what we’ll cover in this blog:</h4><ol><li>Built-in, Simplified String and Categorical Support</li><li>GPU TextVectorizers: Leaner and Meaner</li><li>Accelerating Diverse String Workflows</li></ol><h3>Built-in Support for Strings and Categoricals</h3><p>Goodbye, cuStrings, nvStrings, and nvCategory! We hardly knew ye. Our <a href="https://medium.com/rapids-ai/real-data-has-strings-now-so-do-gpus-994497d55f8e">first couple of posts</a> about string manipulation on GPUs involved separate, specialized libraries for working with string data on the device and required significant expertise to integrate with other RAPIDS libraries like <a href="https://github.com/rapidsai/cudf">cuDF</a> and <a href="https://github.com/rapidsai/cuml">cuML</a>. Since then, we open-sourced, re-architected, and migrated those string and text-related features into more user-friendly DataFrame APIs as part of cuDF. Along the way, we also adopted the “<a href="http://arrow.apache.org/">Apache Arrow</a>” format for cuDF’s string representation, resulting in substantial memory savings and speedups.</p><p><strong>Top-Level Simplified Categorical Support</strong></p><p>With nvCategory retired and categorical dtype support inbuilt into cuDF, Categorization is now straightforward. Check out the comparison between the previous vs. updated code below.</p><h4>Old Categorization using `nvcategory`</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e946884e9a07d808649877161ad0f8f2/href">https://medium.com/media/e946884e9a07d808649877161ad0f8f2/href</a></iframe><h4>Updated Categorization using inbuilt categorical `dtype`</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ef5edd86e5961b782f6881678806c90/href">https://medium.com/media/8ef5edd86e5961b782f6881678806c90/href</a></iframe><h4>Example Workflow:</h4><p>As a concrete, non-toy example of these improvements, consider our recently updated Gutenberg corpus analysis notebook. Previously we had to (slowly) jump through a few hoops, but no longer!</p><p>With our improved Pandas string API coverage, we not only have simpler code, but we also get double the performance. <strong>We took 2.31s previously, now we only take 1.05s, pushing our overall speedup against Pandas to 151x</strong>.</p><p>Check out the comparison between the previous vs. updated notebooks below.</p><h4>Previous:</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98c5b9646b88c685fcb29f985d1807e9/href">https://medium.com/media/98c5b9646b88c685fcb29f985d1807e9/href</a></iframe><p><strong>Updated:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9e1bbd8c47f6619fa54c52801b39a20/href">https://medium.com/media/f9e1bbd8c47f6619fa54c52801b39a20/href</a></iframe><h3>GPU TextVectorizers: Leaner and Meaner</h3><p>We recently launched the <a href="https://docs.rapids.ai/api/cuml/nightly/api.html#feature-extraction-single-gpu">feature.text</a> subpackage in cuML by adding <a href="https://medium.com/rapids-ai/natural-language-processing-text-preprocessing-and-vectorizing-at-rocking-speed-with-rapids-cuml-74b8d751812e">Count and </a><a href="https://medium.com/rapids-ai/natural-language-processing-text-preprocessing-and-vectorizing-at-rocking-speed-with-rapids-cuml-74b8d751812e">TF-IDF vectorizer</a>s, kickstarting a series of natural language processing (NLP) transformers on GPUs.</p><p>Since then, we have added <a href="https://docs.rapids.ai/api/cuml/nightly/api.html#cuml.feature_extraction.text.HashingVectorizer">hashing vectorizer</a> (<a href="https://gist.github.com/VibhuJawa/f894c8e717bfca56ef9d05ee11572b60"><strong>20x faster than scikit-learn</strong></a>) and improved our existing Count/TF-IDF vectorizer performance by <strong>3.3x and memory by 2x</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/306e37e425408a9323771908225000f6/href">https://medium.com/media/306e37e425408a9323771908225000f6/href</a></iframe><p>In our recent NLP <a href="https://medium.com/rapids-ai/natural-language-processing-text-preprocessing-and-vectorizing-at-rocking-speed-with-rapids-cuml-74b8d751812e">blog</a>, we analyzed 5 million COVID related tweets by first vectorizing them using TF-IDF and then clustering and searching in the vector space. With our recent improvements (GitHub <a href="https://github.com/rapidsai/cuml/pull/2554">2554</a>, <a href="https://github.com/rapidsai/cuml/pull/2575">2575</a>, <a href="https://github.com/rapidsai/cudf/pull/5666">5666</a>), we have improved that TF-IDF vectorization of that workflow on both memory and run time fronts.</p><ul><li>Peak memory usage decreased from <strong>19 GB to 8 GB.</strong></li><li>Run time improved from <strong>26s to 8 s</strong>, pushing our overall speed up to <strong>21x over scikit-learn</strong></li></ul><p>All the above improvements mean that your TF-IDF work can scale much further.</p><h3>Ongoing Work to Further Scale-Out TF-IDF Across Multiple Machines:</h3><p>We are currently working on adding support for <a href="https://github.com/rapidsai/cuml/issues/2598">distributed multi-GPU TF-IDF Transformer</a> which, when used with, will give you a distributed vectorized matrix. This will enable end to end acceleration of distributed text processing pipelines as that matrix can be fed into <a href="https://docs.rapids.ai/api/cuml/nightly/api.html#multi-node-multi-gpu-algorithms">distributed machine learning models</a> like <a href="https://docs.rapids.ai/api/cuml/nightly/api.html#cuml.dask.naive_bayes.MultinomialNB">cuml.dask.naive_bayes</a>.</p><h3>Accelerating Diverse String Workflows</h3><p>We are adding more string functionality like <a href="https://docs.rapids.ai/api/cudf/nightly/api.html#cudf.core.column.string.StringMethods.character_tokenize">character_tokenize</a>, <a href="https://docs.rapids.ai/api/cudf/nightly/api.html#cudf.core.column.string.StringMethods.character_ngrams">character_ngrams</a>, <a href="http://10.136.7.101:8000/build/html/api.html#cudf.core.column.string.StringMethods.ngrams_tokenize">ngram_tokenize</a>, <a href="https://docs.rapids.ai/api/cudf/nightly/api.html?highlight=filter_tokens#cudf.core.column.string.StringMethods.filter_tokens">filter_tokens</a>, <a href="https://docs.rapids.ai/api/cudf/nightly/api.html?highlight=filter_tokens#cudf.core.column.string.StringMethods.filter_alphanum">filter_aphanum</a> as well as adding higher-level text-processing API’s like <a href="https://docs.rapids.ai/api/cudf/nightly/api.html#cudf.core.column.string.StringMethods.subword_tokenize">GPU-accelerated BERT tokenizer</a>, <a href="https://docs.rapids.ai/api/cuml/nightly/api.html#feature-extraction-single-gpu">text vectorizers</a>, helping enable more complex string and text manipulation logic like you find in real-world NLP applications.</p><p>Stay tuned for a followup post where we put all these features through their paces in a specialized NLP benchmark. In the meantime,<strong> </strong>try RAPIDS in your NLP work on <a href="https://colab.research.google.com/notebooks/welcome.ipynb">Google Colab</a> or <a href="https://app.blazingsql.com/jupyter/user-redirect/lab/workspaces/auto-b/tree/Welcome_to_BlazingSQL_Notebooks/welcome.ipynb">blazingsql notebooks</a>, see our documentation <a href="https://docs.rapids.ai/api/cudf/nightly/api.html#strings">docs page</a>, and if you see something missing, we <a href="https://github.com/rapidsai/cudf/issues/new?assignees=&amp;labels=%3F+-+Needs+Triage%2C+feature+request&amp;template=feature_request.md&amp;title=%5BFEA%5D">welcome feature requests </a>on GitHub!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bde7e42c8c8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/gpu-text-processing-now-even-simpler-and-faster-bde7e42c8c8a">NLP and Text Processing with RAPIDS: Now Simpler and Faster</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Show Me The Word Count]]></title>
            <link>https://medium.com/rapids-ai/show-me-the-word-count-3146e1173801?source=rss-93f37a34c189------2</link>
            <guid isPermaLink="false">https://medium.com/p/3146e1173801</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[open-source-software]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Vibhu Jawa]]></dc:creator>
            <pubDate>Tue, 30 Jul 2019 17:29:32 GMT</pubDate>
            <atom:updated>2019-07-30T17:29:32.911Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/905/0*apy2seZeaFPNomI-" /></figure><p><em>By: </em><a href="https://medium.com/u/93f37a34c189"><em>Vibhu Jawa</em></a><em>, </em><a href="https://medium.com/u/f37bb17fdf37"><em>Nick Becker</em></a><em>, David Wendt, and </em><a href="https://medium.com/u/4fd80bb59f1e"><em>Randy Gelhausen</em></a></p><p>Since the dawn of Big Data, analytics platforms have competed for the fastest and most succinct word-count code. SlideShare presentations for both batch and streaming engines often proudly pasted their implementations on the first few slides. They showcased the simplicity and demonstrated the capabilities of the tools.</p><p>String support in <a href="https://rapids.ai/index.html">RAPIDS</a> is pretty new: it first arrived <a href="https://medium.com/rapids-ai/real-data-has-strings-now-so-do-gpus-994497d55f8e">a little more than 6 months ago</a>. Since then, we <a href="https://github.com/rapidsai/custrings">open-source</a>d the implementation and began the <a href="https://github.com/rapidsai/cudf/pull/1032">first</a> <a href="https://github.com/rapidsai/cudf/pull/872">phases</a> of cuDF integration. With the <a href="https://rapidsai.github.io/projects/nvstrings/en/0.9.0/api.html#module-nvtext">nvtext module</a>, we’re now tackling larger, more complex text processing building blocks that enable GPU accelerated NLP work. While we’ve been able to do basic word counts for a while, useful analysis of real text data involves preprocessing that we wanted to get right before we published examples.</p><p>Text processing is a foundational technology of modern data science. In this post, we demonstrate faster end-to-end text analytics with GPU acceleration. We use the <a href="https://web.eecs.umich.edu/~lahiri/gutenberg_dataset.html">Project Gutenberg data</a> set to demonstrate high performance tokenization, word counting, and vectorization, and we show how to extend this to interesting clustering analyses.</p><p>By the end of this post, you’ll be able to clean a 19-million-line text dataset in 2.3 seconds on a single <a href="https://www.nvidia.com/content/dam/en-zz/Solutions/design-visualization/productspage/quadro/quadro-desktop/quadro-volta-gv100-data-sheet-us-nvidia-704619-r3-web.pdf">NVIDIA GV-100</a> and use it to find similar authors based on their writing.</p><h3>Accelerated Text Processing with GPUs</h3><p>In most workflows involving textual data, you need to clean and filter the text before running much analysis. That typically involves operations like:</p><ol><li>Removing punctuation</li><li>Lower or upper casing</li><li>Removing stop words</li><li>And various other tasks, depending on dataset &amp; application.</li></ol><p>In our example, the data is a collection of 3,036 English books by <a href="https://web.eecs.umich.edu/~lahiri/gutenberg_author_list">142 authors</a>, a cleaner subset of the <a href="http://www.gutenberg.org/">Project Gutenberg</a> corpus. Each book is a text file on disk. Reading 3,000 relatively small files is a non-ideal data-loading case. Making matters worse, the file content doesn’t contain book title or author metadata. Thus, we read the content into a list, prepending the filename, then pass it to the GPU into a <a href="https://github.com/rapidsai/cudf">cuDF DataFrame</a>. While Dask DataFrame’s read_csv supports including such metadata as a column, <a href="https://github.com/rapidsai/cudf/issues/2269">cuDF can’t support that yet</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a3340a38bcb3e4f21d36af04b9f3a9d/href">https://medium.com/media/7a3340a38bcb3e4f21d36af04b9f3a9d/href</a></iframe><p>With our data in memory, we’re ready to start our preprocessing. Depending on the size of the dataset, these tasks can take a long time, even on powerful boxes with many core CPUs. And say you wanted to speed up this process and port your work to a GPU. Before RAPIDS, you would have had to write a whole lot of CUDA C++ to handle those tasks on a GPU. With <a href="https://github.com/rapidsai/custrings">cuStrings</a> and its integration into cuDF, RAPIDS provides a straightforward and high-level Python API familiar to data engineers, data scientists, and NLP practitioners. We’ll demonstrate it by example.</p><h3>Removing Punctuation and Lower Casing</h3><p>Consider the strings “Hey,” “hey!”, and “hey”. They’re all basically the word “hey”. Regardless of casing and attached punctuation marks, you’d usually want to count them as the same word.</p><p>We’ll first remove punctuation marks. <a href="https://rapidsai.github.io/projects/nvstrings/en/0.9.0/api.html#module-nvtext">nvtext</a> provides a <a href="https://rapidsai.github.io/projects/nvstrings/en/0.9.0/api.html#nvstrings.nvstrings.replace_multi">multi string replace</a> function to make this operation fast and straightforward. We can even chain it together with the <a href="https://rapidsai.github.io/projects/nvstrings/en/0.9.0/api.html#nvstrings.nvstrings.lower">lower</a> function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5b66ebe5b8487f0318d835b0bc11c33/href">https://medium.com/media/f5b66ebe5b8487f0318d835b0bc11c33/href</a></iframe><h3><strong>Removing Stop Words</strong></h3><p>In this workflow, we are looking for the distinctive words used by various authors. If we keep commonly occurring words (stop-words) our count vectors will skew towards them and we would lose more distinguishing features in the noise. We’ll use nltk’s standard library of stop-words and remove them with <a href="https://rapidsai.github.io/projects/nvstrings/en/0.9.0/api.html#nvtext.replace_tokens">nvtext.replace_tokens</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/946091c4b5c03633f1a6abd52673aa86/href">https://medium.com/media/946091c4b5c03633f1a6abd52673aa86/href</a></iframe><h3><strong>Other Tasks: Removing Variable Length Whitespace</strong></h3><p>Sometimes, after removing words, we can end up with consecutive whitespace characters that we want to standardize to avoid impacting our analysis. Removing spaces is still slightly more involved than it would ideally be. We’ll soon make it better with <a href="https://github.com/rapidsai/custrings/pull/386/files">nvtext.normalize_spaces</a>, but for now, we can use a regular expression.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a8f4e9fa6c70c011aaedd59dc782b03/href">https://medium.com/media/1a8f4e9fa6c70c011aaedd59dc782b03/href</a></iframe><h3><strong>Putting It All Together</strong></h3><p>Whew, we’re done with the data cleaning steps. There was lots of code above, but how fast does all that logic run when you combine it all? Let’s compare a <a href="https://www.nvidia.com/content/dam/en-zz/Solutions/design-visualization/productspage/quadro/quadro-desktop/quadro-volta-gv100-data-sheet-us-nvidia-704619-r3-web.pdf">GV100</a> with 2-<a href="https://ark.intel.com/content/www/us/en/ark/products/120492/intel-xeon-gold-6130-processor-22m-cache-2-10-ghz.html">16-core CPUs</a> (64 virtual cores).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/64471dee1992fe2f25cb859d97bf02a2/href">https://medium.com/media/64471dee1992fe2f25cb859d97bf02a2/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b72feaca1f80be5e25dbd7d7385445a/href">https://medium.com/media/1b72feaca1f80be5e25dbd7d7385445a/href</a></iframe><blockquote>Concluding the pre-processing steps, for the whole 19 million line dataset, we’ve cleaned it in 2.31 seconds on a single NVIDIA GV-100. This is 6x faster than the <a href="https://ark.intel.com/content/www/us/en/ark/products/120492/intel-xeon-gold-6130-processor-22m-cache-2-10-ghz.html">dual 16-core CPU (64 virtual core)</a> implementation. Want to try it yourself? <a href="https://colab.research.google.com/drive/1OuL2N8_EDgbaxpUg2Ij7Ws8oU1XRqju3">Click here to experiment.</a></blockquote><h3>Seriously, Show me the Word Count!</h3><p>Before counting the words, we need to split the lines into individual tokens. Given some of the lines are long (i.e. have many tokens) in many datasets, it’s possible to run into an out of memory situation. To handle this efficiently, we created the <a href="https://rapidsai.github.io/projects/nvstrings/en/0.9.0/api.html#nvtext.tokenize">tokenize</a> method in <a href="https://rapidsai.github.io/projects/nvstrings/en/0.9.0/api.html#module-nvtext">nvtext</a>. It generates a single column of all tokens used in the input strings, reducing memory usage significantly. It’s easy to use, and works like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d5f9e120e04976c87b61109a2307249/href">https://medium.com/media/8d5f9e120e04976c87b61109a2307249/href</a></iframe><p>Once we’ve tokenized the text, we just need to count the words. We can use cuDF’s <a href="https://rapidsai.github.io/projects/cudf/en/0.9.0/api.html#groupby">groupby</a> functionality to do this. We’ll wrap both the tokenizing and groupby word counting into a function for convenience.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/85964a4b1f0cf30e904cdc6cbfe32eac/href">https://medium.com/media/85964a4b1f0cf30e904cdc6cbfe32eac/href</a></iframe><p>Now, let’s calculate and compare the word counts for Albert Einstein and Charles Dickens, to see if we find any interesting patterns.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dba8a62dd0baa4dd412b3b5bfbc3ac2e/href">https://medium.com/media/dba8a62dd0baa4dd412b3b5bfbc3ac2e/href</a></iframe><p>Einstein talks about relativity, theory, and body. Dickens is relatively more interested in telling readers a good story: once, upon, time, and one.</p><p>Surprising to no one.</p><h3><strong>Finding Similar Authors with UMAP and KNN</strong></h3><p>Ok, GPUs can pre-process text and count words fast. So what?</p><p>As a motivating example, in high school, I loved reading Raymond Chandler’s crime noir detective stories. A few years ago, I happened upon his Wikipedia entry and learned of his contemporary and friend Dashiell Hammett. I quickly read every Hammett story I could get my hands on.</p><p>Wouldn’t it be nice if I didn’t need to rely on an author’s life story to find other authors I’d enjoy? Good news! In this section, we’ll use our word vectors, dimensionality reduction, and <a href="https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm">K-Nearest-Neighbors</a> to do just that.</p><p>This approach is generally called <a href="https://en.wikipedia.org/wiki/Bag-of-words_model">bag-of-words</a>, and it actually works pretty well. The intuition is straightforward: documents that share many words in common are more likely to be similar than documents that have very few words in common.</p><p>To enable the bag of words, we first need to transform our count vectors into a standardized, aligned format. Once that’s done, we’ll be ready for downstream analytics.</p><h3><strong>Creating Encoded Word Vectors</strong></h3><p>We need to convert the word-count series into directly into count vectors. Eventually, nvtext will support this directly, but for now, we show how to implement it manually using <a href="https://rapidsai.github.io/projects/nvstrings/en/0.9.0/api.html#nvcategory">nvcategory</a> and a GPU accelerated Numba kernel. We believe this will be useful to NLP practitioners experimenting with custom pre-processing logic who don’t want to spend time Cythonizing or otherwise writing performance-oriented native Python extensions.</p><p>We do this in three steps. First, we calculate word counts for all of the authors.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc35d171168981ebc0239d72afd05ce7/href">https://medium.com/media/fc35d171168981ebc0239d72afd05ce7/href</a></iframe><p>Next, we encode the counts Series using the top 20,000 most frequent words in the dataset which we calculated earlier. We use <a href="https://rapidsai.github.io/projects/nvstrings/en/0.9.0/api.html#nvcategory">nvcategory</a> to do this encoding.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87837734e2aedd22a11fed59c7db31a0/href">https://medium.com/media/87837734e2aedd22a11fed59c7db31a0/href</a></iframe><p>Finally, we align the word count vectors to a standard form and order. Each column corresponds to a word_id from the top 20k words, and each row corresponds to the count vector for that author</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/379330aea09df0abf970060215db08e8/href">https://medium.com/media/379330aea09df0abf970060215db08e8/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c0b2e770b4249039994c60a81b76b4a/href">https://medium.com/media/3c0b2e770b4249039994c60a81b76b4a/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ee29d3facae597e90012c304ee86da4/href">https://medium.com/media/8ee29d3facae597e90012c304ee86da4/href</a></iframe><h3>Clustering Authors using K-Nearest Neighbors:</h3><p>One of the simplest approaches to clustering is K-Nearest Neighbors, and it works well with the count vectors we just created. Let&#39;s fit a k-nearest neighbors model on the count encoding array and find some similar author:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab4703c142ec96676e5744c2475dfb23/href">https://medium.com/media/ab4703c142ec96676e5744c2475dfb23/href</a></iframe><p>Let’s find the nearest neighbors to Albert Einstein</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8cb2c9c560a26ba9a433e8ccd11b8371/href">https://medium.com/media/8cb2c9c560a26ba9a433e8ccd11b8371/href</a></iframe><p>Let’s find the nearest neighbors to ‘Charles Dickens’.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ecebb4165dc9d0d6e46676ae5ec5a088/href">https://medium.com/media/ecebb4165dc9d0d6e46676ae5ec5a088/href</a></iframe><p>The nearest neighbor to ‘Albert Einstein’ is ‘Thomas Carlyle’ who was a mathematician but looks like the nearest to ‘Charles Dickens’ is ‘Winston Churchill’ which doesn’t seem right, let’s try to fix that.</p><h3><strong>Reducing Dimensionality with UMAP</strong></h3><p>We are in a high dimensional space with 20,000 dimensions, so a euclidian distance based nearest neighbor is not the best way forward as in high dimensional spaces. Let’s try to fix this by reducing dimensionality using <a href="https://arxiv.org/abs/1802.03426">Uniform Manifold Approximation and Projection (UMAP)</a> which will use map our count vectors down to 3 dimensions using <a href="https://rapidsai.github.io/projects/cuml/en/0.9.0/api.html#cuml.UMAP">cuml.umap</a>.</p><p>Let&#39;s fit a KNN model on the dimension-reduced dataset</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/597543abaf2dd4bf64c49bcf6b91fd6d/href">https://medium.com/media/597543abaf2dd4bf64c49bcf6b91fd6d/href</a></iframe><p>Let’s now look at the neighbors on this manifold.</p><p>Albert Einstein Neighbors:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb2cb7523e68cf42c2e62f4376beef05/href">https://medium.com/media/eb2cb7523e68cf42c2e62f4376beef05/href</a></iframe><p>Charles Dickens Neighbors:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ee5b0702192427f13cedc38b3b9a56e/href">https://medium.com/media/0ee5b0702192427f13cedc38b3b9a56e/href</a></iframe><p>So, in this latent space, ‘Charles Dickens’ and ‘Agatha Christie’ are neighbors, both of whom loved writing stories.</p><h3><strong>Conclusion</strong></h3><p>Our first blog post on strings was titled, “Real Data Has Strings, Now So Do GPUs”. That was true then and now. What’s changed is today we have deeper string support integrated into cuDF, meaning that you can mix and match string munging operations with traditional tabular grouped aggregations. We also now have the <a href="https://rapidsai.github.io/projects/nvstrings/en/0.9.0/api.html#module-nvtext">nvtext</a> module which enables more optimized NLP style string preprocessing on GPUs, and we support passing cleaned data directly into cuML’s GPU accelerated algorithms.</p><p>The takeaway is that you can get large end-to-end speedups on a single GPU vs powerful multi-core CPU machines.</p><blockquote>On this dataset, we saw speedups of 24x vs a 12 virtual core cpu and 6x over a 64 virtual core CPU in text pre-processing.</blockquote><p>Speedups like these give data scientists and engineers the time to spend more time iterating in feature engineering, and more time finding the best parameters and hyperparameters for their machine learning models. NLP is a wide-world. Come check out <a href="https://github.com/rapidsai/custrings">cuStrings on GitHub</a> and let us know which parts of it you’d like to see run faster!</p><p>Want to get started with RAPIDS? Check out <a href="https://github.com/rapidsai/cudf/">cuDF</a> on Github and let us know what you think! You can download pre-built Docker containers for our 0.8 release from <a href="https://ngc.nvidia.com/">NGC</a> or <a href="https://hub.docker.com/r/rapidsai/rapidsai/">Dockerhub</a> to get started or install it yourself via <a href="https://anaconda.org/rapidsai/">Conda</a>. Need something even easier? You can quickly get started with <a href="https://colab.research.google.com/drive/1XTKHiIcvyL5nuldx0HSL_dUa8yopzy_Y#forceEdit=true&amp;offline=true&amp;sandboxMode=true">RAPIDS in Google Colab</a> and try out all the new things we’ve added with just a single push of a button.</p><p>Don’t want to wait for the next release to use upcoming features? You can download our nightly containers <a href="https://hub.docker.com/r/rapidsai/rapidsai-nightly">from Dockerhub</a> or install via <a href="https://anaconda.org/rapidsai-nightly">Conda</a> to stay at the tip of our development branch.</p><p><a href="https://gist.github.com/VibhuJawa/9d7e177db4768a2bf9373a4e33bbad11">Notebook Link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3146e1173801" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rapids-ai/show-me-the-word-count-3146e1173801">Show Me The Word Count</a> was originally published in <a href="https://medium.com/rapids-ai">RAPIDS AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>