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

Subtract a low order n-gram LM from a high order n-gram LM #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

csukuangfj
Copy link
Owner

TODOs

  • need to update the documentation
  • Visualize the result

@@ -118,13 +118,33 @@ class OptimizedHistKey {

} // namespace

class ArpaLmCompilerImplInterface {
public:
virtual ~ArpaLmCompilerImplInterface() = default;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any chance of some short comments here explaining the interface?
the only other comment I have is, of course check it doesn't change the behavior for normal inputs.

StateId dest;
Symbol sym = ngram.words.back();
float weight = -ngram.logprob;
float backoff = -ngram.backoff;

if (low_order == nullptr) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it necessary that the lm to subtract is actually of lower order? If it would work regardless, we might as well make it as general as possible and name it accordingly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... if it can be done elegantly, we can consider generaly linear combinations of logprobs, not just one minus the other.

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

Successfully merging this pull request may close these issues.

2 participants