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

Expose predicted probabilities #52

Open
loretoparisi opened this issue Mar 13, 2019 · 2 comments
Open

Expose predicted probabilities #52

loretoparisi opened this issue Mar 13, 2019 · 2 comments

Comments

@loretoparisi
Copy link

loretoparisi commented Mar 13, 2019

An internal function of CLD2, int GetLangScore(uint32 probs, uint8 pslang) let you get the score of a language by language probability.
This is used in several points to calculate the score of a language, given the top 3 languages predicted like here:

if (indirect < static_cast<int>(obj->kCLDTableSizeOne)) {
    // Up to three languages at indirect
    uint32 langprob = obj->kCLDTableInd[indirect];
    return GetLangScore(langprob, lang1) - GetLangScore(langprob, lang2);
  }

I would like to get the opposite, hence to get the probabilities for each language, referred in the code as langprob.

There are some internal testing function like string GetLangProbTxt(const ScoringContext* scoringcontext, uint32 langprob) that seems to print out these probabilities here, so in theory it should be easier as

uint32 langprob = base_obj->kCLDTableInd[indirect];
retval.append(GetLangProbTxt(scoringcontext, langprob));
@loretoparisi loretoparisi changed the title Expose predicte lprobabilities Expose predicted probabilities Mar 13, 2019
@loretoparisi
Copy link
Author

Any news on this?

@dachev
Copy link
Owner

dachev commented Jul 20, 2020

I'll take a look when I have the time but it will probably be months before I get to it.

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