Пример #1
0
    def testDecodeSyntheticWord_WordSmallJJ_expectTranslation_99(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

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

        #assert
        assertThat(result).matches('99')
Пример #2
0
    def testDecodeSyntheticWord_Empty_expectEmpty(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result = embedding.decode_synthetic_word('')

        #assert
        assertThat(result).is_empty()
Пример #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)
Пример #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)
Пример #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()
Пример #6
0
    def testDecodeSyntheticWord_WordSmallBCDEFGHIJA_expectTranslation_1234567890(
            self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

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

        #assert
        assertThat(result).matches('1234567890')
Пример #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()