<jupyter_start><jupyter_text>Loading Model<jupyter_code>model = fasttext.load_model('../example/models/news_skipgram_subword_01.bin')<jupyter_output><jupyter_text>Selecting random words and read wordvects<jupyter_code>nword = len(model.words)
nsample = 250
words = []
vectors = []
np.random.seed(1970)
for ix in np.random.randint(low = 0, high = nword-1, size = nsample):
    word = model.words[ix]
    vec = model.get_word_vector(word)
    words.append(word)
    vectors.append(vec)<jupyter_output><empty_output><jupyter_text>Plot word vectors<jupyter_code>pca_plot(words,vectors,36)<jupyter_output><empty_output><jupyter_text>Read sample words<jupyter_code>fp = open('words.txt','rt')
words = [ x.strip() for x in fp.readlines()]
fp.close()<jupyter_output><empty_output><jupyter_text>Unsuprevised Model tranined with skipgram + subwords<jupyter_code>model = fasttext.load_model('../example/models/news_skipgram_subword_01.bin')
vectors = get_vectors(model,words)
pca_plot(words,vectors,16)<jupyter_output><jupyter_text>Unsuprevised Model tranined with skipgram + without subwords<jupyter_code>model = fasttext.load_model('../example/models/news_skipgram_02.bin')
vectors = get_vectors(model,words)
pca_plot(words,vectors,16)<jupyter_output><jupyter_text>Unsuprevised Model tranined with cbow + subwords<jupyter_code>model = fasttext.load_model('../example/models/news_cbow_subwords_01.bin')
vectors = get_vectors(model,words)
pca_plot(words,vectors,16)<jupyter_output><jupyter_text>Unsuprevised Model tranined with cbow + without subwords<jupyter_code>model = fasttext.load_model('../example/models/news_cbow_02.bin')
vectors = get_vectors(model,words)
pca_plot(words,vectors,16)<jupyter_output>
{'fraction_non_alphanumeric': 0.1278727165586329, 'fraction_numerical': 0.01708898055391868, 'mean_word_length': 8.929824561403509, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '602784', 'license': 'MIT', 'n_tokens_mistral': 670, 'n_tokens_neox': 627, 'n_words': 79, 'path': 'example/wordvect_plots.ipynb', 'repo_name': 'birolkuyumcu/fastext_gui', 'size': '1697'}