<?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 Upasana Gogna on Medium]]></title>
        <description><![CDATA[Stories by Upasana Gogna on Medium]]></description>
        <link>https://medium.com/@upasanagogna1?source=rss-ae47cabfcad8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mluTOrXoKL1DlOiKefTEbQ.jpeg</url>
            <title>Stories by Upasana Gogna on Medium</title>
            <link>https://medium.com/@upasanagogna1?source=rss-ae47cabfcad8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:50:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@upasanagogna1/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[LIT-language Interpretability Tool for Explaining NLP Models]]></title>
            <link>https://upasanagogna1.medium.com/lit-language-interpretability-tool-for-explaining-nlp-models-18c1a1cde12e?source=rss-ae47cabfcad8------2</link>
            <guid isPermaLink="false">https://medium.com/p/18c1a1cde12e</guid>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[explainable-ai]]></category>
            <category><![CDATA[interpretability]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Upasana Gogna]]></dc:creator>
            <pubDate>Thu, 26 Nov 2020 18:08:52 GMT</pubDate>
            <atom:updated>2020-11-27T05:22:47.283Z</atom:updated>
            <content:encoded><![CDATA[<p>Language Interpretability Tool (LIT) is a browser based UI &amp; toolkit for model interpretability .It is an open-source platform for visualization and understanding of NLP models developed by Google Research Team.</p><p>LIT supports models like Regression, Classification, seq2seq,language modelling and structured predictions.</p><p>It is Framework-agnostic and compatible with TensorFlow, PyTorch, and more.</p><p>Components of LIT are portable, and can easily be used in a Jupyter notebook or standalone script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uh9XCLi8yIIs0nHAVwSJsA.png" /><figcaption>Example LIT structure for classification model</figcaption></figure><h4><strong>Installation/Running LIT</strong></h4><pre>pip install lit-nlp</pre><p>Refer further installation and demo run guide ,how to set up and run LIT on your local server<strong> </strong><a href="https://pair-code.github.io/lit/setup/">LIT — Setup Guide (pair-code.github.io)</a></p><h3><strong>How to use LIT to analyze different type of Models ?</strong></h3><h4>LIT Basic Components</h4><blockquote><strong>General Layout : </strong>LIT consists of a Python backend and a TypeScript frontend.</blockquote><blockquote>UI main components:-</blockquote><blockquote>Global Settings :- for multiple model selection ,Dataset selection &amp; layout configuration.</blockquote><blockquote>Main menu bar:- for changing color, slice selection, dataset comparison.</blockquote><blockquote>Top module section:- for data selection</blockquote><blockquote>Bottom module section: for local explanation ,interpretability ,new datapoint generation.</blockquote><blockquote><strong>DataTable/Datapoint Selections-</strong>LIT displays a loaded dataset and its model results across the set of selected models. Users can dive into detailed results by selecting datapoints from the dataset.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e_aL137oESPzOv2kJlK5mw.png" /></figure><blockquote><strong>Datapoint Editor-</strong>With datapoint editor we can edit selected datapoint, if selected. Also can create new datapoint with “Make new datapoint” button. Any edit to an existing datapoint must be saved as a new datapoint to be explored, to keep datapoints immutable for simplicity of use.</blockquote><blockquote><strong>Slice Editor- </strong><em>You can save selected datapoint/datapoints in Slice editor component for comparison with other models/datapoints , Its like bookmark which you can revisit in future to compare results.</em></blockquote><h4>Global Explanation Modules for Classification problem.</h4><p>There are different type of modules in LIT for model explanation.</p><p>Modules will automatically display if they are applicable to the current model and dataset; for example, the module that shown below referred to classification results only.</p><blockquote><strong>Embedding Projection- </strong>The embedding projector will show all data points by their embeddings projected down to 3 dimension. This is useful for exploring and understanding clusters of data points.</blockquote><blockquote>LIT provides 2 types of embedding projection :-</blockquote><blockquote><a href="https://umap-learn.readthedocs.io/en/latest/basic_usage.html"><strong>UMAP</strong></a><strong>-</strong><em> Just like t-SNE, UMAP is a dimensionality reduction specifically designed for visualizing complex data in low dimensions (2D or 3D). As the number of data points increase, </em><a href="https://umap-learn.readthedocs.io/en/latest/benchmarking.html"><em>UMAP becomes more time efficient</em></a><em> compared to TSNE.</em></blockquote><blockquote><a href="https://arxiv.org/pdf/1906.00114.pdf"><strong><em>PCA</em></strong></a><strong>- </strong><em>Implemented to reduce the dimensionality of </em><strong><em>word embedding</em></strong><em>. In short, it is a feature extraction technique — it combines the variables, and then it drops the least important variables while still retains the valuable parts of the variables.</em></blockquote><p>Note - color of embedding points can be modify either using predicted class/original class or labels on main menu bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCjXcV7MGPSTBBfgo1TqAg.png" /></figure><blockquote><strong>Performance Tab</strong></blockquote><blockquote><strong>Metrics Table</strong>-It shows measures such as accuracy (for classifiers), error (for regression tasks), and BLEU score (for translation tasks) on selected model.</blockquote><blockquote><em>Metrics</em> module shows model metrics not just across the entire dataset, but also for the current selection of datapoints (selected from data table or from slicer).</blockquote><blockquote><strong>Confusion Matrix-</strong>The confusion matrix shown for all data from the dataset (or the current selected datapoint) for classification model only.</blockquote><blockquote><strong>Predictions Tab</strong></blockquote><blockquote><strong>Classification Results:-</strong>It will show<strong> </strong>result of a model on the selected datapoint.</blockquote><blockquote><strong>Scalars</strong>: It will show overall predicted result and selected datapoint probabilities.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*icH_CbiaDrJqxVLUjl4oTg.png" /><figcaption>binary classification probability with threshold setting</figcaption></figure><h4>Local Explanation Modules for Classification problem</h4><blockquote><strong>Saliency Maps: </strong>Salience maps show the influence of different parts of inputs features on a model’s prediction on the primary selection.</blockquote><blockquote>The background of each text piece is colored by the salience of that piece on the prediction, and hovering on any piece will display the exact value calculated for that piece.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*U2xUya9wRCcq6xVAgl0Rag.png" /><figcaption>Saliency map for positive &amp; negative Sentiments</figcaption></figure><blockquote>Grad norm Saliency<em>-It </em>processes the <strong>Token Gradients</strong> and <strong>Tokens </strong>returned by a model and produces a list of scores for each token.</blockquote><blockquote>Grad dot Saliency- <em>It </em>requires a <strong>Token Embedding </strong>input and corresponding output, as well as a <strong>label field Target</strong> to pin the gradient target to the same class as an input and corresponding output.</blockquote><blockquote>Integrated Gradients <em>-</em>The feature attribution values are calculated by taking the <strong>integral of gradients</strong> along a straight path from a baseline to the input being analyzed. It also requires same input as grad dot Saliency.</blockquote><blockquote><strong>Lime Saliency: </strong>It check<strong> </strong>each word based on how much it influenced the prediction positively or negatively.</blockquote><blockquote>Refer below link for more detail explanation and mathematics behind Saliency calculation -<a href="https://arxiv.org/pdf/1703.01365.pdf">Axiomatic Attribution for Deep Networks (arxiv.org)</a></blockquote><p>Refer -<a href="http://marcotcr/lime:%20Lime:%20Explaining%20the%20predictions%20of%20any%20machine%20learning%20classifier%20(github.com)">Lime</a></p><blockquote><strong>Attention : </strong>Displays attention visualization for each layer and head. It shows which tokens are attended to between layers of a model</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*SoJsnebDllP6Pi2AtEUGFA.png" /></figure><blockquote><strong>Counterfactual: </strong>Data Point generation via manual edits or auto generated text from existing data to dynamically create and evaluate new examples.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eTQFzLenPry7Pem9JID3Rg.png" /></figure><blockquote><strong>Scrambler</strong>: Scrambles the words in a text feature randomly.</blockquote><blockquote><strong>Word Replacer</strong>: Provides a text box to define a comma-separated set of replacements to perform (such as “great -&gt; terrible, hi -&gt; hello”).</blockquote><blockquote>Word replacer also supports multiple targets per word with “|” separator. For example, “great -&gt; terrible | bad” will produce two outputs where “great” is replaced with “terrible” and “bad”.</blockquote><blockquote><strong>Counterfactual Explanation: </strong>This is similar to Saliency map but the influence here is calculated by looking at the model results on this datapoint, compared to the results on the rest of the selected datapoints.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*VfmFyhyCRCeTAupRif0Sow.png" /></figure><p>Note -Above components for model interpretability are specific to classification problem only.</p><h3><strong>Conclusion:</strong></h3><p>-<strong>Easy to use </strong>-User can switch between visualizations and analysis to test hypothesis and validate those hypothesis over a data point.</p><p>-<strong>Dynamic Data Generation</strong>-New data points can be added using counter fact generation/datapoint editor and their effect on the model can be visualized side-by-side.</p><p>-<strong>Multi Model Comparison </strong>-It allows comparison for two similar kind of models or two data points to be visualized simultaneously. By loading more than one model in the global settings controls, LIT can compare multiple models.</p><p>-<strong>Explain model behavior </strong>- e.g. Questions like -What happen if I change things like textual style, verb tense in my text. How it will change the prediction? What kind of examples does my model perform poorly on? Is linguistic knowledge learned or ignored?</p><p>-<strong>Configurable</strong>-There is a brief overview of how to run LIT with your own models and datasets. LIT is easy to extend with new interpretability components, generators, and more, both on the frontend or the backend .For more details, see the documentation by LIT in <a href="https://github.com/pair-code/lit">code repository</a>.</p><h3>References:</h3><p><a href="https://arxiv.org/pdf/2008.05122v1.pdf">https://arxiv.org/pdf/2008.05122v1.pdf</a></p><p><a href="https://github.com/pair-code/lit">PAIR-code/lit: The Language Interpretability Tool: Interactively analyze NLP models for model understanding in an extensible and framework agnostic interface. (github.com)</a></p><p><a href="https://pair-code.github.io/lit/demos/">LIT — Demos (pair-code.github.io)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18c1a1cde12e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>