This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
class BiaffineAttention(torch.nn.Module): | |
"""Implements a biaffine attention operator for binary relation classification. | |
PyTorch implementation of the biaffine attention operator from "End-to-end neural relation | |
extraction using deep biaffine attention" (https://arxiv.org/abs/1812.11275) which can be used | |
as a classifier for binary relation classification. |
OlderNewer