Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #%% (0) Important libraries | |
| import tensorflow as tf | |
| import numpy as np | |
| from numpy import random | |
| import matplotlib.pyplot as plt | |
| from IPython import display | |
| % matplotlib inline | |
| #%% (1) Dataset creation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from gensim import models | |
| sentence = models.doc2vec.LabeledSentence( | |
| words=[u'so`bme', u'words', u'here'], tags=["SENT_0"]) | |
| sentence1 = models.doc2vec.LabeledSentence( | |
| words=[u'here', u'we', u'go'], tags=["SENT_1"]) | |
| sentences = [sentence, sentence1] | |
| class LabeledLineSentence(object): |