<commit_before>

<table class="table-striped nb">
    <thead>
        <tr>
            <th>Category</th>
            <th>Value</th>
            <th>Score</th>
        </tr>
    </thead>

    <tbody>
    <% var length = Object.keys(labels).length %>
    <% var ctr = 1 %>
    <% _.each(Object.keys(labels), function(key) { %>
     <% if ( ctr < length ){ %>
        <tr>
            <td><%= labels[key] || key %></td>
            <td id="<%= key %>"><%= scale.score[key].value || "" %></td>
            <td style="text-align:right;" class="tooltip">
                <%= scale.score[key].result || "" %> <span class="left"><%= scale.score[key].explanation || "" %></span>
            </td>
        </tr>
      <% } else { %>
        <tr>
        <td colspan=2><%= labels[key] || key %></td>
        <td style="text-align:right; font-weight: 600;"><%= scale.score[key] || "" %></td>
        </tr>
      <% } %>
      <% ctr = ctr + 1 %>
    <% }); %>

    </tbody>
</table>

<commit_msg>only show tooltip when there is text to display<commit_after>

<table class="table-striped nb">
    <thead>
        <tr>
            <th>Category</th>
            <th>Value</th>
            <th>Score</th>
        </tr>
    </thead>

    <tbody>
    <% var length = Object.keys(labels).length %>
    <% var ctr = 1 %>
    <% _.each(Object.keys(labels), function(key) { %>
     <% if ( ctr < length ){ %>
        <tr>
            <td><%= labels[key] || key %></td>
            <td id="<%= key %>"><%= scale.score[key].value %></td>
            <td style="text-align:right;" class="tooltip">
                <%= scale.score[key].result %> <% if(scale.score[key].explanation) {%><span class="left"><%= scale.score[key].explanation %></span><% } %>
            </td>
        </tr>
      <% } else { %>
        <tr>
        <td colspan=2><%= labels[key] || key %></td>
        <td style="text-align:right; font-weight: 600;"><%= scale.score[key] || "" %></td>
        </tr>
      <% } %>
      <% ctr = ctr + 1 %>
    <% }); %>

    </tbody>
</table>


{'fraction_non_alphanumeric': 0.23842364532019705, 'fraction_numerical': 0.005911330049261084, 'mean_word_length': 1.8169209431345354, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '973807', 'n_tokens_mistral': 762, 'n_tokens_neox': 681, 'n_words': 133}