Skip to content

Instantly share code, notes, and snippets.

View CookiePPP's full-sized avatar

Cookie CookiePPP

View GitHub Profile
@CookiePPP
CookiePPP / stepwise.py
Last active August 15, 2020 11:24 — forked from mutiann/stepwise.py
Stepwise Monotonic Attention
'''
Forked From:
https://gist.github.com/mutiann/38a7638f75c21479582d7391490df37c
Implementation for https://arxiv.org/abs/1906.00672
Tips: You may use "hard" for hard inference, or "parallel" for training or
soft inference.
You possibly have to tune the score_bias_init, which, similar to that in Raffel et al., 2017, is determined a priori to
# -*- coding: utf-8 -*-
""" Use torchMoji to score texts for emoji distribution.
The resulting emoji ids (0-63) correspond to the mapping
in emoji_overview.png file at the root of the torchMoji repo.
Writes the result to a csv file.
"""
from __future__ import print_function, division, unicode_literals