<?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 Alexander Lang on Medium]]></title>
        <description><![CDATA[Stories by Alexander Lang on Medium]]></description>
        <link>https://medium.com/@alex.lang?source=rss-33723b9ae68d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kP1k0YwOhhlQg-e07shr_A.jpeg</url>
            <title>Stories by Alexander Lang on Medium</title>
            <link>https://medium.com/@alex.lang?source=rss-33723b9ae68d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 10:04:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alex.lang/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[Fair is fast, and fast is fair: IBM Slate Foundation models for NLP]]></title>
            <link>https://medium.com/@alex.lang/fair-is-fast-and-fast-is-fair-ibm-slate-foundation-models-for-nlp-3508412a4b04?source=rss-33723b9ae68d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3508412a4b04</guid>
            <category><![CDATA[cloud-pak-for-data]]></category>
            <category><![CDATA[watsonx]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[watson-studio]]></category>
            <dc:creator><![CDATA[Alexander Lang]]></dc:creator>
            <pubDate>Mon, 31 Jul 2023 08:36:57 GMT</pubDate>
            <atom:updated>2023-07-31T08:36:57.954Z</atom:updated>
            <content:encoded><![CDATA[<p>More throughput and less bias in Natural Language Processing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UMT5R04MMmjlJjCb" /><figcaption>Photo by <a href="https://unsplash.com/@loubtr?utm_source=medium&amp;utm_medium=referral">Lou Batier</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Once again, IBM watsonx.ai teamed up with Watson NLP for a major upgrade of the Watson Data Science NLP capabilities. Read “teamed up” as: we grabbed the latest and greatest models from our NLP colleagues and sprinkled them generously across <em>all</em> our data science offerings:</p><ul><li><a href="https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=scripts-watson-natural-language-processing">IBM Cloud Pak for Data (CPD) 4.7</a></li><li><a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp.html?context=wx&amp;audience=wdp">watsonx.ai</a></li><li><a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp.html?context=cpdaas&amp;audience=wdp">IBM Cloud Pak for Data as a Service</a></li></ul><p>Our goal was to tackle the three witches of NLP: <em>bias</em>,<em> high compute expense</em> and <em>limited adaptability</em>. Let’s find out how we fared…</p><p><em>“But wait, what’s Slate?”</em>, you ask? <a href="https://www.ibm.com/blog/introducing-the-technology-behind-watsonx-ai/"><em>Slate</em></a> is a family of encoder-only large language models models built by IBM. You can’t use them for generative AI (i.e., they won’t write this blog entry for me) <em>but</em> they are fast and effective for enterprise NLP tasks like sentiment analysis, entity extraction and classification.</p><h3>Fine-tune Slate models on your data — but try our already fine-tuned models FIRST</h3><p>Our “base” Slate model is called <em>pretrained-model_slate.153m.distilled_many_transformer_multilingual_uncased</em> . <br>That’s quite a mouthful, so let’s tease the name apart: It’s a <em>Slate</em> model, i.e., an encoder-only model similar to <a href="https://arxiv.org/abs/1907.11692">RoBERTa</a> , with <em>153 million</em> parameters. We <em>distilled </em>knowledge from a larger Slate model into this one to keep it reasonably small, which improves inference times. Finally, it was trained on a <em>multilingual, uncased </em>corpus of data.</p><p>You can fine-tune this Slate model on your own data to create custom models for</p><ul><li><a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-classify-text.html?context=wx&amp;audience=wdp#train-slate">classification</a></li><li><a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-entities-transformer.html?context=wx&amp;audience=wdp">entity extraction</a></li><li><a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-extract-sentiment.html?context=wx&amp;audience=wdp">sentence and document sentiment detection</a></li><li><a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-target-sentiment.html?context=wx&amp;audience=wdp">targeted sentiment detection</a></li></ul><p>Here’s an example how to create a fine-tuned classification model:</p><pre>import watson_nlp<br>from watson_nlp.blocks.classification.transformer import Transformer<br>from watson_core.data_model.streams.resolver import DataStreamResolver<br>training_data_file = &quot;train_data.json&quot;<br><br># Step 1: create datastream from training data<br>data_stream_resolver = DataStreamResolver(target_stream_type=list, expected_keys={&#39;text&#39;: str, &#39;labels&#39;: list})<br>train_stream = data_stream_resolver.as_data_stream(training_data_file)<br><br># Step 2: load pre-trained Slate model<br>pretrained_model_resource = watson_nlp.load(&#39;pretrained-model_slate.153m.distilled_many_transformer_multilingual_uncased &#39;)<br><br># Step 3: Fine-train your model, based on the Slate model<br>classification_model = Transformer.train(train_stream, pretrained_model_resource)</pre><p>Each fine-tuning follows the same three steps:</p><ul><li>Step 1: Prepare a JSON file with the training data. The format will differ, depending on your fine-tuning use case. For classification, each entry contains the <em>text</em> to classify, and its classification <em>labels </em>(plural, as we support multi-class classification).</li><li>Step 2: Load the “base” Slate model.</li><li>Step 3: Start training.</li></ul><p>For all fine-tuning use cases:</p><ul><li>Expect to bring <em>1000 examples or more</em>. This is significantly less data than what prior approaches required, especially for models that work across multiple languages. Still, it’s worth checking whether a simpler approach works just as well: Training <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-classify-text.html?context=wx&amp;audience=wdp#train-ensemble">an SVM ensemble</a> can yield good classification results, and will be faster to train and apply to new data. <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-entities-dict.html?context=wx&amp;audience=wdp">Dictionaries</a> and <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-entities-regex.html?context=wx&amp;audience=wdp">regular expressions </a>don’t require any training data for entity detection, and are a good alternative to detect “simpler”, more regular, entities.</li><li>Use a <em>GPU</em> environment for training. In watsonx.ai and Cloud Pak for Data as a Service, that’s the <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/notebook-environments.html?context=wx&amp;audience=wdp#default-gpu">GPU notebook</a> environments. They have the Watson NLP library pre-installed, just like the NLP Runtime 23.1 and NLP Runtime 22.2 environments. In Cloud Pak for Data, it’s the <a href="https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=environments-gpu">GPU environment</a> that you can install as an add-on.</li></ul><h4>Fine-tuned NLP models available out-of-the-box</h4><p>Before you embark on your fine-tuning exercise, check out the Slate models that we have <em>already fine-tuned </em>for several use-cases:</p><ul><li><a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-block-entity-enhanced.html?context=wx&amp;audience=wdp#machine-learning-general">entity extraction</a>: <em>entity-mentions_transformer-workflow_multilingual_slate.153m.distilled</em></li><li><a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-block-relation-extraction.html?context=wx&amp;audience=wdp">relationship detection</a>: <em>relations_transformer-workflow_multilingual_slate.153m.distilled</em></li><li><a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-block-sentiment.html?context=wx&amp;audience=wdp">sentence and document sentiment detection</a>: <em>sentiment-aggregated_transformer-workflow_multilingual_slate.153m.distilled</em></li><li><a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-block-sentiment.html?context=wx&amp;audience=wdp">targeted sentiment detection</a>: <em>targets-sentiment_transformer-workflow_multilingual_slate.153m.distilled</em></li></ul><p>To make using them even easier, these models are available as <strong><em>workflows</em></strong><em>. </em>They include all necessary preprocessing as part of the model. You just invoke the <em>run </em>method with your input text, like so:</p><pre>import watson_nlp<br># Load Target Sentiment model for English<br>targets_sentiment_model = watson_nlp.load(&#39;targets-sentiment_transformer-workflow_multilingual_slate.153m.distilled&#39;)<br><br># Run the target sentiment model on the input text<br>targets_sentiments = targets_sentiment_model.run(&#39;The rooms are nice, but the bed was not very comfortable.&#39;)<br><br># Print the targets with the associated sentiment<br>print(targets_sentiments)</pre><p>In our previous NLP environment (NLP Runtime 22.2), you had to know that targeted sentiment required the output of syntax analysis, and add an additional intermediate step:</p><pre>import watson_nlp<br><br># Load Syntax and the Target Sentiment model for English<br>syntax_model = watson_nlp.load(&#39;syntax_izumo_en_stock&#39;)<br>targets_sentiment_model = watson_nlp.load(&#39;targets-sentiment_sequence-bert_multi_stock&#39;)<br><br># Run the syntax model on the input text<br>syntax_result = syntax_model.run(&#39;The rooms are nice, but the bed was not very comfortable.&#39;)<br><br># Run the targets sentiment model on the syntax results<br>targets_sentiments = targets_sentiment_model.run(syntax_result)<br><br># Print the targets with the associated sentiment<br>print(targets_sentiments)</pre><p>If you’re using NLP in Runtime 22.2 today, consider upgrading to Runtime 23.1 — you can remove the intermediate step from your code, and you’ll get an improved targeted sentiment model!</p><p>And if you’re missing the call to<em> watson_nlp.download() </em>in above code snippet — that step is no longer necessary in watsonx.ai and Cloud Pak for Data as a Service! We “pre-load” the NLP models now on our cloud environment for faster load times. You can still keep the <em>download() </em>method in your Runtime 22.2 notebooks, but remove that call when switching to Runtime 23.1 — it’s no longer supported there.</p><h3>Reduced bias through careful training data selection and filtering</h3><p>All large language models are trained on incredible amounts of data. Before trusting these models to work on your enterprise data, wouldn’t it be nice if:</p><ul><li>Your model provider carefully vetted and balanced all data sources that went into the model, and ensured that the sources’ intellectual property is respected according to its license?</li><li>Your model provider removed hate, abuse and profanity (aka “HAP”) from the data before it went into training the model?</li></ul><p>If you say “yes” to both, read on. Otherwise, I have a picture for you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CEQKKhuO_Pc1GzwFAcEZ_g.png" /><figcaption>Bias in sentiment analysis</figcaption></figure><p>Above notebook snippet runs sentiment analysis on the same three sentences, on two models. <em>One</em> of them is our “Slate” sentiment model. I hope you can spot the difference — it’s our training data selection and HAP filtering at work!</p><h3>Foundational models that do not <em>require</em> GPUs</h3><p>Slate models are fairly powerful <em>and</em> small enough to run effectively in runtime environments as small as 1 CPU and 8G RAM — whether using them for batch inference through Jupyter Notebooks in watsonx.ai and Watson Studio or for online inference through Python functions in Watson Machine Learning on CPD.</p><p>To further improve their runtime characteristics, we offer our fine-tuned Slate foundation models in two variants:</p><ul><li><em>GPU-optimized</em>: These models run in both GPU and CPU environments, with a <em>significantly</em> higher throughput in GPU environments (up to an order of magnitude).</li><li><em>CPU-optimized</em>: These models run only on CPUs. They need more memory to run, compared to the GPU-optimized variant. However, their throughput is higher, compared to running the GPU-optimized variant on a CPU. These models have a <em>-cpu</em> suffix, e.g. <em>targets-sentiment_transformer-workflow_multilingual_slate.153m.distilled</em><strong><em>-cpu</em></strong></li></ul><p>So, if you have a GPU available, use our GPU-optimized models. In all other cases, use the CPU-optimized models (when available). Here’s an easy switch you can include in your notebooks to load the right model, based on the environment:</p><pre>gpu_available = False<br>try:<br>    hw_spec = os.environ[&#39;RUNTIME_HARDWARE_SPEC&#39;]<br>    if &#39;num_gpu&#39; in json.loads(hw_spec):<br>        gpu_available = True<br>except:<br>    pass<br><br>entity_model_name = &#39;entity-mentions_transformer-workflow_multilingual_slate.153m.distilled&#39;<br>if gpu_available:<br>    entity_model = watson_nlp.load(entity_model_name)<br>else:<br>    entity_model = watson_nlp.load(entity_model_name + &#39;-cpu&#39;)</pre><p>This optimization is not limited to <em>our</em> fine-tuned models: if you fine-tune a Slate model, you can save the resulting model as either GPU-optimized or CPU-optimized — or you save the model twice, once per variant. Just specify the <em>cpu_format </em>parameter when saving the model:</p><pre>from ibm_watson_studio_lib import access_project_or_space<br>wslib = access_project_or_space({...})<br><br>wslib.save_data(&#39;&lt;model name&gt;&#39;, <br>                data=my_finetuned_model.as_bytes(cpu_format=True), <br>                overwrite=True)</pre><h3>Let Watson NLP de-witch your text analytics challenges</h3><p>So, did we achieve our goals? Let’s see…</p><ul><li><em>Bias: </em>While there’s always more to be done, the new release of our NLP capabilities improves trust and transparency in our models. And further good news: we’ll bring the same level of trust to additional models, step by step.</li><li><em>High compute expense: </em>We tackled this from two angles — providing out-of-the-box fine-tuned models for specific use cases, so you don’t have to spend resources on fine-tuning yourself <em>and m</em>aking CPU-optimized models available that reduce the need for GPUs.</li><li><em>Limited adaptability:</em> In NLP Runtime 22.2, we only supported custom classification models. We now expanded this to custom entity, sentiment and targeted sentiment models, all based on the same Slate model.</li></ul><p>I think I leave the verdict to <em>you —</em> try out our new NLP capabilities in <a href="https://www.ibm.com/products/watsonx-ai">watsonx.ai</a> and let us know what we did well, and what we can improve!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3508412a4b04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Watson NLP models in IBM Cloud Pak for Data]]></title>
            <link>https://medium.com/@alex.lang/deploy-watson-nlp-models-in-ibm-cloud-pak-for-data-f16b4d8b0cc7?source=rss-33723b9ae68d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f16b4d8b0cc7</guid>
            <category><![CDATA[watson-machine-learning]]></category>
            <category><![CDATA[cloud-pak-for-data]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[watson-studio]]></category>
            <dc:creator><![CDATA[Alexander Lang]]></dc:creator>
            <pubDate>Mon, 10 Apr 2023 08:54:13 GMT</pubDate>
            <atom:updated>2023-04-10T08:54:13.457Z</atom:updated>
            <content:encoded><![CDATA[<p>High-Quality Text Analysis in <em>your</em> OpenShift environment</p><p>We put our Watson NLP capabilities into IBM Cloud Pak for Data 4.6— at no extra charge. Here are the noteable changes and enhancements compared to Watson NLP in Watson Studio Notebooks in IBM Cloud that you’ve been using since January ’22 (right?). If you’re looking for a “Watson NLP Primer” before diving into this post: check <a href="https://medium.com/@alex.lang/watson-natural-language-processing-comes-to-ibm-watson-studio-notebooks-a81802dee9c8">here</a> and <a href="https://medium.com/ibm-data-ai/watson-natural-language-processing-now-generally-available-in-ibm-watson-studio-notebooks-8bc9d464f33d">there</a>.</p><h3>NLP in Watson Studio Notebooks: completely behind your firewall</h3><p>The Watson NLP Python library is part of <em>all</em> Notebook runtimes in IBM Cloud Pak for Data (CPD) by default<em>, </em>whether you start your Notebook with <em>Runtime 22.1</em> or <em>Runtime 22.2. </em>It’s also included in our JupyterLab runtimes — so you can use NLP in a Git-Based Project and in Python scripts, not just Notebooks. We keep the NLP capabilities between IBM Cloud Pak for Data and IBM Cloud Pak for Data as a Service in sync — so notebooks developed in the cloud will also run in CPD, and vice versa.</p><p>One side note: the NLP versions within Runtime 22.1 and Runtime 22.2 are different. Runtime 22.2 contains some NLP API updates, and newer built-in models. So, if you start your text analysis journey now, I recommend you start with Runtime 22.2 right away. Our <a href="https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=notebooks-watson-natural-language-processing">documentation</a> clearly states the changes between 22.1 and 22.2 (good news: there aren’t many).</p><p>One enhancement when running NLP in Cloud Pak for Data: you do <em>not</em> need to “download” NLP models before using them. For example, to load the English syntax model in <em>CPD</em>, use</p><pre># Load Syntax for English<br>syntax_model = watson_nlp.load(&#39;syntax_izumo_en_stock&#39;)</pre><p>In <em>CPD as a service</em>, you need to download the model into your runtime first:</p><pre># Load Syntax for English<br>syntax_model = watson_nlp.load(watson_nlp.download(&#39;syntax_izumo_en_stock&#39;))</pre><p>In CPD, the built-in NLP models (the so-called “<a href="https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=processing-library-block-catalog">blocks</a>”) are installed in a directory within the file system of your CPD cluster. This way, NLP works in so-called <em>air-gapped</em> CPD environments that don’t have internet access: everything you need for text analytics is right in your CPD installation, no further downloads required at runtime.</p><p>Speaking of installation: as the built-in NLP models are fairly large, they’re only installed when you <em>explicitly</em> request them —check our install docs on <a href="https://www.ibm.com/docs/en/SSQNUZ_4.6.x/wsj/install/postinstall-ws.html">Runtime 22.2</a> and <a href="https://www.ibm.com/docs/en/SSQNUZ_4.6.x/svc-jupyternotebooks39/jupyternotebooks39-install.html">Runtime 22.1</a>, respectively.</p><h3>Deploy NLP models in Watson Machine Learning</h3><p>The new feature I like most about Watson NLP in CPD: you can now take NLP models and deploy them in Watson Machine Learning. This includes both built-in and <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-create-model.html?context=cpdaas&amp;audience=wdp">custom NLP models</a>.</p><p>With this enhancement, you can now take your NLP models and wrap them into a web service to integrate them into your application (through a so-called <a href="https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=assets-creating-online-deployments"><em>online deployment</em></a>), or apply the models regularly to batches of incoming data (aka <a href="https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=assets-creating-batch-deployments"><em>batch deployment</em></a>).</p><p>More often than not, you have to apply multiple models to the incoming text data. For example, you run a language detection model first, then the appropriate syntax model, followed by a sentiment model. This is why CPD allows you to deploy <em>Python functions</em> and <em>Python scripts </em>that contain your custom logic alongside the actual model invocation. Here’s an <a href="https://github.com/IBMDataScience/sample-notebooks/blob/master/CloudPakForData/notebooks/4.6/IPYNB/Runtime22-2/Deploy_Pretrained_Sentiment_Model.ipynb">example</a>:</p><pre>def detect_sentiment():<br>    import watson_nlp<br>    <br>    syntax_model = watson_nlp.load(&#39;syntax_izumo_en_stock&#39;)<br>    sentiment_model = targets_sentiment_model = watson_nlp.load(&#39;targets-sentiment_sequence-bert_multi_stock&#39;)<br>    <br>    def score(input):<br>        scoring_prediction_out = []<br>        for input_data_row in input[&quot;input_data&quot;][0][&quot;values&quot;]: <br>            scoring_prediction_row = []<br>            for input_data in input_data_row:            <br>                syntax_result = syntax_model.run(input_data, <br>                                                     parsers=(&#39;token&#39;, &#39;lemma&#39;, &#39;part_of_speech&#39;))<br>                targets_sentiments = targets_sentiment_model.run(syntax_result)<br>                scoring_prediction_row.append(targets_sentiments.to_dict())<br>                <br>            scoring_prediction_out.append(scoring_prediction_row)<br>            <br>        # Score using the pre-defined model<br>        scoring_response = {<br>            &#39;predictions&#39;: [{&#39;fields&#39;: [&#39;nlp_prediction&#39;], <br>                             &#39;values&#39;: scoring_prediction_out<br>                            }]<br>        }<br><br>        return scoring_response<br>    <br>    return score</pre><p>The aptly named<em> detect_sentiment()</em> is a Python function for sentiment detection that you can deploy in Watson Machine Learning. It follows the same structure as all Python functions you’ll create for NLP:</p><p>First, you load the relevant NLP models. This can be both built-in models, as shown in the example above, and custom models that you created. Built-in models are directly available via the <em>load() </em>method. Custom models need to be <em>promoted </em>into a deployment space first, from the project you created them in. This is explained in detail in our <a href="https://github.com/IBMDataScience/sample-notebooks/tree/master/CloudPakForData/notebooks/4.6/Projects">sample NLP project</a> — check out the notebook <em>Deploy Custom Classification Model </em>once you imported the project into CPD.</p><p>Note: load these models <em>outside </em>the <em>score() </em>method. This way, WML will load these models only once, when the function is deployed, to ensure that the actual inference within <em>score()</em> is as fast as possible.</p><p>Then, you create the <em>score() </em>method to do the inference. This is very similar to applying NLP models within notebooks: you apply them in the required order on the input data. In our example, it’s first syntax analysis, then targeted sentiment extraction.</p><p>Lastly, you turn the NLP results into a Python <em>dict, </em>collect the results for each row of the incoming data, and return these results. You can then deploy the function directly from your Notebook, or from the CPD UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jM6sJmgdTix4Xqt9QS6uwQ.png" /><figcaption>Online Deployment of a Python function</figcaption></figure><p>To test an online deployment of your NLP models, simply type in or upload some samples into our UI and check the results, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0m_ZBbjGzSKdDiYwEqKWkQ.png" /><figcaption>Test online model deployment in IBM Cloud Pak for Data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v35qqy7eMEKO-D_1Yf2qUw.png" /><figcaption>Online inference results for targeted sentiment</figcaption></figure><p>To get started, check out our documentation on <a href="https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=notebooks-watson-natural-language-processing">NLP capabilities</a> and how to <a href="https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=assets-deploying-nlp-models">deploy NLP models</a>. My recommendation: import our <a href="https://github.com/IBMDataScience/sample-notebooks/tree/master/CloudPakForData/notebooks/4.6/Projects">sample project</a>, and execute its notebooks. They (hopefully) get you started on all capabilities of NLP in Cloud Pak for Data, including the creation of custom models and model deployment. Note: the directory contains the same project in two flavors: one for the NLP version in Runtime 22.1, and one for Runtime 22.2.</p><p>Including Watson NLP into Cloud Pak for Data is another milestone in our path to integrate NLP into the AI lifecycle. And we won’t stop there: watch this space for new innovations, new models, and new capabilities with Watson NLP and Cloud Pak for Data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f16b4d8b0cc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turn Data into Feature Groups with IBM Cloud Pak for Data]]></title>
            <link>https://medium.com/@alex.lang/turn-data-into-feature-groups-with-ibm-cloud-pak-for-data-8e09f3feb41d?source=rss-33723b9ae68d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e09f3feb41d</guid>
            <category><![CDATA[cloud-pak-for-data]]></category>
            <category><![CDATA[feature-store]]></category>
            <category><![CDATA[feature-engineering]]></category>
            <dc:creator><![CDATA[Alexander Lang]]></dc:creator>
            <pubDate>Fri, 03 Mar 2023 08:19:40 GMT</pubDate>
            <atom:updated>2023-03-11T14:50:39.587Z</atom:updated>
            <content:encoded><![CDATA[<h4>Create, share and reuse curated feature data across your data science projects</h4><h4>Managing machine learning features in Cloud Pak for Data today</h4><p>A <em>feature </em>is a piece of data that serves as the input or target for a machine learning model. Data scientists spend a lot of effort constructing features such as <em>In-Store Customer Revenue Last Month</em> from ‘raw’ data sources. These features can be reused in multiple machine learning models —<em> if</em> they’re discoverable across the enterprise.</p><p>IBM Cloud Pak for Data provides a large variety of tools to construct features, including Jupyter notebooks, SPSS Modeler flows or Watson Pipelines. With its myriad of data connectors, it’s easy to store these features in the backend of<em> </em>your choice — you’re not tied to the backend of a particular “feature store”. And by adding these features to a catalog in Watson Knowledge Catalog, all data scientists can find them and use them in projects. So, we’re done, right? Not quite…</p><h4>Feature Groups: Curated Data Assets for Machine Learning</h4><p>We just enhanced feature management in IBM Cloud Pak for Data as a Service with <em>Feature Groups. </em>A <em>Feature Group </em>is a data asset that contains features for machine learning. Feature Groups extend the existing feature management capabilities in three ways:</p><ol><li>Feature metadata that helps build models</li><li>Easily find features across the platform</li><li>Use feature metadata in Jupyter notebooks</li></ol><h4>Creating feature groups in projects and catalogs</h4><p>When you open a data asset in one of your projects or catalogs, you will notice a new tab <em>Feature group, </em>with a small “beta” icon on the side. Initially, this tab will be empty. Press the <em>New feature group</em> button, select the data asset columns, enter some <em>feature metadata</em>, and your screen will start looking like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1S5wxr3ei9J_JimxjSrN1Q.png" /><figcaption>Feature metadata overview for a feature group</figcaption></figure><p>There are various metadata attributes you can set for each feature. I want to highlight three of them. See our <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/feature-group.html">documentation</a> for the full list.</p><p><strong>Role: </strong>Most features serve as <em>Input</em> for a machine learning model. If your feature group is curated training data, specify one or more features as <em>Target, </em>to make the “goal” of this feature group clear. Use the <em>Identifier </em>role for features that are not to be used as input for modeling, but that identify a particular row of data.</p><p><strong>Recipe: </strong>If your feature represents a complex formula (such as <em>customer lifetime value</em>) or is the result of some advanced data wrangling, store the actual formula or the code snippet in the <em>recipe</em>. That way, others can reproduce your feature, and it’s transparent how a particular feature was derived.</p><p><strong>Fairness information: </strong>For input features that may be susceptible to bias (such as <em>Age</em> or <em>Gender</em>), provide <em>reference </em>and <em>monitored groups. </em>For target features, provide <em>favorable</em> and <em>unfavorable</em> outcomes. IBM AutoAI and open source frameworks such as <a href="http://aif360.mybluemix.net/">AIF360</a> use this information to detect and mitigate bias in the feature group and in the models built from it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Z1fhOKwo6_YRD3U-xCoeA.png" /><figcaption>Metadata details for Feature Age, including Fairness Information</figcaption></figure><h4>Finding feature groups</h4><p>When searching for data assets in Cloud Pak for Data, you will notice a new filter option: <em>Contains Feature Group. </em>Use this filter to narrow your results from dozens of data assets that contain your search term down to feature groups, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73dIlqgUBvpSgEkxzqLA9Q.png" /><figcaption>Restricting asset search results to feature groups</figcaption></figure><p>Starting with AutoAI, you will be able to select feature groups as input in Watson Studio model building tools:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FibI29DnK_bJ1breZOENBg.png" /><figcaption>Zoning in on feature groups when selecting input data</figcaption></figure><h4>The AssetFrame: create and use feature groups in Notebooks</h4><p>Metadata is most useful in the tool you’re currently working with. That’s why we’ve created a new library in our Python notebooks called<em> AssetFrame. </em>It provides easy access to data assets and their feature group metadata. Here’s a quick look at what it can do:</p><p>Initialize an AssetFrame with the name of a data asset:</p><pre>from assetframe_lib import AssetFrame<br>af = AssetFrame.from_data_asset(&quot;Retail Customers&quot;)</pre><p>Show a sample of the data asset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WctWp_H-rngw5e6RajIAjQ.png" /><figcaption>Feature group — metadata in context</figcaption></figure><p>Have you noticed? The syntax is similar to pandas dataframes, but the result has two key improvements:</p><ul><li>You don’t need to load the full data asset into your notebook first — the AssetFrame retrieves the data “on the fly”, using the data connectivity capabilities of Cloud Pak for Data.</li><li>The data is enriched with feature metadata: each column contains the <em>role</em>, <em>monitored</em> and <em>reference groups</em> are highlighted, as are <em>favorable</em> and <em>unfavorable outcomes</em>.</li></ul><p>Create a feature group from a pandas data frame:</p><pre>af = AssetFrame.from_pandas(dataframe=credit_risk_df, name=&quot;Retail Customers&quot;)<br>af.create_default_features()<br><br>risk_feat = af.get_feature(&quot;Risk&quot;)<br>risk_feat.set_roles([&quot;Target&quot;])<br><br>risk_feat.set_favorable_labels(&quot;No Risk&quot;)<br>risk_feat.set_unfavorable_labels(&quot;Risk&quot;)<br><br>af.to_data_asset()</pre><p>The code snippet above takes your feature-engineered pandas dataframe <em>credit_risk_df, </em>turns all columns into features, and provides additional metadata for the target column <em>Risk. </em>It then creates a new data asset in your project containing the feature group metadata and your pandas dataframe.</p><h4>Next steps</h4><p>Should you turn <em>all</em> your data assets into feature groups? No. Here are good candidates for feature groups:</p><ul><li>Data <em>for a specific use case </em>— for example, manually annotated training data for supervised learning. You plan to reuse the data to build multiple models for the same use case.</li><li>Data <em>about a specific entity</em> —for example, a customer, product information or monthly sales. You plan to reuse the data to build models for different use cases, typically joining it with other data first.</li><li>Data that is the result of feature construction, and contains “higher-level” attributes such as <em>customer lifetime value.</em></li></ul><p>To get started with feature groups, see our documentation on the <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/feature-group.html">Feature Group UI</a> and the <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/py_assetframe.html">AssetFrame</a> to find out their complete capabilities.</p><p>We have also added a new Sample Project in the Watson Studio Gallery: <a href="https://dataplatform.cloud.ibm.com/exchange/public/entry/view/e756adfa2855bdfc20f588f9c1986382?context=cpdaas"><em>Creating and using feature store data</em></a><em>. </em>In this project, you will find more examples of the AssetFrame library, including how to use a Feature Group to train an AutoAI model.</p><p>Start making your feature data “stand out” through feature groups — we’d love to hear your feedback!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e09f3feb41d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean up your topic models with Watson NLP]]></title>
            <link>https://medium.com/ibm-data-ai/clean-up-your-topic-models-with-watson-nlp-1598104ae41a?source=rss-33723b9ae68d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1598104ae41a</guid>
            <dc:creator><![CDATA[Alexander Lang]]></dc:creator>
            <pubDate>Tue, 06 Sep 2022 19:04:12 GMT</pubDate>
            <atom:updated>2022-09-06T19:04:12.033Z</atom:updated>
            <content:encoded><![CDATA[<p>scikit-learn + Watson = Club Topicana!</p><p>I like the topic modelling capabilities of <em>scikit-learn</em>, especially <a href="https://scikit-learn.org/1.0/modules/generated/sklearn.decomposition.NMF.html?highlight=nmf#sklearn.decomposition.NMF"><em>Non-Negative Matrix Factorization</em></a><em>, </em>aka<em> NMF</em>. Many data scientists use LDA, but I found NMF to produce more clearly distinguishable topics when the underlying documents share some key terms (for example, social media posts about the same brand or product).</p><p>But be it LDA or NMF, the quality of topic models improves by reducing the number of words the algorithm has to consider. Stopword filtering is a start, but with Watson NLP, you can do even better!</p><p>Consider the <a href="https://scikit-learn.org/1.0/auto_examples/applications/plot_topics_extraction_with_nmf_lda.html?highlight=nmf">excellent topic modelling example</a> from scikit-learn. Using the Kulbach-Leibler divergence on a newsgroup dataset, NMF already produces some fairly good topics — but some topics contain terms like <em>don </em>or <em>ve,</em>or a lot of numbers, which makes the topics harder to understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_CX_aS2CBDhBKci337BAg.png" /><figcaption>Topic Modeling based on scikit-learn’s newsgroups dataset</figcaption></figure><p>These topics are the result of running the following parts of the topic modelling example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/41dcd114275c9f36ff03e203bdc45872/href">https://medium.com/media/41dcd114275c9f36ff03e203bdc45872/href</a></iframe><p>Now, let’s “clean up” up this model. Fortunately, the <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-block-syntax.html">Syntax block</a> of Watson NLP integrates easily into scikit-learn. It allows me to</p><ul><li>Limit my analysis to words that have a particular <em>part-of-speech, </em>such as nouns or adjectives. For my topic models, I often use only nouns or proper nouns.</li><li>Use the <em>lemma </em>of a word, instead of its surface form that appears in the text. This way, both singular (<em>“mouse”</em>) and plural forms (<em>“mice”</em>) of a word get mapped to the same form (<em>“mouse”</em>). Unlike word stems that stemming algorithms produce, lemmas are actual words that users of the topic model immediately understand.</li></ul><p>To use Watson NLP in scikit-learn, I first create the custom tokenization function watson_tokenizer in my Notebook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d54b8902d972517922eef1f8b6bc1b8c/href">https://medium.com/media/d54b8902d972517922eef1f8b6bc1b8c/href</a></iframe><p>This function receives the text to tokenize. It then runs Watson NLP’s syntax model for English to obtain the individual tokens, the lemma of each token and its part-of-speech. Then, it collects the tokens with the <a href="https://universaldependencies.org/u/pos/">part-of-speech tags</a> <em>Noun or Proper Noun. </em>If the token has a lemma, it returns the lemma — otherwise, it returns the surface form. Running it yields</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aBsbt11ck5lJKVtUDIWpzQ.png" /><figcaption>Analyzing fairly intelligent rodents</figcaption></figure><p>To integrate watson_tokenizer into scikit-learn, I specify it as tokenizer when creating the scikit-learn Vectorizer that is used to pre-process the text for topic modeling.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/01a3ce5a06260a6faafe7e7a8a68da91/href">https://medium.com/media/01a3ce5a06260a6faafe7e7a8a68da91/href</a></iframe><p>Then, I fit the NMF model based on the new IF-IDF values:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30add6c14c337d3792343882f5307f32/href">https://medium.com/media/30add6c14c337d3792343882f5307f32/href</a></iframe><p>The change is minimal — but the result is arguably better:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*am5t4o6mDu2p_4Zxjhjg2g.png" /><figcaption>Topic Modelling of newsgroups, using noun lemmas from Watson NLP</figcaption></figure><p>To repeat: both results were achieved by running the scikit-learn topic modelling example within IBM Watson Studio, on the same document sample (2000 documents), with the same number of features (1000). All I changed was using a custom tokenizer instead of the scikit-learn stopword list.</p><p>This approach not only works for NMF topic modelling: I can use Watson NLP’s syntax block as a custom tokenizer in <em>every </em>scikit-learn Vectorizer that accepts a tokenizer attribute. This way, I can also improve LDA models, document clustering or text classification with the higher-quality text features from Watson NLP. However, for text classification, I recommend using Watson NLP <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp-classify-text.html?context=cpdaas&amp;audience=wdp">all the way</a>.-)</p><p>So, to give your topic models a nicer tan, go to I<a href="https://dataplatform.cloud.ibm.com/">BM Cloud Pak for Data as a Service</a>, launch a notebook with the <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp.html?context=cpdaas&amp;audience=wdp">NLP environment</a> — and Welcome to Club T(r)opicana!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1598104ae41a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-data-ai/clean-up-your-topic-models-with-watson-nlp-1598104ae41a">Clean up your topic models with Watson NLP</a> was originally published in <a href="https://medium.com/ibm-data-ai">IBM Data Science in Practice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Watson Natural Language Processing: now generally available in IBM Watson Studio Notebooks]]></title>
            <link>https://medium.com/ibm-data-ai/watson-natural-language-processing-now-generally-available-in-ibm-watson-studio-notebooks-8bc9d464f33d?source=rss-33723b9ae68d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bc9d464f33d</guid>
            <category><![CDATA[watson-studio]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[notebook]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[text-analytics]]></category>
            <dc:creator><![CDATA[Alexander Lang]]></dc:creator>
            <pubDate>Thu, 11 Aug 2022 17:46:47 GMT</pubDate>
            <atom:updated>2022-09-21T18:24:24.052Z</atom:updated>
            <content:encoded><![CDATA[<p>Less beta, more languages</p><p>Since January, thousands of Watson Studio Notebooks have used the Watson NLP library for high-quality Natural Language Processing in more than 20 languages. I’m glad our users weren’t put off by my <a href="https://medium.com/@alex.lang/watson-natural-language-processing-comes-to-ibm-watson-studio-notebooks-a81802dee9c8">blog post</a> on that subject.</p><p>It’s time for the next step: as of today, the Watson NLP integration is no longer in “beta” status, and ready to take on your production workload!</p><h3>Deeper sentiment insights</h3><p>We added a new model for <em>sentence-level</em> sentiment detection, based on BERT, with improved quality. We’ve also added a utility method that makes it easy to compute document-level sentiment, based on the sentiment of the individual sentences.</p><p>And my favorite: we included a new model to detect <em>targeted sentiment. </em>Targeted sentiment is an innovation straight out of IBM Research: it not only determines the sentiment (positive or negative) of a particular phrase, but tells you <em>exactly </em>what the sentiment is about. For example, the sentence “<em>The location was great, but the rooms were dirty.”</em> will yield two pieces of targeted sentiment: <em>(location, SENT_POSITIVE)</em> and <em>(rooms, SENT_NEGATIVE)</em> — without the need to specify targets in advance!</p><p>This allows for deep sentiment insights without any custom configuration, as the following example shows. I ran a set of hotel reviews through targeted sentiment — and the result clearly shows me the areas the hotel needs to improve on:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E2sWmhMybTJOaKcYvNNnWw.png" /><figcaption>Targeted sentiment for hotel reviews</figcaption></figure><h3>Support for GPUs</h3><p>The Watson NLP library is now also included in all our GPU environments by default. This is specifically relevant if you want to train your own classification models based on CNN — you will see that the training time per epoch is reduced, compared to our CPU environments. Running on GPUs may also speed up inference time, i.e., when you apply your custom model to new data.</p><h3>Getting Started</h3><p>Using Watson NLP models is <em>still</em> easy as 1–2–3–4:</p><ol><li>Start a Python notebook with the <em>DO + NLP Runtime 22.1 on Python 3.9</em>, or the <em>GPU Runtime 22.1 on Python 3.9</em></li><li>Import the <em>watson_nlp </em>library</li><li>Load the <em>block</em> that contains the model you need</li><li>Apply the block to your text</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YjUMCRHfIjjFnsJoz1PNw.png" /><figcaption>Using Watson NLP in a Notebook</figcaption></figure><p>We updated the <em>block catalog</em> in our <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp.html">documentation </a>with all models you can use out-of-the box, and instructions of how to create your own models, including code samples.</p><p>We also updated our sample Project in the Watson Studio Gallery: <a href="https://dataplatform.cloud.ibm.com/exchange/public/entry/view/636001e59902133a4a23fd89f010e4cb?context=cpdaas"><em>Text Analysis with Watson Natural Language Processing</em></a>. This project contains sample notebooks that show you how to work with each model, and examples how to further analyze and visualize the results for insights. Most of these notebooks are also available outside the project, directly in the Gallery. Just <a href="https://dataplatform.cloud.ibm.com/gallery?context=cpdaas&amp;query=nlp">search for “NLP” in the Gallery</a> to get them all.</p><h3>Migrating from the NLP beta version</h3><p>The good news: most of your notebooks will continue to work “as is” once you switched to the new environments. Here’s what you need to do:</p><ul><li>The NLP beta version will be supported for another two weeks. To ensure your notebooks continue to work after that, switch to an environment that contains the new NLP library.</li><li>If you use the Default NLP beta environment: Change the environment of your Notebook from <em>Default Python 3.8 + Watson NLP XS (beta) </em>to <em>DO + NLP Runtime 22.1 on Python 3.9</em> or <em>GPU Runtime 22.1 on Python 3.9.</em></li><li>If you use a custom NLP environment: Create a new custom NLP environment, using the software versions <em>DO + NLP Runtime 22.1 on Python 3.9</em> or <em>GPU Runtime 22.1 on Python 3.9. </em>Change the environment of your notebook to this new custom environment.</li><li>Sentiment analysis: Use the new blocks for sentence sentiment and targeted sentiment. The document sentiment block from the NLP beta is deprecated.</li><li>Tone classification: Use the block name <em>ensemble_classification-workflow_en_tone-stock </em>instead of <em>ensemble_classification-wf_en_tone-stock.</em></li><li>Emotion classification: Use the block name <em>ensemble_classification-workflow_en_emotion-stock </em>instead of <em>ensemble_classification-wf_en_emotion-stock.</em></li><li>Custom classification models: We recommend retraining your models with the new NLP library. This will allow you to benefit from quality improvements we made, especially in the ensemble classifier.</li></ul><p>As always, we’re looking forward to your feedback, and are excited to bring more innovations from IBM Research and IBM Software to your data science experience!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bc9d464f33d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-data-ai/watson-natural-language-processing-now-generally-available-in-ibm-watson-studio-notebooks-8bc9d464f33d">Watson Natural Language Processing: now generally available in IBM Watson Studio Notebooks</a> was originally published in <a href="https://medium.com/ibm-data-ai">IBM Data Science in Practice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Watson Natural Language Processing comes to IBM Watson Studio Notebooks]]></title>
            <link>https://medium.com/@alex.lang/watson-natural-language-processing-comes-to-ibm-watson-studio-notebooks-a81802dee9c8?source=rss-33723b9ae68d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a81802dee9c8</guid>
            <category><![CDATA[watson]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[watson-studio]]></category>
            <dc:creator><![CDATA[Alexander Lang]]></dc:creator>
            <pubDate>Thu, 20 Jan 2022 18:28:09 GMT</pubDate>
            <atom:updated>2022-01-20T18:38:35.149Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use Watson NLP to bring unstructured data into the Data Fabric</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7iSQvozpTa-5OjLH" /><figcaption>Photo by <a href="https://unsplash.com/@etiennegirardet?utm_source=medium&amp;utm_medium=referral">Etienne Girardet</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>High-Quality Natural Language Processing in more than 20 Languages</h3><p>Call center records, customer complaints, social media posts, problem reports… text is everywhere in the enterprise and beyond. Most of the time, text data doesn’t stand alone: it’s part of a data record with many structured columns. And now, it’s easier than ever to extract meaning and structure from text and combine it with structured data. We’re launching <strong><em>Watson Natural Language Processing Environments</em></strong><em> for Watson Studio Notebooks</em>. This capability is available in <em>all</em> <a href="https://dataplatform.cloud.ibm.com/">Watson Studio</a> plans in IBM Cloud Pak for Data as a Service, including our free trial.</p><p>The <em>Watson Natural Language Processing Environment </em>gives you instant access to pre-trained, high-quality text analysis models for <strong><em>over 20 languages </em></strong>in your notebooks. These models are created and maintained by experts in IBM Research and IBM Software and evaluated for quality for each language. The following models are provided out-of-the-box:</p><ul><li><strong>Syntax Analysis:</strong> Identify <em>tokens</em>, their base forms (aka <em>lemmas</em>) and their <em>part of speech</em>. Run <em>dependency parsing </em>to identify the subject, verb, and objects of a sentence.</li><li><strong>Noun Phrase extraction:</strong> Identify noun phrases like <em>“windscreen wiper”</em> or <em>“front bumper”</em> from your text.</li><li><strong>Keyword retrieval:</strong> Rank noun phrases according to their relevance in a document.</li><li><strong>Entity Extraction: </strong>Extract 20 entity types from the text, including <em>Organization</em>, <em>Person</em>, <em>Job Title, Location, Phone Number, Email Address, Measure, Money, Date</em> and <em>Time</em>.</li><li><strong>Sentiment:</strong> Identify the sentiment of a text as <em>positive, negative,</em> or <em>neutral.</em></li><li><strong>Tone:</strong> Classify a text as <em>excited, frustrated, impolite, polite, sad, satisfied,</em> or <em>sympathetic.</em></li><li><strong>Emotion:</strong> Classify the emotion expressed in a text as <em>anger, disgust, fear, joy</em>, or <em>sadness.</em></li></ul><p>It bears repeating: these models don’t just work for English. We provide models that work in <em>Arabic, Chinese, Czech, Danish, Dutch, German, English, Finnish, French, Hebrew, Hindi, Italian, Japanese, Korean, Norwegian, Portuguese, Romanian, Russian, Slovak, Spanish and Turkish</em> — and for some models, we support even <em>additional</em> languages.</p><p>We placed special attention to the data used to train these models. This includes the quality of the data, the data provenance, and its intellectual property. The value for you: the models we built from this data can be used in your production environment, without worrying about license or intellectual property infringements — unlike some models you may find for open-source text analysis frameworks.</p><p>In case our built-in models don’t cover all your analysis requirements — feel free to build your own custom models, using:</p><ul><li>A high-performance matcher for <strong>dictionaries</strong> and <strong>regular expressions</strong>. Thanks to our built-in syntax analysis, you can put lemmas into the dictionary, and we match all inflected forms automatically. So, you add “<em>mouse”</em> — we find “<em>mice”.</em></li><li>GloVE, USE and BERT <strong>embeddings</strong></li><li><strong>Custom classifiers </strong>with your own training data. You can use SVM, CNN and BERT approaches — or simply create an <em>ensemble</em> classifier that combines various models</li></ul><p>You can store these custom models in your Watson Studio project, and reuse in other notebooks.</p><h3>Integrated into the Cloud Pak for Data Experience</h3><p>Extracting information from text is just the first step. To deliver insights, you want to integrate the results into your data fabric — and automate the insights going forward. Fortunately, Watson Studio has got you covered:</p><p><strong>Turn text analysis into text <em>mining</em></strong></p><p>Once the NLP results are in your notebook, use the full array of “structured” analytics approaches to identify patterns <em>across</em> documents. Or correlate the results with other, structured columns in your data. This yields additional insights that go beyond a single piece of text.</p><p>For example, run <em>syntax analysis</em> to identify noun phrases that occur in car problem descriptions, and then use <em>association rule</em> <em>analysis</em> to identify the key noun phrases for a particular car model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*Dwx5s3-Jftkhb9nCrpWxlQ.png" /><figcaption>Noun phrases for a particular car model</figcaption></figure><p>Or correlate the results of<em> syntax</em> <em>analysis</em> and <em>sentiment</em> <em>analysis</em> to identify the aspects that drive positive or negative sentiment for a particular hotel</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*CVTWFc86wK0cia0S2cGf5A.png" /><figcaption>Nouns that co-occur with a particular sentiment in reviews for two hotels</figcaption></figure><p><strong>Visualize and share insights</strong></p><p>Visualize results right in your notebook (like the charts you see above) and share a link to your notebook with your stakeholders or create <em>dashboards</em> to let them interactively explore the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHR01h4GKPbCk9_u8O6l6g.png" /><figcaption>Dashboard with sentiment information on hotel reviews</figcaption></figure><p><strong>Productize and Automate</strong></p><p>Run your notebook as a <em>job</em> to apply text analysis regularly on new data. Use <em>AI Orchestration</em> to combine the notebook with other tools, such as AutoAI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sfxRok_Ji7eTXlkD5UicHQ.png" /><figcaption>Use NLP to extract additional information for a customer churn model</figcaption></figure><h3>Getting Started</h3><p>Using Watson NLP models is easy as 1–2–3–4:</p><ol><li>Start a Python notebook with the <em>Default Python 3.8 + Watson NLP XS (beta)</em> environment</li><li>Import the <em>watson_nlp </em>library</li><li>Load the <em>block</em> that contains the model you need</li><li>Apply the block to your text</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*JP4xP1k2ejKxTDzij0NEcw.png" /><figcaption>Using Watson NLP in a notebook</figcaption></figure><p>Our extensive <a href="https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/watson-nlp.html?context=cpdaas&amp;audience=wdp">documentation</a> includes a <em>block catalog</em> with all models you can use out-of-the box, and instructions how to create your own models, including code samples.</p><p>We also added a new Sample Project in the Watson Studio Gallery: <a href="https://dataplatform.cloud.ibm.com/exchange/public/entry/view/636001e59902133a4a23fd89f010e4cb"><em>Text Analysis with Watson Natural Language Processing</em></a>. This project contains sample notebooks that show you how to work with each model, and examples how to further analyze and visualize the results for insights — including the ones from this blog.</p><p>We’re looking forward to your feedback — so, just plug in your own data and get going!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a81802dee9c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>