A method performed by an electronic device using
artificial intelligence according to an embodiment of the present disclosure, the method includes receiving a speech
signal; and generating a text corresponding to the speech
signal by using the speech
signal as input in a pre-trained first
artificial intelligence algorithm model, wherein the first
artificial intelligence algorithm model including a first
model parameter outputs a first predicted text by using a synthetic speech and a reference text as input, extracts a first loss based on the first predicted text and the reference text, and performs a first pre-training based on the first loss, wherein the first artificial intelligence
algorithm model that performed the first pre-training includes a second
model parameter, wherein the first artificial intelligence algorithm model that performed the first pre-training outputs a second predicted text by using the synthetic speech and the reference text as input, and extracts a second loss based on the second predicted text and the reference text, wherein the electronic device determines a
loss rate which is a ratio of the first loss and the second loss, determines an
adaptation parameter based on the second
model parameter and the second loss if the
loss rate is below a threshold value, and determines a third model parameter based on the
adaptation parameter and the second model parameter, wherein the first artificial intelligence algorithm model is repeatedly pre-trained such that the first artificial intelligence algorithm model that performed a second pre-training is configured to include the third model parameter.