| CPC G06F 40/30 (2020.01) [G06F 40/58 (2020.01); H04L 51/02 (2013.01)] | 11 Claims |

|
1. An electronic device comprising:
a memory storing instructions; and
at least one processor configured to execute the instructions to:
obtain an inquiry from a user of a target device, the inquiry being formatted as a text;
determine semantic roles of sentence components in the text by inputting information on the text to a first model trained to determine the semantic roles of the sentence components, wherein the first model is trained to determine each of the sentence components of the text as one of an agent, a recipient, and a predicate;
input the sentence components to a second model trained with a reduced amount of training data to:
output a risk level of the text based on the semantic roles of the sentence components; and
based on a sentence component determined as at least one of the agent and the recipient being the user or the target device, increase the risk level of the text;
identify an unknown sentence component of the sentence components that is not recognized by the second model;
obtain a synonym of the unknown sentence component from a database;
obtain the risk level of the text by inputting the semantic roles and sentence components, with the synonym in place of the unknown sentence component, to the second model;
identify a dangerous situation based on the risk level of the text being equal to or higher than a threshold; and
based on the dangerous situation being identified, perform an operation corresponding to the risk level of the text among a plurality of operations, the plurality of operations comprising performing a power-off of the target device, blocking network connection of the target device, re-starting of the target device, and turning off a background application which is running at the target device.
|