Open jcalve opened 11 months ago
Few more examples,
import { Language } from "@nlpjs/language"
const lang = new Language();
const text = 'What is your name?'
console.log(text, lang.guess(text).filter((x, i) => i< 3).map((x) => [x.language, x.score]));
What is your name? [
[ 'Catalan', 0.6079295154185023 ],
[ 'English', 0.5898188937836515 ],
[ 'Tagalog', 0.5824767498776309 ]
What is your name? My name is Akash. [
[ 'Tagalog', 0.8929468157954805 ],
[ 'Igbo', 0.8762839534352888 ],
[ 'English', 0.8621319333485505 ]
]
Language guess mistakes english for catalan. [
[ 'Catalan', 1 ],
[ 'Javanese', 0.9550908467603703 ],
[ 'English', 0.9403496743229345 ]
]
Describe the bug The Language.guess() function mistakes a short english sentence for catalan
To Reproduce 1 - Run this script:
Output
Desktop (please complete the following information):