import abc
import logging
from decoder.dot_product_decoder import DotProductDecoder
from decoder.mlp_decoder import MLPDecoder


class DecoderFactory:

    def __init__(self):
        pass
    def get_decoder(self, config, embeddings=None):
        if config.decoder_model == 'mlp':
            logging.info('MLP is selected as decoder.')
            return MLPDecoder(config, embeddings)
        elif config.decoder_model == 'dot_product':
            logging.info('Dot Product is selected as decoder.')
            return DotProductDecoder(config)
        else:
            logging.error('No such decoder name as ' + config.decoder_model)
            raise ValueError('Define the decoder')