In a sentence completion test one word of a sentence is missing and you must pick it from a few candidates. Mikolov et al. scored each candidate with a trained skip-gram model: put the candidate at the input, predict every other word of the sentence, and add up the log-probabilities. Write the scorer and the chooser.
The skip-gram model has an input table W_in and an output table W_out, both float arrays of shape (V, d). For an input word the probability of a word is the softmax
sentence_score(W_in, W_out, sentence, blank, candidate) -> float
sentence: a list of word ids; blank: the index of the missing word (the id stored there is a placeholder and must be ignored); candidate: a word id.0.0.complete_sentence(W_in, W_out, sentence, blank, candidates) -> tuple
candidates: a non-empty list of word ids.(best, scores): scores lists each candidate's sentence score rounded to 4 decimals, in the order given, and best is the candidate with the highest unrounded score (ties go to the earlier candidate).