def delexicalize(self, utterance, usr_acts, sys_acts):
        """
        De-lexicalize an utterance.

        :param utterance: the utterance to delexicalize
        :param usr_acts: user's dialogue acts
        :param sys_acts: system's dialogue acts
        :return: the de-lexicalized utterance
        """

        # Do not track 'bye' utterances as those were generated by taking
        # into account the goal the user had at time
        # of data collection - which is not reflected in randomly sampled
        # goals.
        for pattern in self.bye_patterns:
            if pattern in utterance:
                return 'UNK'

        delex_utterance = deepcopy(utterance)

        # Replace synonyms (we are only generating nlg templates here)
        delex_utterance = delex_utterance.replace('center', 'centre')
        delex_utterance = delex_utterance.replace('cheaply', 'cheap')
        delex_utterance = delex_utterance.replace('moderately', 'moderate')
        delex_utterance = delex_utterance.replace('expensively', 'expensive')

        for dc in self.dontcare_patterns:
            delex_utterance = delex_utterance.replace(dc, 'dontcare')

        # Look for a request (there may also be implicit or explicit confirms)
        sys_req_slot = ''
        for sa in sys_acts:
            if sa['act'] == 'request':
                sys_req_slot = sa['slots'][0][1]
                break

        # Replace each slot value with token
        for usr_act in usr_acts:
            for slot in usr_act['slots']:
                if slot[0] == 'this':
                    if sys_req_slot:
                        slot[0] = sys_req_slot
                    else:
                        continue

                if len(slot) > 1:
                    if usr_act['act'] == 'request':
                        if slot[1] == 'addr':
                            delex_utterance = \
                                delex_utterance.replace(
                                    'address', '<' + slot[1].upper() + '>')

                        elif slot[1] == 'phone':
                            delex_utterance = \
                                delex_utterance.replace(
                                    'phone number',
                                    '<' + slot[1].upper() +
                                    '>')
                            delex_utterance = \
                                delex_utterance.replace(
                                    'phone', '<' + slot[1].upper() + '>')

                        elif slot[1] == 'postcode':
                            delex_utterance = \
                                delex_utterance.replace(
                                    'postcode', '<' + slot[1].upper() + '>')
                            delex_utterance = \
                                delex_utterance.replace(
                                    'post code', '<' + slot[1].upper() + '>')
                            delex_utterance = \
                                delex_utterance.replace(
                                    'postal code', '<' + slot[1].upper() + '>')
                            delex_utterance = \
                                delex_utterance.replace(
                                    'zip code', '<' + slot[1].upper() + '>')

                        else:
                            delex_utterance = \
                                delex_utterance.replace(
                                    slot[1], '<' + slot[1].upper() + '>')
                    else:
                        delex_utterance = \
                            delex_utterance.replace(
                                slot[1], '<' + slot[0].upper() + '>')

        return delex_utterance if '<' in delex_utterance else 'UNK'

        De-lexicalize an utterance.

        :param utterance: the utterance to delexicalize
        :param usr_acts: user's dialogue acts
        :param sys_acts: system's dialogue acts
        :return: the de-lexicalized utterance
        
plato/utilities/parser/parse_dstc2.py