Apparatus and method of processing natural language using boosting keyword set and suppressing keyword set
The method of using boosting and suppression keyword sets in natural language processing enhances sentence generation by promoting desired keywords and suppressing undesired ones, improving speed and accuracy in LLM-based systems.
Patent Information
- Application Number
- JP2025066746
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-12
- Filing Date
- 2025-04-15
- Publication Date
- 2025-12-24
AI Technical Summary
Existing natural language processing systems using Large Language Models (LLMs) face issues when generating text in a target language, as they cannot adjust the training dataset to avoid undesired keywords and maintain control over generated sentences.
A method involving boosting and suppression keyword sets is employed, where a boosting keyword set promotes desired keywords and a suppression keyword set suppresses undesired ones, using an artificial neural network model to generate sentences.
This approach improves the speed and accuracy of natural language processing by adjusting generation probabilities based on keyword sets, enhancing the likelihood of desired keywords and reducing undesired ones in generated sentences.
Smart Images

Figure 2025187003000001_ABST
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to techniques for processing natural language using keyword sets. [Background technology]
[0002] Recently, in the field of natural language processing technology, there has been a trend to use LLM (Large Language Model) as a basic model, and then apply post-processing techniques such as fine-tuning or few-shot learning to suit the user's purpose.
[0003] However, according to the prior art, when the underlying LLM model is a model trained in a foreign language, there is a problem that the foreign language appears in a field that requires the generation of Korean, or there is a problem that unnecessary or undesired keywords are generated because the user cannot change the training dataset of the underlying LLM model.
[0004] Accordingly, there is an increasing demand for technology that can control the sentences generated during the inference process according to the types of keywords desired by the user, while still using the conventional LLM model as the basic model.
[0005] Korean Patent Registration No. 10-2668859 discloses a "natural language processing-based control system, its operation method, and its communication method." [Prior art documents] [Patent documents]
[0006] [Patent Document 1] Korean Patent Publication No. 10-2023-0112514 Summary of the Invention [Problem to be solved by the invention]
[0007] The present disclosure provides techniques for processing natural language using boosting and suppression keyword sets. [Means for solving the problem]
[0008] According to one aspect of the present disclosure, a natural language processing method may be proposed, which is executed in an electronic device including one or more processors and one or more memories storing instructions to be executed by the one or more processors, and may include the steps of: acquiring a boosting keyword set, the boosting keyword set including at least one boosting keyword to be targeted for promotion when generating a sentence using an artificial neural network model; acquiring a suppression keyword set, the suppression keyword set including at least one suppression keyword to be targeted for suppression when generating a sentence using the artificial neural network model; and generating a sentence through the artificial neural network model based on the boosting keyword set and the suppression keyword set.
[0009] According to another aspect of the present disclosure, there may be provided an electronic device for natural language processing, the electronic device including one or more processors and one or more memories storing instructions to be executed by the one or more processors, the one or more processors acquiring a boosting keyword set, the boosting keyword set including at least one boosting keyword to be targeted for promotion in generating a sentence using an artificial neural network model, acquiring a suppression keyword set, the suppression keyword set including at least one suppression keyword to be targeted for suppression in generating a sentence using the artificial neural network model, and generating a sentence through the artificial neural network model based on the boosting keyword set and the suppression keyword set.
[0010] According to another aspect of the present disclosure, there may be provided a non-transitory computer-readable storage medium having recorded thereon instructions for natural language processing, the non-transitory computer-readable storage medium having recorded thereon instructions for causing one or more processors to perform operations, the instructions may cause the one or more processors to perform the following steps: acquiring a boosting keyword set, the boosting keyword set including at least one boosting keyword to be targeted for promotion when generating sentences using an artificial neural network model; acquiring a suppression keyword set, the suppression keyword set including at least one suppression keyword to be targeted for suppression when generating sentences using an artificial neural network model; and generating sentences through an artificial neural network model based on the boosting keyword set and the suppression keyword set. [Effects of the Invention]
[0011] The natural language processing method according to the present disclosure can improve the speed of natural language processing.
[0012] The natural language processing method according to the present disclosure can generate sentences by adjusting the generation probability depending on the type of keyword.
[0013] The natural language processing method according to the present disclosure can increase the probability that generated sentences contain boosted keywords.
[0014] The natural language processing method according to the present disclosure can reduce the probability that generated sentences contain suppressive keywords. [Brief explanation of the drawings]
[0015] [Figure 1] 1 is a diagram showing a system including a server (100), a user terminal (200), and a communication network (300) according to an embodiment of the present disclosure. [Figure 2] FIG. 1 is a block diagram of a server 100 according to one embodiment of the subject matter disclosed herein. [Figure 3] FIG. 2 is a block diagram of a user terminal (200) according to one embodiment of the subject matter disclosed herein. [Figure 4] FIG. 1 is a diagram illustrating an exemplary flowchart of a natural language processing method according to an embodiment of the present disclosure. [Figure 5] FIG. 1 is a conceptual diagram illustrating an exemplary keyword trie according to one embodiment of the present disclosure. [Figure 6] FIG. 1 is a diagram illustrating an example of a flowchart relating to a first embodiment of generating a sentence using a keyword trye. [Figure 7] FIG. 10 is a diagram illustrating an example of a flowchart relating to a second embodiment of generating a sentence using a keyword trie. [Figure 8] FIG. 10 is a diagram illustrating an example of a flowchart relating to a third embodiment in which a sentence is generated using a keyword trye. DETAILED DESCRIPTION OF THE INVENTION
[0016] <Summary of the Invention>
[0017] In one embodiment, the boosting keyword set may be a keyword set for a first language, and the suppression keyword set may include a keyword set for a second language.
[0018] In one embodiment, the boosting keyword set or the suppression keyword set may be generated based on the word distribution in public data for the target language and the word distribution in specific data entered by the user.
[0019] In one embodiment, the boosting keyword set may include words that appear in the public data with a frequency lower than a first threshold frequency and that appear in the specific data with a frequency higher than a second threshold frequency.
[0020] In one embodiment, the suppressed keyword set may include words that appear in the public data with a frequency higher than a third threshold frequency but that appear in the private data with a frequency lower than a fourth threshold frequency.
[0021] In one embodiment, generating a sentence through the artificial neural network model may include calculating a generation probability for each of a plurality of tokens based on the output of the artificial neural network model for an input token sequence, and determining a successor token.
[0022] In one embodiment, the generation probability for each of the plurality of tokens may be calculated to be different from each other according to the classification of each token.
[0023] In one embodiment, the generation probability for each of the plurality of tokens may be calculated using a first probability distribution adjustment parameter (factor) for increasing the generation probability when the token is included in the token set of the boosting keyword set, and may be calculated using a second probability distribution adjustment parameter for decreasing the generation probability when the token is included in the token set of the suppression keyword set.
[0024] In one embodiment, generating sentences through the artificial neural network model may be performed using a keyword trie that includes one or more nodes, each of which may include a token and a keyword state value for a token sequence that includes consecutive tokens for each node in a path from the root node to the current node.
[0025] In one embodiment, the keyword trie may be generated based on the boosting keyword set or the suppression keyword set.
[0026] In one embodiment, generating a sentence through the artificial neural network model includes generating a first token sequence using a first probability distribution adjustment parameter; generating a second token sequence using the first probability distribution adjustment parameter and a second probability distribution adjustment parameter; and replacing one of the first token sequence and the second token sequence with the other token sequence if a predetermined condition is satisfied, and the predetermined condition may be a condition whose validity is determined based on the keyword trie.
[0027] In one embodiment, the step of replacing one of the first token sequence and the second token sequence with the other token sequence when the predetermined condition is satisfied may include the step of replacing the first token sequence with the second token sequence when the first token sequence is determined to include an inhibited keyword, and the step of replacing the second token sequence with the first token sequence when the first token sequence is determined to include a boosted keyword or not include an inhibited keyword.
[0028] In one embodiment, the step of generating a sentence through the artificial neural network model may include the steps of generating a first token sequence using a first probability distribution adjustment parameter, and, if the first token sequence is determined to include a suppressed keyword, generating a second token sequence using the first probability distribution adjustment parameter and a second probability distribution adjustment parameter.
[0029] In one embodiment, the step of generating a sentence through the artificial neural network model may include the steps of: generating a plurality of candidate token sequences by determining a plurality of successor tokens for each of N (N is a natural number greater than or equal to 2) token sequences using the artificial neural network model; calculating a cumulative probability for each of the plurality of candidate token sequences according to a predetermined calculation method; and determining N token sequences from the plurality of candidate token sequences based on the cumulative probability.
[0030] In one embodiment, the step of calculating the cumulative probability for each of the plurality of candidate token sequences according to the predetermined calculation method may include a step of increasing the cumulative probability if the candidate token sequence is determined to include a boosting keyword, and a step of decreasing the cumulative probability if the candidate token sequence is determined to include an inhibiting keyword.
[0031] <Detailed Description of the Invention>
[0032] The various examples described herein are provided for the purpose of clearly explaining the technical idea of the present disclosure and are not intended to limit the technical idea to specific embodiments. The technical idea of the present disclosure includes various modifications, equivalents, alternatives, and examples that are selectively combined from all or part of the examples described herein. Furthermore, the scope of the technical idea of the present disclosure is not limited to the various examples shown below or the specific descriptions thereof.
[0033] Terms used herein, including technical or scientific terms, may have the meaning commonly understood by one of ordinary skill in the art to which this disclosure belongs, unless otherwise defined.
[0034] As used herein, the terms "comprise," "may include," "have," "may comprise," "may comprise," "have," "could have," and the like refer to the presence of a feature (e.g., a function, operation, or component) of interest, but do not exclude the presence of additional features. In other words, these terms should be understood as open-ended terms that include the possibility of including other embodiments.
[0035] As used herein, singular terms may include plural meanings unless the context indicates otherwise, and this also applies to singular terms recited in the claims.
[0036] As used herein, unless the context dictates otherwise, expressions such as "first," "second," "primary," and "secondary" are used to distinguish one object from another when referring to multiple similar objects, and do not limit the order or importance of those objects. For example, multiple keywords according to the present disclosure may be distinguished from one another by being referred to as a "first keyword," a "second keyword," etc. Similarly, terms used in the present disclosure, such as "threshold frequency" and "probability distribution adjustment parameter," may be distinguished from one another by being referred to as a "first," a "second," etc.
[0037] As used herein, phrases such as "A, B, and C," "A, B, or C," "at least one of A, B, and C," or "at least one of A, B, or C" may refer to each listed item or all possible combinations of the listed items. For example, "at least one of A or B" may include all of: (1) at least one A; (2) at least one B; and (3) at least one A and at least one B.
[0038] As used herein, the term "module" may refer to software or hardware components such as a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). However, "module" is not limited to hardware and software. A "module" may be configured to be stored on an addressable storage medium and configured to execute on one or more processors. In one embodiment, a "module" may include components such as software components, object-oriented software components, class components, and task components, as well as processors, functions, attributes, procedures, subroutines, program code segments, drivers, firmware, microcode, circuits, data, databases, data structures, tables, arrays, and variables.
[0039] As used herein, the phrase "based on" is used to describe one or more factors that influence the decision, act of judgment, or behavior described in the phrase or sentence in which it appears, and does not exclude additional factors that influence that decision, act of judgment, or behavior.
[0040] As used in this document, the expression "coupled" or "connected" to a component (e.g., a first component) to another component (e.g., a second component) may mean that the component is not only directly coupled or connected to the other component, but also that the component is coupled or connected via another component (e.g., a third component).
[0041] As used herein, the phrase "configured to" may mean "set to," "capable of," "modified to," "made to," "capable of," or similar, depending on the context. This phrase is not limited to the meaning of "specially designed in terms of hardware." For example, a processor configured to perform a specific operation may mean a generic purpose processor capable of performing that specific operation by executing software, or a special purpose computer structured through programming to perform that specific operation.
[0042] In this disclosure, artificial intelligence (AI) refers to technology that mimics human learning, reasoning, and perception capabilities and realizes them on a computer, and may include concepts such as machine learning and symbolic logic. Machine learning (ML) may be an algorithmic technology that automatically classifies or learns the characteristics of input data. Artificial intelligence technology may analyze input data as a machine learning algorithm, learn the analysis results, and make judgments or predictions based on the learning results. Furthermore, technology that utilizes machine learning algorithms to mimic the cognitive and judgment functions of the human brain may also be considered to be within the scope of artificial intelligence. For example, technical fields such as linguistic understanding, visual understanding, inference / prediction, knowledge representation, and motion control may be included.
[0043] In this disclosure, machine learning may refer to the process of training a neural network model using data processing experience. Machine learning may also refer to computer software improving its own data processing capabilities. A neural network model is constructed by modeling correlations between data, and these correlations may be expressed by multiple parameters. Machine learning can be defined as an artificial neural network model that extracts and analyzes features from given data to derive correlations between data, and then repeats this process to optimize the parameters of the neural network model. For example, an artificial neural network model can learn the mapping (correlation) between input and output data given as input-output pairs. Alternatively, an artificial neural network model can derive regularities between given data and learn those relationships even when only input data is given.
[0044] In the present disclosure, an artificial neural network, an artificial intelligence learning model, a machine learning model, or an artificial neural network model may be designed to implement a human brain structure on a computer and may include multiple network nodes that simulate human neurons and have weights. The multiple network nodes may simulate the synaptic activity of neurons, in which neurons exchange signals through synapses, and may have interconnections. In an artificial neural network, the multiple network nodes may be located at different depth layers and exchange data according to convolutional connections. The artificial neural network may be, for example, an artificial neural network model, a convolutional neural network model, or the like.
[0045] Hereinafter, various embodiments of the present disclosure will be described with reference to the accompanying drawings. In the accompanying drawings and the description of the drawings, identical or substantially equivalent components may be designated by the same reference numerals. In addition, in the following description of various embodiments, repeated description of identical or corresponding components may be omitted, but this does not mean that the components are not included in the embodiment.
[0046] 1 is a diagram showing a system including a server (100), a user terminal (200), and a communication network (300) according to an embodiment of the present disclosure. The server (100) and the user terminal (200) can exchange information with each other via the communication network (300).
[0047] The server 100 may be an electronic device that performs the natural language processing operations of the present disclosure, such as an application server, a proxy server, or a cloud server, and transfers information or results of natural language processing to a user terminal 200 connected via a wired or wireless connection.
[0048] The user terminal 200 may be a terminal of a user who wishes to receive the results of natural language processing. The user terminal 200 may be, for example, at least one of a smartphone, a tablet computer, a personal computer (PC), a mobile phone, a personal digital assistant (PDA), an audio player, and a wearable device. The communication network 300 may include any of wired and wireless communication networks.
[0049] The communication network 300 may allow data to be exchanged between the server 100 and the user terminal 200. The wired communication network may include, for example, a communication network using a standard such as Universal Serial Bus (USB), High Definition Multimedia Interface (HDMI), Recommended Standard-232 (RS-232), or Plain Old Telephone Service (POTS). The wireless communication network may include, for example, communication networks related to technologies such as enhanced Mobile Broadband (eMBB), Ultra Reliable Low-Latency Communications (URLLC), Massive Machine Type Communications (MMTC), Long-Term Evolution (LTE), LTE Advance (LTE-A), New Radio (NR), Universal Mobile Telecommunications System (UMTS), Global System for Mobile communications (GSM), Code Division Multiple Access (CDMA), Wideband CDMA (WCDMA), Wireless Broadband (WiBro), Wireless Fidelity (WiFi), Bluetooth (Bluetooth), Near Field Communication (NFC), Global Positioning System (GPS), or Global Navigation Satellite System (GNSS). The communication network 300 in this specification is not limited to the above examples and may include, without limitation, various types of communication networks that allow data to be exchanged between multiple entities or devices.
[0050] In the disclosure of this specification, when describing the configuration or operation of a certain device, the term "device" may be used to refer to the device being described, and the term "external device" may be used to refer to a device that exists externally from the perspective of the device being described. For example, when describing a server (100) as a "device," the user terminal (200) may be referred to as an "external device" from the perspective of the server (100). Also, when describing a user terminal (200) as a "device," the server (100) may be referred to as an "external device" from the perspective of the user terminal (200). In other words, the server (100) and the user terminal (200) may be referred to as an "device" and an "external device," respectively, or as an "external device" and an "device," respectively, depending on the perspective of the respective operating entities.
[0051] FIG. 2 is a block diagram of a server 100 according to one embodiment of the present disclosure. The server 100 may include one or more processors 110, communication interfaces 120, or memory 130. In some embodiments, at least one of these components may be omitted from the server 100, or other components may be added to the server 100. In some embodiments, additionally or alternatively, some components may be integrated or implemented as a single or multiple entities. At least some of the components inside or outside the server 100 may be interconnected via a bus, general-purpose input / output (GPIO), serial peripheral interface (SPI), mobile industry processor interface (MIPI), or the like, to exchange data or signals.
[0052] One or more processors 110 may be referred to as processor 110. The term processor 110 may refer to a collection of one or more processors, unless the context clearly dictates otherwise. The processor 110 may run software (e.g., instructions, programs, etc.) to control at least one component of the server 100 connected to the processor 110. The processor 110 may also perform various operations, such as calculations, processing, data generation, or data manipulation. The processor 110 may also load data from or store data in the memory 130.
[0053] The communication interface 120 may perform wireless or wired communication between the server 100 and another device (e.g., the user terminal 200 or another server). For example, the communication interface 120 may perform wireless communication according to standards such as eMBB, URLLC, MMTC, LTE, LTE-A, NR, UMTS, GSM, CDMA, WCDMA, WiBro, WiFi, Bluetooth, NFC, GPS, or GNSS. The communication interface 120 may also perform wired communication according to standards such as Universal Serial Bus (USB), High Definition Multimedia Interface (HDMI), Recommended Standard-232 (RS-232), or Plain Old Telephone Service (POTS).
[0054] The memory 130 may store various data. The data stored in the memory 130 may include software (e.g., instructions, programs, etc.) that may be retrieved, processed, or used by at least one component of the server 100. The memory 130 may include volatile or nonvolatile memory. The term "memory 130" may refer to one or more sets of memory, unless the context clearly dictates otherwise. As used herein, the terms "set of instructions stored in the memory 130" or "programs stored in the memory 130" may refer to an operating system for controlling the resources of the server 100, an application, or middleware that provides various functions to applications so that the applications can utilize the resources of the server 100. In one embodiment, the memory 130 may store instructions that are executed by the processor 110 and correspond to the specific operations when the processor 110 performs the specific operations.
[0055] In one embodiment, the server 100 may transfer data corresponding to the calculation results of the processor 110, data received via the communication interface 120, or data stored in the memory 130 to an external device. The external device may be a device for presenting, displaying, or outputting the received data.
[0056] In one embodiment, the server 100 may further include an input unit 140. The input unit 140 may be a component that transmits data received from an external device to at least one component included in the server 100. For example, the input unit 140 may include at least one of a mouse, a keyboard, or a touchpad.
[0057] In one embodiment, the server 100 may further include an output unit 150. The output unit 150 may display (output) or transmit (send) information processed by the server 100 to an external device. For example, the output unit 150 may visually display information processed by the server 100. The output unit 150 may display UI (User Interface) information or GUI (Graphical User Interface) information. In this case, the output unit 150 may include at least one of a liquid crystal display (LCD), a thin film transistor-liquid crystal display (TFT-LCD), an organic light-emitting diode (OLED), a flexible display, a three-dimensional display, and an electronic ink display. For example, the output unit 150 may audibly display information processed by the server 100. The output unit 150 may display audio data conforming to any audio file format (e.g., MP3, FLAC, WAV, etc.) through an audio device. In this case, the output unit 150 may include at least one of a speaker, a headset, or headphones. For example, the output unit 150 may also transfer information processed by the server 100 to an external output device. The output unit 150 may transfer or send information processed by the server 100 to an external output device using the communication interface 120. The output unit 150 may also transfer or send information processed by the server 100 to an external output device using a separate output communication interface.
[0058] 3 is a block diagram of a user terminal 200 according to one embodiment of the present disclosure. The user terminal 200 may include one or more processors 210, a communication interface 220, or a memory 230. The user terminal 200 may also include at least one of an input unit 240 or an output unit 250.
[0059] The processor 210 may run software (e.g., instructions, programs, etc.) to control at least one component of the user terminal 200 connected to the processor 110. The processor 210 may also perform various operations such as calculations, processing, data generation or processing, etc. The processor 210 may also load data, etc. from the memory 230 and store data, etc. in the memory 230.
[0060] The communication interface 220 may perform wireless or wired communication between the user terminal 200 and another device (e.g., the server 100 or another user terminal). For example, the communication interface 220 may perform wireless communication according to a standard such as eMBB, URLLC, MMTC, LTE, LTE-A, NR, UMTS, GSM, CDMA, WCDMA, WiBro, WiFi, Bluetooth, NFC, GPS, or GNSS. For example, the communication interface 220 may perform wired communication according to a standard such as USB, HDMI, RS-232, or POTS.
[0061] The memory 230 may store various data. The data stored in the memory 230 may include software (e.g., instructions, programs, etc.) that may be retrieved, processed, or used by at least one component of the user terminal 200. The memory 230 may include volatile or nonvolatile memory. The term "memory 230" may refer to one or more sets of memory, unless the context clearly dictates otherwise. As used herein, the terms "set of instructions stored in the memory 230" or "programs stored in the memory 230" may refer to an operating system for controlling resources of the user terminal 200, an application, or middleware that provides various functions to applications so that the applications can utilize the resources of the user terminal 200. In one embodiment, when the processor 210 performs a particular operation, the memory 230 may store instructions that are executed by the processor 210 and correspond to the particular operation.
[0062] In one embodiment, the user terminal 200 may further include an input unit 240. The input unit 240 may be a component that transmits data received from an external device to at least one component included in the user terminal 200. For example, the input unit 240 may include at least one of a mouse, a keyboard, or a touchpad.
[0063] In one embodiment, the user terminal 200 may further include an output unit 250. The output unit 250 may display (output) or transmit (send) information processed by the user terminal 200 to an external device. For example, the output unit 250 may visually display information processed by the user terminal 200. The output unit 250 may display UI (User Interface) information, GUI (Graphical User Interface) information, etc. In this case, the output unit 250 may include at least one of a liquid crystal display (LCD), a thin film transistor liquid crystal display (TFT-LCD), an organic light emitting diode (OLED), a flexible display, a 3D display, and an electronic ink display. For example, the output unit 250 may audibly display information processed by the user terminal 200. The output unit 250 may display audio data conforming to any audio file format (e.g., MP3, FLAC, WAV, etc.) through an audio device. In this case, the output unit 250 may include at least one of a speaker, a headset, or headphones. For example, the output unit 250 may also transfer information processed by the user terminal 200 to an external output device. The output unit 250 may transfer or send information processed by the user terminal 200 to an external output device using the communication interface 220. The output unit 250 may also transfer or send information processed by the user terminal 200 to an external output device using another output communication interface.
[0064] In the following description, for convenience of explanation, the subject of the operation may be omitted, and in this case, it may be understood that each operation is performed by the server 100. However, the method according to the present disclosure may also be performed by the user terminal 200, and some of the operations included in the method may be performed by the user terminal 200 and the rest may be performed by the server 100.
[0065] FIG. 4 is a diagram illustrating an exemplary flowchart of a natural language processing method according to an embodiment of the present disclosure.
[0066] The server 100 may acquire a boosting keyword set (S410). The boosting keyword set may include at least one boosting keyword that is a target for promoting generation when generating sentences using an artificial neural network model.
[0067] In natural language processing, text data, the data to be processed, is converted into a form that can be recognized and operated on by a computer. This conversion process may involve tokenization, which divides the text data into certain units, and embedding, which converts individual tokens into vector values that can be recognized and processed by a computer. The byte pair encoding (BPE) technique may be used for tokenization. Generally, BPE is a technique that creates a vocabulary by breaking down words into characters or Unicode units, and then generates tokens by merging consecutive characters or Unicodes in the vocabulary according to their frequency of appearance. In one embodiment, the tokenization process may be byte-level BPE. Assuming that individual characters contained in natural language data are encoded using UTF-8, byte-level BPE refers to a technique in which each character is broken down into 1 to N bytes (N is an integer greater than or equal to 1) to create an initial vocabulary on a byte-by-byte basis, and then successively performs merging steps from there to ultimately generate a vocabulary with a predetermined number of elements. On the other hand, the embedding process is a process of converting each token generated by the tokenization process into an embedding vector, which can be generated by various techniques such as Glove, FastText, Word2Vec, etc.
[0068] JPEG2025187003000002.jpg58150
[0069] In this disclosure, the term "keyword" is used to refer to a token sequence having a predetermined length, and is a concept that includes boosting keywords and suppressed keywords. A "boosting keyword" may be used to refer to a specific token sequence whose generation is promoted so as to be included in a sentence when the server (100) generates a sentence using an artificial neural network model. Also, a "suppressed keyword" may be used to refer to a specific token sequence whose generation is suppressed so as not to be included in a sentence when the server (100) generates a sentence using an artificial neural network model.
[0070] Next, the server 100 may acquire a suppression keyword set (S420). The suppression keyword set may include at least one suppression keyword that is to be suppressed when generating sentences using the artificial neural network model.
[0071] In one embodiment of the present disclosure, the boosting keyword set may be a keyword set for a first language (e.g., Korean), and the suppressed keyword set may be a keyword set for a second language (e.g., English, Chinese, or Japanese). Specifically, the boosting keyword set may be configured to include token sequences that satisfy a specific occurrence condition within the entire set of token sequences after tokenization is performed on public text data for the first language. The suppressed keyword set may be configured to include token sequences that satisfy a specific occurrence condition within the entire set of token sequences after tokenization is performed on public text data for the second language. The specific occurrence condition may be, for example, a condition that is satisfied if a keyword appears a predetermined number of times (n times) or more, or a condition that is satisfied if a keyword appears with a predetermined probability (n%) or more. When generating sentences using an artificial neural network model using a boosting keyword set for a specific language (first language) and a suppressed keyword set for another language (a second language other than the first language), the generation of keywords for the first language is promoted while the generation of keywords for the second language is suppressed, thereby generating sentences that are more suitable for use in the first language. A specific sentence generation method will be described in detail below.
[0072] In one embodiment of the present disclosure, the boosting keyword set or the suppression keyword set may be generated based on a comparison of word distribution in public data for the target language with word distribution in specific data input by a user, where the public data refers to publicly available data available to anyone via the Internet, and the specific data refers to data input by a user.
[0073] In one embodiment, the boosting keyword set may include words that appear in the unique data a predetermined number of times or more. In another embodiment, the boosting keyword set may include words that appear in the unique data at a predetermined frequency or more. In another embodiment, the boosting keyword set may include words that appear in the public data at a frequency lower than a first threshold frequency but that appear in the unique data at a frequency higher than a second threshold frequency. Specifically, the boosting keyword set may include words (i.e., token sequences) that appear in the public data at a low frequency (e.g., 0.01% or less) but that appear in the unique data entered by a user at a high frequency (e.g., 0.05% or more). The first and second threshold frequencies may be appropriately set based on word distribution statistics for the public data and the unique data, respectively. For example, the first threshold frequency may be set as the first quartile of the probability of occurrence of each word in the public data, and the second threshold frequency may be set as the third quartile of the probability of occurrence of each word in the unique data, etc. The boosting keyword set may also include words that appear in the public data at a frequency lower than a first threshold frequency but that appear in the private data a certain number of times or more.
[0074] In one embodiment, the suppression keyword set may include words that appear in the public data with a frequency higher than a third threshold frequency but appear in the unique data with a frequency lower than a fourth threshold frequency. Specifically, the suppression keyword set may include words that appear in the public data with a high frequency (e.g., 0.05% or less) but appear in the unique data entered by the user with a low frequency (e.g., 0.01% or less). The third and fourth threshold frequencies, like the first and second threshold frequencies described above, may be appropriately set based on word distribution statistics for the public data and the unique data, respectively. The suppression keyword set may also include words that appear in the public data with a frequency higher than the third threshold frequency but appear a certain number of times or less in the unique data.
[0075] As described above, the present disclosure can generate a boosting keyword set or a suppression keyword set by comparing the word distribution in the public data for the target language with the word distribution in the specific data entered by the user. This has the effect of selecting words that are more frequently used or less frequently used in the specific data based on the basic word distribution of the public data for the target language, and efficiently reflecting this in sentence generation using an artificial neural network model.
[0076] The server (100) may then generate a sentence through an artificial neural network model based on the boosting keyword set and the suppression keyword set (S430). In this disclosure, a sentence may be composed of one or more consecutive tokens and may include a keyword. In this disclosure, a sentence may be a token sequence in which subsequent tokens are sequentially arranged and determined repeatedly at each step by the artificial neural network model.
[0077] Specifically, the server 100 may calculate a generation probability for each of a plurality of tokens based on the output of the artificial neural network model for the input token sequence. The generation probability may be expressed, for example, as in Equation 1 below.
[0078]
number
[0079] Equation 1 represents the probability of generating the t-th token based on the input token sequence. t indicates the t-th token, and x1 t-1 is the number of tokens from the first token to the t-1th token (t is 1 or more, x1 0 denotes the input token sequence at step t, including the token sequence up to φ). α denotes the embedding vector for a specific token (α) that is an element included in the set of all tokens (vocabulary, V), and h tindicates the output value of the last layer of the model (e.g., a logit function). Furthermore, T on the right-hand side is a probability distribution adjustment parameter for adjusting the probability distribution and may be referred to as temperature. The probability distribution adjustment parameter (T) of the present disclosure is a parameter that is globally applied to the entire token set (V). As its value becomes infinitely larger, the overall probability values converge to similar values regardless of the model output for each individual token. Therefore, compared to when the probability distribution adjustment parameter is not used, fewer tokens with a high generation probability relative to the conventional probability distribution are selected, and more tokens with a low generation probability are selected. On the other hand, as the value of the probability distribution adjustment parameter approaches 0, the model output for each individual token is amplified. Therefore, compared to when the probability distribution adjustment parameter is not used, more tokens with a high generation probability relative to the conventional probability distribution are selected, and fewer tokens with a low generation probability are selected. As exemplified in the above-mentioned Equation 1, the server (100) of the present disclosure may calculate the generation probability for each of multiple tokens corresponding to elements of the entire token set (V). The server (100) can determine the token with the highest calculated generation probability as the subsequent token.
[0080] According to an embodiment of the present disclosure, the server 100 may calculate the generation probability differently depending on the classification of each token. A method of calculating the generation probability differently depending on the classification of each token may be expressed, for example, as in the following Equations 2 and 3.
[0081]
number
[0082]
number
[0083] Equation 2 replaces T in equation 1 with T T x In this case, T xrepresents the token-level temperature (i.e., the probability distribution adjustment parameter) for the x-th token. Equation 3 represents the token-level temperature, and T B is the token (x) in the boosted keyword set (V B ) and T S is the set of tokens (V S ) indicates a suppression probability distribution parameter used when the token set of the boosting keyword set is included in the token sequence that constitutes each boosting keyword. In this case, the token set of the suppression keyword set may be a set made up of tokens included in the token sequence that constitutes each suppression keyword. In other words, when calculating the generation probability for each of a plurality of tokens, if the token is a token included in the token set of the boosting keyword set, the server (100) uses a boosting probability distribution adjustment parameter (T B ) to calculate the generation probability, and if the token is included in the token set of the suppression keyword set, the suppression probability distribution adjustment parameter (T S ) can be calculated using the boosting probability distribution parameter (T B ) can be a real number smaller than 1 to increase the selection probability of tokens included in the boosting keywords, and the value of the suppression probability distribution parameter (T S The value of ( ) may be a real number greater than 1 to lower the probability of selecting a token included in the suppressed keyword. As described above, the server 100 may use different probability distribution adjustment parameters depending on the classification of the token to calculate different generation probabilities for each token and determine the subsequent tokens that follow the input sequence accordingly.
[0084] The server (100) of the present disclosure may utilize a keyword trie containing one or more nodes to generate sentences through an artificial neural network model.
[0085] 5 is a conceptual diagram illustrating an example of a keyword trie according to an embodiment of the present disclosure. Each node of the keyword trie may include a token and a keyword state value. The keyword state value of a node is determined by the root node (N root ) to the node in question. For example, the root node (N root ) to t node (N t ), if the sequence of consecutive tokens arranged by tracing the trie structure up to the t ) may have a keyword status value of 1. Also, for example, the root node (N root ) to t node (N t ) corresponds to the suppression keyword, the t-node (N t ) can have a keyword status value of -1. Also, for example, the root node (N root ) to t node (N t ) does not correspond to either the boosting keyword or the suppression keyword, the t-node (N t ) may have a keyword state value of 0. Hereinafter, in this disclosure, each node of a keyword trie may be expressed as (v, s), where v may represent the tokens possessed by the node and s may represent the keyword state value of the node. Each node of a keyword trie may have a different state value depending on whether the token sequence of the node located on the path from the root node to the node corresponds to a boosting keyword, a suppressed keyword, or neither a boosting keyword nor a suppressed keyword.
[0086] In the present disclosure, a keyword trie can be generated based on a boosting keyword set or a suppression keyword set. For illustration, refer to the keyword trie in FIG. 5, where the boosting keyword set is {[v,v 22 ],[v2,v 21 ,v 212 ]}, and the suppression keyword set is {[v2,v 21 ,v 211 ],[v2,v 22 ,v 221 ]}. In this case, the first token of each token sequence included in the entire token sequence set is common to v2, so the common token v2 can be located in the first parent node. Also, the root node (N root ) to token v2, the keyword state value of the node with token v2 can be 0 because it is not included in the boosting keyword set or the suppression keyword set. Therefore, the parent node of the set of all token sequences with token v2 can be expressed as (v2,0). Next, the token following token v2 in the set of all token sequences is token v 21 or token v 22 Therefore, the child nodes of the parent node (i.e., (v2,0)) are token v 21 or token v 22 In this case, we can place a node containing the token v 21 The token sequence ([v2,v 21 ]) is not included in the boosting keyword set or the suppression keyword set, so the token v 21 The keyword state value of a node with token v can be 0. 21 The node with (v 21 ,0) from the root node to the token v 22 The token sequence ([v2,v 22]) is a token sequence included in the boosting keyword set, so token v 22 The keyword state value of a node with token v can be 1. 22 The node with (v 22 ,1) The above is merely an example of generating a keyword trie based on a boosting keyword set or a suppression keyword set, and is not intended to limit the present disclosure.
[0087] FIG. 6 is a diagram showing an example of a flowchart relating to a first embodiment of generating a sentence using a keyword trye.
[0088] The server 100 may generate a first token sequence using a first probability distribution adjustment parameter (i.e., a boosting probability distribution adjustment parameter) (S610). Specifically, in step t (t is a natural number greater than or equal to 1), the server 100 inputs a first token sequence of length t-1, including the first token through the t-1th token, to an artificial neural network model, calculates a generation probability for each of the tokens using the first probability distribution adjustment parameter for the output of the artificial neural network model, determines a subsequent token according to the calculated generation probability, and concatenates the determined subsequent token to the t-1th token, thereby generating a first token sequence of length t. The generation probability calculated by the server 100 for each of the tokens using the boosting probability distribution parameter may be calculated, for example, according to Equation 2 above and Equation 4 below.
[0089]
number
[0090] Equation 4 is an equation obtained by removing the suppression probability distribution parameter from Equation 3, and the boosting probability distribution parameter (T B ) using token level T x The calculation formula for the token level T in Equation 4 is shown below. xWhen applying Equation 2, the server (100) can calculate the generation probability using the boosting probability distribution parameters.
[0091] The server (100) may generate a second token sequence using the first probability distribution adjustment parameter (i.e., the boosting probability distribution parameter) and the second probability distribution adjustment parameter (i.e., the suppression probability distribution parameter) (S620). That is, in step t (t is a natural number greater than or equal to 1), the server (100) inputs a token sequence of length t-1 including the first token through the t-1th token to an artificial neural network model, calculates a generation probability for each of the multiple tokens using the first probability distribution adjustment parameter and the second probability distribution adjustment parameter for the output of the artificial neural network model, determines a subsequent token according to the calculated generation probability, and concatenates the subsequent token to follow the t-1th token, thereby generating a second token sequence of length t. The generation probability calculated by the server (100) for each of the multiple tokens using the boosting probability distribution parameter and the suppression probability distribution parameter may be calculated, for example, using the above-mentioned Equations 2 and 3.
[0092] The server 100 may replace one of the first and second token sequences with the other token sequence if a predetermined condition is met (S630). In this case, the predetermined condition may be a condition whose existence or non-existence is determined based on a keyword trie.
[0093] The server (100) may replace the first token sequence with the second token sequence if the keyword try determines that the first token sequence includes a suppressed keyword.
[0094] In one embodiment, the server (100) may determine that the first token sequence of length t contains a suppressed keyword if, in step t, the node corresponding to the token newly added to the first token sequence of length t-1 is a leaf node in the keyword trie and the keyword state value of the node indicates a suppressed keyword (e.g., -1).
[0095] In one embodiment, if, in step t, a node corresponding to a token newly added to a first token sequence of length t-1 is not a leaf node in the keyword trie and the state value of the node indicates a suppression keyword (e.g., -1), the server (100) may set a variable indicating that the first token sequence of length t may contain a suppression keyword to a True value and execute the next step. That is, in such a case, in step t, the server (100) may suspend the determination of whether the first token sequence contains a suppression keyword, save only the possibility that the first token sequence contains a suppression keyword, and proceed with the subsequent step (i.e., step t+1 and subsequent steps). In this case, if, in the subsequent step, the variable indicating that the first token sequence may contain a suppression keyword is True and the node corresponding to the token newly added to the first token sequence does not exist in the keyword trie or is a leaf node in the keyword trie with a state value indicating a suppression keyword, the server (100) may determine that the first token sequence contains a suppression keyword.
[0096] The server (100) may replace the second token sequence with the first token sequence if the keyword trie determines that the first token sequence contains a boosting keyword or does not contain a suppression keyword.
[0097] In one embodiment, the server (100) may determine that the first token sequence of length t contains a boosting keyword if, at step t, the node corresponding to the token newly added to the first token sequence of length t-1 is a leaf node in the keyword trie and the keyword state value of the node indicates a boosting keyword (e.g., 1).
[0098] In one embodiment, the server (100) can determine that, in step t, if there is no node in the keyword trie corresponding to a token newly added to the first token sequence of length t-1, and if a variable indicating that the first token sequence may contain a suppressed keyword has a value of False, the first token sequence contains a boosted keyword.
[0099] As described above, the server (100) may generate a token sequence that includes more boosting keywords and fewer suppression keywords by replacing one of the first and second token sequences with the other token sequence according to a predetermined condition determined based on the keyword trie. That is, the server (100) of the present disclosure calculates, at each step, all of the first token sequence generated using the boosting probability distribution parameter and the second token sequence generated using the boosting probability distribution parameter and the suppression probability distribution parameter, and if a suppression keyword is detected in the first token sequence, it may replace the first token sequence with the second token sequence generated by further suppressing the suppression keyword, thereby removing the suppression keyword. Furthermore, if a boosting keyword is detected in the first token sequence, it may replace the second token sequence up to the current point with the first token sequence, thereby synchronizing subsequent operations. Furthermore, the server (100) that determines the conditions for suppression keywords or boosting keywords using a keyword trie does not iterate through the entire token sequence or from the root to the current node in the process of determining whether a token sequence includes a boosting keyword or a suppression keyword, but can immediately determine whether a token sequence includes a boosting keyword or a suppression keyword using only the node position and keyword state value of the last token according to the data structure of the keyword trie described above, thereby having the advantage of increasing the calculation speed.
[0100] FIG. 7 is a diagram showing an example of a flowchart relating to a second embodiment of generating a sentence using a keyword trye.
[0101] The server (100) may generate a first token sequence using the first probability distribution adjustment parameter (i.e., the boosting probability distribution adjustment parameter) (S710). Step S710 in Figure 7 may be performed in the same manner as or similar to step S610 in Figure 6, so a duplicated description will be omitted.
[0102] If the server (100) determines that the first token sequence includes the suppressed keyword, the server (100) may generate a second token sequence using the first probability distribution adjustment parameter and the second probability distribution adjustment parameter (S720).
[0103] If the first token sequence is determined to include a suppressed keyword, the input token sequence for generating the second token sequence may be determined based on the node path of the keyword trie at the time the first token sequence is determined to include a suppressed keyword.
[0104] For example, the token sequence corresponding to the suppression keyword is "[v s1 ,v s2 ,v s3 ]" and the node path corresponding to such a token sequence is expressed as "[Root,(v s1 ,0),(v s2 ,0),(v s3 ,-1)]. Also, suppose that the server (100) receives a first token sequence of length 5, “[v1,v2,v3,v s1 ,v s2 ]" followed by the token (v s3 ) to create the first token sequence of length 6: [v1,v2,v3,v s1 ,v s2 ,v s3 ]" is generated. In this case, the server (100) can determine that the first token sequence contains a suppression keyword by using the keyword trie. In this case, the server (100) generates the token sequence "[v s1 ,v s2 ,v s3 ]" from the first token sequence, and replace the token sequence with the input token sequence "[v s1 ,v s2 ,v s3]" to generate the second token sequence. That is, the input token sequence input to the artificial neural network model to generate the second token sequence may be a token sequence obtained by deleting the suppressed keyword from the first token sequence.
[0105] Unlike the first embodiment, the server (100) according to the second embodiment may generate a second token sequence to replace the first token sequence when the first token sequence is determined to include a suppressed keyword. This allows the present disclosure to generate a sentence that includes many boosting keywords and few suppressed keywords while reducing the amount of storage space used. Furthermore, in the second embodiment, the suppressed keywords included in the first token sequence are deleted and then new tokens are generated to generate the second token sequence, which has the effect of removing suppressed keywords that have been detected a predetermined number of times or more.
[0106] FIG. 8 is a diagram showing an example of a flowchart relating to a third embodiment in which a sentence is generated using a keyword trye.
[0107] The server (100) may generate multiple candidate token sequences by determining multiple successor tokens for each of N (N is a natural number greater than or equal to 2) token sequences of length t (t is a natural number greater than or equal to 1) using an artificial neural network model (S810). That is, in each step, the server (100) may perform an operation through the artificial neural network model on each of the N token sequences to generate multiple (e.g., M) successor tokens, resulting in a total of N x M candidate token sequences.
[0108] The server (100) may calculate the cumulative probability for each of a plurality of candidate token sequences according to a predetermined calculation method (S820). The cumulative probability for a token sequence may be the cumulative product of the generation probabilities of subsequent tokens newly added at each step. For example, if the generation probabilities of each token in the token sequence "[v1, v2, v3]" are 0.9, 0.8, and 0.1, respectively, the cumulative probability of the token sequence may be 0.072 (= 0.9 × 0.8 × 0.1).
[0109] The server 100 may increase the cumulative probability when a candidate token sequence is determined to include a boosting keyword. For example, if a subtoken sequence "[v2, v3]" in a candidate token sequence "[v1, v2, v3]" corresponds to a boosting keyword, the server 100 may increase the cumulative probability of the candidate token sequence. Increasing the cumulative probability may be performed by adding a predetermined positive weight to the cumulative probability, multiplying the cumulative probability by a real number greater than 1, or the like.
[0110] The server 100 may decrease the cumulative probability when it determines that a candidate token sequence contains a suppressed keyword. For example, in a candidate token sequence "[v1, v2, v3]," if a subtoken sequence "[v2, v3]" corresponds to a suppressed keyword, the server 100 may decrease the cumulative probability of the candidate token sequence. The decrease in cumulative probability may be performed by adding a predetermined negative weight to the cumulative probability, multiplying the cumulative probability by a real number less than 1, or the like.
[0111] The server (100) may determine N token sequences of length t+1 from among the multiple candidate token sequences based on the cumulative probability for each of the multiple candidate token sequences (S830). That is, if the server (100) generates M subsequent tokens for each token sequence in descending order of generation probability at each step, the server (100) may determine N token sequences in descending order of cumulative probability from a total of N×M candidate token sequences at each step.
[0112] The server (100) according to the third embodiment generates sentences by considering N token sequences at each step, and therefore not only can solve the problem of a greedy algorithm that generates sentences with a single output, but also can more efficiently generate sentences that contain more boosting keywords and fewer suppression keywords by adjusting the cumulative probability using a keyword trie generated based on a boosting keyword set or a suppression keyword set.
[0113] In the flowcharts or flow charts of the disclosure herein, the steps of a method or algorithm are described in a sequential order, but the steps may be performed sequentially or in any combinable order. The description of flowcharts or flow charts herein does not exclude variations or modifications to the method or algorithm, and does not imply that any step is essential or desirable. In some embodiments, at least some steps may be performed in parallel, iteratively, or heuristically. In some embodiments, at least some steps may be omitted, or other steps may be added.
[0114] Various embodiments of the disclosure herein may be implemented as software in a machine-readable storage medium. The software may be software for implementing various embodiments of the disclosure herein. The software may be inferred from various embodiments of the disclosure herein by a programmer skilled in the art. For example, the software may be a program including machine-readable instructions (e.g., code or code segments). A machine is a device operable according to instructions retrieved from a storage medium, such as a computer. In one embodiment, the machine may be a computing device according to various embodiments of the disclosure herein. In one embodiment, the processor of the machine may execute the retrieved instructions to cause machine components to perform functions corresponding to the instructions. In one embodiment, the processor may be the processor 110, 210 according to embodiments of the disclosure herein. A storage medium may refer to any type of recording medium that is machine-readable and on which data is recorded. The storage medium may include, for example, a ROM, a RAM, a CD-ROM, a magnetic tape, a flexible disk, an optical data storage device, etc. In one embodiment, the storage medium may be memory (130, 230). In one embodiment, the storage medium may be implemented in a distributed form, such as in computer systems connected via a network. Software may be stored and executed in a distributed manner in the computer systems. The storage medium may be a non-transitory storage medium. A non-transitory storage medium refers to a tangible medium that exists regardless of whether data is stored semi-permanently or temporarily, and does not include a signal that is propagated transitorily.
[0115] Although the technical idea of the disclosure of the present specification has been described above using various embodiments, the technical idea of the disclosure of the present specification includes various substitutions, modifications, and alterations that can be made within the scope of what a person skilled in the art to which the disclosure of the present specification pertains can understand. Furthermore, it should be understood that such substitutions, modifications, and alterations are included in the scope of the appended claims.
Claims
1. 1. A natural language processing method executed on an electronic device including one or more processors and one or more memories storing instructions for execution by said one or more processors, comprising: A step of obtaining a boosting keyword set, the boosting keyword set including at least one boosting keyword to be targeted for boosting sentence generation when generating sentences using an artificial neural network model; a step of acquiring a suppression keyword set, the suppression keyword set including at least one suppression keyword to be suppressed when generating sentences using an artificial neural network model; generating sentences through an artificial neural network model based on the boosting keyword set and the suppression keyword set; A method comprising:
2. The method of claim 1 , wherein the boosting keyword set is a keyword set for a first language and the suppression keyword set is a keyword set for a second language.
3. The boosting keyword set or the suppression keyword set is The method of claim 1 , wherein the target language is generated based on the word distribution in public data about the target language and the word distribution in specific data input by the user.
4. The boosting keyword set is The method of claim 3 , wherein the words that appear in the public data with a frequency lower than a first threshold frequency include words that appear in the private data with a frequency higher than a second threshold frequency.
5. The suppression keyword set is The method of claim 3 , further comprising the step of: including, among words that appear in the public data with a frequency higher than a third threshold frequency, words that appear in the private data with a frequency lower than a fourth threshold frequency.
6. The step of generating sentences through the artificial neural network model includes: calculating a generation probability for each of a plurality of tokens based on the output of the artificial neural network model for an input token sequence; determining a successor token; The method of claim 1 , comprising:
7. The generation probability for each of the plurality of tokens is The method according to claim 6, wherein the tokens are calculated differently depending on the classification of each token.
8. The generation probability for each of the plurality of tokens is 7. The method of claim 6, wherein if a token is a token included in a set of tokens of the boosting keyword set, the calculation is performed using a first probability distribution adjustment parameter for increasing the generation probability, and if the token is a token included in a set of tokens of the suppression keyword set, the calculation is performed using a second probability distribution adjustment parameter for decreasing the generation probability.
9. The step of generating sentences through the artificial neural network model includes: It is performed using a keyword trie containing one or more nodes, The method of claim 1 , wherein the one or more nodes each include a token and a keyword state value associated with a token sequence including the token of each node in a path from a root node to a current node.
10. The keyword trye may be The method of claim 9 , wherein the keyword set is generated based on the boosting keyword set or the suppression keyword set.
11. The step of generating sentences through the artificial neural network model includes: generating a first token sequence using a first probability distribution adjustment parameter; generating a second token sequence using the first probability distribution adjustment parameter and the second probability distribution adjustment parameter; replacing one of the first and second token sequences with the other token sequence if a predetermined condition is met; The method of claim 9 , comprising:
12. If the predetermined condition is satisfied, the step of replacing one of the first token sequence and the second token sequence with the other token sequence includes: if the first token sequence is determined to include a suppressed keyword, replacing the first token sequence with the second token sequence; replacing the second token sequence with the first token sequence if the first token sequence is determined to include a boosting keyword or not include a suppressed keyword; The method of claim 11 , comprising:
13. The step of generating sentences through the artificial neural network model includes: generating a first token sequence using a first probability distribution adjustment parameter; generating a second token sequence using the first probability distribution adjustment parameter and the second probability distribution adjustment parameter when the first token sequence is determined to include a suppressed keyword; 10. The method of claim 9, comprising:
14. The step of generating sentences through the artificial neural network model includes: generating a plurality of candidate token sequences by determining a plurality of successor tokens for each of N (N is a natural number equal to or greater than 2) token sequences using the artificial neural network model; calculating a cumulative probability for each of the plurality of candidate token sequences according to a predetermined calculation method; determining N token sequences from the plurality of candidate token sequences based on the cumulative probabilities; 10. The method of claim 9, comprising:
15. calculating a cumulative probability for each of the plurality of candidate token sequences according to the predetermined calculation method, increasing the cumulative probability if the candidate token sequence is determined to include a boosted keyword; decreasing the cumulative probability if the candidate token sequence is determined to contain a suppressed keyword; 15. The method of claim 14, comprising:
16. In an electronic device, one or more processors; one or more memories storing instructions for execution by the one or more processors; The one or more processors: A boosting keyword set is obtained, and the boosting keyword set includes at least one boosting keyword to be used for promoting generation when generating sentences using an artificial neural network model; A suppression keyword set is obtained, and the suppression keyword set includes at least one suppression keyword that is to be suppressed when generating sentences using an artificial neural network model; An electronic device that generates sentences based on the boosting keyword set and the suppression keyword set through an artificial neural network model.
17. A non-transitory computer-readable medium having stored thereon instructions that, when executed by one or more processors, cause the one or more processors to perform operations, comprising: The instructions cause the one or more processors to: A step of obtaining a boosting keyword set, the boosting keyword set including at least one boosting keyword to be targeted for boosting sentence generation when generating sentences using an artificial neural network model; a step of acquiring a suppression keyword set, the suppression keyword set including at least one suppression keyword to be suppressed when generating sentences using an artificial neural network model; generating sentences through an artificial neural network model based on the boosting keyword set and the suppression keyword set; A computer-readable recording medium that causes the computer to execute the above steps.
Citation Information
Patent Citations
Text generation method and device, computer equipment and storage medium
CN117973380A
Information processing device, information processing method, and program
JP2020035019A
Sentence generation method and apparatus using multiple keywords based on artificial intelligence
KR1020230112514A