language_detection / README.md
qmaru's picture
Update README.md
eade331 verified
---
license: mit
base_model: alexneakameni/language_detection
library_name: transformers.js
pipeline_tag: text-classification
---
https://huggingface.co/alexneakameni/language_detection with ONNX weights to be compatible with Transformers.js.
```javascript
import { pipeline } from "@huggingface/transformers"
const classifier = await pipeline('text-classification', 'qmaru/language_detection')
const output = await classifier('I hate you!', { top_k: 6 })
console.log(output)
// [
// { label: 'eng_Latn', score: 0.6555308103561401 },
// { label: 'srd_Latn', score: 0.086576908826828 },
// { label: 'ita_Latn', score: 0.024977771565318108 },
// { label: 'als_Latn', score: 0.019376492127776146 },
// { label: 'fur_Latn', score: 0.016824522987008095 },
// { label: 'fra_Latn', score: 0.015999119728803635 }
// ]
```