A device for processing a keyboard input, based on training, the device comprising: a screen; a memory storing at least one instruction; and a processor configured to execute the at least one instruction to: display a keyboard, from a plurality of keyboards of different shapes and sizes, on the screen of the device; receive a swipe input of a user, the swipe input connecting a plurality of keys on the displayed keyboard; extract a trajectory connecting the plurality of keys on the displayed keyboard, based on the swipe input; generate coordinate information of the displayed keyboard indicating a shape and size of the displayed keyboard; generate coordinate information of the trajectory indicating a shape and size of the trajectory; normalize the trajectory based on the generated coordinate information of the displayed keyboard and coordinate information of the trajectory; apply, to a trained model for the keyboard input, based on the normalized trajectory, normalized trajectory information indicating a shape of the normalized trajectory and a relative position of the normalized trajectory with respect to the displayed keyboard of the plurality of keyboards of different shapes and sizes; and determine a plurality of input characters corresponding to the trajectory, based on a result of the applying the normalized trajectory information. a screen; a memory storing at least one instruction; and a processor configured to execute the at least one instruction to: display a keyboard, from a plurality of keyboards of different shapes and sizes, on the screen of the device; receive a swipe input of a user, the swipe input connecting a plurality of keys on the displayed keyboard; extract a trajectory connecting the plurality of keys on the displayed keyboard, based on the swipe input; generate coordinate information of the displayed keyboard indicating a shape and size of the displayed keyboard; generate coordinate information of the trajectory indicating a shape and size of the trajectory; normalize the trajectory based on the generated coordinate information of the displayed keyboard and coordinate information of the trajectory; apply, to a trained model for the keyboard input, based on the normalized trajectory, normalized trajectory information indicating a shape of the normalized trajectory and a relative position of the normalized trajectory with respect to the displayed keyboard of the plurality of keyboards of different shapes and sizes; and determine a plurality of input characters corresponding to the trajectory, based on a result of the applying the normalized trajectory information. display a keyboard, from a plurality of keyboards of different shapes and sizes, on the screen of the device; receive a swipe input of a user, the swipe input connecting a plurality of keys on the displayed keyboard; extract a trajectory connecting the plurality of keys on the displayed keyboard, based on the swipe input; generate coordinate information of the displayed keyboard indicating a shape and size of the displayed keyboard; generate coordinate information of the trajectory indicating a shape and size of the trajectory; normalize the trajectory based on the generated coordinate information of the displayed keyboard and coordinate information of the trajectory; apply, to a trained model for the keyboard input, based on the normalized trajectory, normalized trajectory information indicating a shape of the normalized trajectory and a relative position of the normalized trajectory with respect to the displayed keyboard of the plurality of keyboards of different shapes and sizes; and determine a plurality of input characters corresponding to the trajectory, based on a result of the applying the normalized trajectory information.