<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="author" content="rdgai">
  <title>rdgai report</title>
    
  <!-- Favicons -->
  <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABgWlDQ1BzUkdCIElFQzYxOTY2LTIuMQAAKJF1kc8rRFEUxz8zaORHFMnC4qVhNeRHDTbKTEJN0hhlsJl53syoeTOv92bSZKtsFSU2fi34C9gqa6WIlKxnTWzQc55RI5lzO/d87vfec7r3XHBH0qpuVfeBnsmZ4YmAMh9dUDxFPNTTRgtDMdUyxmZmQlS0tztcTrzpcWpVPvev1S9rlgquWuFR1TBzwpPCodWc4fC2cKuaii0Lnwr7TLmg8K2jx0tcdDhZ4g+HzUg4CO5mYSX5i+O/WE2ZurC8HK+ezqs/93Fe0qBl5mYldop3YBFmggAKU4wTxE8/IzL76WGAXllRIb/vO3+arOSqMhsUMFkhSYocPlHzUl2TmBBdk5Gm4PT/b1+txOBAqXpDAGqebPulCzxb8Llp2++Htv15BFWPcJEp52cPYPhV9M2y5t2HpnU4uyxr8R0434D2ByNmxr6lKnF3IgHPJ9AYhZZrqFss9exnn+N7iKzJV13B7h50y/mmpS925mftiwiumwAAAAlwSFlzAAALEwAACxMBAJqcGAAABDtJREFUWIXt1muIlFUcBvDfzI6zu3axtSwLI1cRdQsSDcMEazMk2rK0pKA1tg9a0KCBKF2IwD4VCBVT9CGxNsqsrCwVq1VUsmglSBe0yxoVtYEXhL3MvjM7O9uH9x15nTaNcOlDPfDnvZznnOc5F/7nz38diSy1+BATcH+Gb0ZSMMsMvIlfcVcKN2JB1H6/ETaAZjREMS+Jz3AQAV4aYXHIRloH0JbMMIiv0JXhp5FWjzS60J5hMDnSgmfDv24gVfkjy7VYjoVInyOdAj7CKxk6/tLAi1xc4nMcTfA2ColzYyCNxWjOMvFPBnIYJDHEmiGGMONJes6Ndogsa/Eb1uDUvJL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4PDebxfoZfhtP7H/8q/gD4EGVfq3MYqAAAAABJRU5ErkJggg==" />
  <meta name="theme-color" content="#940000">

  <style>
    {% include 'assets/css/bootstrap.rdgai.min.css' %}
    {% include 'assets/css/rdgai.min.css' %}
  </style>
</head>

<body>

  <header class="navbar navbar-dark sticky-top bg-light flex-md-nowrap p-0 shadow">
    <button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse"
      data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
  </header>

  <div class="container-fluid">
    <div class="row">

      <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block sidebar collapse">
        <div id="brand">
          <a href="https://rbturnbull.github.io/rdgai/" target="_blank">{% include 'assets/img/rdgai-logo-tall.svg' %}</a>
        </div>
        
        <div  style="height: 450px; overflow-y: auto;">
          <ul class="nav flex-column pt-2">
            <li class="nav-item">
              <a class="nav-link active" aria-current="page" href="#"  id="overview-tab" data-bs-toggle="tab" data-bs-target="#overview" type="button" role="tab" aria-controls="overview" aria-selected="true">
                {% include 'assets/img/feather-bar-chart-2.svg' %}
                Overview
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" aria-current="page" href="#"  id="prompt-tab" data-bs-toggle="tab" data-bs-target="#prompt" type="button" role="tab" aria-controls="prompt" aria-selected="true">
                {% include 'assets/img/feather-align-left.svg' %}
                Prompt
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" aria-current="page" href="#"  id="review-tab" data-bs-toggle="tab" data-bs-target="#review" type="button" role="tab" aria-controls="review" aria-selected="true">
                {% include 'assets/img/feather-align-left.svg' %}
                Review
              </a>
            </li>
            <li style="text-align: center; font-weight: bold;">Incorrect ({{incorrect_count}})</li>
            {% for item in incorrect_items %}
              <li class="nav-item">
                <a class="nav-link" aria-current="page" href="#"  id="incorrect-{{ loop.index }}-tab" data-bs-toggle="tab" data-bs-target="#incorrect-{{ loop.index }}" type="button" role="tab" aria-controls="incorrect-{{ loop.index }}" aria-selected="true">
                  {% include 'assets/img/feather-x-circle.svg' %}
                  {{ item.app_id }}
                </a>
              </li>
            {% endfor %}
            <li style="text-align: center; font-weight: bold;">Correct ({{correct_count}})</li>
            {% for item in correct_items %}
              <li class="nav-item">
                <a class="nav-link" aria-current="page" href="#"  id="correct-{{ loop.index }}-tab" data-bs-toggle="tab" data-bs-target="#correct-{{ loop.index }}" type="button" role="tab" aria-controls="correct-{{ loop.index }}" aria-selected="true">
                  {% include 'assets/img/feather-check-circle.svg' %}
                  {{ item.app_id }}
                </a>
              </li>
            {% endfor %}
          </ul>
        </div>
      </nav>

      <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
        <div class="tab-content" id="rdgai-tab-content">
          <div class="tab-pane fade show active" id="overview" role="tabpanel" aria-labelledby="overview-tab">
            <h1 class="text-center">Overview</h1>
            <div class="container">
              <div class="row justify-content-center">
                  <div class="col-md-4">
                      <table class="table table-bordered table-striped">
                          <tbody>
                              <tr>
                                  <th>Accuracy</th>
                                  <td>{{ accuracy | round(1) }}%</td>
                              </tr>
                              <tr>
                                  <th>Precision</th>
                                  <td>{{ precision | round(1) }}%</td>
                              </tr>
                              <tr>
                                  <th>Recall</th>
                                  <td>{{ recall | round(1) }}%</td>
                              </tr>
                              <tr>
                                  <th>F1</th>
                                  <td>{{ f1 | round(1) }}%</td>
                              </tr>
                              <tr>
                                  <th>Correct</th>
                                  <td>{{ correct_count }}</td>
                              </tr>
                              <tr>
                                  <th>Incorrect</th>
                                  <td>{{ incorrect_count }}</td>
                              </tr>
                          </tbody>
                      </table>
                  </div>
              </div>
          </div>
          


            <h2>Confusion Matrix</h2>
            {{ confusion_matrix|safe }}
          </div>

          <div class="tab-pane fade show" id="prompt" role="tabpanel" aria-labelledby="prompt-tab">
            <h1>Base Prompt</h1>
            <pre class="prompt">{{ prompt }}</pre>
          </div>
          <div class="tab-pane fade show" id="review" role="tabpanel" aria-labelledby="review-tab">
            <h1>Review</h1>
            <h2>Review Prompt</h2>
            <pre class="prompt">{{ review_template.pretty_repr() }}</pre>
            {% if review_result %}
              <h2>Review Result</h2>
              <pre class="prompt">{{ review_result }}</pre>
            {% endif %}
          </div>

          {% for item in incorrect_items %}
          <div class="tab-pane fade show" id="incorrect-{{ loop.index }}" role="tabpanel" aria-labelledby="incorrect-{{ loop.index }}-tab">
              <h1>{{ item.app_id }}</h1>
              <p class="verse"><span>{{ item.app.text_before() }}</span> <span class='highlight'>{{ item.app.text_with_signs() }}</span> <span>{{ item.app.text_after() }}</span></p>
              <div class="row justify-content-center text-center">        
                <p class="relation"><span>{{ item.active }}</span> &lrm;➜ <span>{{ item.passive }}</span></p>
              </div>
              <div class="row justify-content-center text-center">
                <div class="col-md-4">
                  <div class="card bg-secondary text-white">
                    <div class="card-body">
                      <p class="card-text small">Ground Truth</p>
                      <h5 class="card-title large">{{", ".join(item.ground_truth)}}</h5>
                      <h5 class="card-title large">{{item.ground_truth_description}}</h5>
                    </div>
                  </div>
                </div>
                <div class="col-md-4">
                  <div class="card bg-danger text-white">
                    <div class="card-body">
                      <p class="card-text small">Incorrect Prediction</p>
                      <h5 class="card-title large">{{", ".join(item.predicted)}}</h5>
                      <h5 class="card-title large">{{item.description}}</h5>
                    </div>
                  </div>
                </div>
              </div>      
          </div>
        {% endfor %}     

        {% for item in correct_items %}
        <div class="tab-pane fade show" id="correct-{{ loop.index }}" role="tabpanel" aria-labelledby="correct-{{ loop.index }}-tab">
            <h1>{{ item.app_id }}</h1>
            <p class="verse"><span>{{ item.app.text_before() }}</span> <span class='highlight'>{{ item.app.text_with_signs() }}</span> <span>{{ item.app.text_after() }}</span></p>
            <div class="row justify-content-center text-center">        
              <p class="relation"><span>{{ item.active }}</span> &lrm;➜ <span>{{ item.passive }}</span></p>
            </div>
            <div class="row justify-content-center text-center">
              <div class="col-md-4">
                <div class="card bg-secondary text-white">
                  <div class="card-body">
                    <p class="card-text small">Ground Truth</p>
                    <h5 class="card-title large">{{", ".join(item.ground_truth)}}</h5>
                    <h5 class="card-title large">{{item.ground_truth_description}}</h5>
                  </div>
                </div>
              </div>
              <div class="col-md-4">
                <div class="card bg-success text-white">
                  <div class="card-body">
                    <p class="card-text small">Correct Prediction</p>
                    <h5 class="card-title large">{{", ".join(item.predicted)}}</h5>
                    <h5 class="card-title large">{{item.description}}</h5>
                  </div>
                </div>
              </div>
            </div>      
        </div>
      {% endfor %}     

    </div>        
        
      </main>
    </div>
  </div>

  <script>
    {% include 'assets/js/bootstrap.min.js' %}
  </script>

</body>

</html>