Electronic device, method and storage medium for providing search box including reference text
An electronic device includes a display; at least one processor; and at least one memory storing a knowledge graph, where the at least one memory stores instructions that, when executed by the at least one processor, cause the electronic device to perform at least one operation, and where the at least one operation includes: based on an occurrence of a trigger, identifying context information; displaying, through the display, a first reference text determined based on the context information and at least one node of the knowledge graph in a search box; displaying, through the display, a text corresponding to the first reference text in the search box according to a user input identical to part of the first reference text; based on the text and the at least one node of the knowledge graph, searching for a first content; and displaying, through the display, the searched first content.
1 . An electronic device, comprising:
a display;
at least one processor; and
at least one memory storing a knowledge graph, wherein the at least one memory stores instructions that, when executed by the at least one processor, cause the electronic device to perform operations, and
wherein the operations include:
based on an occurrence of a trigger, identifying context information corresponding to a state of the electronic device;
comparing the context information with one or more nodes of the knowledge graph;
identifying, among the one or more nodes of the knowledge graph, at least one node that corresponds to the context information;
displaying, in a search box through the display, a first reference text determined based on the context information and the at least one node of the knowledge graph;
displaying, in the search box through the display, a text corresponding to the first reference text according to a user input identical to part of the first reference text, wherein the text is displayed according to a first attribute and a remaining portion of the first reference text is displayed according to a second attribute based on the text being identical to the part of the first reference text;
based on the text corresponding to the first reference text and the at least one node of the knowledge graph, searching for a first content; and
displaying, through the display, the first content obtained from the search based on the text corresponding to the first reference text and the at least one node of the knowledge graph.
2 . The electronic device of claim 1 ,
wherein the operations further include:
identifying a change in the context information in a state in which the searched first content is displayed;
searching for a second content related to the text and the at least one node of the knowledge graph according to the change in the context information; and
displaying, through the display, the searched second content in replacement of the first content.
3 . The electronic device of claim 2 ,
wherein the operations further include:
displaying a reason for displaying the second content in replacement of the first content, based on the context information and information associated with the at least one node of the knowledge graph.
4 . The electronic device of claim 2 ,
wherein the operations further include:
based on the change in the context information, displaying, through the display, a second reference text determined based on the at least one node of the knowledge graph in replacement of the text in the search box.
5 . The electronic device of claim 4 ,
wherein the operations further include:
identifying second context information according to an occurrence of a second trigger in the state in which the searched first content is displayed;
determining whether a difference between a value corresponding to the context information and a value corresponding to the second context information is within a predetermined range;
when the difference between the value of the context information and the value of the second context information not being within the predetermined range, searching for and displaying the second content related to the text and the at least one node of the knowledge graph; and
based on the difference between the context information and the second context information being within the predetermined range, maintaining the display of the first content related to the at least one node of the knowledge graph.
6 . The electronic device of claim 5 ,
wherein, when the value of the context information and the value of the second context information are related to a distance,
wherein the searching for and displaying the second content includes:
based on a difference between a first distance of the context information and a second distance of the second context information not being within a predetermined distance, searching for and displaying the second content related to the text and the at least one node of the knowledge graph, and
wherein the maintaining the display of the first content includes:
based on the difference between the first distance of the context information and the second distance of the second context information being within the predetermined distance, maintaining the display of the first content related to the at least one node of the knowledge graph.
7 . The electronic device of claim 5 ,
wherein when the value of the context information and the value of the second context information are related to a time,
wherein the searching for and displaying the second content includes:
based on a difference between a first time of the context information and a second time of the second context information not being within a predetermined time, searching for and displaying the second content related to the text and the at least one node of the knowledge graph, and
wherein the maintaining the display of the first content includes:
based on the difference between the first time of the context information and the second time of the second context information being within the predetermined time, maintaining the display of the first content related to the at least one node of the knowledge graph.
8 . The electronic device of claim 1 ,
wherein the operations further include:
identifying at least one first node corresponding to the context information among the at least one node of the knowledge graph; and
identifying the first reference text, based on the at least one first node.
9 . The electronic device of claim 8 ,
wherein the identifying the first reference text based on the at least one first node includes:
identifying the first reference text using at least part of the at least one first node.
10 . The electronic device of claim 9 ,
wherein the identifying the first reference text using the at least part of the at least one first node includes at least one of:
identifying the first reference text by adding at least one first additional text to the at least part of the at least one first node, or
replacing the at least part of the at least one first node with at least one second additional text.
11 . The electronic device of claim 8 ,
wherein the identifying the first reference text based on the at least one first node includes:
identifying the first reference text using at least part of the at least one first node and at least part of at least one second node associated with the at least one first node.
12 . The electronic device of claim 11 ,
wherein the identifying the first reference text using the at least part of the at least one first node and the at least part of the at least one second node associated with the at least one first node includes:
identifying the first reference text by adding at least one third additional text to the at least part of the at least one first node and the at least part of the at least one second node, and/or replacing the at least part of the at least one first node and the at least part of the at least one second node with at least one fourth additional text.
13 . The electronic device of claim 12 ,
wherein the identifying the at least one first node corresponding to at least part of at least one piece of the context information among the at least one node of the knowledge graph includes:
identifying the at least one first node including a same text as the at least part of the at least one piece of the context information and/or having a meaning associated with the at least part of the at least one piece of the context information.
14 . The electronic device of claim 13 ,
wherein the operations further include:
identifying a first score corresponding to the knowledge graph, based on a correspondence relationship between the at least part of the at least one piece of the context information and the at least one first node; and
identifying the knowledge graph as a knowledge graph for generating the first reference text, based on the first score being greater than at least one other score corresponding to at least one other knowledge graph different from the knowledge graph.
15 . The electronic device of claim 1 ,
wherein the first content comprises at least one first object corresponding to at least one first application and/or at least one first function corresponding to at least one first node.
16 . The electronic device of claim 1 ,
wherein the first content comprises at least one second object corresponding to at least one first node.
17 . The electronic device of claim 1 ,
wherein the operations further include:
changing the knowledge graph;
identifying another reference text different from the first reference text, based on a comparison result between at least one piece of the context information and at least part of at least one node of the changed knowledge graph; and
displaying, through the display, the search box comprising the other reference text.
18 . A method for operating an electronic device, the method comprising:
based on an occurrence of a trigger, identifying context information corresponding to a state of the electronic device;
comparing the context information with one or more nodes of the knowledge graph;
identifying, among the one or more nodes of the knowledge graph, at least one node that corresponds to the context information;
displaying, in a search box through a display, a first reference text determined based on the context information and the at least one node of the knowledge graph;
displaying, in the search box through the display, a text corresponding to the first reference text according to a user input identical to part of the first reference text, wherein the text is displayed according to a first attribute and a remaining portion of the first reference text is displayed according to a second attribute based on the text being identical to the part of the first reference text;
based on the text corresponding to the first reference text and the at least one node of the knowledge graph, searching for a first content; and
displaying, through the display, the first content obtained from the search based on the text corresponding to the first reference text and the at least one node of the knowledge graph.
19 . A storage medium storing computer-readable instructions, the instructions, when executed by at least one processor of an electronic device, cause the electronic device to perform operations,
wherein the operations comprise:
based on an occurrence of a trigger, identifying context information corresponding to a state of the electronic device;
comparing the context information with one or more nodes of the knowledge graph;
identifying, among the one or more nodes of the knowledge graph, at least one node that corresponds to the context information;
displaying, in a search box through a display, a first reference text determined based on the context information and the at least one node of the knowledge graph;
displaying, in the search box through the display, a text corresponding to the first reference text according to a user input identical to part of the first reference text, wherein the text is displayed according to a first attribute and a remaining portion of the first reference text is displayed according to a second attribute based on the text being identical to the part of the first reference text;
based on the text corresponding to the first reference text and the at least one node of the knowledge graph, searching for a first content; and
displaying, through the display, the first content obtained from the search based on the text corresponding to the first reference text and the at least one node of the knowledge graph.