Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language guess mistakes english for catalan #1364

Open
jcalve opened this issue Dec 12, 2023 · 1 comment
Open

Language guess mistakes english for catalan #1364

jcalve opened this issue Dec 12, 2023 · 1 comment

Comments

@jcalve
Copy link

jcalve commented Dec 12, 2023

Describe the bug
The Language.guess() function mistakes a short english sentence for catalan

To Reproduce
1 - Run this script:

import { Language } from "@nlpjs/language"

const lang = new Language();
const text = 'What is your name?'
console.log(text, lang.guess(text, ['es', 'en', 'ca']))

Output

What is your name? [
  { alpha3: 'cat', alpha2: 'ca', language: 'Catalan', score: 1 },
  {
    alpha3: 'eng',
    alpha2: 'en',
    language: 'English',
    score: 0.9702093397745571
  },
  {
    alpha3: 'spa',
    alpha2: 'es',
    language: 'Spanish',
    score: 0.7093397745571659
  }
]

Desktop (please complete the following information):

  • OS: Windows
  • Package version: 4.26.1
  • Node: 16
@ackava
Copy link

ackava commented Sep 26, 2024

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 ]
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants