Exemplo n.º 1
0
    def testDecodeSyntheticWord_WordSmallJJ_expectTranslation_99(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result = embedding.decode_synthetic_word('jj')

        #assert
        assertThat(result).matches('99')
Exemplo n.º 2
0
    def testDecodeSyntheticWord_Empty_expectEmpty(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result = embedding.decode_synthetic_word('')

        #assert
        assertThat(result).is_empty()
Exemplo n.º 3
0
    def testDedodeEmbeddingLine_Embedding47_expectSizeOfEmbeddigIs512(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        _, result = embedding.decode_embedding_line(EMBEDDING_OF_47)

        #assert
        assertThat(result).is_nuple(512)
Exemplo n.º 4
0
    def testDedodeEmbeddingLine_Embedding47_expectHasOneDimension(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        _, result = embedding.decode_embedding_line(EMBEDDING_OF_47)

        #assert
        assertThat(result).has_dimensionality(1)
Exemplo n.º 5
0
    def testDecodeEmbeddingLine_Embedding47_expectDecodedIndexIsNotZero(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result, _ = embedding.decode_embedding_line(EMBEDDING_OF_47)

        #assert
        assertThat(result).is_not_zero()
Exemplo n.º 6
0
    def testDecodeSyntheticWord_WordSmallBCDEFGHIJA_expectTranslation_1234567890(
            self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result = embedding.decode_synthetic_word('bcdefghija')

        #assert
        assertThat(result).matches('1234567890')
Exemplo n.º 7
0
    def testDecodeEmbeddingLine_TheUnknownEmbedding_expectDecodedIndexIsZero(
            self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result, _ = embedding.decode_embedding_line(EMBEDDING_OF_UNKNOWN)

        #assert
        assertThat(result).is_zero()