def get_rel_parts(relations_gold):
    """Extract only discourse relation parts/spans of token ids by relation id from CoNLL16st corpus.

        rel_parts[14905] = {
            'Arg1': (879, 880, 881, 882, 883, 884, 885, 886),
            'Arg1Len': 46,
            'Arg2': (877, 889, 890, 891, 892, 893, 894),
            'Arg2Len': 36,
            'Connective': (878, 888),
            'ConnectiveLen': 6,
            'Punctuation': (),
            'PunctuationLen': 0,
            'PunctuationType': '',
            'DocID': 'wsj_1000',
            'ID': 14905,
            'TokenMin': 877,
            'TokenMax': 894,
            'TokenCount': 17,
        }
    """

    rel_parts = {}
    for rel_id, gold in relations_gold.iteritems():
        doc_id = gold['DocID']
        punct_type = gold['Punctuation']['PunctuationType']

        # short token lists from detailed/gold format to only token id
        arg1_list = tuple( t[2]  for t in gold['Arg1']['TokenList'] )
        arg2_list = tuple( t[2]  for t in gold['Arg2']['TokenList'] )
        conn_list = tuple( t[2]  for t in gold['Connective']['TokenList'] )
        punct_list = tuple( t[2]  for t in gold['Punctuation']['TokenList'] )
        all_list = sum([list(arg1_list), list(arg2_list), list(conn_list), list(punct_list)], [])

        # character lengths of parts
        arg1_len = sum(( (e - b)  for b, e in gold['Arg1']['CharacterSpanList'] ))
        arg2_len = sum(( (e - b)  for b, e in gold['Arg2']['CharacterSpanList'] ))
        conn_len = sum(( (e - b)  for b, e in gold['Connective']['CharacterSpanList'] ))
        punct_len = sum(( (e - b)  for b, e in gold['Punctuation']['CharacterSpanList'] ))

        # save relation parts
        rel = {
            'Arg1': arg1_list,
            'Arg1Len': arg1_len,
            'Arg2': arg2_list,
            'Arg2Len': arg2_len,
            'Connective': conn_list,
            'ConnectiveLen': conn_len,
            'Punctuation': punct_list,
            'PunctuationLen': punct_len,
            'PunctuationType': punct_type,
            'DocID': doc_id,
            'ID': rel_id,
            'TokenMin': min(all_list),
            'TokenMax': max(all_list),
            'TokenCount': len(all_list),
        }
        rel_parts[rel_id] = rel
    return rel_parts