File size: 710 Bytes
c45d283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python3
# coding=utf-8

import torch
import torch.nn as nn
import torch.nn.functional as F

from model.head.abstract_head import AbstractHead
from data.parser.to_mrp.sequential_parser import SequentialParser
from utility.cross_entropy import cross_entropy


class SequentialHead(AbstractHead):
    def __init__(self, dataset, args, initialize):
        config = {
            "label": True,
            "edge presence": False,
            "edge label": False,
            "anchor": True,
            "source_anchor": True,
            "target_anchor": True
        }
        super(SequentialHead, self).__init__(dataset, args, config, initialize)
        self.parser = SequentialParser(dataset)