qmaru commited on
Commit
eade331
·
verified ·
1 Parent(s): 28be1fc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +19 -2
README.md CHANGED
@@ -1,8 +1,25 @@
1
  ---
2
  license: mit
3
- base_model: Helsinki-NLP/opus-mt-en-zh
4
  library_name: transformers.js
5
- pipeline_tag: translation
6
  ---
7
 
8
  https://huggingface.co/alexneakameni/language_detection with ONNX weights to be compatible with Transformers.js.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ base_model: alexneakameni/language_detection
4
  library_name: transformers.js
5
+ pipeline_tag: text-classification
6
  ---
7
 
8
  https://huggingface.co/alexneakameni/language_detection with ONNX weights to be compatible with Transformers.js.
9
+
10
+ ```javascript
11
+ import { pipeline } from "@huggingface/transformers"
12
+
13
+ const classifier = await pipeline('text-classification', 'qmaru/language_detection')
14
+ const output = await classifier('I hate you!', { top_k: 6 })
15
+ console.log(output)
16
+ // [
17
+ // { label: 'eng_Latn', score: 0.6555308103561401 },
18
+ // { label: 'srd_Latn', score: 0.086576908826828 },
19
+ // { label: 'ita_Latn', score: 0.024977771565318108 },
20
+ // { label: 'als_Latn', score: 0.019376492127776146 },
21
+ // { label: 'fur_Latn', score: 0.016824522987008095 },
22
+ // { label: 'fra_Latn', score: 0.015999119728803635 }
23
+ // ]
24
+
25
+ ```