-
Notifications
You must be signed in to change notification settings - Fork 0
/
root.html
846 lines (827 loc) · 26.7 KB
/
root.html
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-0P0V4JBRGT"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-0P0V4JBRGT");
</script>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=yes"
/>
<title>scout</title>
<style>
html {
line-height: 1.5;
font-family: Georgia, serif;
font-size: 20px;
color: #1a1a1a;
background-color: #fdfdfd;
}
body {
margin: 0 auto;
max-width: 36em;
padding-left: 50px;
padding-right: 50px;
padding-top: 50px;
padding-bottom: 50px;
hyphens: auto;
overflow-wrap: break-word;
text-rendering: optimizeLegibility;
font-kerning: normal;
}
@media (max-width: 600px) {
body {
font-size: 0.9em;
padding: 1em;
}
}
@media print {
body {
background-color: transparent;
color: black;
font-size: 12pt;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3,
h4 {
page-break-after: avoid;
}
}
p {
margin: 1em 0;
}
a {
color: #1a1a1a;
}
a:visited {
color: #1a1a1a;
}
img {
max-width: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 1.4em;
}
h5,
h6 {
font-size: 1em;
font-style: italic;
}
h6 {
font-weight: normal;
}
ol,
ul {
padding-left: 1.7em;
margin-top: 1em;
}
li > ol,
li > ul {
margin-top: 0;
}
blockquote {
margin: 1em 0 1em 1.7em;
padding-left: 1em;
border-left: 2px solid #e6e6e6;
color: #606060;
}
code {
font-family: Menlo, Monaco, "Lucida Console", Consolas, monospace;
font-size: 85%;
margin: 0;
}
pre {
margin: 1em 0;
overflow: auto;
}
pre code {
padding: 0;
overflow: visible;
overflow-wrap: normal;
}
.sourceCode {
background-color: transparent;
overflow: visible;
}
hr {
background-color: #1a1a1a;
border: none;
height: 1px;
margin: 1em 0;
}
table {
margin: 1em 0;
border-collapse: collapse;
width: 100%;
overflow-x: auto;
display: block;
font-variant-numeric: lining-nums tabular-nums;
}
table caption {
margin-bottom: 0.75em;
}
tbody {
margin-top: 0.5em;
border-top: 1px solid #1a1a1a;
border-bottom: 1px solid #1a1a1a;
}
th {
border-top: 1px solid #1a1a1a;
padding: 0.25em 0.5em 0.25em 0.5em;
}
td {
padding: 0.125em 0.5em 0.25em 0.5em;
}
header {
margin-bottom: 4em;
text-align: center;
}
#TOC li {
list-style: none;
}
#TOC a:not(:hover) {
text-decoration: none;
}
code {
white-space: pre-wrap;
}
span.smallcaps {
font-variant: small-caps;
}
span.underline {
text-decoration: underline;
}
div.column {
display: inline-block;
vertical-align: top;
width: 50%;
}
div.hanging-indent {
margin-left: 1.5em;
text-indent: -1.5em;
}
ul.task-list {
list-style: none;
}
pre > code.sourceCode {
white-space: pre;
position: relative;
}
pre > code.sourceCode > span {
display: inline-block;
line-height: 1.25;
}
pre > code.sourceCode > span:empty {
height: 1.2em;
}
.sourceCode {
overflow: visible;
}
code.sourceCode > span {
color: inherit;
text-decoration: inherit;
}
div.sourceCode {
margin: 1em 0;
}
pre.sourceCode {
margin: 0;
}
@media screen {
div.sourceCode {
overflow: auto;
}
}
@media print {
pre > code.sourceCode {
white-space: pre-wrap;
}
pre > code.sourceCode > span {
text-indent: -5em;
padding-left: 5em;
}
}
pre.numberSource code {
counter-reset: source-line 0;
}
pre.numberSource code > span {
position: relative;
left: -4em;
counter-increment: source-line;
}
pre.numberSource code > span > a:first-child::before {
content: counter(source-line);
position: relative;
left: -1em;
text-align: right;
vertical-align: baseline;
border: none;
display: inline-block;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
padding: 0 4px;
width: 4em;
color: #aaaaaa;
}
pre.numberSource {
margin-left: 3em;
border-left: 1px solid #aaaaaa;
padding-left: 4px;
}
div.sourceCode {
}
@media screen {
pre > code.sourceCode > span > a:first-child::before {
text-decoration: underline;
}
}
code span.al {
color: #ff0000;
font-weight: bold;
} /* Alert */
code span.an {
color: #60a0b0;
font-weight: bold;
font-style: italic;
} /* Annotation */
code span.at {
color: #7d9029;
} /* Attribute */
code span.bn {
color: #40a070;
} /* BaseN */
code span.bu {
} /* BuiltIn */
code span.cf {
color: #007020;
font-weight: bold;
} /* ControlFlow */
code span.ch {
color: #4070a0;
} /* Char */
code span.cn {
color: #880000;
} /* Constant */
code span.co {
color: #60a0b0;
font-style: italic;
} /* Comment */
code span.cv {
color: #60a0b0;
font-weight: bold;
font-style: italic;
} /* CommentVar */
code span.do {
color: #ba2121;
font-style: italic;
} /* Documentation */
code span.dt {
color: #902000;
} /* DataType */
code span.dv {
color: #40a070;
} /* DecVal */
code span.er {
color: #ff0000;
font-weight: bold;
} /* Error */
code span.ex {
} /* Extension */
code span.fl {
color: #40a070;
} /* Float */
code span.fu {
color: #06287e;
} /* Function */
code span.im {
} /* Import */
code span.in {
color: #60a0b0;
font-weight: bold;
font-style: italic;
} /* Information */
code span.kw {
color: #007020;
font-weight: bold;
} /* Keyword */
code span.op {
color: #666666;
} /* Operator */
code span.ot {
color: #007020;
} /* Other */
code span.pp {
color: #bc7a00;
} /* Preprocessor */
code span.sc {
color: #4070a0;
} /* SpecialChar */
code span.ss {
color: #bb6688;
} /* SpecialString */
code span.st {
color: #4070a0;
} /* String */
code span.va {
color: #19177c;
} /* Variable */
code span.vs {
color: #4070a0;
} /* VerbatimString */
code span.wa {
color: #60a0b0;
font-weight: bold;
font-style: italic;
} /* Warning */
.display.math {
display: block;
text-align: center;
margin: 0.5rem auto;
}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<h1 id="scout">Scout</h1>
<hr />
<p>
Scout is a lightweight, developer-friendly service that computes, stores,
and indexes sentence embeddings, serving them through a RESTful interface.
Think of it as a mashup of an embedding model, a vector database, and a
querying service, all in a single, easy-to-use package. To use
<code>scout</code>, simply pass us whole sentences (or paragraphs). Scout
will automatically compute embeddings for each sentence and index them.
When you want to query, send another sentence and Scout will return
sentences that are most semantically similar to the query sentence.
</p>
<p>
Scout's embedding model supports
<a
href="https://www.sbert.net/docs/pretrained_models.html#multi-lingual-models"
>50+ languages</a
>
and allows querying using either
<a href="https://www.cs.cmu.edu/~tmalisie/projects/iccv11/"
>Exemplar Support Vector Machine (Exemplar-SVM)</a
>
or cosine similarity. Exemplar-SVM is an alternative to cosine similarity
for ranking that can perform better (at the cost of computing an SVM for
each query):
</p>
<blockquote>
<p>
Random note on k-Nearest Neighbor lookups on embeddings: in my
experience much better results can be obtained by training SVMs instead.
Not too widely known.
</p>
<p>
Short example:
<a
href="https://github.com/karpathy/randomfun/blob/master/knn_vs_svm.ipynb"
>https://github.com/karpathy/randomfun/blob/master/knn_vs_svm.ipynb</a
>
</p>
<p>
Works because SVM ranking considers the unique aspects of your query
w.r.t. data.
</p>
<p>
—
<a href="https://twitter.com/karpathy/status/1647025230546886658"
>Andrej Karpathay (@karpathy)</a
>
</p>
</blockquote>
<p>
Scout can be used to power semantic search or as a pre-filtering step to
reduce prompt sizes for GPT and other costly LLM inputs. Scout can also be
used for topic clustering, recommendation systems, or a variety of other
natural language processing (NLP) tasks.
</p>
<p>
Scout employs
<a
href="https://huggingface.co/sentence-transformers/distiluse-base-multilingual-cased-v2"
><code>distiluse-base-multilingual-cased-v2</code></a
>, a 512-dimensional multilingual sentence embedding model. Remarkably,
inputs in <em>different</em> languages are mapped close in vector space,
allowing for applications across languages. The 53 supported languages
are: ar, bg, ca, cs, da, de, el, en, es, et, fa, fi, fr, fr-ca, gl, gu,
he, hi, hr, hu, hy, id, it, ja, ka, ko, ku, lt, lv, mk, mn, mr, ms, my,
nb, nl, pl, pt, pt-br, ro, ru, sk, sl, sq, sr, sv, th, tr, uk, ur, vi,
zh-cn, zh-tw. This model is based upon
<a href="https://arxiv.org/abs/1908.10084"
>Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks</a
>.
</p>
<p>
Scout is used at <a href="https://homevision.co">HomeVision</a> as a
backend to a number of internal tools and pipelines. HomeVision pipelines
collectively process millions of pages of appraisal text monthly using
NLP, computer vision, and machine learning.
</p>
<p>
<b>Note:</b> This server is itself a running instance of scout, so feel
free to make and create indices and try it out. Just be aware that this
server may be restarted at any time, wiping out any data.
<code>¯\_(ツ)_/¯</code>
</p>
<h2 id="api-documentation">API Documentation</h2>
<details>
<summary>
<code><b>POST</b> /index/{index_name}</code>
<p>Creates an index named <code>index_name</code></p>
</summary>
<h3 id="parameters">Parameters</h3>
<table>
<thead>
<tr class="header">
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>index_name</code></td>
<td>Name of the index to create</td>
</tr>
<tr class="even">
<td>body</td>
<td>
Optional <code>POST</code> body containing an array of
<code>TextBody</code> objects to index. If missing, an empty index
will be created.
</td>
</tr>
</tbody>
</table>
<h3 id="responses">Responses</h3>
<table>
<thead>
<tr class="header">
<th>HTTP Code</th>
<th>Response</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>200</code></td>
<td>Returns <code>IndexResponse</code></td>
</tr>
</tbody>
</table>
<h3 id="example">Example</h3>
<div class="sourceCode" id="cb1">
<pre
class="sourceCode bash"
><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ex">curl</span> <span class="at">-H</span> <span class="st">"Content-Type: application/json"</span> <span class="at">-d</span> <span class="st">'[{"id": "hamlet", "text": "To be, or not to be: that is the question."}, {"id": "julius_caesar", "text": "Friends, Romans, countrymen, lend me your ears."}]'</span> https://goscout.online/index/shakespeare</span></code></pre>
</div>
</details>
<details>
<summary>
<code><b>GET</b> /index/{index_name}</code>
<p>Reads an index named <code>index_name</code></p>
</summary>
<h3 id="parameters-1">Parameters</h3>
<table>
<thead>
<tr class="header">
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>index_name</code></td>
<td>Name of the index to read</td>
</tr>
</tbody>
</table>
<h3 id="responses-1">Responses</h3>
<table>
<thead>
<tr class="header">
<th>HTTP Code</th>
<th>Response</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>200</code></td>
<td>Returns <code>IndexResponse</code></td>
</tr>
</tbody>
</table>
<h3 id="example-1">Example</h3>
<div class="sourceCode" id="cb2">
<pre
class="sourceCode bash"
><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">curl</span> https://goscout.online/index/shakespeare</span></code></pre>
</div>
</details>
<details>
<summary>
<code><b>PUT</b> /index/{index_name}</code>
<p>Updates an index named <code>index_name</code></p>
</summary>
<h3 id="parameters-2">Parameters</h3>
<table>
<thead>
<tr class="header">
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>index_name</code></td>
<td>Name of the index to read</td>
</tr>
<tr class="even">
<td>body</td>
<td>
Required <code>PUT</code> body containing an array of
<code>TextBody</code> objects to index. These text bodies will be
appended to the index.
</td>
</tr>
</tbody>
</table>
<h3 id="responses-2">Responses</h3>
<table>
<thead>
<tr class="header">
<th>HTTP Code</th>
<th>Response</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>200</code></td>
<td>Returns <code>IndexResponse</code></td>
</tr>
</tbody>
</table>
<h3 id="example-2">Example</h3>
<div class="sourceCode" id="cb3">
<pre
class="sourceCode bash"
><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">curl</span> <span class="at">-H</span> <span class="st">"Content-Type: application/json"</span> <span class="at">-X</span> PUT <span class="at">-d</span> <span class="st">'[{"id": "henry_v", "text": "Once more unto the breach, dear friends, once more."}]'</span> https://goscout.online/index/shakespeare</span></code></pre>
</div>
</details>
<details>
<summary>
<code><b>DELETE</b> /index/{index_name}</code>
<p>Deletes an index named <code>index_name</code></p>
</summary>
<h3 id="parameters-3">Parameters</h3>
<p>None</p>
<h3 id="responses-3">Responses</h3>
<table>
<thead>
<tr class="header">
<th>HTTP Code</th>
<th>Response</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>200</code></td>
<td>Returns <code>IndexResponse</code></td>
</tr>
</tbody>
</table>
<h3 id="example-3">Example</h3>
<div class="sourceCode" id="cb4">
<pre
class="sourceCode bash"
><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">curl</span> <span class="at">-X</span> DELETE https://goscout.online/index/shakespeare</span></code></pre>
</div>
</details>
<details>
<summary>
<code
><b>GET</b> /index/{index_name}/query?q={query}&n={num
results}&method={method}</code
>
<p>Queries an index named <code>index_name</code></p>
</summary>
<h3 id="parameters-4">Parameters</h3>
<table>
<thead>
<tr class="header">
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>index_name</code></td>
<td>Name of the index to read</td>
</tr>
<tr class="even">
<td><code>q</code></td>
<td>
Required query parameter of text to query against
<code>index_name</code>
</td>
</tr>
<tr class="odd">
<td><code>n</code></td>
<td>
Optional query param to set number of returned results (default:
<code>3</code>)
</td>
</tr>
<tr class="even">
<td><code>method</code></td>
<td>
Optional query param to set the method. Valid options are
<code>svm</code> for Exemplar SVM, or <code>cosine</code> for
Cosine similarity. (default: <code>svm</code>)
</td>
</tr>
</tbody>
</table>
<h3 id="responses-4">Responses</h3>
<table>
<thead>
<tr class="header">
<th>HTTP Code</th>
<th>Response</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>200</code></td>
<td>Returns an array of <code>SearchResult</code></td>
</tr>
</tbody>
</table>
<h3 id="example-4">Example</h3>
<div class="sourceCode" id="cb5">
<pre
class="sourceCode bash"
><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">curl</span> https://goscout.online/index/shakespeare/query<span class="pp">?</span>q=romans<span class="kw">&</span><span class="va">n</span><span class="op">=</span>2</span></code></pre>
</div>
</details>
<h3 id="api-schema">API Schema</h3>
<details>
<summary>
<code>TextBody</code>
<p>
Represents a sentence to be embedded. The <code>id</code> attribute is
an arbitrary string, meaningful only to the client. The
<code>text</code> attribute can be a sentence or paragraph to be
embedded.
</p>
</summary>
<h5 id="example-5">Example</h5>
<div class="sourceCode" id="cb6">
<pre
class="sourceCode json"
><code class="sourceCode json"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">"id"</span><span class="fu">:</span> <span class="st">"hamlet"</span><span class="fu">,</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">"text"</span><span class="fu">:</span> <span class="st">"To be, or not to be: that is the question."</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre>
</div>
</details>
<details>
<summary>
<code>SearchResult</code>
<p>
Represents a result from a query. In addition to the fields from
<code>TextBody</code>, the <code>score</code> attribute is a float
that represents how well matched the query is to the result.
</p>
</summary>
<h5 id="example-6">Example</h5>
<div class="sourceCode" id="cb7">
<pre
class="sourceCode json"
><code class="sourceCode json"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">"id"</span><span class="fu">:</span> <span class="st">"hamlet"</span><span class="fu">,</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">"text"</span><span class="fu">:</span> <span class="st">"To be, or not to be: that is the question."</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> <span class="st">"score"</span><span class="er">:</span> <span class="fl">0.87</span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre>
</div>
</details>
<details>
<summary>
<code>ErrorResponse</code>
<p>
Returned by the API when encountering an error. The
<code>error</code> attribute is a message with more information about
an error. The status code associated with this response will always be
non-200.
</p>
</summary>
<h5 id="example-7">Example</h5>
<div class="sourceCode" id="cb8">
<pre
class="sourceCode json"
><code class="sourceCode json"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">"ok"</span><span class="fu">:</span> <span class="kw">false</span><span class="fu">,</span></span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">"error"</span><span class="fu">:</span> <span class="st">"An error has occurred"</span></span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre>
</div>
</details>
<details>
<summary>
<code>IndexResponse</code>
<p>
Returned by CRUD action on an index. The <code>index</code> attribute
is the name of the index and the <code>size</code> attribute is the
size of the index at the time of the action.
</p>
</summary>
<h5 id="example-8">Example</h5>
<div class="sourceCode" id="cb9">
<pre
class="sourceCode json"
><code class="sourceCode json"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">"index"</span><span class="fu">:</span> <span class="st">"shakespeare"</span><span class="fu">,</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">"size"</span><span class="fu">:</span> <span class="dv">1431</span></span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre>
</div>
</details>
<h2 id="source-code-technical-notes-installation">
Source Code, Technical Notes, Installation
</h2>
<p>
The source code for <code>scout</code> can be found at
<a href="https://github.com/homevision/rs-scout"
><a href="https://github.com/homevision/rs-scout"
>https://github.com/homevision/rs-scout</a
></a
>. Scout is written in Rust (built using <code>v1.69.0</code>) and targets
<code>x86_64</code> architectures. Note: you must be able to build
PyTorch's C++ bindings as this is a required dependency. Scout's
Exemplar-SVM querying is powered by
<a href="https://www.csie.ntu.edu.tw/~cjlin/liblinear/"
><code>liblinear</code></a
>, the same library used to power fast SVM training in
<a
href="https://scikit-learn.org/stable/modules/generated/sklearn.svm.LinearSVC.html"
><code>scikit-learn</code></a
>. For the time being, <code>rs-scout</code> does <em>not</em> compile on
Apple Silicon.
</p>
<h3 id="installationexecution">Installation/Execution</h3>
<ol type="1">
<li>
Download repository:
<code
>git clone git@github.com:HomeVision/rs-scout.git && cd
rs-scout</code
>
</li>
<li>
Download and convert model weights using
<a
href="https://github.com/cpcdoy/rust-sbert#convert-models-from-python-to-rust"
><code>rust-sbert</code></a
>
to <code>./models</code>
</li>
<li>Start server: <code>cargo run</code></li>
<li>Test server: <code>curl http://localhost:8000</code></li>
</ol>
<h2 id="questions-comments-or-feedback-welcome">
Questions, Comments, or Feedback Welcome
</h2>
<p>
Please find me on twitter at
<a href="https://twitter.com/vincentchu">@vincentchu</a>.
</p>
</body>
</html>