File size: 8,080 Bytes
e94e407
d806877
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e94e407
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
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta
      http-equiv="Content-Security-Policy"
      content="default-src 'self'; script-src 'self'; style-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'none'"
    />
    <title>Local Label Queue</title>
    <link rel="stylesheet" href="style.css" />
    <script type="module" src="app.mjs"></script>
  </head>
  <body>
    <main>
      <header>
        <p class="eyebrow">WIDECHAOS / LOCAL LABEL QUEUE</p>
        <h1>Annotate text. Keep the unfinished records.</h1>
        <p class="lede">
          A browser queue with explicit labels, abstentions and portable
          checkpoints.
        </p>
        <p class="memory-note">
          Decisions stay in this page's memory. Download a checkpoint before
          closing or reloading; there is no automatic backup.
        </p>
      </header>
      <div class="workspace">
        <aside>
          <section>
            <h2>Start or restore</h2>
            <details id="setup" open>
              <summary>New session setup</summary>
              <label for="items">Inventory JSONL</label
              ><textarea
                id="items"
                rows="9"
                spellcheck="false"
                aria-describedby="setup-help"
              ></textarea>
              <p id="setup-help" class="hint">
                Each line: id, group, text. Use null for an unknown group. Up to
                1,000 records / 1 MiB UTF-8. The sample has 12 synthetic items
                with no gold labels.
              </p>
              <label for="taxonomy">Labels · one per line</label
              ><textarea id="taxonomy" rows="3" spellcheck="false">
bug
question
example</textarea
              >
              <p class="hint">
                Use 2–9 distinct labels. Editing setup leaves the active session
                unchanged until you start it.
              </p>
              <p class="replace-note">
                Starting replaces current decisions. Download their checkpoint
                first if you need them.
              </p>
              <button id="start" disabled>Start new session</button>
            </details>
            <div class="restore">
              <label for="checkpoint-file">Checkpoint JSON file</label
              ><input
                id="checkpoint-file"
                type="file"
                accept=".json,application/json"
              />
              <p class="hint">
                Files are read locally, not uploaded. A verified preview appears
                before replacement.
              </p>
              <div id="restore-preview" hidden>
                <p id="preview-summary"></p>
                <p id="preview-hash" class="mono hint"></p>
                <button id="replace" class="secondary">
                  Replace session with this checkpoint
                </button>
              </div>
            </div>
            <p class="hint">
              Checksums detect inconsistent content. Anyone can modify and
              rehash a file; this is not a signature or authenticity check.
            </p>
          </section>
          <section id="save-pane" hidden>
            <h2>Keep a checkpoint</h2>
            <p id="save-state" class="save-state"></p>
            <button id="prepare">Prepare current downloads</button>
            <div id="downloads" class="downloads"></div>
            <p class="hint">
              Both files include all source texts, ids, groups and current
              decisions. Check contents before sharing. Downloading annotations
              does not save a resumable checkpoint.
            </p>
          </section>
        </aside>
        <div>
          <p id="status" role="status" aria-live="polite">
            Loading synthetic inventory…
          </p>
          <p id="error" role="alert" tabindex="-1" hidden></p>
          <div id="initial" class="placeholder">
            Start a session or restore a verified checkpoint to review records.
          </div>
          <section id="session-pane" hidden>
            <h2>Active session</h2>
            <div id="counts" class="counts"></div>
            <p id="reviewed" class="hint"></p>
            <progress
              id="progress"
              max="1"
              value="0"
              aria-label="Reviewed fraction, including abstentions"
            ></progress>
            <p id="inventory-hash" class="mono hint"></p>
            <div class="controls">
              <div>
                <label for="filter">Queue filter</label
                ><select id="filter">
                  <option value="all">All records</option>
                  <option value="unlabelled">Unlabelled</option>
                  <option value="labelled">Labelled</option>
                  <option value="abstained">Abstained</option>
                </select>
              </div>
              <div>
                <label for="jump">Jump to record</label
                ><select id="jump"></select>
              </div>
            </div>
            <div class="navigation">
              <button id="previous" class="secondary">Previous record</button
              ><span id="position"></span
              ><button id="next" class="secondary">Next record</button>
            </div>
            <article
              id="record-panel"
              tabindex="0"
              aria-label="Current annotation record"
              aria-describedby="shortcuts"
            >
              <div id="empty-record" hidden></div>
              <div id="record" hidden>
                <p id="record-id" class="record-id"></p>
                <p id="record-group" class="hint"></p>
                <blockquote id="source-text"></blockquote>
                <p id="decision" class="decision"></p>
                <div
                  id="label-buttons"
                  role="group"
                  aria-label="Choose a label"
                  class="label-buttons"
                ></div>
                <div class="actions">
                  <button id="abstain" class="secondary">Abstain · A</button
                  ><button id="clear" class="secondary">Clear decision</button>
                </div>
              </div>
            </article>
            <div class="actions undo-row">
              <button id="undo" class="secondary">
                Undo last decision · U
              </button>
              <p id="undo-count" class="hint"></p>
            </div>
            <p id="shortcuts" class="hint">
              Keyboard: 1–9 choose a label, A abstains, U undoes. Shortcuts are
              inactive inside text and selection inputs. A decision advances to
              the next unlabelled item, switching to All if needed.
            </p>
            <details>
              <summary>Counts by label</summary>
              <div class="table-wrap">
                <table>
                  <thead>
                    <tr>
                      <th scope="col">Label</th>
                      <th scope="col">Records</th>
                    </tr>
                  </thead>
                  <tbody id="label-counts"></tbody>
                </table>
              </div>
            </details>
            <p class="hint">
              Reviewed includes abstentions. Completion is not evidence that
              labels are correct; every record remains in exports.
            </p>
          </section>
        </div>
      </div>
      <footer>
        <p>
          Local memory and explicit downloads · no models, uploads, browser
          storage or telemetry ·
          <a href="README.md">Format and reproducible checks</a>
        </p>
        <p lang="zh">
          标签、弃权、未完成分别保留。刷新前下载检查点,恢复先校验再明确替换;哈希不证明文件来源或标注正确性。
        </p>
      </footer>
    </main>
  </body>
</html>