# Path: dsenser/constants.py
# POS = "PartOfSpeech"
# 
# SNT_ID = 3
# 
# TOK_IDX = 0
# 
# TOK_ID = 4
# 
# TOK_LIST = "TokenList"
# 
# WORDS = "words"
# 
# Path: dsenser/resources.py
# CHM = ConnHeadMapper()
# 
# Path: dsenser/utils.py
# def is_explicit(a_rel):
#     """Check whether given relation is explicit.
# 
#     Args:
#       a_rel (dict):
#        discourse relation to classify
# 
#     Returns:
#       bool:
#         ``True`` if the relation is explicit, ``False`` otherwise
# 
#     """
#     return bool(a_rel[CONNECTIVE][TOK_LIST])


from dsenser.constants import POS, SNT_ID, TOK_IDX, TOK_ID, TOK_LIST, WORDS
from dsenser.scorer.conn_head_mapper import ConnHeadMapper
from dsenser.resources import CHM
from dsenser.utils import is_explicit
from collections import defaultdict
        """
        if is_explicit(a_rel):
            return self.explicit.predict(a_rel, a_data, a_ret, a_i)
        return self.implicit.predict(a_rel, a_data, a_ret, a_i)

    def _free(self):
        """Free resources used by the model.

        """
        del self.explicit
        del self.implicit
        self.n_y = -1

    def _divide_ds(self, a_ds):
        """Separate dataset into explicit and implicit instances.

        Args:
          a_ds (tuple):
            list of gold relations and dict with parses

        Returns:
          tuple:
            trainings set with explicit and implicit connectives

        """
        if not a_ds:
            return (([], {}), ([], {}))
        explicit_instances = []
        implicit_instances = []
        for i, irel in enumerate(a_ds[0]):

# Path: dsenser/constants.py
# POS = "PartOfSpeech"
# 
# SNT_ID = 3
# 
# TOK_IDX = 0
# 
# TOK_ID = 4
# 
# TOK_LIST = "TokenList"
# 
# WORDS = "words"
# 
# Path: dsenser/resources.py
# CHM = ConnHeadMapper()
# 
# Path: dsenser/utils.py
# def is_explicit(a_rel):
#     """Check whether given relation is explicit.
# 
#     Args:
#       a_rel (dict):
#        discourse relation to classify
# 
#     Returns:
#       bool:
#         ``True`` if the relation is explicit, ``False`` otherwise
# 
#     """
#     return bool(a_rel[CONNECTIVE][TOK_LIST])


# Path: dsenser/base.py
from dsenser.constants import POS, SNT_ID, TOK_IDX, TOK_ID, TOK_LIST, WORDS
from dsenser.scorer.conn_head_mapper import ConnHeadMapper
from dsenser.resources import CHM
from dsenser.utils import is_explicit
from collections import defaultdict

        """
        if is_explicit(a_rel):
            return self.explicit.predict(a_rel, a_data, a_ret, a_i)
        return self.implicit.predict(a_rel, a_data, a_ret, a_i)

    def _free(self):
        """Free resources used by the model.

        """
        del self.explicit
        del self.implicit
        self.n_y = -1

    def _divide_ds(self, a_ds):
        """Separate dataset into explicit and implicit instances.

        Args:
          a_ds (tuple):
            list of gold relations and dict with parses

        Returns:
          tuple:
            trainings set with explicit and implicit connectives

        """
        if not a_ds:
            return (([], {}), ([], {}))
        explicit_instances = []
        implicit_instances = []
        for i, irel in enumerate(a_ds[0]):

            if is_explicit(irel):