diff --git a/seq2seq/textsum/convert_data.py b/seq2seq/textsum/convert_data.py index 148dcc5c9c0..3f960d0a4d0 100755 --- a/seq2seq/textsum/convert_data.py +++ b/seq2seq/textsum/convert_data.py @@ -8,6 +8,10 @@ import pickle import re +import sys +sys.path.append('../../lib') +import labeler + # Special tokens PARAGRAPH_START = '

' PARAGRAPH_END = '

' @@ -18,21 +22,6 @@ DOCUMENT_START = '' DOCUMENT_END = '' -# Labels -BUG = 'bug' -FEATURE = 'feature' -PERFORMANCE = 'performance' -RELIABILITY = 'reliability' -MAINTENANCE = 'maintenance' - -fs_labeler = { - 'b':BUG, - 'f':FEATURE, - 'p':PERFORMANCE, - 'c':RELIABILITY, - 'misc':MAINTENANCE, -} - def to_skip(token): return token in '={}<>()[]--' or '=' in token @@ -49,7 +38,7 @@ def get_tokens(string, counter): return tokens def parse_patch(patch): - label = fs_labeler[patch['type']] + label = FS_LABELER[patch['type']] lines = patch['message'].splitlines() assert patch['subject'] == lines[0].strip() return label, lines