Xenova HF staff commited on
Commit
5da02f5
1 Parent(s): 2652e27

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +15 -0
README.md CHANGED
@@ -14,7 +14,12 @@ library_name: "transformers.js"
14
 
15
 
16
  ```js
 
 
 
17
  let url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
 
 
18
  let transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');
19
  let output = await transcriber(url);
20
  // { text: " And so my fellow Americans ask not what your country can do for you, ask what you can do for your country." }
@@ -23,7 +28,12 @@ let output = await transcriber(url);
23
  **Example:** Transcribe English w/ timestamps.
24
 
25
  ```js
 
 
 
26
  let url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
 
 
27
  let transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');
28
  let output = await transcriber(url, { return_timestamps: true });
29
  // {
@@ -38,7 +48,12 @@ let output = await transcriber(url, { return_timestamps: true });
38
  **Example:** Transcribe English w/ word-level timestamps.
39
 
40
  ```js
 
 
 
41
  let url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
 
 
42
  let transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');
43
  let output = await transcriber(url, { return_timestamps: 'word' });
44
  // {
 
14
 
15
 
16
  ```js
17
+ // npm i @xenova/transformers
18
+ import { pipeline } from '@xenova/transformers';
19
+
20
  let url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
21
+
22
+ // Create translation pipeline
23
  let transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');
24
  let output = await transcriber(url);
25
  // { text: " And so my fellow Americans ask not what your country can do for you, ask what you can do for your country." }
 
28
  **Example:** Transcribe English w/ timestamps.
29
 
30
  ```js
31
+ // npm i @xenova/transformers
32
+ import { pipeline } from '@xenova/transformers';
33
+
34
  let url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
35
+
36
+ // Create translation pipeline
37
  let transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');
38
  let output = await transcriber(url, { return_timestamps: true });
39
  // {
 
48
  **Example:** Transcribe English w/ word-level timestamps.
49
 
50
  ```js
51
+ // npm i @xenova/transformers
52
+ import { pipeline } from '@xenova/transformers';
53
+
54
  let url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
55
+
56
+ // Create translation pipeline
57
  let transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en');
58
  let output = await transcriber(url, { return_timestamps: 'word' });
59
  // {