Skip to content

Commit 8d948bf

Browse files
1wheeljenpersonmattsoulanille
authored
Add custom vocab instructions to USE (#294)
Co-authored-by: Jen Person <[email protected]> Co-authored-by: Matthew Soulanille <[email protected]>
1 parent f5907d8 commit 8d948bf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

universal-sentence-encoder/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ use.loadTokenizer().then(tokenizer => {
8383
});
8484
```
8585

86+
87+
Pass a path to the Tokenizer to use a different vocabulary:
88+
89+
```js
90+
use.loadTokenizer('https://storage.googleapis.com/learnjs-data/bert_vocab/vocab.json').then(tokenizer => {
91+
tokenizer.encode('Hello, how are you?'); // [0, 15350, 29623, 2129, 2024, 2017, 29632]
92+
});
93+
```
94+
8695
To use the QnA dual encoder:
8796
```js
8897
// Load the model.

0 commit comments

Comments
 (0)