Example #1
0
    def test_get_top_words_limit_tokens(self):
        "Top words with limit on the number of tokens"

        top_words = corpus.get_top_words(self.tokens,
                                         self.activations,
                                         0,
                                         num_tokens=10)
        self.assertEqual(len(top_words), 10)
Example #2
0
    def test_get_top_words_3(self):
        "Basic top words evaluation"

        top_words = corpus.get_top_words(self.tokens, self.activations, 2)

        tokens = map(lambda x: x[0], top_words)
        tokens = [x[:14] for x in tokens]
        self.assertNotIn("neuron_1_token", tokens)
        self.assertNotIn("neuron_2_token", tokens)