(self)
return self._weights
Mapping of term string (or term#POS, if :attr:`DepecheMood.word_rep` is "lemmapos")
        to the terms' normalized weights on a fixed set of affective dimensions
        (aka "emotions").
Mapping of term string (or term#POS, if :attr:`DepecheMood.word_rep` is "lemmapos")
        to the terms' normalized weights on a fixed set of affective dimensions
        (aka "emotions").
Mapping of term string ( or term#POS if : attr : DepecheMood . word_rep is lemmapos ) to the terms normalized weights on a fixed set of affective dimensions ( aka emotions ) .
def weights(self) -> Dict[str, Dict[str, float]]:
        """
        Mapping of term string (or term#POS, if :attr:`DepecheMood.word_rep` is "lemmapos")
        to the terms' normalized weights on a fixed set of affective dimensions
        (aka "emotions").
        """
        if not self._weights:
            if not self.filepath:
                raise OSError(
                    "resource file {} not found;\n"
                    "has the data been downloaded yet?".format(self._filepath)
                )
            with io.open(self.filepath, mode="rt", encoding="utf-8") as csvfile:
                csv_reader = csv.reader(csvfile, delimiter="\t")
                rows = list(csv_reader)
            cols = rows[0]
            self._weights = {
                row[0]: {col: float(val) for col, val in zip(cols[1:-1], row[1:-1])}
                for row in rows[1:]
                if int(row[-1]) >= self.min_freq
            }
        return self._weights
def weights ( self ) -> Dict [ str , Dict [ str , float ] ] : if not self . _weights : if not self . filepath : raise OSError ( "resource file {} not found;\n" "has the data been downloaded yet?" . format ( self . _filepath ) ) with io . open ( self . filepath , mode = "rt" , encoding = "utf-8" ) as csvfile : csv_reader = csv . reader ( csvfile , delimiter = "\t" ) rows = list ( csv_reader ) cols = rows [ 0 ] self . _weights = { row [ 0 ] : { col : float ( val ) for col , val in zip ( cols [ 1 : - 1 ] , row [ 1 : - 1 ] ) } for row in rows [ 1 : ] if int ( row [ - 1 ] ) >= self . min_freq } return self . _weights