I am using NLTK to train a bigram model using a Laplace estimator. The contructor for the NgramModel is:
def __init__(self, n, train, pad_left=True, pad_right=False,
estimator=None, *estimator_args, **estimator_kwargs):
After some research, I found that a syntax that works is the following:
bigram_model = NgramModel(2, my_corpus, True, False, lambda f, b:LaplaceProbDist(f))
Although it seems to work correctly, I am confused about the last two arguments. Mainly, why is the 'estimator' argument a lambda function and how is interacting with the LaplaceProbDist?