File size: 12,501 Bytes
21baed4 2406314 21baed4 1434f10 e4a03b0 21baed4 1434f10 2406314 21baed4 e7361c3 ef811a0 21baed4 2406314 21baed4 bac80cb 3835fc2 bac80cb 72b7ea3 bac80cb 3835fc2 bac80cb 21baed4 2406314 21baed4 852e112 21baed4 1550538 2406314 21baed4 2406314 21baed4 2406314 21baed4 2406314 21baed4 e831371 21baed4 2406314 21baed4 2406314 21baed4 2406314 852e112 21baed4 2406314 21baed4 2406314 852e112 21baed4 852e112 21baed4 2406314 21baed4 2406314 852e112 21baed4 e4a03b0 2406314 bbb0d0f 21baed4 59e06b1 21baed4 59e06b1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | {% extends "base.html" %}
{% block title %}Consultants - Explorer{% endblock %}
{% block nav_consultants %}active{% endblock %}
{% block head %}
<script>
</script>
{% endblock %}
{% block content %}
<div class="page-header consultants-header">
<div class="page-header-text">
<div class="page-eyebrow">Objection Analyzer</div>
<h1 class="page-title">Decode the <em>real</em> concern.</h1>
<p class="page-subtitle">Select the exact visa service from the active matrix, paste a customer objection, and the AI returns the matching type and cluster. Responses stay blank until they are filled in Browse.</p>
</div>
<div class="page-header-actions consultants-actions">
<button type="button" class="btn btn-outline btn-sm" onclick="document.getElementById('consultant-tips').open = !document.getElementById('consultant-tips').open">Tips</button>
<a href="/analytics" class="btn btn-outline btn-sm">History</a>
</div>
</div>
<div class="consultants-workspace">
<section class="card consultant-input-card" id="analyzer-form">
<div class="consultant-card-title">Customer context</div>
<div class="consultant-context-grid">
<div class="field consultant-customer-name-field">
<label class="field-label" for="customer-name">Customer Name</label>
<input id="customer-name" class="input" type="text" placeholder="Type customer name" maxlength="120" />
</div>
<div class="field">
<label class="field-label" for="customer-group">Group</label>
<select id="customer-group" class="select" onchange="updateServiceDropdown()">
{% for g in group_labels %}
<option value="{{ g }}">{{ g }}</option>
{% endfor %}
</select>
</div>
<div class="field">
<label class="field-label" for="visa-service-search">Service</label>
<div class="service-combobox" id="service-combobox">
<input type="hidden" id="visa-service" value="" />
<input id="visa-service-search" class="input" type="text"
placeholder="Select a service"
autocomplete="off"
oninput="filterServiceOptions()"
onfocus="openServiceOptions()" />
<div id="visa-service-options" class="service-options" hidden></div>
</div>
</div>
</div>
<div class="consultant-card-title consultant-tracking-title">Objection tracking</div>
<div class="consultant-tracking-grid">
<div class="field">
<label class="field-label" for="objection-status">Objection Status</label>
<select id="objection-status" class="select">
<option value="Unsolved">Unsolved</option>
<option value="Solved">Solved</option>
</select>
</div>
<div class="field">
<label class="field-label" for="main-contact-platform">Main Contact Platform</label>
<select id="main-contact-platform" class="select">
<option value="">Select a platform</option>
<option value="Explorer Webapp">Explorer Webapp</option>
<option value="Explorer by SL">Explorer by SL</option>
<option value="Explorer Travel Agency">Explorer Travel Agency</option>
</select>
</div>
<div class="field">
<label class="field-label" for="objection-date">Objection Date</label>
<input id="objection-date" class="input consultant-date-input" type="text" inputmode="none" autocomplete="off" readonly placeholder="Select date" data-themed-date="true" />
</div>
<div class="field">
<label class="field-label" for="first-contact-date">First Contact Date</label>
<input id="first-contact-date" class="input consultant-date-input" type="text" inputmode="none" autocomplete="off" readonly placeholder="Select date" data-themed-date="true" />
</div>
<div class="field">
<label class="field-label" for="ad-source">Ad Source</label>
<input id="ad-source" class="input" type="text" placeholder="Type ad source" maxlength="120" />
</div>
<div class="field">
<label class="field-label" for="lead-quality">Lead Quality</label>
<select id="lead-quality" class="select">
<option value="">Select lead quality</option>
<option value="Qualified">Qualified</option>
<option value="Not Qualified">Not Qualified</option>
<option value="Lost">Lost</option>
<option value="Converted">Converted</option>
<option value="Intake">Intake</option>
<option value="Awaiting Documents">Awaiting Documents</option>
</select>
</div>
</div>
<div class="consultant-card-title consultant-quote-title">Customer quote</div>
<div class="field">
<textarea id="quote" class="textarea consultant-quote-box" rows="6"
placeholder="Paste the customer's exact words. e.g. "Why are you so expensive compared to other agencies on Norodom?""
maxlength="2000"></textarea>
<div class="consultant-quote-meta">
<span id="quote-readiness">Minimum 10 characters</span>
<span id="char-counter">0 / 2000</span>
</div>
</div>
<div id="input-error" class="alert alert-error mt-1" hidden></div>
<button id="analyze-btn" class="btn btn-primary btn-lg btn-block consultant-analyze-btn" onclick="runPredict()">
Analyze objection
</button>
<div class="consultant-examples">
<div class="consultant-example-label">Try an example</div>
<button type="button" class="consultant-example" data-example="Why is your fee 1,200 USD when the agency on Norodom is only 800?">
"Why is your fee 1,200 USD when the agency on Norodom is only 800?"
</button>
<button type="button" class="consultant-example" data-example="I'm not sure I trust you with my passport for that long.">
"I'm not sure I trust you with my passport for that long."
</button>
<button type="button" class="consultant-example" data-example="My friend got rejected last year - what if the same thing happens to me?">
"My friend got rejected last year - what if the same thing happens to me?"
</button>
<button type="button" class="consultant-example" data-example="Can I just submit the application myself to save the consultancy fee?">
"Can I just submit the application myself to save the consultancy fee?"
</button>
</div>
</section>
<section class="consultant-output-column">
<div id="result-placeholder" class="consultant-placeholder-card">
<div class="consultant-placeholder-mark">✦</div>
<h2>Awaiting your customer quote.</h2>
<p>
The model has been trained on <strong>4,400+</strong> real Explorer by SL chats.
Paste a verbatim objection on the left to receive a structured breakdown and the perfect bilingual response.
</p>
</div>
<div id="no-objection-panel" class="no-objection-card consultant-output-card" hidden>
<div class="card-header-title">No customer objection detected</div>
<div id="no-objection-message" class="no-objection-title">This quote does not contain a customer objection.</div>
<div class="no-objection-copy">
Paste a customer concern about price, documents, processing time, trust, location, or visa risk before running the analyzer.
</div>
<div id="no-objection-quote" class="no-objection-quote"></div>
</div>
<div id="result-panel" class="consultant-result-panel" hidden>
<div id="correction-banner" class="correction-banner" hidden>
<strong>Prediction improved by staff correction</strong>
</div>
<div class="card result-quote consultant-result-quote mb-2">
<div>
<div class="card-header-title mb-1">Customer quote</div>
<div id="result-quote-text" class="result-quote-text"></div>
</div>
<div id="result-badges" class="result-badges"></div>
</div>
<div class="grid-3 mb-2 consultant-result-grid">
<div class="card card-tight">
<div class="card-header-title">Objection type</div>
<div id="result-type" class="result-value-big mt-2"></div>
<div id="result-type-conf"></div>
</div>
<div class="card card-tight">
<div class="card-header-title">Cluster</div>
<div id="result-cluster" class="result-value-big mt-2"></div>
<div id="result-cluster-conf"></div>
</div>
<div class="card card-tight">
<div class="card-header-title">Severity</div>
<div id="result-severity" class="mt-2"></div>
<div id="result-video" class="result-meta mt-2"></div>
</div>
</div>
<div class="card result-highlight consultant-perfect-card mb-2">
<div class="consultant-perfect-head">
<div class="card-header-title">Perfect response</div>
<button type="button" class="btn btn-outline btn-sm" onclick="copyPerfectResponse()">Copy</button>
</div>
<div id="result-response" class="result-value mt-2"></div>
</div>
<details class="consultant-extra-details mb-2">
<summary>More response details</summary>
<div class="grid-2 mt-2">
<div class="card">
<div class="card-header-title">Recommended solution</div>
<div id="result-solution" class="result-value mt-2"></div>
</div>
<div class="card">
<div class="card-header-title">Follow-up question</div>
<div id="result-followup" class="result-value mt-2"></div>
</div>
</div>
</details>
<div id="no-response-warn" class="alert alert-info" hidden>
This service and objection exists in the Browse matrix, but its response has not been filled yet.
Add the English and Khmer response from the Browse page when it is ready.
</div>
<div id="service-objection-warn" class="alert alert-info" hidden>
This objection does not exist for this visa service
</div>
<div class="card" id="feedback-section">
<div class="card-header-title">Was this prediction correct?</div>
<div class="flex gap-1 mt-2" id="feedback-btns">
<button class="btn btn-outline" onclick="feedbackYes()">Yes, correct</button>
<button class="btn btn-outline" onclick="feedbackNo()">No, fix it</button>
</div>
<div id="feedback-msg" hidden style="margin-top:0.75rem;font-size:0.9rem;"></div>
<div id="correction-form" hidden style="margin-top:1.5rem; padding-top:1.25rem; border-top:1px solid var(--border);">
<div class="card-header-title text-gold mb-2">Correct the prediction</div>
<div class="grid-2">
<div class="field">
<label class="field-label">Correct Objection Type</label>
<select id="correct-type" class="select" onchange="updateClusterOptions()"></select>
</div>
<div class="field">
<label class="field-label">Correct Cluster</label>
<select id="correct-cluster" class="select"></select>
</div>
</div>
<div class="flex gap-1 mt-2">
<button class="btn btn-primary" onclick="submitCorrection()">Submit correction</button>
<button class="btn btn-outline" onclick="cancelCorrection()">Cancel</button>
</div>
</div>
</div>
<details id="consultant-tips" class="tips-details mt-2">
<summary>Tips for getting the best results</summary>
<div class="tips-body card mt-1">
<ul class="tips-list">
<li><strong>Paste the customer's exact words.</strong> The model was trained on real Explorer by SL chat data - phrasing matters.</li>
<li><strong>One objection at a time.</strong> If a customer raises two concerns, analyze each separately.</li>
<li><strong>Include context if possible.</strong> Selecting the visa type and destination helps the response lookup.</li>
<li><strong>Wrong prediction?</strong> Click <em>No, fix it</em> to submit a correction. The system learns from every correction.</li>
</ul>
</div>
</details>
</div>
</section>
</div>
{% endblock %}
|