Electronic device and method for providing utterance content determined using search of persona data store, and non-transitory computer-readable storage medium
A persona-based language model with a data store and k-NN LM techniques addresses the challenge of generating contextually appropriate responses in electronic devices, enhancing dialogue system performance.
Patent Information
- Application Number
- PCT/KR2024/004859
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-11
- Publication Date
- 2025-10-16
AI Technical Summary
Existing electronic devices struggle to generate natural language responses that accurately reflect a persona and previous conversational history, leading to discrepancies in dialogue systems.
The implementation of a persona-based language model that utilizes a data store to search for and determine tokens based on previous utterances and persona data, using k-NN LM techniques to enhance response generation.
This approach allows for more accurate and contextually appropriate responses by leveraging persona-specific data stores, improving dialogue system performance without the need for extensive retraining.
Smart Images

Figure KR2024004859_16102025_PF_FP_ABST
Abstract
Description
Electronic device, method, and non-transitory computer-readable storage medium for providing determined utterance content using a search of a persona data store
[0001] The present disclosure relates to an electronic device, a method, and a non-transitory computer-readable storage medium for providing utterance content determined by using a search of a persona data store.
[0002] Natural language refers to the language used in human daily life. Electronic devices supporting functions related to natural language are being developed. For example, electronic devices may include language models for providing messages in natural language. To mitigate the discrepancy between newly generated utterances and previous conversational history, persona-based language models are being developed.
[0003] In one embodiment, a non-transitory computer-readable storage medium may store instructions. The instructions, when executed by an electronic device including a memory and a communication circuit, may cause the electronic device to obtain a plurality of first tokens corresponding to a query message based on receiving the query message from an external electronic device through the communication circuit. The instructions, when executed by the electronic device, may cause the electronic device to generate a plurality of second tokens representing a response message using the plurality of first tokens and a persona database stored in the memory. The persona database may store conversation data for each of the plurality of personas for generating the response message. The instructions, when executed by the electronic device, may cause the electronic device to execute a language model to obtain a plurality of first candidate tokens when generating a third token representing a word to be positioned after the plurality of second tokens in the response message. The instructions, when executed by the electronic device, may cause the electronic device to search the persona database using the plurality of second tokens when generating the third token, thereby obtaining a plurality of second candidate tokens. The instructions, when executed by the electronic device, may cause the electronic device to determine the third token from among the plurality of first candidate tokens and the plurality of second candidate tokens when generating the third token. The instructions, when executed by the electronic device, may cause the electronic device to transmit the response message including the plurality of second tokens and the third token to the external electronic device via the communication circuit.
[0004] A method of an electronic device according to one embodiment may include an operation of obtaining a plurality of first tokens corresponding to a query message based on receiving a query message from an external electronic device, and an operation of generating a plurality of second tokens representing a response message using the plurality of first tokens and a persona database stored in the memory. The persona database may store conversation data for each of the plurality of personas for generating the response message. The method may include: executing a language model to obtain a plurality of first candidate tokens when generating a third token representing a word to be positioned after the plurality of second tokens in the response message; searching the persona database using the plurality of second tokens to obtain a plurality of second candidate tokens when generating a third token representing a word to be positioned after the plurality of second tokens in the response message; and determining a third token from among the plurality of first candidate tokens and the plurality of second candidate tokens when generating a third token representing a word to be positioned after the plurality of second tokens in the response message; and transmitting the response message including the plurality of second tokens and the third token to the external electronic device.
[0005] According to one embodiment, an electronic device may include a communication circuit and a processor. The processor may be configured to, based on receiving a query message from an external electronic device through the communication circuit, obtain a plurality of first tokens corresponding to the query message, and generate a plurality of second tokens representing a response message using the plurality of first tokens and a persona database stored in the memory. The persona database may store conversation data for each of the plurality of personas for generating the response message. The processor may be configured to, when generating a third token representing a word to be positioned after the plurality of second tokens in the response message, execute a language model to obtain a plurality of first candidate tokens, search the persona database using the plurality of second tokens to obtain a plurality of second candidate tokens, and determine the third token from among the plurality of first candidate tokens and the plurality of second candidate tokens, and transmit the response message including the plurality of second tokens and the third token to the external electronic device through the communication circuit.
[0006] FIG. 1 is a block diagram of an electronic device according to one embodiment.
[0007] FIG. 2 is an exemplary block diagram of an electronic device according to one embodiment.
[0008] FIG. 3 is a diagram illustrating a method for an electronic device according to one embodiment to determine an answer for a current turn.
[0009] FIG. 4 is a flowchart of the operation of an electronic device according to one embodiment.
[0010] FIG. 5 is a flowchart of the operation of an electronic device according to one embodiment.
[0011] Hereinafter, various embodiments of this document are described with reference to the attached drawings.
[0012] The various embodiments of this document and the terminology used therein are not intended to limit the technology described in this document to a specific embodiment, but should be understood to include various modifications, equivalents, and / or substitutes of the embodiment. In connection with the description of the drawings, similar reference numerals may be used for similar components. The singular expression may include plural expressions unless the context clearly indicates otherwise. In this document, expressions such as "A or B", "at least one of A and / or B", "A, B, or C", or "at least one of A, B, and / or C" may include all possible combinations of the items listed together. Expressions such as "first", "second", "first", or "second" may modify the corresponding components regardless of order or importance, and are only used to distinguish one component from another, but do not limit the corresponding components. When it is said that a component (e.g., a first component) is “(functionally or communicatively) connected” or “connected” to another component (e.g., a second component), the component may be directly connected to the other component, or may be connected via another component (e.g., a third component).
[0013] The term "module" as used in this document includes a unit composed of hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit. A module may be an integral component, or a minimal unit or portion thereof that performs one or more functions. For example, a module may be composed of an application-specific integrated circuit (ASIC).
[0014] FIG. 1 is a block diagram of an electronic device (101), according to one embodiment. In FIG. 1, an exemplary system including an electronic device (101) and / or an external electronic device (109) is illustrated. While the electronic device (101) and / or the external electronic device (109) are illustrated as being directly connected, the embodiment is not limited thereto. For example, the electronic device (101) and the external electronic device (109) may be connected to each other via one or more routers and / or an access point (AP).
[0015] The external electronic device (109) of FIG. 1 may be a terminal owned by a user. The terminal may include, for example, a personal computer (PC) such as a laptop or desktop, a smartphone, a smartpad, or a tablet PC. The terminal may include a portable gaming device and / or a gaming console. The terminal may include a smart accessory such as a smartwatch, a smart ring, and / or a head-mounted device (HMD). The terminal may be referred to as a mobile device, a user terminal, a user equipment (UE), a multi-function device, a portable communication device, or a portable device.
[0016] Referring to FIG. 1, the electronic device (101) may include at least one of a processor (110-1), a memory (115-1), and a communication circuit (120-1). The processor (110-1), the memory (115-1), and the communication circuit (120-1) may be electrically and / or operably coupled with each other by an electronic component (or electrical component), such as a communication bus (102-1). Hereinafter, the electronic components being operably coupled may mean that a direct connection or an indirect connection is established between the electronic components, either wired or wireless, so that a second electronic component is controlled by a first electronic component among the electronic components. Although illustrated based on different blocks, the embodiment is not limited thereto, and some of the electronic components of FIG. 1 (e.g., at least a portion of the processor (110-1), the memory (115-1), and the communication circuit (120-1)) may be included in a single integrated circuit such as a system on a chip (SoC). The type and / or number of electronic components included in the electronic device (101) is not limited to that illustrated in FIG. 1. For example, the electronic device (101) may include only some of the electronic components illustrated in FIG. 1. One or more clusters in which a plurality of electronic devices including the electronic device (101) are grouped may be referred to as servers.
[0017] Referring to FIG. 1, according to one embodiment, an external electronic device (109) may include at least one of a processor (110-2), a memory (115-2), a communication circuit (120-2), a display (125), a microphone (126), and a speaker (127). Similar to the electronic device (101), the processor (110-2), the memory (115-2), the communication circuit (120-2), the display (125), the microphone (126), and / or the speaker (127) may be electrically and / or operatively connected to each other by electronic components such as a communication bus (102-2). In the present disclosure, among the descriptions of the processor (110-2), memory (115-2), and communication circuit (120-2) of the external electronic device (109), descriptions that overlap with the descriptions of the processor (110-1), memory (115-1), and communication circuit (120-1) of the electronic device (101) may be omitted.
[0018] In one embodiment, a processor (e.g., processors 110-1 and 110-2) may include circuitry (e.g., processing circuitry) for processing data based on one or more instructions. The circuitry for processing data may include, for example, an arithmetic and logic unit (ALU), a floating point unit (FPU), a field programmable gate array (FPGA), a central processing unit (CPU), a graphics processing unit (GPU), a neural processing unit (NPU), and / or an application processor (AP). For example, the number of processors may be one or more. The processing circuitry of the processor that loads (or fetches) instructions and performs calculations corresponding to the loaded instructions may be referred to as or referred to as a core circuit (or core). For example, the processor may have a multi-core processor architecture including a plurality of core circuits, such as a dual core, a quad core, a hexa core, or an octa core. The functions and / or operations described with reference to the present disclosure may be collectively performed by one or more processing circuits included in a processor.
[0019] In one embodiment, memory (e.g., memories (115-1, 115-2)) may include circuitry for storing data and / or instructions input to or output from a processor (e.g., processors (110-1, 110-2)). The memory may include, for example, volatile memory, such as random-access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM). The volatile memory may include, for example, at least one of dynamic RAM (DRAM), static RAM (SRAM), cache RAM, and pseudo SRAM (PSRAM). The non-volatile memory may include, for example, at least one of a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), a flash memory, a hard disk, a compact disk, a solid state drive (SSD), and an embedded multimedia card (eMMC). The processor (110-1) of the electronic device (101) may execute instructions of a memory (115-1) within the electronic device (101) to perform functions and / or operations indicated by the instructions.
[0020] In one embodiment, the communication circuit (e.g., the communication circuits 120-1, 120-2) may include hardware for supporting transmission and / or reception of data between the electronic device (101) and the external electronic device (109). The communication circuit may include, for example, at least one of a modem (MODEM), an antenna, and an optical / electronic (O / E) converter. The communication circuit may support transmission and / or reception of electrical signals based on various types of protocols, such as Ethernet, a local area network (LAN), a wide area network (WAN), wireless fidelity (Wi-Fi), near field communication (NFC), Bluetooth, Bluetooth low energy (BLE), ZigBee, long term evolution (LTE), fifth generation (5G) new radio (NR), sixth generation (6G), and / or above-6G.
[0021] In one embodiment, the display (125) of the external electronic device (109) can output visualized information to the user. For example, the display (125) can visualize or output information generated by a graphic processing unit (GPU) and / or a processor (110-2). The display (125) can include a liquid crystal display (LCD), a plasma display panel (PDP), and / or a plurality of light emitting diodes (LEDs). The LEDs can include organic LEDs (OLEDs). The display (125) can include a flexible display, a flat panel display (FPD), and / or electronic paper.
[0022] In one embodiment, the external electronic device (109) may include a sensor (e.g., a touch sensor panel (TSP)) for detecting an external object (e.g., a user's finger) on the display (125). For example, using the TSP, the external electronic device (109) may detect an external object that is in contact with the display (125) or floating on the display (125). In response to detecting the external object, the external electronic device (109) may execute a function associated with a particular visual object among visual objects displayed within the display (125) that corresponds to a location of the external object on the display (125).
[0023] In one embodiment, a processor (110-2) of an external electronic device (109) may obtain an electrical signal representing vibration of the atmosphere from a microphone (126). The processor (110-2) may transmit an audio signal to a speaker (127), thereby causing the speaker (127) to cause vibration of the atmosphere. The external electronic device (109) may include one or more microphones and / or one or more speakers.
[0024] Referring to FIG. 1, one or more instructions (or commands) indicating operations and / or actions to be performed on data by a processor (e.g., processors (110-1, 110-2)) may be stored in a memory (e.g., memories (115-1, 115-2)). A set of one or more instructions may be referred to as firmware, an operating system, a process, a routine, a sub-routine, a program, and / or a software application (hereinafter, an application). Hereinafter, installation of an application may mean that one or more instructions provided in the form of an application are stored in a memory, and that the one or more applications are stored in a format executable by the processor (e.g., a file having an extension designated by the operating system of the electronic device (101)).
[0025] Referring to FIG. 1, an exemplary program (e.g., a server application (or server agent application) (141)) installed in an electronic device (101) is illustrated. The processor (110-1) of the electronic device (101) may execute the server application (141) to execute a function related to natural language. The function may include a function of generating or transmitting at least one natural language sentence expressing information related to one or more natural language sentences (e.g., one or more natural language sentences received from a user of an external electronic device (109). The function may include a function of executing or calling another function supported by the electronic device (101) and expressed by one or more natural language sentences. The server application (141) may be installed in the electronic device (101) to support a service related to conversational interaction (e.g., a chatbot service).
[0026] Referring to FIG. 1, an exemplary program (e.g., a client application (or client agent application) (151)) installed in an external electronic device (109) is illustrated. A processor (110-2) of the external electronic device (109) may execute the client application (151) to communicate with the electronic device (101). For example, the processor (110-2) executing the client application (151) may control a communication circuit (120-2) to establish a communication link between the electronic device (101) and the external electronic device (109). Through the communication link, the processor (110-2) may transmit one or more natural language sentences to the electronic device (101). The one or more natural language sentences may be recognized or identified from a user input received through a display (125) and / or a microphone (126). For example, using speech-to-text (STT), the processor (110-2) can detect or obtain one or more natural language sentences from an audio signal received through a microphone (126).
[0027] According to one embodiment, the electronic device (101) may receive at least one natural language sentence obtained by an external electronic device (109) executing a client application (151) through a communication link established between the electronic device (101) and the external electronic device (109) using a communication circuit (120-1). Hereinafter, the at least one prompt sentence may include the at least one natural language sentence received by the electronic device (101) from the external electronic device (109). The at least one prompt sentence may include one or more natural language sentences processed by the electronic device (101) executing the server application (141). The electronic device (101) that receives the at least one prompt sentence may execute the server application (141) to generate one or more natural language sentences related to the at least one prompt sentence.
[0028] An electronic device (101) executing a server application (141) may perform calculations referred to as a neural network, an artificial neural network, a deep learning model, a machine learning model, a model, and / or an agent to generate one or more natural language sentences. The model may include a software application (e.g., the server application (141)) designed to simulate neural activity (e.g., reasoning, and / or learning) of a living organism, including a human. The processor (110-1) of the electronic device (101) may execute the software application to perform calculations related to the model. In order to perform the calculations, the software application may be installed in the electronic device (101) together with information related to the calculations (e.g., types of calculations included in the model, and / or filters and / or weights related to layers included in the model).
[0029] A model for generating natural language sentences may include a generative model. From a probability distribution perspective, a generative model may be trained to generate second data from first data that follows a specific probability distribution (e.g., a probability distribution used to train the generative model). The generative model may include a neural language model (NLM) and / or a pretrained language model (PLM) (e.g., bidirectional encoder representations from transformers (BERT), text-to-text transfer transformer (T5), pathways language model (PaLM), and / or a generative pre-trained transformer (GPT)). For example, the generative model may include a pretrained language model specialized for chatbot-type speech. For example, the generative model may include various language models including not only a decoder-based model structure of the GPT2 series but also an encoder-decoder-based model structure. Accordingly, more complex and natural conversation generation may be possible. The generative model can generate appropriate responses by considering the speaker's persona, which is a personal characteristic, and previous utterance history. The electronic device (101) may include a persona database (142) to generate the responses. The persona database (142) may store information for generating responses based on the execution of the generative model. For example, the persona database (142) may include information for generating persona-based responses (e.g., persona) and information regarding previous utterances.
[0030] In one embodiment, when the electronic device (101) generates the natural language sentence, k-NN LM (k-nearest neighborhood language modeling) may be applied. Accordingly, a data store (e.g., a persona database (142)) that stores tokens with a high probability of the next utterance in a key-value format according to a given utterance situation may be constructed. The data store may be used to generate natural language sentences corresponding to various utterance situations. A token may be information that matches a word (or morpheme) one-to-one and may be computer-readable information related to a word (or morpheme). A token may include a vector (or matrix) in which a word corresponding to the token is parameterized. A token may include any vector corresponding to a word and / or morpheme corresponding to the token within a vector space for representing semantic similarity between words and / or morphemes. A token may be referred to as token information and / or a token vector.
[0031] According to one embodiment, the electronic device (101) may first create a data store using the encoded results of tokens (training contexts) up to time t-1 among input sentences (e.g., encoded persona training contexts, such as sentences (320, 340) in FIG. 3) as a key and the token (target) at time t (e.g., target tokens (322, 342) in FIG. 3) as a value. Thereafter, the electronic device (101) may obtain the next token using the input sentence (e.g., encoded persona and dialog test context, such as the second token (310) in FIG. 3). At this time, the electronic device (101) may find k sets of values that become k-NN by encoding the input sentence and searching the data store for the corresponding result. Thereafter, the electronic device (101) can obtain statistics of the predicted token (e.g., the second candidate tokens (328) and the third candidate tokens (348) of FIG. 3) by normalizing the set of searched values and aggregating the same values. For example, the statistics of the predicted token may include statistics on the probability of the predicted token (e.g., the probabilities (330 and 350) of FIG. 3). Based on this, the electronic device (101) can generate a final predicted token (e.g., the operation result (316) of FIG. 3) through interpolation of the statistics of the predicted token and the statistics of the base language model (e.g., the statistics on the probabilities (314) of the first candidate tokens (312) of FIG. 3). The electronic device (101) can determine an answer token (e.g., the third token described with reference to FIG. 3) among the final predicted token(s).
[0032] As described above, the electronic device (101) can quickly propose optimal response tokens based on a given utterance situation by introducing a data store for the k-NN LM. Specifically, within the data store, a vector encoding the utterance situation and information on the next token expected in that situation can be stored in key-value format. The data store can be utilized to generate more appropriate responses for various utterances without additional training.
[0033] Additionally, the introduction of a data store for k-NN LMs allows for the creation of a persona-specific data store. For example, adding a persona may require simply adding data to the data store, without requiring training of a language model executed by the electronic device.
[0034] The electronic device (101) can generate a response for the next utterance based on the persona of the speaker or the target of the utterance and previous utterance records. The k-NN LM technique can be applied to improve the performance of the dialogue system and to specialize the persona. Data preprocessing for input and output in the form of utterances can be performed, and a data store based on this can be constructed.
[0035] FIG. 2 is an exemplary block diagram of an electronic device according to one embodiment. The electronic device of FIG. 2 may be an example of the electronic device (101) of FIG. 1. The drawings described above may be referred to when describing FIG. 2.
[0036] In FIG. 2, one or more blocks (e.g., a language model (210), a searcher (220), and / or an output token determiner (230)) executed by an electronic device (101) are illustrated. The one or more blocks may represent one or more software programs, software applications, or models executed by the electronic device (101). Some of the blocks illustrated in FIG. 2 (e.g., the language model (210)) may be executed by an external electronic device different from the electronic device (e.g., the external electronic device (109) of FIG. 1).
[0037] Referring to FIG. 2, the electronic device (101) can receive a query message (q) through the communication circuit (120-1). The query message (q) can include one or more prompt sentences. The electronic device (101) can execute a language model (210) to generate a response message (r) corresponding to the received query message (q). The response message (r) can include one or more natural language sentences output from the language model (210). The electronic device (101) can transmit the response message (r) to an external electronic device (109) through the communication circuit (120-1).
[0038] In one embodiment, the electronic device (101) may generate a response for the current turn within a response message (r) based on the persona and previous utterances. For example, the information input and output to the language model (210) for the electronic device (101) to generate a response for the current turn is as shown in Table 1 below.
[0039]
[0040] In Table 1 above, p is a persona (e.g., one or more natural language sentences for constructing a persona, stored in a data store), h is the previous utterance content (dialogue history), and r i may be the i-th token in the response message (r). For example, r imay represent a token to be newly generated by the electronic device (101) while the electronic device (101) sequentially generates tokens included in the response message (r). may be tokens prior to the current turn within the response message (r). For example, may be tokens included in the response message (r) generated by the electronic device (101) up to now.
[0041] For example, h in Table 1 may include at least one natural language sentence transmitted through a specific session, which includes at least one of sessions established between the electronic device (101) and a plurality of external devices. The sessions may be referred to as chat rooms. In one embodiment, the persona database (142) may store tokens with a high probability of next utterance for a given utterance situation in the form of a key-value pair. The key may be a vector encoding the utterance situations of the previous and current turns, and the value may be a token with a high probability of next generation for the corresponding utterance situation. The key-value pair may be represented as shown in Table 2 below.
[0042]
[0043] In one embodiment, various utterance situations can be used to build a data store or output a response utterance. For example, as shown in Table 3 below, input settings can be applied when building a data store and when model inference is performed.
[0044]
[0045] By supporting various settings as shown in Table 3 above, the speech generation capability of the electronic device (101) can be enhanced, and its ability to respond to various speech situations can be enhanced. Furthermore, by pre-establishing a data store that provides possible responses to personas and previous speech, it is possible to respond to situations where personas or previous speeches are not available during actual inference. In other words, a conversation system with satisfactory performance can be built even in situations where the information provided for speech is limited. By establishing a data store for each persona, a single conversation system can be used to respond to various personas. Accordingly, speech generation tendencies can be changed simply by modifying a pre-established data store, without the need to train individual models for speech for specific personas.
[0046] FIG. 3 is a diagram illustrating a method for an electronic device according to one embodiment to determine an answer for a current turn.
[0047] Referring to FIGS. 2 and 3, in one embodiment, an electronic device (101) may receive a query message (q) from an external electronic device (109) through a communication circuit (120-1). The electronic device (101) may execute a language model (210) to obtain first tokens corresponding to the query message (q). The electronic device (101) may use a persona database (142) to generate second tokens (310) representing a response message (r) to the query message (q) and a third token positioned after the second tokens (310). The second tokens (310) may correspond to natural language sentences such as "I like winter, I'm from." Each of the second tokens (310) may be tokens generated based on an operation of the electronic device (101) to generate the third token described with reference to FIG. 3.
[0048] Hereinafter, a method for an electronic device (101) to generate the third token located next to the second tokens (310) or to determine the third token among candidate tokens is described.
[0049] In one embodiment, the electronic device (101) may generate one or more first candidate tokens by executing a language model (210). For example, the electronic device (101) may input a query message (q) and second tokens (310) into the language model (210), thereby obtaining one or more first candidate tokens (312) and probabilities (314) of each of the one or more first candidate tokens.
[0050] In one embodiment, the electronic device (101) may execute the searcher (220) to obtain one or more second candidate tokens (328) and / or one or more third candidate tokens (348). For example, the electronic device (101) may obtain one or more second candidate tokens (328) and / or one or more third candidate tokens (348) by searching the persona database (142) using the second tokens (310) positioned before the third token.
[0051] For example, the electronic device (101) may obtain second candidate tokens (328) by using sentences (320) stored in the persona database (142) and target tokens (322) corresponding to each of the sentences (320). The sentences (320) may include, but are not limited to, sentences such as, for example, "here just give it," "have you been to," and "I'm 30 years." The target tokens (322) may include, but are not limited to, "back" corresponding to the sentence "here just give it," "Korea" corresponding to the sentence "have you been to," and "Japan" corresponding to the sentence "I'm 30 years."
[0052] For example, the electronic device (101) may obtain first representative information indicating a portion prior to the position of the third token from each of the sentences (320) stored in the persona database (142). The electronic device (101) may obtain second representative information for the second tokens (310). The electronic device (101) may obtain one or more second candidate tokens (328) using the first representative information and the second representative information. For example, the electronic device (101) may calculate a similarity (324) between the first representative information and the second representative information using a k-NN (nearest neighbor) algorithm. For example, the electronic device (101) may select or determine k tokens having a position corresponding to the position of the third token from each of the k sentences having relatively large similarities. The k tokens may be included in nearest k (326).
[0053] The electronic device (101) can calculate the nearest k (326) based on the similarity (324). The electronic device (101) can obtain one or more second candidate tokens (328) and probabilities (330) for each of the one or more second candidate tokens (328) by normalizing and aggregating the searched target tokens corresponding to the nearest k (326). The probabilities (330) may be probabilities for generating or determining the third token. For example, the probabilities (330) may indicate whether the tokens are appropriate as the third token. The electronic device (101) can use the k-NN algorithm to determine tokens located at positions corresponding to the third token within a specified number of sentences filtered from among the sentences (320), as one or more second candidate tokens (328).
[0054] In one embodiment, the electronic device (101) may obtain third candidate tokens (348) by using sentences (340) stored in the persona database (142) and target tokens (342) corresponding to each of the sentences (340). The sentences (340) may include, but are not limited to, sentences such as, for example, "I like to," "I was born in," and "I have been to." The target tokens (342) may include, but are not limited to, "ski" corresponding to the sentence "I like to," "Korea" corresponding to the sentence "I was born in," and "Korea" corresponding to the sentence "I have been to."
[0055] In one embodiment, sentences (320) and sentences (340) may be stored in the persona database (142) by being distinguished by multiple chat sessions formed by a chatbot service provided by the electronic device (101). For example, sentences (320) and sentences (340) may be sentences transmitted through different chat sessions. Since the electronic device (101) determines the third token using sentences (320, 340) distinguished by chat sessions, a response message generated by the electronic device (101) and including the third token may include sentences appropriate to the context of the chat conversation between users that was conducted through the chat session.
[0056] For example, the electronic device (101) may obtain third representative information indicating a portion prior to the position of the third token from each of the sentences (340) stored in the persona database (142). The electronic device (101) may obtain one or more third candidate tokens (348) using the third representative information and the second representative information for the second tokens (310). For example, the electronic device (101) may calculate a similarity (344) between the third representative information and the second representative information using a k-NN algorithm. The electronic device (101) may calculate nearest k (346) based on the similarity (344). For example, the electronic device (101) may select k tokens having a position corresponding to the position of the third token from each of the k sentences having relatively large similarities. The k tokens may be included in nearest k (346).
[0057] The electronic device (101) can obtain one or more third candidate tokens (348) and probabilities (350) for each of the one or more third candidate tokens (348) by normalizing and aggregating the similarities corresponding to the searched target tokens corresponding to the nearest k (346). The probabilities (350) may be probabilities for generating or determining the third token. For example, the probabilities (350) may indicate whether the third token is suitable.
[0058] In one embodiment, by executing the output token determiner (230), the electronic device (101) can determine the third token from among the candidate tokens (312, 328, and 348). For example, the electronic device (101) can determine the third token using an operation result (316) based on probabilities (314) of each of one or more first candidate tokens (312), probabilities (330) of each of one or more second candidate tokens (328), and probabilities (350) of each of one or more third candidate tokens (348). For example, the electronic device (101) can determine the third token from among the candidate tokens (312, 328, and 348) using an interpolation result of the probabilities (314, 330, and 350). For example, the electronic device (101) can determine the third token among candidate tokens (312, 328, and 348) using a weighted sum of probabilities (314, 330, and 350).
[0059] For example, the electronic device (101) may calculate or determine an operation result (316) by combining (e.g., interpolating and / or weighting) the probabilities (314, 330, and 350) of candidate tokens (312, 328, and 348) based on words corresponding to each of the candidate tokens. In the exemplary operation result (316) of FIG. 3, the electronic device (101) may determine the token corresponding to 'Korea' with the highest probability among the operation results (316) as the third token.
[0060] The electronic device (101), after generating the third token described with reference to FIG. 3, may continue to generate other tokens after the third token within the response message (r). The other tokens may be determined by the electronic device (101) re-performing the operation described with reference to FIG. 3. When generating the other tokens, the third token may be included in the second token (310) described above. For example, the electronic device (101) may repeatedly perform the operation described with reference to FIG. 3 to generate tokens included in the response message (r). If all probabilities included in the calculation result (316) are lower than a specified threshold, the electronic device (101) may stop generating new tokens and transmit a signal including all tokens (e.g., the second token (310) and the third token) generated before the stop to the external electronic device (109) as the response message (r).
[0061] In one embodiment, the k-NN algorithm is described as being used to obtain candidate tokens (328 and 348), but is not limited thereto. For example, cosine similarity and / or Euclidean distance may be used to calculate similarities (324 and 344).
[0062] Hereinafter, with reference to FIGS. 4 and 5, an exemplary operation of an electronic device (101) determining the third token according to one embodiment is described.
[0063] FIGS. 4 and 5 are flowcharts illustrating operations of an electronic device according to one embodiment. The operations of the electronic device described with reference to FIGS. 4 and 5 may be performed by the electronic device (101) and / or the processor (110-1) of FIG. 1. The operations of FIG. 5 may include detailed operations of operation 440 of FIG. 4. In describing FIGS. 4 and 5, reference may be made to FIGS. 1 to 3.
[0064] Referring to FIG. 4, in operation (410), a query message may be received. For example, the electronic device (101) may receive a query message (q) from an external electronic device (109) via a communication circuit (120-1). The query message (q) may include one or more natural language sentences (e.g., prompt sentences) obtained by the external electronic device (109).
[0065] In operation (420), a plurality of first tokens corresponding to the query message may be acquired. For example, the electronic device (101) may acquire a plurality of first tokens corresponding to the query message (q) based on receiving the query message (q).
[0066] In operation (430), a plurality of second tokens representing a response message may be generated. For example, the electronic device (101) may generate a plurality of second tokens representing a response message (r) using a plurality of first tokens corresponding to a query message (q). To generate the plurality of second tokens, the persona database (142) (e.g., 'p' in Table 1) may be utilized.
[0067] In operation (440), a third token may be generated, indicating a word to be positioned after a plurality of second tokens within the response message. For example, the electronic device (101) may generate a third token, indicating a word to be positioned after a plurality of second tokens within the response message (r). Operation (440) is described below with reference to FIG. 5.
[0068] In operation (450), a response message may be transmitted. For example, the electronic device (101) may transmit a response message (r) including the third token to the external electronic device (109) via the communication circuit (120-1). The response message (r) may optionally include the plurality of second tokens.
[0069] Referring to FIG. 5, in operation (510), a plurality of first candidate tokens may be obtained. For example, the electronic device (101) may execute the language model (210) to obtain a plurality of first candidate tokens. In order to obtain the plurality of first candidate tokens, message history information (e.g., 'h' in Table 1) transmitted between the electronic device (101) and the external electronic device (109) may be input into the language model (210). The electronic device (101) may input the plurality of first tokens and the plurality of second tokens into the language model (210) to obtain the plurality of first candidate tokens and probabilities of each of the plurality of first candidate tokens.
[0070] In operation (520), a plurality of second candidate tokens may be obtained by searching the persona database using a plurality of second tokens. For example, the electronic device (101) may acquire a plurality of second candidate tokens (e.g., ' in Table 1 above) by searching the persona database using a plurality of second tokens. ') can be used to search the persona database (142) to obtain multiple second candidate tokens. In order to obtain the multiple second candidate tokens, previous conversation history (h) and / or persona (p) can be used together, as shown in Table 3.
[0071] For example, the electronic device (101) can obtain representative information indicating a portion preceding a position related to the word from each of the sentences stored in the persona database (142). The electronic device (101) can obtain the plurality of second candidate tokens using the representative information and the representative information for the plurality of second tokens. The electronic device (101) can obtain the representative information from sentences obtained within one or more chat sessions formed by a chatbot service provided through the electronic device (101), for example. The sentences within the one or more chat sessions can be stored within the persona database (142). The sentences of the plurality of chat sessions can be stored in the persona database (142) and classified according to the chat sessions.
[0072] For example, the electronic device (101) may use a k-NN (nearest neighbor) algorithm to calculate similarities between the representative information corresponding to each of the sentences and the representative information for the plurality of second tokens. The electronic device (101) may use the k-NN algorithm to determine tokens located at positions corresponding to the word within a specified number of sentences filtered from among the sentences, as the plurality of second candidate tokens.
[0073] Alternatively, the electronic device (101) may calculate similarities between the representative information corresponding to each of the sentences and the representative information for the plurality of second tokens using cosine similarity. The electronic device (101) may determine tokens located at positions corresponding to the word within a specified number of sentences filtered from among the sentences, as the plurality of second candidate tokens, based on the similarities calculated according to the cosine similarity.
[0074] In operation (530), a third token may be determined from among a plurality of first candidate tokens and a plurality of second candidate tokens. For example, the electronic device (101) may execute the language model (210) to obtain the plurality of first candidate tokens and first probabilities of each of the plurality of first candidate tokens. The electronic device (101) may obtain the plurality of second candidate tokens and second probabilities of each of the plurality of second candidate tokens by using a result of searching the persona database (142) using the plurality of second tokens. The electronic device (101) may determine the third token from among the plurality of first candidate tokens and the plurality of second candidate tokens by using weighted sums of the first probabilities and the second probabilities.
[0075] Although not shown, the electronic device (101) may continue to generate other tokens after the third token in the response message (r) after generating the third token in operation (440). For example, the electronic device (101) may generate the other token by performing operation (440) again. When generating the other token, the third token may be included in the plurality of second tokens used to obtain the plurality of first candidate tokens in operation (510). The electronic device (101) may repeatedly perform operation (440) of FIG. 4 to generate tokens included in the response message (r). If all probabilities included in the operation result (316) are lower than a specified threshold, the electronic device (101) may stop repeating operation (440) and perform operation (450). For example, if all probabilities included in the operation result (316) are lower than a specified threshold, the electronic device (101) may stop generating new tokens and transmit a signal including all tokens generated before the stop (e.g., the second token (310) and the third token) to the external electronic device (109) as a response message (r).
[0076] In one embodiment, a non-transitory computer-readable storage medium may store instructions. The instructions, when executed by an electronic device including a memory and a communication circuit, may cause the electronic device to obtain a plurality of first tokens corresponding to a query message based on receiving the query message from an external electronic device through the communication circuit. The instructions, when executed by the electronic device, may cause the electronic device to generate a plurality of second tokens representing a response message using the plurality of first tokens and a persona database stored in the memory. The persona database may store conversation data for each of the plurality of personas for generating the response message. The instructions, when executed by the electronic device, may cause the electronic device to execute a language model to obtain a plurality of first candidate tokens when generating a third token representing a word to be positioned after the plurality of second tokens in the response message. The instructions, when executed by the electronic device, may cause the electronic device to search the persona database using the plurality of second tokens when generating the third token, thereby obtaining a plurality of second candidate tokens. The instructions, when executed by the electronic device, may cause the electronic device to determine the third token from among the plurality of first candidate tokens and the plurality of second candidate tokens when generating the third token. The instructions, when executed by the electronic device, may cause the electronic device to transmit the response message including the plurality of second tokens and the third token to the external electronic device via the communication circuit.
[0077] For example, the instructions, when executed by the electronic device, may cause the electronic device to input the plurality of first tokens and the plurality of second tokens into the language model, thereby obtaining the plurality of first candidate tokens and the generation probabilities of each of the plurality of first candidate tokens.
[0078] For example, the instructions, when executed by the electronic device, may cause the electronic device to input message history information transmitted between the external electronic device and the electronic device into the language model.
[0079] For example, the instructions, when executed by the electronic device, may cause the electronic device to obtain, from each of the sentences stored in the persona database, representative information indicating a portion preceding a position associated with the word, and to obtain the plurality of second candidate tokens using the representative information and the representative information for the plurality of second tokens.
[0080] For example, the instructions, when executed by the electronic device, may cause the electronic device to obtain the representative information from the persona database, from the sentences obtained within a chat session formed by a chatbot service provided using the electronic device.
[0081] For example, within the persona database, multiple sentences provided by the chatbot service may be stored and distinguished by multiple chat sessions formed by the chatbot service.
[0082] For example, the instructions, when executed by the electronic device, may cause the electronic device to calculate, using a k-NN (nearest neighbor) algorithm, similarities between the representative information corresponding to each of the sentences and the representative information for the plurality of second tokens, extract a specified number of sentences from among the sentences according to the k-NN algorithm based on the similarities, and determine tokens corresponding to positions of the words within the extracted sentences as the plurality of second candidate tokens.
[0083] For example, the instructions, when executed by the electronic device, may cause the electronic device to calculate, using cosine similarity, similarities between the representative information corresponding to each of the sentences and the representative information for the plurality of second tokens, and, based on the similarities, determine tokens located at positions corresponding to the word within a specified number of sentences filtered from among the sentences as the plurality of second candidate tokens.
[0084] For example, the instructions, when executed by the electronic device, may cause the electronic device to execute the language model to obtain the plurality of first candidate tokens and first probabilities of each of the plurality of first candidate tokens, to obtain the plurality of second candidate tokens and second probabilities of each of the plurality of second candidate tokens using a result of searching the persona database using the plurality of second tokens, and to determine the third token from among the plurality of first candidate tokens and the plurality of second candidate tokens using weighted sums of the first probabilities and the second probabilities.
[0085] For example, the instructions, when executed by the electronic device, may cause the electronic device to obtain the second probabilities by normalizing and aggregating the results of searching the persona database using the plurality of second tokens.
[0086] For example, the persona database may store tokens that are stored separately according to each of the plurality of personas, and the instructions, when executed by the electronic device, may cause the electronic device to obtain the plurality of second candidate tokens from among the tokens that are stored separately according to each of the plurality of personas.
[0087] A method of an electronic device according to one embodiment may include an operation of obtaining a plurality of first tokens corresponding to a query message based on receiving a query message from an external electronic device, and an operation of generating a plurality of second tokens representing a response message using the plurality of first tokens and a persona database stored in the memory. The persona database may store conversation data for each of the plurality of personas for generating the response message. The method may include: executing a language model to obtain a plurality of first candidate tokens when generating a third token representing a word to be positioned after the plurality of second tokens in the response message; searching the persona database using the plurality of second tokens to obtain a plurality of second candidate tokens when generating a third token representing a word to be positioned after the plurality of second tokens in the response message; and determining a third token from among the plurality of first candidate tokens and the plurality of second candidate tokens when generating a third token representing a word to be positioned after the plurality of second tokens in the response message; and transmitting the response message including the plurality of second tokens and the third token to the external electronic device.
[0088] For example, the method may include an operation of inputting the plurality of first tokens and the plurality of second tokens into the language model, thereby obtaining the plurality of first candidate tokens and the generation probabilities of each of the plurality of first candidate tokens.
[0089] For example, the method may include an action of inputting message history information transmitted between the external electronic device and the electronic device into the language model.
[0090] For example, the method may include an operation of obtaining representative information indicating a portion preceding a position related to the word in each of the sentences stored in the persona database, and an operation of obtaining the plurality of second candidate tokens using the representative information and the representative information for the plurality of second tokens.
[0091] For example, the method may include an operation of obtaining the representative information from the sentences obtained within one chat session formed by a chatbot service provided using the electronic device, from the persona database.
[0092] For example, within the persona database, multiple sentences provided by the chatbot service may be stored and distinguished by multiple chat sessions formed by the chatbot service.
[0093] For example, the method may include an operation of calculating similarities between the representative information corresponding to each of the sentences and the representative information for the plurality of second tokens using a k-NN (nearest neighbor) algorithm, an operation of extracting a specified number of sentences from among the sentences according to the k-NN algorithm based on the similarities, and an operation of determining tokens corresponding to positions of the words within the extracted sentences as the plurality of second candidate tokens.
[0094] For example, the method may include an operation of calculating similarities between the representative information corresponding to each of the sentences and the representative information for the plurality of second tokens using cosine similarity, and an operation of determining tokens located at positions corresponding to the word within a specified number of sentences filtered from among the sentences based on the similarities as the plurality of second candidate tokens.
[0095] For example, the method may include executing the language model to obtain the plurality of first candidate tokens and first probabilities of each of the plurality of first candidate tokens, using a result of searching the persona database using the plurality of second tokens to obtain the plurality of second candidate tokens and second probabilities of each of the plurality of second candidate tokens, and using weighted sums of the first probabilities and the second probabilities to determine the third token from among the plurality of first candidate tokens and the plurality of second candidate tokens.
[0096] According to one embodiment, an electronic device may include a communication circuit and a processor. The processor may be configured to obtain a plurality of first tokens corresponding to a query message received from an external electronic device through the communication circuit. The processor may be configured to generate a plurality of second tokens representing a response message using the plurality of first tokens and a persona database stored in the memory. The persona database may store conversation data for each of the plurality of personas for generating the response message. The processor may be configured to obtain a plurality of first candidate tokens by executing a language model when generating a third token representing a word to be positioned after the plurality of second tokens in the response message. The processor may be configured to search the persona database using the plurality of second tokens to obtain a plurality of second candidate tokens, and determine the third token from among the plurality of first candidate tokens and the plurality of second candidate tokens. The processor may be configured to transmit the response message, including the plurality of second tokens and the third token, to the external electronic device via the communication circuit.
[0097] For example, the processor may be configured to input the plurality of first tokens and the plurality of second tokens into the language model, obtain probabilities of the plurality of first candidate tokens and each of the plurality of first candidate tokens, and input message history information transmitted between the external electronic device and the electronic device into the language model.
[0098] The devices described above may be implemented as hardware components, software components, and / or a combination of hardware components and software components. For example, the devices and components described in the embodiments may be implemented using one or more general-purpose computers or special-purpose computers, such as a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA), a programmable logic unit (PLU), a microprocessor, or any other device capable of executing instructions and responding to them. The processing device may execute an operating system (OS) and one or more software applications running on the operating system. The processing device may also access, store, manipulate, process, and generate data in response to the execution of the software. For ease of understanding, the processing device is sometimes described as being used alone; however, one of ordinary skill in the art will recognize that the processing device may include multiple processing elements and / or multiple types of processing elements. For example, a processing unit may include multiple processors, or a processor and a controller. Other processing configurations, such as parallel processors, are also possible.
[0099] Software may include a computer program, code, instructions, or a combination of one or more of these, which may configure a processing device to perform a desired operation or may independently or collectively command the processing device. The software and / or data may be embodied in any type of machine, component, physical device, computer storage medium, or device for interpretation by the processing device or for providing instructions or data to the processing device. The software may also be distributed over networked computer systems and stored or executed in a distributed manner. The software and data may be stored on one or more computer-readable recording media.
[0100] The method according to the embodiment may be implemented in the form of program commands that can be executed through various computer means and recorded on a computer-readable medium. In this case, the medium may be one that continuously stores a computer-executable program or one that temporarily stores it for execution or download. In addition, the medium may be various recording means or storage means in the form of a single or multiple hardware combinations, and is not limited to a medium directly connected to a computer system, but may also be distributed over a network. Examples of the medium may include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and those configured to store program commands, including ROM, RAM, and flash memory. In addition, examples of other media may include recording media or storage media managed by app stores that distribute applications, sites that supply or distribute various software, servers, etc.
[0101] Although the embodiments described above have been described by way of limited examples and drawings, those skilled in the art will appreciate that various modifications and variations can be made based on the above teachings. For example, appropriate results can still be achieved even if the described techniques are performed in a different order than described, and / or components of the described systems, structures, devices, circuits, etc. are combined or combined in a different manner than described, or are replaced or substituted with other components or equivalents.
[0102] Therefore, other implementations, other embodiments, and equivalents to the claims also fall within the scope of the claims described below.
Claims
1. A non-transitory computer-readable storage medium storing instructions, wherein when the instructions are executed by an electronic device including a memory and a communication circuit, the electronic device: Based on receiving a query message from an external electronic device through the communication circuit, obtaining a plurality of first tokens corresponding to the query message; Using the plurality of first tokens and the persona database stored in the memory, a plurality of second tokens representing a response message are generated, and the persona database stores conversation data for each of the plurality of personas for generating the response message; When generating a third token representing a word to be positioned after the plurality of second tokens in the above response message: Run the language model to obtain multiple first candidate tokens; Searching the persona database using the plurality of second tokens to obtain a plurality of second candidate tokens; and Among the plurality of first candidate tokens and the plurality of second candidate tokens, determining the third token; Causing the response message, including the plurality of second tokens and the third token, to be transmitted to the external electronic device through the communication circuit. Non-transitory computer-readable storage medium.
2. In claim 1, the instructions, when executed by the electronic device, cause the electronic device to: By inputting the plurality of first tokens and the plurality of second tokens into the language model, the plurality of first candidate tokens and the generation probabilities of each of the plurality of first candidate tokens are obtained. Non-transitory computer-readable storage medium.
3. In claim 2, the instructions, when executed by the electronic device, cause the electronic device to: Causing the language model to input message history information transmitted between the external electronic device and the electronic device, Non-transitory computer-readable storage medium.
4. In claim 1, the instructions, when executed by the electronic device, cause the electronic device to: In each of the sentences stored in the above persona database, representative information is obtained indicating the part preceding the position related to the word; Causing the acquisition of the plurality of second candidate tokens by using the representative information and the representative information for the plurality of second tokens. Non-transitory computer-readable storage medium.
5. In claim 1, the instructions, when executed by the electronic device, cause the electronic device to: From the persona database, causing the representative information to be obtained from the sentences obtained within a chat session formed by the chatbot service provided using the electronic device. Non-transitory computer-readable storage medium.
6. In claim 5, within the persona database, A plurality of sentences provided by the chatbot service are stored separately by a plurality of chat sessions formed by the chatbot service. Non-transitory computer-readable storage medium.
7. In claim 1, the instructions, when executed by the electronic device, cause the electronic device to: Using the k-NN (nearest neighbor) algorithm, similarities between the representative information corresponding to each of the sentences and the representative information for the plurality of second tokens are calculated; Based on the above similarities, a specified number of sentences are extracted from the above sentences according to the k-NN algorithm; In the extracted sentences, causing the tokens corresponding to the positions of the words to be determined as the plurality of second candidate tokens. Non-transitory computer-readable storage medium.
8. In claim 1, the instructions, when executed by the electronic device, cause the electronic device to: Using cosine similarity, calculate the similarities between the representative information corresponding to each of the sentences and the representative information for the plurality of second tokens; Causing a plurality of second candidate tokens to be determined, based on the similarities, among the sentences filtered out from among the sentences, the tokens located at positions corresponding to the word, Non-transitory computer-readable storage medium.
9. In claim 1, the instructions, when executed by the electronic device, cause the electronic device to: By executing the language model, the plurality of first candidate tokens and first probabilities of each of the plurality of first candidate tokens are obtained; Using the results of searching the persona database using the plurality of second tokens, obtaining the plurality of second candidate tokens and the second probabilities of each of the plurality of second candidate tokens; and Using the weighted sums of the first probabilities and the second probabilities, causing the third token to be determined among the plurality of first candidate tokens and the plurality of second candidate tokens. Non-transitory computer-readable storage medium.
10. In claim 9, the instructions, when executed by the electronic device, cause the electronic device to: By normalizing and aggregating the results of searching the persona database using the plurality of second tokens, the second probabilities are obtained. Non-transitory computer-readable storage medium.
11. In claim 1, The above persona database stores tokens that are stored separately according to each of the plurality of personas, The above instructions, when executed by the electronic device, cause the electronic device to: Causing the user to obtain the plurality of second candidate tokens from among the tokens stored separately according to each of the plurality of personas. Non-transitory computer-readable storage medium.
12. In the method of an electronic device, An operation of obtaining a plurality of first tokens corresponding to a query message based on receiving a query message from an external electronic device; An operation of generating a plurality of second tokens representing a response message using the plurality of first tokens and the persona database stored in the memory, wherein the persona database stores conversation data for each of the plurality of personas for generating the response message; When generating a third token representing a word to be positioned after the plurality of second tokens in the above response message: The act of executing a language model to obtain multiple first candidate tokens; An operation of searching the persona database using the plurality of second tokens to obtain a plurality of second candidate tokens; and An operation of determining the third token among the plurality of first candidate tokens and the plurality of second candidate tokens; and An operation of transmitting the response message including the plurality of second tokens and the third token to the external electronic device; method.
13. In claim 12, the method comprises: An operation of inputting the plurality of first tokens and the plurality of second tokens into the language model, and obtaining the plurality of first candidate tokens and the generation probabilities of each of the plurality of first candidate tokens, method.
14. In claim 13, the method comprises: An operation including inputting message history information transmitted between the external electronic device and the electronic device into the language model, method.
15. In claim 12, the method comprises: An action of obtaining representative information indicating a portion preceding a position related to the word in each of the sentences stored in the persona database; An operation of obtaining the plurality of second candidate tokens using the representative information and the representative information for the plurality of second tokens; method.
16. In claim 12, the method comprises: An operation of obtaining the representative information from the sentences obtained within a chat session formed by a chatbot service provided using the electronic device from the persona database, method.
17. In claim 16, within the persona database, A plurality of sentences provided by the chatbot service are stored separately by a plurality of chat sessions formed by the chatbot service. method.
18. In claim 12, the method comprises: An operation of calculating similarities between the representative information corresponding to each of the sentences and the representative information for the plurality of second tokens using the k-NN (nearest neighbor) algorithm; Based on the above similarities, an operation of extracting a specified number of sentences from the above sentences according to the k-NN algorithm; and An operation of determining tokens corresponding to the positions of the words within the extracted sentences as the plurality of second candidate tokens; method.
19. In claim 12, the method comprises: An operation of executing the language model to obtain the plurality of first candidate tokens and first probabilities of each of the plurality of first candidate tokens; An operation of obtaining the plurality of second candidate tokens and second probabilities of each of the plurality of second candidate tokens by using the results of searching the persona database using the plurality of second tokens; and An operation of determining the third token from among the plurality of first candidate tokens and the plurality of second candidate tokens by using weighted sums of the first probabilities and the second probabilities; method.
20. In electronic devices, communication circuit; and Contains a processor, The above processor: Based on receiving a query message from an external electronic device through the communication circuit, obtaining a plurality of first tokens corresponding to the query message; Using the plurality of first tokens and the persona database stored in the memory, a plurality of second tokens representing a response message are generated, and the persona database stores conversation data for each of the plurality of personas for generating the response message; When generating a third token representing a word to be positioned after the plurality of second tokens in the above response message: Run the language model to obtain multiple first candidate tokens; Searching the persona database using the plurality of second tokens to obtain a plurality of second candidate tokens; and Among the plurality of first candidate tokens and the plurality of second candidate tokens, determining the third token; configured to transmit the response message including the plurality of second tokens and the third token to the external electronic device through the communication circuit, Electronic devices.
Citation Information
Patent Citations
Animal model for diabetic peripheral neuropathy using zebrafish and use thereof
KR1020230130275A
High Early Strength Cement Concrete Composite and Road Concrete Repairing Method Using The Same
KR1020240173291A
Broadcasting System Having a Function of Management of Real-time Broadcasting Service Impediment
KR102233846B1
Apparatus and method for building attribute data using multi persona
KR102613358B1
Context based conversation system
US20160283463A1