-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
47 lines (29 loc) · 1.25 KB
/
Copy pathconfig.py
File metadata and controls
47 lines (29 loc) · 1.25 KB
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
40
41
42
43
44
45
46
47
import re
# General configurations
get_cpts = lambda df, bid:\
sorted(list(set(df.loc[bid].index.get_level_values(0).tolist())),
key=lambda x: int(re.search(r'\d+', x).group()))
get_bullets = lambda df, bid, cpt: df.loc[bid, cpt].bullets[0]
TOKEN_MAX_LEN = 45 # max length of a word
PARA_MIN_LEN = 2 # minimum length for a sentence/paragraph
REPLACE_ABBR = False # set to True to replace abbreviations
SPECIAL_CHAR_FILE = '/home/marco/epfl/magma/special_char_file.txt'
REMOVE_PAR = False # set to True to remove text between parentheses
SEED = 42 # random seed, set for reproducibility
MODEL_MAX_LEN = 1019 # maximum input length fro BART and PEGASUS
BULLETS_MIN_LEN = 50
BULLETS_MED_LEN = 180 # gold summaries median length
BULLETS_MAX_LEN = 350
ONE_BULLET_MIN_LEN = 10
ONE_BULLET_MED_LEN = 30
ONE_BULLET_MAX_LEN = 150
LENGTH_PENALTY = 1
NUM_BEAMS = 4
NO_REPEAT_NGRAM_SIZE = 5
MAX_RATIO = 0.25 # maximum text ratio
ROUGE_TYPES = ['rouge1', 'rouge2', 'rougeL']
# assign the bullets based on this ROUGE type (1, 2, or L)
ROUGE_TYPE_RECALL = 'rougeL_recall'
MAGMA_DIR = '/home/marco/epfl/magma/'
# Datasets path
DATASET_PATH = MAGMA_DIR+'datasets/'