An electronic device for natural language understanding includes at least one memory and at least one processor coupled to the at least one memory. The at least one processor is configured to process an utterance using a trained model. The at least one processor is also configured to replace a first portion of the utterance with a first token, where the first token represents a semantic role of the first portion of the utterance based on a slot vocabulary. The at least one processor is further configured to determine a slot value in the utterance based on the first token. In addition, the at least one processor is configured to perform a task corresponding to the utterance based on the determined slot value.