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

Repeating string yields different results #52

Open
bittlingmayer opened this issue Mar 21, 2016 · 0 comments
Open

Repeating string yields different results #52

bittlingmayer opened this issue Mar 21, 2016 · 0 comments

Comments

@bittlingmayer
Copy link

Knowing that most lang id systems perform worse on short strings, I have been experimenting with normalising the length:

MIN_LEN = 30
id = langid.rank(s)[0]
print langid.rank(s)[0]
while len(s) < MIN_LEN:
    s += '  ' + s
    print langid.rank(s)[0]
len_norm_id = langid.rank(s)[0]

I have noticed the following:

If id ie the original score was correct, the probability increases significantly after length normalisation.

If not, the probability only increases < ~10% or the identified language changes (usually to another incorrect language).

It is not a golden rule, but it is reliable enough that we could use it to:

  • increase probability on short strings
  • return 'und' in the cases where it is very fickle
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

1 participant