November 2018
Beginner to intermediate
182 pages
4h 48m
English
One simple technique for assessing any vectorization method is to simply use the training corpus as the test corpus. Of course, we expect that we will overfit our model to the training set, but that's fine.
We can use the training corpus as a test corpus by doing the following:
Let's do this in code, as follows:
ranks = []for idx in range(len(ted_talk_docs)): inferred_vector = model.infer_vector(ted_talk_docs[idx].words) sims = model.docvecs.most_similar([inferred_vector], topn=len(model.docvecs)) rank = [docid for docid, ...
Read now
Unlock full access