-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathconstants.py
39 lines (32 loc) · 863 Bytes
/
constants.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
Constants shared across files.
"""
import re
# special tokens and number regex
UNK = '_UNK' # unk/OOV word/char
WORD_START = '<w>' # word star
WORD_END = '</w>' # word end
NUM = 'NUM' # number normalization string
NUMBERREGEX = re.compile("[0-9]+|[0-9]+\\.[0-9]+|[0-9]+[0-9,]+")
# tasks
POS = 'pos' # part-of-speech tagging
CHUNK = 'chunk' # chunking
SRL = 'srl' # semantic role labeling
NER = 'ner' # named entity recognition
TASK_NAMES = [POS, CHUNK, SRL, NER]
# domains
DOMAINS = ['bc', 'bn', 'mz', 'nw', 'wb', 'tc', 'pt']
# model files
MODEL_FILE = 'sluice_net.model'
PARAMS_FILE = 'sluice_net_params.pkl'
# optimizers
SGD = 'sgd'
ADAM = 'adam'
# type of layer connections
STITCH = 'stitch'
CONCAT = 'concat'
SKIP = 'skip'
NONE = 'none'
# cross-stitch and layer-stitch initialization schemes
BALANCED = 'balanced'
IMBALANCED = 'imbalanced'