#!/usr/bin/env python
# -*- coding: utf-8; mode: python; -*-

"""Module providing abstract interface class for LSTM sense calssification.

Attributes:
  LSTMBaseSenser (class):
    abstract class defining interface for explicit and implicit classifier

"""

##################################################################
# Imports
from __future__ import absolute_import, print_function

from dsenser.nnbase import NNBaseSenser
from dsenser.theano_utils import floatX, theano, HE_UNIFORM, ORTHOGONAL, TT

import gc
import numpy as np

##################################################################
# Variables and Constants
TRUNCATE_GRADIENT = 20


##################################################################
# Class
class LSTMBaseSenser(NNBaseSenser):
    """Abstract class for LSTM disambiguation of relation senses.

    Attributes:
      n_y (int): number of distinct classes

    """

    def batch_predict(self, a_rels, a_data, a_ret):
        """Method for predicting sense of multiple relations.

        Args:
          a_rels (list):
            list of input relations
          a_data (2-tuple(dict, dict)):
            list of input JSON data
          a_ret (np.array):
            prediction matrix

        Returns:
          void:

        Note:
          updates ``a_ret`` in place