Natural language processing method, natural language processing system, and natural language processing program
The natural language processing system addresses the challenge of unclear grammatical definitions in Japanese by using a word dictionary and templates to recognize dependency relationships and colloquial expressions, enhancing the naturalness and accuracy of human-computer dialogues.
Patent Information
- Application Number
- JP2024106723
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2044-07-02
AI Technical Summary
Existing Japanese natural language processing technologies struggle with accurately recognizing dependency relationships and colloquial expressions due to the lack of clear grammatical definitions in Japanese, leading to difficulties in generating natural and appropriate responses in human-computer dialogues.
A natural language processing system that utilizes a word dictionary with attribute information and predefined templates to analyze input sentences, allowing for accurate recognition of dependency relationships and colloquial expressions, and generates appropriate responses by selecting templates based on the combination of elements in the input sentence.
Enables more natural and accurate dialogue by effectively recognizing the meaning of input sentences, including colloquial expressions, and generating appropriate responses that align with the speaker's intended meaning, thereby improving human-computer interaction.
Smart Images

Figure 2026007155000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a Japanese natural language processing method, a natural language processing system, and a natural language processing program. [Background technology]
[0002] Conventionally, technologies for enabling humans to interact with computers that perform natural language processing have been known. By using natural language processing suited to each language, more natural interactions between computers and humans can be realized, and natural language processing technologies that are particularly suited to the Japanese language are known.
[0003] Patent Document 1 discloses a technology for more appropriately completing function words that need to be supplemented in an intermediate predicate. Patent Document 1 assigns semantic labels to functional expressions of predicates and further classifies them into three types: Mod, Foc, and T. A tense determination unit 71 determines whether a functional expression needs to be supplemented for the intermediate predicate based on the meaning and type of the functional expression of the intermediate predicate to be supplemented and the conjunction following the intermediate predicate. For an intermediate predicate that is determined to need a functional expression to be supplemented, a completion processing unit 72 compares the semantic labels of the intermediate predicate and the functional expression of the predicate to be supplemented immediately after it. Based on the type of functional expression (Mod, Foc, T) of the intermediate predicate, the technology determines the functional expression that is "missing" in the intermediate predicate. Patent Document 1 discloses that only the functional expressions of the immediately following predicate that are missing the intermediate predicate are supplemented.
[0004] Patent Document 2 discloses a technology that can generate appropriate questions at low cost. Patent Document 2 discloses that a question candidate generation unit 29 generates question candidates by inputting at least one label to a template created from a question, in which words contained in the question are left blank and parts of speech and semantic attributes of the words are assigned to the blanks, and replacing the blanks with words that are characteristic of the input label and correspond to the parts of speech and semantic attributes assigned to the blanks. A question evaluation unit 30 calculates a score representing the likelihood of each question candidate using a language model corresponding to the input label, and outputs question candidates with high likelihood as questions. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] Japanese Patent Application Laid-Open No. 2011-164678 [Patent Document 2] Patent Publication No. 2017-27233 Summary of the Invention [Problem to be solved by the invention]
[0006] An object of the present invention is to provide a novel technique for conducting more natural dialogue in Japanese natural language processing. [Means for solving the problem]
[0007] In order to solve the above-mentioned problems, the present invention is a natural language processing method in which a computer stores in a memory unit a word dictionary in which attribute information is assigned to words, which are elements that themselves have meaning, and templates in which combinations of multiple elements are defined, and selects a template that corresponds to an input sentence based on the combination of elements that make up the input sentence.
[0008] The present invention also provides a natural language processing system that includes a memory unit that stores a word dictionary in which attribute information is assigned to words, which are elements that have meaning in themselves, and templates in which combinations of multiple elements are defined, and a template processing unit that selects a template that corresponds to an input sentence based on the combination of elements that make up the input sentence.
[0009] The present invention also provides a natural language processing program that causes a computer having stored in a storage unit a word dictionary in which attribute information is assigned to words, which are elements that have meaning in themselves, and templates in which combinations of a plurality of elements are defined, to function as a template processing unit that selects a template that corresponds to an input sentence based on the combination of elements that make up the input sentence.
[0010] In a preferred embodiment of the present invention, the elements include elements that have meaning when combined with words, and the templates have one or more groups of the words and zero, one, or more groups of the elements as comparison targets, as well as positional information indicating the order of the comparison targets in the input sentence, and the templates are selected by comparing the groups to which the elements constituting the input sentence belong according to the order.
[0011] Japanese does not have a clear grammatical definition for word order, making it difficult to recognize dependency relationships between words when the word order changes. Furthermore, Japanese does not have a clear grammatical definition for colloquial expressions. While some colloquial expressions contain important meanings that affect the meaning of the entire sentence, it has been difficult for natural language processing to accurately recognize the meanings contained in these expressions. The above-described configuration allows input sentences to be classified as combinations of attributes, enabling abstract recognition including dependency relationships and colloquial expressions.
[0012] In a preferred embodiment of the present invention, the templates include a dialogue template for recognizing an input sentence from a combination of elements contained in the input sentence, and a word template for recognizing a plurality of consecutive elements contained in the input sentence as a single unit element, and the plurality of consecutive elements that make up the input sentence are grouped into a single unit element by applying the word template, and the dialogue template is selected using the elements grouped by the word template.
[0013] With this configuration, it is possible to distinguish between words or elements that modify other words and the words that are modified, thereby enabling more accurate semantic recognition of the input sentence.
[0014] In a preferred embodiment of the present invention, instruction information for a reply sentence to an input sentence is further stored in association with the template, and a reply sentence to the input sentence is generated in accordance with the instruction information associated with the selected template. In a preferred embodiment of the present invention, the instruction information includes any of the following processes using attribute information of a specific element included in the input sentence: replacing it with a word having a common attribute, converting the inflected form of the element, converting the word into a superordinate concept, or converting the word's position. In a preferred embodiment of the present invention, the instruction information is an instruction to generate a reply sentence using a specific template. In a preferred embodiment of the present invention, the attribute information includes a first attribute that defines the meaning of a word by a combination of classifications having a hierarchical structure of two or more levels, and the instruction information is an instruction to generate an answer sentence using a predetermined word that is identified by manipulating the positional relationship in the hierarchical structure of the first attribute of a word included in the input sentence. In a preferred embodiment of the present invention, the elements include elements that have meaning when combined with words, an element dictionary in which attribute information indicating the meaning of the elements is assigned to the elements is stored in a memory unit, and the instruction information is an instruction to generate an answer sentence using a specified element identified by converting the attribute information of the element included in the input sentence into specified attribute information. In a preferred embodiment of the present invention, the template includes one or more words and positional information of the words in a sentence, and the instruction information is an instruction to generate an answer sentence that converts the positional information of a predetermined word included in the input sentence into different positional information.
[0015] Even when a common subject is being discussed, the way the subject is expressed varies depending on the speaker. In a dialogue between a human and a computer, if the computer's change in the subject's expression is inappropriate, the human will feel uncomfortable in the dialogue. With this configuration, the system can abstract the meaning of the input sentence by recognizing the input sentence as a combination of attribute information, generate a favorable response sentence for that meaning, and generate a natural response sentence that reflects the change in the subject's expression.
[0016] In a preferred embodiment of the present invention, groups of elements are determined for the elements that make up the input sentence, and a new template is generated based on the group of elements. In a preferred embodiment of the present invention, the word dictionary includes, as the attribute information, a first attribute that defines the meaning of a word by a combination of classifications having a hierarchical structure of two or more levels, and a new template is generated based on a group of words defined by the first attribute of the words that make up the input sentence. In a preferred embodiment of the present invention, an element dictionary in which attribute information is assigned to elements that are combined with other words to give meaning is stored in a memory unit, and a new template is generated based on a group of elements defined by the attribute information of the elements that make up the input sentence.
[0017] Furthermore, the present invention provides a computer that stores in a storage unit element data indicating elements that constitute a sentence, an element group indicating a set of said element data, and a dialogue template in which one or more template elements including said element data and / or said element group are arranged, as well as attributes and attribute values for each of said element data, Determining a question template, which is a dialogue template corresponding to the question sentence; generating a predicted answer sentence based on the question template; In generating the estimated answer sentence, a process of converting the template elements arranged on an answer template to the question template based on the attributes and / or attribute values to generate predicted answer sentences; a process of generating an answer template by performing stretching to replace some of the template elements arranged on the question template with other template elements, and generating a predicted answer sentence based on the template elements arranged in the generated answer template; or a process of searching for other answer templates that share some of the template elements with the question template, and generating a predicted answer sentence based on the template elements arranged in the searched answer template; The natural language processing method generates the estimated answer sentence by one or more of the following.
[0018] With this configuration, it is possible to generate a predicted answer sentence to a question sentence.
[0019] In a preferred embodiment of the present invention, the computer that stores the generated estimated answer sentence further comprises: When an input answer sentence is received from a user, the estimated answer sentence is searched for based on the input answer sentence, and the attribute and / or attribute value corresponding to the input answer sentence is obtained.
[0020] With this configuration, the attributes and / or attribute values of the input answer sentence can be acquired by searching for the estimated answer sentence.
[0021] In a preferred embodiment of the present invention, the attribute and / or attribute value corresponding to the estimated answer sentence is output in association with the estimated answer sentence, and a registration screen for an action to be executed is displayed by referring to the attribute and / or attribute value; storing conditions relating to the input attributes and / or attribute values and actions to be executed; When an input response sentence is received from a user, the attribute and / or attribute value corresponding to the input response sentence is acquired and the action is executed.
[0022] With this configuration, the action to be executed in response to the input answer sentence can be set with reference to the estimated answer sentence.
[0023] The present invention also provides a computer program that causes a computer to execute the natural language processing method.
[0024] Furthermore, the present invention provides a dialogue template in which element data indicating elements constituting a sentence, element groups indicating sets of the element data, and one or more template elements including the element data and / or the element groups are arranged, and attributes and attribute values for each of the element data; a template processing unit that determines a question template that is a dialogue template corresponding to the question sentence; an answer sentence estimation unit that generates an estimated answer sentence based on the question template; The answer sentence estimation unit a process of converting the template elements arranged on an answer template to the question template based on the attributes and / or attribute values to generate predicted answer sentences; a process of generating an answer template by performing stretching to replace some of the template elements arranged on the question template with other template elements, and generating a predicted answer sentence based on the template elements arranged in the generated answer template; or a process of searching for other answer templates that share some of the template elements with the question template, and generating a predicted answer sentence based on the template elements arranged in the searched answer template; The natural language processing system generates the estimated answer sentence by one or more of the following. [Effects of the Invention]
[0025] According to the present invention, a novel technique for conducting more natural dialogue in Japanese natural language processing can be provided. [Brief explanation of the drawings]
[0026] [Figure 1] FIG. 1 is a configuration diagram of a natural language processing system according to a first embodiment. [Figure 2] FIG. 1 is a hardware configuration diagram of the first embodiment. [Figure 3] 1 is a conceptual diagram of words, elements, etc. according to the first embodiment. [Figure 4] FIG. 2 is a data structure diagram of a word dictionary according to the first embodiment. [Figure 5] FIG. 2 is a data structure diagram of a word dictionary according to the first embodiment. [Figure 6] FIG. 2 is a data structure diagram of the usage dictionary of the first embodiment. [Figure 7] FIG. 2 is a schematic diagram of components of dialogue data according to the first embodiment. [Figure 8] FIG. 1 is a schematic diagram of a Word template according to the first embodiment. [Figure 9] FIG. 2 is a schematic diagram of a dialogue template according to the first embodiment. [Figure 10] 10 is a process flowchart relating to registration of a dialogue template according to the first embodiment. [Figure 11] 10 is a processing flowchart relating to word template registration according to the first embodiment. [Figure 12] 10 is a processing flowchart when a dialogue is carried out with a user according to the first embodiment. [Figure 13] 10 is a flowchart showing a process for identifying a dialogue template from an input sentence according to the first embodiment. [Figure 14] FIG. 10 is a configuration diagram of a natural language processing system according to a second embodiment. [Figure 15] 10 is a processing flowchart relating to the answer sentence estimation process of the second embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0027] <Embodiment 1> A natural language processing system according to a first embodiment of the present invention will be described below with reference to the drawings. Note that the embodiment described below is an example of the present invention, and the present invention is not limited to the following embodiment, and various configurations can also be adopted.
[0028] In this embodiment, the configuration, operation, etc. of a natural language processing system will be described, but similarly configured methods, devices, computer programs, and program recording media storing the programs can also achieve similar effects. A series of processes according to this embodiment described below is provided as a computer-executable program, and can be provided via a non-transitory computer-readable recording medium such as a CD-ROM or a flexible disk, or even via a communication line. In addition, in this embodiment, the program may be implemented in a so-called cloud computing format, in which the program is launched on an external computer to realize its functions on a client terminal.
[0029] The natural language processing system is composed of a computer device. The computer device has an arithmetic unit such as a CPU (Central Processing Unit) and a storage device. The computer device can function as a natural language processing device by executing a natural language processing program stored in the storage device using the arithmetic unit. The natural language processing method is realized by processing the computer device including the natural language processing device.
[0030] <1.1. System Configuration> Fig. 1 shows an example of a system configuration diagram of a natural language processing system 1. As shown in Fig. 1, the natural language processing system 1 includes an input sentence acquisition unit 10, a natural language processing unit 20, an answer sentence output unit 30, and a database DB.
[0031] The input sentence acquisition unit 10 acquires text data as an input sentence from the input data. The input sentence acquisition unit 10 outputs the input sentence to the natural language processing unit 20. The input data is input from an interlocutor or from another natural language processing system, for example, a natural language processing system 1′ or a language generation AI system such as LLM (Large Language Models). The input data may be any of voice data, image data, or text data. If the input data is voice data, the input sentence acquisition unit 10 transcribes the voice data (text recognition) to acquire the input sentence. If the input data is image data, the input sentence acquisition unit 10 performs OCR processing or the like on the image data to acquire the input sentence.
[0032] The natural language processing unit 20 acquires an input sentence from the input sentence acquisition unit 10 and generates an answer sentence by natural language processing the input sentence. The natural language processing unit 20 outputs an answer sentence corresponding to the input sentence to the answer sentence output unit 30. In this embodiment, the natural language processing unit 20 includes a registration unit 21, a division unit 22, a word processing unit 23, a template processing unit 24, and an answer sentence generation unit 25. Note that in this embodiment, a new template is registered using the registration unit 21, the division unit 22, and the word processing unit 23.
[0033] The answer sentence output unit 30 acquires an answer sentence from the natural language processing unit 20, and outputs output data generated from the acquired answer sentence. The output data is voice data or text data.
[0034] The database DB is configured to be able to communicate data with the natural language processing unit 20 .
[0035] <1.2. Hardware Configuration> In one embodiment, the natural language processing system 1 is configured as a dialogue device 100 and a natural language processing device 200. The dialogue device 100 includes a dialogue robot, a terminal device, or the like, and is equipped with an input sentence acquisition unit 10 and a response sentence output unit 30. The natural language processing device 200 includes a server device, or the like, and is equipped with a natural language processing unit 20. The dialogue device 100 and the natural language processing device 200 are connected to a communication network and configured to be able to communicate data.
[0036] 2(a) shows an example of a hardware configuration diagram of the dialogue device 100. The dialogue device 100 includes a communication unit 101, a control unit 102, a storage unit 103, an input unit 104, and an output unit 105 as the hardware configuration.
[0037] The communication unit 101 controls communication with the communication network, and performs inputs required to operate the interactive device 100 and outputs data related to the operation results.
[0038] The control unit 102 includes one or more processors such as a CPU, and executes a dialogue program, an OS, and other applications to control the overall operation and processing of the dialogue device 100. The control unit 102 executes processing based on the dialogue program stored in the storage unit 103, causing the computer device to function as the dialogue device 100, and realizing the functional components described below.
[0039] The memory unit 103 is a hard disk drive (HDD), read only memory (ROM), random access memory (RAM), etc., and stores the interactive program and data used when the control unit 102 executes processing based on the program.
[0040] The input unit 104 inputs input data including voice data or text data to the control unit 102. The input unit 104 is configured with a microphone for acquiring voice data, a keyboard for acquiring text data, a touch panel, and the like.
[0041] The output unit 105 outputs output data including audio data or text data, and is configured with a speaker that outputs audio data, a display that displays text data, and the like.
[0042] 2(b) shows an example of a hardware configuration diagram of the natural language processing apparatus 200. The natural language processing apparatus 200 includes a communication unit 201, a control unit 202, and a storage unit 203 as its hardware configuration.
[0043] The communication unit 201 controls communication with the communication network, and performs input necessary to operate the natural language processing device 200 and outputs data related to the operation results.
[0044] The control unit 202 includes one or more processors such as a CPU, and executes a natural language processing program, an OS, and other applications to control the overall operation and processing of the natural language processing device 200. The control unit 202 executes processing based on the natural language processing program stored in the storage unit 203, thereby causing the computer device to function as the natural language processing device 200, and realizing functional components described below.
[0045] The memory unit 203 is a hard disk drive (HDD), read only memory (ROM), random access memory (RAM), etc., and stores a natural language processing program and data used by the control unit 202 when executing processing based on the program.
[0046] <1.3.Database> The database DB includes a word DB1 that stores a word dictionary, an element DB that stores an element dictionary (an inflection DB2 that stores an inflection dictionary, and an ending DB3 that stores an ending dictionary), a word template DB4 that stores word templates, a dialogue template DB5 that stores dialogue templates, an answer template DB6 that stores answer templates, a dialogue scenario DB7 that stores dialogue scenarios, and a word group DB 8. Note that data of elements such as the word dictionary and element dictionary is called element data.
[0047] <2.1. Words, Elements> FIG. 3 is a conceptual diagram showing definitions of words, elements, etc. in this embodiment. In this embodiment, an element that has meaning in itself is called a "word." Examples of words include "I," "eat," and "today." Words include conventional parts of speech such as nouns, verbs, adjectives, adjectival verbs, adverbs, conjunctions, conjunctions, and interjections. Words are stored in a word dictionary in word DB1.
[0048] In this embodiment, an element that does not have meaning by itself and is included in an input sentence in combination with a word is called an "element." Elements include conjugations of words such as "wa" (to be), "no" (to be), "tabe" (to be), and "tai" (to want to be). Elements also include particles and auxiliary verbs as conventional parts of speech. Conjugations are stored in the conjugation dictionary of the conjugation DB2.
[0049] Elements may also include endings that are connected to words or other elements (conjugations). Endings include, for example, "tabetai" (desu) and "tabetai" (wa). Endings are stored in an ending dictionary in Endings DB3. Conjugation DB2 and Endings DB3 are referred to as element DBs.
[0050] <2.2.Word> In this embodiment, a combination of elements that includes at least one or more elements and indicates a semantic unit included in an input sentence is referred to as a "word." A word may be "only one or more words" or "one or more words + one or more elements (conjugation and / or suffix)." Specific examples of words include "yakiniku bento: word + word," "I: word + conjugation," "I want to eat: word + conjugation," and "I want to eat: word + conjugation + suffix." Also, a word may be formed by combining multiple words with one or more elements, such as "bones of the fingers of the hand." Note that "I: word" may also be treated as a word.
[0051] <2.3. Word Groups, Element Groups> Here, a group that defines a set of words is called a word group (dashed line in FIG. 3), and a group that defines a set of elements is called an element group (dashed line in FIG. 3). In this embodiment, element groups include word groups, which are sets of one or more words, and element groups, which are sets of one or more elements. One or more word groups are set for the words stored in the word DB 1. Examples of word groups include groups defined by information set for the words, such as attribute groups defined by one or more pieces of attribute information (described later) set for the words, and word modification groups to which words with a common associated element group belong, as well as groups defined by adding words to a group list.
[0052] Furthermore, elements stored in the element DB belong to one or more element groups. Here, words in the word DB1 are associated with element groups that refer to them (which indicate elements that can be linked). An element group is a group that defines a set of elements that can be linked to the same element. Words that can be combined with elements are so-called nominatives and stems. Note that element groups include conjugation groups, which are sets of conjugations, and suffix groups, which are sets of suffixes. A conjugation group is, for example, a set of multiple conjugations that can be applied to a common stem. A suffix group is, for example, a set of multiple suffixes that can be substituted without sounding strange in Japanese expressions.
[0053] Information for defining word groups, such as a list of words belonging to a word group, may be stored in the word group DB8, or word groups may be defined based on attribute information of words, etc. In this embodiment, a set of words associated with the same element group is defined as a word group called a common conjugation group, and a list of multiple words belonging to the group is stored in the word group DB8 using a group ID, which is an identifier of the common conjugation group, as a key. By defining common conjugation groups and conjugation groups by lists, words and elements are linked in the database DB.
[0054] <2.4.Attribute information> In this embodiment, the natural language processing unit 20 refers to the words and elements stored in the word DB1 and element DB, and performs natural language processing based on attribute information of the elements included in the input sentence. The attribute information indicates the meaning of the elements, and includes word attributes related to the words and element attributes related to the elements.
[0055] The word attribute is information indicating the meaning or quality of the word itself, and in this embodiment, includes a first attribute and a second attribute. The first attribute is defined as a word category that indicates the semantic content or quality of a word. In this embodiment, the word category is a classification that indicates the meaning of a word and has a hierarchical structure of two or more levels. The meaning of a word is expressed by a combination of classifications. The second attribute is defined as a modifier attribute that indicates the semantic content or quality of the word. The modifier attribute is set for each word group called a word modifier group, and has modifier attribute items and modifier attribute values that express the modifier meaning of the word using text, numbers, or logical values (truth values). Note that a word modifier group includes one or more arbitrarily specified words and / or one or more words determined by one or more arbitrarily specified word categories, and the modifier attribute of a word is determined according to the word modifier group set for the word.
[0056] The element attributes are information about elements that supplement words, and indicate the speaker's emotions, intentions, nuances, situations, etc. that arise from the elements, and in this embodiment include the third attribute and the fourth attribute. The third attribute is defined as an inflection attribute that indicates the meaning of the inflection. The inflection attribute has an inflection attribute item and an inflection attribute value that expresses the meaning of the inflection using text, a number, or a logical value (truth value). The fourth attribute is defined as a suffix attribute that indicates the meaning of the suffix. The suffix attribute indicates the suffix attribute item and the suffix attribute value that expresses the meaning of the suffix assigned to the word using text, numbers, or logical values (truth values).
[0057] <2.5. Word Dictionary> The word DB1 stores a word dictionary that defines multiple words. The words are classified into word categories based on the meaning of the word. In this embodiment, the word categories have a hierarchical structure according to the level of semantic abstraction. The hierarchical structure has two or more levels, and there is no limit to the number of levels.
[0058] <2.6. Word Categories> FIG. 4(a) shows an example of the configuration of word categories in a word dictionary. A word category has a word category ID, which is an identifier unique to the word category, a related word category ID indicating a related word category, and a word category name. A related word category includes a word category ID indicating a parent-child relationship in a hierarchical structure, and in this embodiment, refers to the parent word category ID. For example, the word category name "Brand" has a related word category ID of the word category name "Distribution" that corresponds to the parent relationship, and the word category name "Distribution" has a related word category ID of the word category name "Food" that corresponds to the parent relationship. Note that the related word category is not limited to a parent-child relationship, as long as it is a word belonging to the same word group, such as a grandchild relationship, sibling relationship, or cousin relationship.
[0059] FIG. 4(b) is an example of a data structure showing the first attributes of words in a word dictionary. An example structure is shown. FIG. 4(c) is a conceptual diagram showing the first attributes of words defined by FIG. 4(a) and FIG. 4(b). The word categories in FIG. 4(c) have a hierarchical structure defined by the related word category IDs shown in FIG. 4(a), with the left side showing the word categories in the higher hierarchy and the right side showing the word categories in the lower hierarchy. The word categories in the lower hierarchy belong to the word categories in the higher hierarchy and indicate their meaning in combination with the classifications in the higher hierarchy. In FIG. 4(c), the meaning of the word (word name) "Brand A" is defined, for example, by a hierarchical structure of word categories indicating, from the top down, food, distribution systems, and brands. For example, in this embodiment, the data shown in Figure 4(b) links the word "Brand A" to a related word category ID (10 in Figure 4(a)), which is the identification information of the lowest-level word category to which the word hangs (Brand in Figure 4(c)), and also links to a word identifier (word ID) that is unique either alone or in combination with the word category identifier.
[0060] The word categories and parts of speech classified by the word categories are not limited to the example shown in Figure 4. In this embodiment, word category names and word names are distinguished by word category IDs and word IDs, and words with the same word name may exist under different word categories. Furthermore, each word indicating a word category name (word category names in Figure 4(a)) may be assigned a word identifier instead of a word category identifier and treated as a word.
[0061] Fig. 5(a) shows an example of a data structure indicating word data in a word dictionary and its second attribute. The word data is data related to a word and is specified by a word ID, which is a word identifier. Note that, due to the table shown in Fig. 5 and the data stored in the word group DB8, the word data has a word category ID and a word group ID such as those exemplified in Fig. 4. As shown in Fig. 5(a), the word data includes a word ID, a word name, a reading of the word name (kana and katakana), a part of speech, a word stem, a reading of the stem (kana and katakana), a conjugation type of the stem, and a modification attribute.
[0062] The inflection type indicates the classification of inflected words such as verbs, and in this embodiment is information for specifying an inflection table corresponding to the word. It may also be an inflection table ID or the like.
[0063] A modifier attribute is data associated with a word and defines additional meanings of the word. Modifier attributes may be defined for each word group. For example, in this embodiment, a common modifier attribute item is set for word groups defined by word categories. A word group to which a common modifier attribute is assigned is called a word modifier group.
[0064] In the illustrated example, when a word modification group is defined by word category ID=1 (word category: food), modification attributes such as "tasty," "junk," and "luxury" may be defined for the word. A modification attribute value is set for each item of the modification attribute; for example, the word "fast food" is set to have a high junk level, and the word "French" is set to have a high luxury level. The modification attribute value is set as text, a numerical value, a logical value, or the like. In this embodiment, a word modification group is set for each word category, but any other set of words may also be used as a word modification group. In the above example, a word modification group is defined by one word category ID, but one word modification group may also be defined using an AND or OR condition for multiple word categories.
[0065] The word group DB8 stores a word group table that defines word groups. The word group table uses a word group identifier, such as a word group ID, as a key, and has a word group name and an identifier (word ID) of one or more words belonging to the word group. When storing information indicating a word modification group, one or more modification attribute names or identifiers assigned to the word modification group, the data type of the modification attribute value, the number of characters, etc. may be stored. A word group may be defined by one or more word categories, and if it is defined by one word category, it does not need to be stored in the word group DB8.
[0066] <2.7. Conjugation Dictionary> The inflection DB2 (element DB) stores an inflection dictionary (inflection table) that defines multiple inflection data and their groups. In this embodiment, an inflection table ID is assigned to each inflection table, and each table is defined as an inflection group to which inflection that can be combined with a common word belongs. Figure 6 shows an example of the data structure of the inflection dictionary. As shown in Figure 6, the inflection data uses an inflection ID, which is an identifier specific to each inflection and is unique either alone or in combination with an inflection table ID, as a key, and for each inflection belonging to the same group, it has an inflection name, inflection attribute, and question phrase marker.
[0067] The conjugation attribute item indicates the meaning that a conjugation contains, and is classified into basic, negative, question, future intention, past perfect, perfect, wish, regret, antonym, and possible. Each conjugation attribute has a conjugation attribute value that indicates the strength of its meaning. For example, conjugations that have the meaning of future intention, such as "I intend to eat" and "I decided to eat," are defined as containing a stronger meaning of "future intention" when expressed as "I decided to eat" rather than "I intend to eat," and are defined as future intention attribute values of "1" and "2," respectively.
[0068] The conjugation table is set according to the conjugation type of the word. The conjugation type indicates common conjugation forms of words, such as godan conjugation and shimoichi conjugation. The conjugation table in the illustrated example is linked to words with a shimoichi conjugation type, such as "taberu" (eat) and "ne" (sleep). In this embodiment, conjugations include phrases defined as conventional conjugation forms and phrases not defined as conventional conjugation forms, and are defined as phrases used as part of conjugated expressions such as verbs. Taking the verb "taberu" (eat) as an example, "taberu" is a stem that does not conjugate, and "ru" is a conjugable conjugation. Conjugations are set according to the conjugation type of the stem. For verbs with a conjugation type of jodan or shimoichi conjugation, examples of conjugations include "ru," "masu," "nai," "masen," "ru?," "masu?," "masu?", "ru ki na shinai," "ru ki na shinai," "yo kana," "yootto," "miteruka," and "ru tsumori" (I don't think so). Note that the conjugations listed here are merely examples, and various conjugations are defined.
[0069] Conjugations include colloquial idiomatic expressions, each with its own meaning. Traditionally, Japanese verb conjugation forms were defined with meanings according to the conjugation form, such as the potential form, conjunctive form, conclusive form, attributive form, conditional form, and imperative form. However, traditional conjugation forms did not categorize conjugations such as colloquial, and the meanings contained in conjugations could not be processed as natural language. A conjugation dictionary is a dictionary designed to process colloquial idiomatic expressions as natural language by defining conjugations and conjugation attributes.
[0070] Conjugations are not limited to particles and auxiliary verbs, but may include combinations of traditional parts of speech, including nouns, verbs, adjectives, adjectival verbs, pronouns, adverbs, conjunctions, conjunctions, and interjections, or parts of speech that are not conventionally defined.
[0071] The conjugation dictionary can include a dictionary that defines conjugations that assign meaning to stems of parts of speech other than verbs. For example, particles such as "wa," "no," and "ga" that conjugate "person" can be grouped together to form a conjugation group. In this case, for example, the conjugation group may be defined by the word category associated with the word. A word having a conjugation type in the word dictionary is associated with a conjugation dictionary that corresponds to the conjugation type.
[0072] <2.8. Ending Dictionary> The ending DB3 stores an ending dictionary that defines multiple ending data. The ending data defines the meaning of an ending. The ending data includes an ending ID, which is an identifier unique to the ending, an ending name, and an ending attribute.
[0073] The ending attribute item indicates the meaning that the ending contains, and is classified into basic, negative, question, future intention, past perfect, perfect, wish, regret, antonym, and possible. The ending attribute has an ending attribute value that indicates the strength of each meaning. For example, endings that have a question meaning, such as "desu ka" (is it?) and "desu ka" (is it?), are defined as containing a stronger meaning of "question" when expressed as "desu ka" (is it?), and are defined as question attribute values "1" and "2," respectively.
[0074] <2.9. Examples of components of dialogue data> FIG. 7 is a schematic diagram of the components of dialogue data in this embodiment. In FIG. 7(a), symbol A indicates dialogue data (input sentence), symbol B indicates a word, and symbol C indicates an element. Dialogue data A1 is divided into words B1 to B3 and elements C1 to C3 by referring to a word dictionary and an element dictionary. Each of words B1 to B3 is associated with a common conjugation group (an element in the element DB) in word DB1, so that word D can be determined from the beginning of the input sentence by combining elements such as "word only," "word + element (conjugation)," and "word + element (conjugation) + element (ending)." By referring to the word dictionary, first to fourth attributes set for words D1 to D3 are determined. Based on the words and elements contained in the word, a unique identifier and attribute value (such as a word category ID, attribute name, and attribute value) are assigned to each attribute as the first to fourth attributes. For example, for word D1, an attribute can be determined for each word, such as first attribute: word category ID=7 (person>first person), second attribute: attribute name=attribute value...
[0075] <3.1.Template> A template is information that defines a combination of multiple element groups and their order. In this embodiment, a template has one or more thrones. A throne is a comparison target to be compared with one or more words included in an input sentence, and each throne has one or more applicable word groups and / or element groups defined. This word group may be a collection of words with common attribute information (e.g., word category, etc.) or a collection of arbitrary words collected for a specific purpose in the word group DB8. Similarly, an element group may be a collection of conjugations (elements) defined by a conjugation table or the like, or a collection of arbitrary elements. In addition, a template has position information that indicates the order of words in the throne / input sentence. By comparing the groups and their order set in the throne with the words and their order in the input sentence, template matching can be performed for the input sentence. The position information indicates the order of words in the throne, i.e., included in the sentence. Template matching is performed by comparing the words that make up the input sentence with the comparison target that corresponds to the order in which they appear.
[0076] In this embodiment, the templates include word templates, dialogue templates, and answer templates. Word templates are templates for determining word types, groups, cases, etc., and are stored in the word template DB4. Dialogue templates are templates for understanding the content, type, etc., of an input sentence, and are stored in the dialogue template DB5. Answer templates are templates for creating answer sentences, and are stored in the answer template DB6.
[0077] <3.2. Word Template> A word template is a template for recognizing multiple elements, such as a word modified by other words, as a single word. A word template can determine, for example, a combination of multiple consecutive words, multiple consecutive words, or a combination of one or more consecutive words and one or more elements as a word. Figure 8 shows a data structure diagram of word template data. In this embodiment, a word template includes a word template ID, which is a unique identifier for the word template, a sample sentence, a word template name, and one or more thrones E, which are used to compare consecutive element combinations in an input sentence, etc. The thrones E include position information and one or more words and / or elements to be assigned to the thrones. In this embodiment, word groups or element groups are assigned to the thrones, and by referencing these groups, multiple types of words consisting of combinations of a first group of consecutive elements and second and subsequent groups of elements can be recognized. The groups are word groups or element groups. In this embodiment, a pair of a word group ID and an inflection table ID is specified for each thrones.
[0078] For example, word template ID=1 is a word template that is matched when an input sentence containing words such as "hand" or "foot" is entered. The first throne E1 corresponds to the word "hand" and the accompanying phrase "of." The first throne E1 has position information 1, a word group ID (=11) that includes "hand" and "foot," and a conjugation table ID (=2) for "of." In this embodiment, it is assumed that the first ball seat E1 includes pairs of word groups and element groups. However, for example, as shown by the ball seats E11 and E12, the word groups and element groups may be respectively applied to the ball seats. In the illustrated example, the first ball seat E11 has a position information of 1 and a word group ID (= 11) including "hand" and "foot", and the second ball seat E12 has a position information of 2 and an inflection table ID (= 2) related to "no". In this embodiment, it is assumed that a group is applied to each ball seat. However, as shown by the ball seat E21, in the ball seats included in a certain word template, instead of some or all of the groups, the word itself or the element itself may be applied. For example, the first ball seat E21 has a position information of 1 and a word ID (= 111) of "hand" and an inflection ID (= 222) of "no". Incidentally, a group including only one element may be defined and applied to the ball seat.
[0079] The word template ID = 2 is, for example, a word template that is matched when an input sentence including words such as "finger of hand", "back of hand", "finger of foot", etc. is input. The first ball seat E2 corresponds to the word "of hand", and the second ball seat E3 corresponds to the word (word) "finger". The first ball seat E2 has a position information of 1, a group ID (= 11) related to "hand", and an inflection table ID (= 2) related to "no". The second ball seat E3 has a position information of 2, a word group ID (= 12) of "finger", and an inflection table ID (= 1) indicating that "finger" is in the basic form (not including elements). In the illustrated example, an inflection table ID = 1 is assigned to the ball seat without inflection. Incidentally, when the target ball seat does not include inflection data, the inflection table ID may be omitted.
[0080] For example, word template ID=3 is a word template that is matched when an input sentence includes words such as "finger bones," "skin of the fingers," and "toe bones." The first throne E4 has position information 1 and has a word group ID (=11) related to "hand" and a conjugation table ID (=2) related to "of." The second throne E5 has position information 2 and has a word group ID (=12) related to "finger" and a conjugation table ID (=2) related to "of." The third throne E6 has position information 3 and has a word group ID (=13) related to "bone" and a conjugation table ID (=1) indicating that "bone" is the base form. The number of thrones that make up a word template is not limited.
[0081] The division unit 22 divides the input sentence acquired by the input sentence acquisition unit 10 into elements. Specifically, the division unit 22 performs the division process in accordance with the division rules shown below. The division unit 22 refers to the word dictionary of the word DB1 to identify words included in the input sentence. The division unit 22 further refers to the element DBs (inflection DB2, suffix DB3) to identify elements (inflection, suffix) included in the input sentence.
[0082] The word processor 23 determines words from elements included in the input sentence. The word processor 23 refers to the word template DB4 and determines whether a combination of consecutive elements arranged sequentially from the first word of the input sentence corresponds to a registered word template. If a combination that corresponds to the word template is found, the word processor 23 confirms it as a word based on the word template. Then, the word processor 23 searches for words to which a word template has not been applied, starting from the beginning of the input sentence, and checks whether there is a word or element corresponding to the word. If a word or element cannot be identified, it is determined to be a word consisting of a single word. If a word or element can be identified, it checks whether there are any further consecutive words or elements. If further consecutive words or elements cannot be identified, it is determined to be a word consisting of, for example, a word and an element (conjugation). If they can be identified, it is determined to be a word consisting of, for example, a word, an element (conjugation), and an element (suffix). The division unit 22 divides the input sentence into one or more words by repeatedly referring to words and elements in order from the beginning to the end of the input sentence. Furthermore, the word processing unit 23 also regards words and / or elements included in the input sentence to which no word template has been applied as words, and proceeds to matching with the dialogue template.
[0083] <3.3. Dialogue Templates> The dialogue template includes required comparison targets and optional comparison targets, which are distinguished by a required flag in this embodiment. Optional comparison targets indicate words that can be omitted in an input sentence. For example, dialogue data such as "I had curry for dinner" or "I ate curry" may be input as an input sentence in response to the question "What did you have for dinner yesterday?" In this way, words indicating the time or object, subjects, etc. (in this example, "yesterday," "I," "for dinner," etc.) may be omitted, and even when these are omitted, they can be matched to the same template.
[0084] FIG. 9 shows a data structure diagram of dialogue template data. In FIG. 8, a dialogue template includes a dialogue template ID, which is an identifier unique to the dialogue template, a sample sentence, a dialogue template name, and one or more thrones (W1 to W4) to be compared. In this embodiment, a throne includes position information, a required flag, and a group of elements to be assigned to the throne. The group is a word group or a word group and element group, and in this embodiment, is a combination of a word group ID and an inflection table ID. The required flag is a logical value indicating whether the word corresponding to the throne is required in the dialogue data. Note that for words determined by word template matching, the word or word and element at the end of the word template is used when matching with the throne in the dialogue template.
[0085] Dialogue template ID=1 is a greeting template. Word group ID=1 includes words such as "good morning" and "hello," and when an input sentence consisting of these words is entered, it is matched (throne W1). If the target throne does not contain conjugation data, the conjugation table ID may be omitted, or an ID indicating the base form may be defined. In the illustrated example, conjugation table ID=1 is assigned to thrones that do not contain conjugations. For example, groups of elements may be assigned to each throne, as shown by thrones E11 and E12 in Fig. 8. Also, as shown by throne E21 in Fig. 8, elements themselves may be assigned to a throne included in a certain dialogue template instead of some or all of the groups.
[0086] The dialogue template CT2 is a template for a weather question, and is a template that matches when dialogue data such as "Tell me the weather today" is input. The first throne W2 has location information of 1, a required flag of false, and has a word group ID for "today" included in "today's", and a conjugation table ID for "of". The second throne W3 has location information of 2, a required flag of true, and has a word group ID for "weather" and a conjugation table ID indicating that "weather" is the base form. The third throne W4 has location information of 3, a required flag of false, and has a word group ID for "teaching" included in "oshiete", and a conjugation table ID for "te".
[0087] The template processing unit 24 compares the words of the input sentence determined by the word processing unit 23 with the dialogue templates to determine a dialogue template corresponding to the input sentence. In this embodiment, the template processing unit 24 references the dialogue templates in the dialogue template DB 5 to select a template corresponding to the input sentence based on the degree of match between the combinations of groups to which each element constituting the input sentence belongs. Note that the combination of thrones does not necessarily have to match perfectly, and the dialogue template with the highest match rate may be determined as the one corresponding to the input sentence. The match rate may be calculated based on the match rate of the thrones, etc.
[0088] <3.4. Dialogue scenario> In this embodiment, the dialogue between the person and the dialogue device progresses based on a dialogue scenario. The dialogue scenario is data that sets the general flow of the dialogue. The dialogue scenario is based on a dialogue template specified by an input sentence, and branches and the like are set according to the subsequent dialogue (input sentence and its response sentence). The dialogue scenario is stored in a dialogue scenario DB7.
[0089] <3.5. Instruction information> The instruction information is set in association with a dialogue template and indicates an action to be executed in response to an input sentence. The instruction information may be associated with a dialogue template in a dialogue scenario. The action includes outputting a fixed answer sentence, as well as generating and outputting an answer sentence. The answer sentence generation unit 25 executes the action based on the instruction information associated with the dialogue template.
[0090] <3.6. Answer generation and output> The natural language processing unit 20 acquires an input sentence and classifies the input sentence into a dialogue template by referring to the dialogue template DB5. The answer sentence generation unit 25 then acquires instruction information predefined for the acquired dialogue template and generates an answer sentence based on the instruction information. When the action includes generating an answer sentence, the instruction information includes an answer template having conversion rules for words and / or elements to be placed on one or more referenced thrones. In this case, the answer sentence generation unit 25 acquires the answer template by referring to the answer template DB6.
[0091] <3.7. Answer template> An answer template is a template for responding to an input sentence and is associated with a dialogue template by instruction information. An answer template includes references to some or all of the thrones of the associated dialogue template. For example, when the input sentence "I ate cup ramen" is recognized as a dialogue template consisting of "Throne 1: Cup ramen o" and "Throne 2: ate," the answer sentence "Cup ramen" can be generated by directly referencing the word "Cup ramen" in Throne 1. The answer template may further include conversion rules for the referenced thrones or dialogue templates (if references to all thrones are included). For example, the answer sentence "Ramen" can be generated by superimposing the word category of the word "Cup ramen" in Throne 1. The dialogue template may also include a fixed answer sentence in combination with the throne reference. For example, the word "Cup ramen" in Throne 1 can be combined with the fixed phrase "I ate" to generate the answer sentence "I ate cup ramen."
[0092] <3.8. Conversion rules> Conversion rules include nominative conversion, interrogative conversion, inversion conversion, ellipsis conversion, first attribute conversion, second attribute conversion, third attribute conversion, and fourth attribute conversion. However, the conversion rules are not limited to these, and any rule can be set. Conversion rules can be set by specifying attribute information of elements included in a specific element referenced in the dialogue template. A response template may include a combination of multiple conversion rules.
[0093] Nominative case conversion is a conversion rule that converts the first, second, or third person of words related to "person" contained in an input sentence. This enables conversion according to the positions of the speaker and listener. A question transformation is a transformation rule that transforms an input sentence into a question. For example, it is a transformation rule that transforms an element of the input sentence into an element that becomes a question, or adds an element to the input sentence. Inversion is a rule that converts the position information of a specific word (throne) contained in an input sentence to the end of the sentence, resulting in an inverted expression. An omission transformation is a rule that omits specific words contained in an input sentence.
[0094] The first attribute conversion is a rule for converting the word category of words included in an input sentence. The first attribute conversion sets conversion conditions related to the first attribute, such as whether the word categories belong to the same word group or different word groups, and the level of hierarchy to convert to. This makes it possible to obtain words with higher or lower concepts from the word DB1. The second attribute conversion is a rule for converting the modifier attribute of a word included in an input sentence. The second attribute conversion sets a condition for changing the modifier attribute or the modifier attribute value of a specific word. For example, a value to be added or subtracted from the modifier attribute value of a specific word included in an input sentence can be set, and another word having the added or subtracted modifier attribute value can be determined. The third attribute conversion is a rule for converting the inflection attribute of the inflection data included in the input sentence. The third attribute conversion sets a condition for changing the inflection attribute or the inflection attribute value. For example, a value to be added or subtracted from the inflection attribute value of a specific inflection included in the input sentence can be set, and another inflection having the added or subtracted inflection attribute value can be obtained from the element DB. The fourth attribute conversion is a rule for converting the ending attribute or ending attribute value of an ending included in an input sentence. The fourth attribute conversion sets a condition for changing the ending attribute or ending attribute value. For example, a value to be added or subtracted from the ending attribute value of a specific ending included in an input sentence is set, and another ending having the added or subtracted ending attribute value can be obtained from the element DB.
[0095] <3.9. Control Commands> The action based on the instruction information may further include a control command to any device. The control command includes output of operation information for operating the device, such as an instruction to a specific external device (e.g., turning off the lights, opening the curtains, sending an email, etc.), an instruction to a search device to search for information, or control of an actuator, display, or speaker installed in the dialogue device. The operation information may include any word or phrases included in the input sentence, or may include a generated response sentence. The control command to the device may include, for example, a request to a language generation AI system such as an LLM, and the input sentence acquisition unit 10 performs further action (e.g., generating and outputting a sentence to the interlocutor based on this response) based on the response received from the language generation AI system.
[0096] <4.1. New Dialogue Template Registration Process> Next, the process for registering a new dialogue template based on an input sentence will be explained. Figure 10 shows a process flowchart for registering a dialogue template.
[0097] The input sentence acquisition unit 10 acquires an input sentence input from a terminal device (not shown) of a user who wishes to register a new dialogue template (step S11). The division unit 22 divides the input sentence into elements (step S12). The word processing unit 23 refers to the word template DB4 and determines the words included in the input sentence (step S13).
[0098] The registration unit 21 registers a new dialogue template from the input sentence. In step S14, the registration unit 21 references the word groups of words and element groups of elements included in the words obtained from the input sentence in step S13, and associates them with the order of appearance of the words included in the input sentence. The order of appearance of the words included in the input sentence becomes the position information of the throne of the new dialogue template, and the referenced group is linked to the throne.
[0099] In step S15, the dialogue template is stretched as necessary. The stretching process changes the content of the template generated according to the input sentence, such as by expanding, contracting, or changing the range of attributes for each throne of the new dialogue template to be registered. In this embodiment, the registration unit 21 presents groups of words included in the input sentence to the terminal device of the user who is registering the new dialogue template, allowing the user to register a dialogue template with a changed scope of application. For example, a word group (e.g., a word category) of words included in the word in the input sentence can be used as a word group for the throne in the new dialogue template. Furthermore, any word group can be specified, such as a higher-level word category, a lower-level word category, a word modification group for that word, or any other group containing any word, to generate a dialogue template in which the specified word group is linked to the throne. Furthermore, the stretching process may be configured to search a word dictionary and specify a group for another word not included in the input sentence. Furthermore, for elements, an element group corresponding to a specified word may be selected in conjunction with the specified word group, or any element group may be specified. It may also be possible to delete the throne set by the words in the input sentence, or to replace the position information.
[0100] In step S16, the registration unit 21 sets the order of the words in the input sentence as throne position information, links the selected group to the throne, and registers the dialogue template in the dialogue template DB 5. When multiple word groups are designated for the same throne by the stretching process, the registration unit 21 may register a dialogue template for each word group.
[0101] <4.2. New Word template registration process> 11 shows a processing flowchart for registering a word template. In this embodiment, a word template is set up by multiple groups, or one or more word groups and one or more element groups. The registration unit 21 receives the designation of the word group and element group and registers a new word template.
[0102] First, the registration unit 21 receives a registration instruction request for a word template from the terminal device of a user who wishes to register a new word template (step S21). The registration unit 21 receives a selection of a first word group and a first element group to be assigned to a first throne (step S22). Here, the registration unit 21 may be configured to receive a selection of a word category or arbitrary word data, allowing the user to specify a word group. For example, when registering a word template for combining the word "A: finger" and the element "B: of," the word group that applies to A is defined by a word group based on a word category or a word group to which an arbitrarily selected word belongs. For example, first, a word group including "finger," "hand," "foot," "head," etc. is specified as A. Then, an element (conjugation) group including "of" is specified as B. The specified groups A and B are each set to the throne of the new word template (position information 1 in FIG. 8). For thrones that do not include elements, a registration indicating that they do not include elements is made (for example, null data, a predetermined character string is added, etc.).
[0103] The registration unit 21 accepts a selection of whether or not to terminate the combination of words and elements (conjugations) defined as a word template (step S23). If the combination is to be continued (NO in step S23), the registration unit 21 proceeds to the next step S24 and executes processing. If the combination is to be terminated (YES in step S23), the registration unit 21 proceeds to step S26 and completes the word template setting process.
[0104] In step S24, the registration unit 21 accepts the selection of a word group and an element group to be linked to the subsequent second throne. Here, the registration unit 21 may be configured to accept the selection of any word or element and specify the word group to which the selected word belongs and the element group to which the element belongs. Note that for a throne that does not contain a word or element, an indication that the word or element is not included is registered (for example, null data, a predetermined character string, etc.). In step S25, the registration unit 21 accepts the selection of whether to end the additional combination of word groups and element groups. If the combination is to be completed (YES in step S25), the registration unit 21 proceeds to the subsequent step S26 and completes the word template setting process. If the combination is to be continued (NO in step S25), i.e., if a third or subsequent throne is to be set, the registration unit 21 returns to step S24, accepts the selection of further word groups and element groups to be combined, and links them to the throne.
[0105] The registration unit 21 stores the word template in the word template DB4 based on the position information of the throne, the word group, and the element group set in steps S21 to S25 (step S27). For example, as one form of word template configuration, the word template may be composed of only a plurality of word groups. Examples of word templates in this form include text data such as "Tokyo Station" and "bookshelf." Word templates consisting of only word groups include so-called idioms. The registration unit 21 can accept the registration of a word template consisting of only word groups by accepting a selection to omit element groups in steps S22 and S24. Note that when multiple word groups are specified for the same throne, the registration unit 21 may register a word template for each word group.
[0106] <5.1. Natural language processing of input text> Next, a description will be given of a process for carrying out a dialogue with a user using a dialogue template, etc. Fig. 12 shows a process flowchart for carrying out a dialogue with a user according to this embodiment.
[0107] <5.2. Identifying Dialogue Templates> First, in step S31, a dialogue template corresponding to the input sentence is identified (step S31). FIG. 13 shows a processing flowchart up to identifying a dialogue template from an input sentence. The input sentence acquisition unit 10 acquires the input sentence and outputs it to the natural language processing unit 20 (step S41). The division unit 22 divides the input sentence into elements (step S42). The word processing unit 23 refers to attribute information of the elements included in the input sentence (step S43). The word processing unit 23 refers to a word dictionary to identify a word category (first attribute) and a modification attribute (second attribute) possessed by a word. If the input sentence includes a conjugation, the word processing unit 23 refers to a conjugation dictionary to identify a conjugation attribute (third attribute) possessed by the conjugation. If the input sentence includes a suffix, the word processing unit 23 refers to a suffix dictionary to identify a suffix attribute (fourth attribute) possessed by the suffix.
[0108] <5.3. Word template confirmation process> The word processor 23 executes a word determination process based on the divided elements (steps S44 to S49). First, the word processor 23 generates a tentative word by sequentially combining the divided elements from the beginning of the input sentence (step S45). In step S46, the word processor 23 determines whether a combination of consecutively arranged tentative words matches a word template stored in the word template DB4. If the tentative word combination does not match a word template stored in the word template DB4 (NO in step S46), the word processor 23 returns to step S45 and determines whether there is a matching word template for another combination. If the combination matches a word template stored in the word template DB4 (YES in step S46), the word processor 23 determines the word based on the word template (step S47).
[0109] The word processing unit 23 repeatedly executes the processes of steps S44 to S49 until word templates to be applied to all words in the input sentence are determined (step S48). In step S47, elements for which there is no corresponding word template are determined as single words. When the word processing unit 23 completes the determination process for all words in the input sentence, it proceeds to step S49 and executes the subsequent process. Note that the word processing unit 23 may be configured to further apply word templates to words once determined, for example, after determining a word consisting of two elements, it may further determine a word consisting of that word and another element.
[0110] The template processing unit 24 refers to the dialogue template DB5 and extracts the dialogue template with the highest match rate with the combination of words arranged in the predetermined order determined in step S49 (step S50). For words determined by the word template, the last word or group of words and elements is compared with the group set in the dialogue template's throne. If there are multiple dialogue templates with the highest match rate (YES in step S51), the template processing unit 24 proceeds to step S52 and executes a dialogue template narrowing-down process (step S52). If there is only one dialogue template with the highest match rate (NO in step S51) or the narrowing-down process is completed, the process proceeds to step S53. If multiple dialogue templates have the same match rate, the narrowing-down process refers to the dialogue scenario DB7 and selects a dialogue template based on the priority of the dialogue template set in the scenario. For example, a history of template selection in the dialogue scenario may be recorded, and the dialogue scenario with the highest match rate may be applied. In step S53, the template processing unit 24 identifies the dialogue template as the dialogue template corresponding to the input sentence. The template processing unit 24 associates the identified dialogue template with the input sentence and stores them in the database DB.
[0111] <5.4. Determining Instruction Information> 11, the answer sentence generation unit 25 refers to the dialogue scenario stored in the scenario DB and determines whether instruction information including an answer sentence corresponding to the dialogue template is associated with the dialogue template (step S32). If instruction information including a fixed answer sentence is set in the dialogue scenario (YES in step S32), the answer sentence generation unit 25 outputs the answer sentence included in the instruction information to the answer sentence output unit 30 (step S33).
[0112] If the instruction information does not include a fixed answer sentence (NO in step S32), the answer sentence generation unit 25 proceeds to the next step S34. In step S34, the answer sentence generation unit 25 refers to the dialogue scenario and acquires instruction information including an answer template. The answer sentence generation unit 25 converts words and elements in the input sentence according to the conversion rules, generates an answer sentence by applying the converted sentence to the answer template, and passes it to the answer sentence output unit 30 (step S35). The answer sentence output unit 30 acquires the answer sentence from the natural language processing unit 20 and outputs the answer sentence (step S36). The answer sentence output unit 30 outputs the answer sentence by playing back audio data or displaying it as text data.
[0113] <6.1.Sample> A sample of the process from obtaining a dialogue template corresponding to an input sentence to outputting a response sentence is shown below.
[0114] <6.2. Sample 1> Input sentence X1 is text data saying "Thank you." The natural language processing unit 20 acquires input sentence X1 and classifies it into a dialogue template X2 related to "thank you." Upon acquiring dialogue template X2, the reply sentence generation unit 25 refers to a dialogue scenario X3 related to "thank you" and acquires instruction information X4. Here, if instruction information X4 is instruction information including a fixed-length reply sentence X5 saying "You're welcome," the reply sentence generation unit 25 generates the reply sentence X5 saying "You're welcome."
[0115] <6.3.Sample 2> Input sentence Z1 is text data of "I am 18 years old today." The natural language processing unit 20 acquires input sentence Z1 and classifies it into dialogue template Z2 related to "age." The input sentence is a combination of the words "I," "today," and "I am 18 years old." The word "I" is word Z3 corresponding to throne 1 of dialogue template Z2 and has a word group (word category) of "person / first person" as its first attribute. The word "today" Z4 is word Z5 corresponding to throne 2 and has a word group of "tense / today" as its first attribute. The word "I am 18 years old" is word Z5 corresponding to throne 3 and has "age" as its word attribute. Dialogue scenarios Z7A to Z7C are associated with dialogue scenario Z7A, and dialogue scenario Z7B related to "age" is described to be referenced when input sentence Z1 corresponding to dialogue template Z2 is input. When dialogue template Z2 is determined, the answer sentence generation unit 25 references dialogue scenario Z7B related to "age" and acquires instruction information Z8. Here, instruction information Z8 is instruction information that includes a command to generate an answer sentence using answer template Z9. Answer template Z9 references all thrones 1 to 3 of dialogue template Z2, and is set with conversion rules Z10: omitting (deleting) throne 1 by referring to it, Z11: performing inversion by referring to throne 2, and Z12: converting to a question by referring to throne 3. The answer sentence generation unit 25 omits word Z3 according to Z10, converts word Z5 to a question according to Z12, and inverts word Z4 according to Z11. As a result, the answer sentence generation unit 25 generates an answer sentence such as "Are you 18 years old? Today" according to the conversion rules of the answer template.
[0116] In one embodiment, the natural language processing system 1 is configured as a dialogue device 100. The dialogue device 100 is embodied as a dialogue robot or a terminal device having dialogue means. The terminal device includes a smartphone, a tablet terminal, a smart speaker, etc. In this case, the dialogue device 100 includes an input sentence acquisition unit 10, a natural language processing unit 20, and a response sentence output unit 30.
[0117] <Embodiment 2> Next, a second embodiment will be described with reference to Figures 14 and 15. Note that components similar to those in the first embodiment are denoted by the same reference numerals, and a description thereof will be omitted. In this embodiment, (1) a process of estimating (automatically generating) an answer to an arbitrary question, and (2) a process of asking a follow-up question when an answer from the user is insufficient during a dialogue with the user, will be described.
[0118] The input sentence to the system or the output sentence from the system regarding a question is called a question sentence, the output sentence from the system in response to the question sentence or the input sentence to the system is called an answer sentence, the dialogue template matched to the question sentence is called a question template, and the dialogue template used to generate the answer sentence is called an answer template. In addition, the inflection data and suffix data are collectively referred to as element data. Furthermore, the word data constituting the word dictionary stored in the word DB1 and the element data constituting the element dictionary stored in the element DB are collectively referred to as element data. Furthermore, a set of element data, that is, a word group and an element group, is collectively referred to as an element group. Furthermore, one or more template elements are arranged on the dialogue template. The template elements are element data and / or element groups (word data, or word groups, word data and element data, word data and element groups, word groups and element data, word groups and element groups) set on one or more thrones prepared in the dialogue template.
[0119] <7.1. System Configuration> 14 shows an example of a system configuration diagram of the natural language processing system 1. In this embodiment, the natural language processing system 1 is configured as a dialogue device 100, a natural language processing device 200, and a user terminal device 300. The follow-up question is asked via the dialogue device 100 and the natural language processing device 200, and the answer sentence is estimated via the user terminal device 300 and the natural language processing device 200. The user terminal device 300 is equipped with a communication unit 301, a control unit 302, a memory unit 303, an input unit 304, and an output unit 305, similar to the hardware configuration of the dialogue device 100 shown in Figure 2(a), and the user terminal device 300 and the natural language processing device 200 are connected by a communication network and configured to be able to communicate data.
[0120] In this embodiment, the natural language processing unit 20 includes a registration unit 21, a division unit 22, a word processing unit 23, a template processing unit 24, a conversion processing unit 26, a response sentence estimation unit 27, and a dialogue processing unit 28. The conversion processing unit 26 converts the sentences according to predefined conversion rules. The reply sentence estimation unit 27 generates one or more reply sentences (estimated reply sentences) in response to the input sentence (estimated reply sentence creation process). The dialogue processing unit 28 executes processing related to the dialogue with the user who is conducting the dialogue. In this embodiment, it controls the execution of actions in response to answer sentences (input answer sentences) from the user according to a dialogue template, processes additional questions, and registers a dialogue scenario. In the action execution control, it executes an action corresponding to an answer sentence input from the user according to a combination of predefined conditions and actions. In the additional question processing, the dialogue processing unit 28 asks additional questions as answers to questions during a dialogue with the user to supplement elements missing from the actual answer sentence. In the dialogue scenario registration processing, the dialogue processing unit 28 accepts data input related to the dialogue scenario from the user who designs the dialogue scenario, and registers it in the dialogue scenario DB7.
[0121] <7.2.(1) Generating Estimated Answers> Next, (1) Generation of Estimated Answer Sentences will be explained. In this embodiment, the answer sentence estimation unit 27 generates estimated answer sentences using an answer template corresponding to a question sentence.
[0122] Here, the answer sentence estimation unit 27: (A) any interaction template predefined by the user; (B) one or more dialogue templates generated by stretching the question template based on some template elements included in the question template; and (C) One or more of the one or more dialogue templates obtained by searching the question template based on some template elements included in the question template are used as answer templates corresponding to the question sentence.
[0123] The answer sentence estimation unit 27 calculates the answer sentence for the answer template as follows: (D) Selecting any element data (word data or element data) from each element group (word group or element group) arranged in the answer template, determining combinations, and generating one or more estimated answer sentences according to the number of combinations; or (E) From each element group (word group or element group) arranged in the answer template, any element data (word data or element data) that matches the attributes and / or attribute values that are the conversion conditions is selected to determine the combination, and one or more estimated answer sentences are generated depending on the number of combinations.
[0124] That is, in generating an estimated answer sentence, the answer sentence estimation unit 27 generates an estimated answer sentence by one or more of the following processes: a process of converting, via the conversion processing unit 26, the template elements arranged on the answer template for the question template based on the attributes and / or attribute values that are the conditions for conversion, to generate an estimated answer sentence; a process of performing stretching, via the registration unit 21, to replace some of the template elements arranged on the question template with other template elements, to generate an answer template, and generating an estimated answer sentence based on the template elements arranged in the generated answer template; or a process of searching for other answer templates that have some template elements in common with the question template, and generating an estimated answer sentence based on the template elements arranged in the searched answer template.
[0125] Note that multiple attributes and / or attribute values may be specified as conversion conditions. In this case, the conversion processing unit 26 generates one or multiple patterns of presumed answer sentences that match the conversion conditions for each answer template, and then generates one or multiple patterns of presumed answer sentences for another conversion condition.
[0126] <7.3. Determining the Answer Template> (A) The dialogue template predefined by the user may be a question template. The answer template for generating a predicted answer sentence may be the question template itself, or alternatively or additionally, may be one or more of (A) a predefined dialogue template, (B) a dialogue template generated by stretching, and (C) a searched dialogue template.
[0127] When generating an answer template, the answer sentence estimation unit 27 passes the question template to the registration unit 21, and the registration unit 21 performs a stretching process based on replacing some of the template elements arranged on the question template with other template elements, thereby generating an answer template for generating an estimated answer sentence. If an answer template has been registered in advance, the answer sentence estimation unit 27 searches the dialogue template DB 5 for other dialogue templates that share some template elements with the question template, and uses the retrieved dialogue template as the answer template for generating an estimated answer sentence.
[0128] <7.4. Marker elements> A marker element includes one template element or a combination of multiple template elements that can be the subject of an answer sentence from among the template elements in the sequence of a question template. A template element that can be the subject of an answer sentence is, for example, a template element related to the 5W1H arranged in a dialogue template, and refers to, for example, the following word data or a word group as a collection of word data such as the following: When: "when" or "what time", Where: "where" or "at (place)", Who: "with whom" or "who", What: "what", Why: "why", How: "how"
[0129] When a marker element is set for a question template, (B) the stretching process may replace the marker element with another template element, and (C) the search may search the dialogue template DB5 for other dialogue templates that share elements other than the marker element.
[0130] A correspondence relationship may be defined between element data or element groups and marker elements. The correspondence relationship may be defined by, for example, one or more of a combination of word data, a combination of word groups, a combination of word data attributes, a combination of word data and word groups, a combination of word data and word data attributes, and a combination of word groups and word data attributes. For example, a correspondence relationship can be defined by linking a word group including "with whom" and "who" with word data whose word category (first attribute) is "person." When a correspondence relationship is defined, (B) the stretching process may replace the marker element with another template element for which a correspondence relationship is defined. Furthermore, (C) the search may search the dialogue template DB5 for a dialogue template including a marker element and another template element for which a correspondence relationship is defined.
[0131] In this embodiment, the marker element is set by the user who inputs the question sentence. The user specifies the position information (position of the throne) of the template element to be set as the marker element in the question template to the answer sentence estimation unit 27. Note that when the question sentence is input by voice, voice analysis may be performed, and the marker element on the question template may be determined according to the part that is emphasized by speaking loudly or slowly.
[0132] A single marker element may be a combination of multiple template elements, and may further include the combination of multiple template elements and their positional relationship. The positional relationship includes the order of the template elements, or whether they are consecutive. Note that marker elements may be defined for master data. For example, a marker element may be defined by specifying any template element arranged in a dialogue template stored in the dialogue template DB5, or may be defined for word data stored in a word DB or word groups stored in a word group DB that can be arranged in a dialogue template as template elements. Furthermore, among the template elements arranged in a dialogue template, required template elements (required comparison targets) may be treated as marker elements.
[0133] <7.5. Examples of using estimated answers> For example, by providing a predicted answer sentence, the user can obtain data on a combination of a question sentence and an answer sentence.
[0134] Furthermore, by outputting a combination of an estimated answer sentence and the attributes and / or attribute values that are the conditions for conversion, or the classification results based on them, it is possible to understand what attributes, attribute values, or context the estimated answer sentence was created for, thereby making it possible to efficiently design dialogue scenarios via the dialogue processing unit 28.
[0135] <7.6. Dialogue scenario> A dialogue scenario may include at least one of a step IN in which the interlocutor inputs an input sentence when engaging in a dialogue with a person (interlocutor) via the dialogue device 100, and a step AC in which the dialogue device 100 performs an action. When multiple steps are arranged in a dialogue scenario or when dialogue scenarios are connected to each other, the dialogue scenario, the connection between dialogue scenarios, or both are designed so that the dialogue flow branches depending on the input sentence by defining a combination of step IN and step AC.
[0136] <7.6. Action execution processing> The user can set instruction information for executing an action in a dialogue scenario via the dialogue processing unit 28. The instruction information is information indicating an action to be executed in response to an input sentence (answer sentence) from the interlocutor, and may include one or more of the following: output of a fixed answer sentence or a fixed question sentence, output of a generated answer sentence or question sentence, or device control. Note that the instruction information may also include an action that is deterministically executed regardless of an input sentence from the interlocutor (for example, a question sentence that the dialogue device 100 initially outputs to the interlocutor).
[0137] The dialogue processing unit 28 processes to display to the user a registration screen for registering conditions related to the input attributes and / or attribute values and actions to be executed. The dialogue processing unit 28 outputs the attributes and / or attribute values corresponding to the estimated answer sentence in association with the estimated answer sentence on the registration screen, and the user can register the actions to be executed while understanding what attributes and / or attribute values will be input when what kind of actual answer sentence is input. The registration screen allows a dialogue scenario to be registered, and defines the branching conditions at each step, the actions to be taken when the conditions are met, and the connections between steps. The branching conditions can be set based on the template that matches the actual answer sentence, the attributes and / or attribute values of the actual answer sentence, whether the actual answer sentence lacks essential answer elements, etc. When dialogue is conducted with a user, the dialogue processing unit 28 performs template matching, identifies word data for the input answer sentence, and searches a database to determine which branch the input answer sentence from the user corresponds to, and then executes an action.
[0138] <7.7.(2) Additional Question Processing> Next, (2) the additional question processing will be explained. In this embodiment, a scene will be illustrated in which, during a dialogue between the user and the dialogue device 100 using a natural language processing method, the dialogue device 100 asks the user a question using voice output data, and the user responds using voice input data.
[0139] 15 is a processing flowchart for the follow-up question processing. As shown in FIG. 15, first, the natural language processing unit 20 outputs a question sentence set in the dialogue scenario (step S61). Then, input data of an actual answer sentence is accepted from the user (step S62).
[0140] Next, the template processing unit 24 performs template matching on the actual answer sentence to check whether the actual answer sentence contains required answer elements (step S63). Required answer elements are, for example, element data or element groups that have a defined correspondence with the marker elements of the question sentence, and it is determined whether these template elements are included in the answer template. Alternatively, it is determined whether the words included in the input sentence are word data that have a correspondence with the marker elements, and it is determined whether the answer sentence contains required answer elements. Note that the marker elements are assumed to be assigned to the dialogue scenario or the question template for the question sentence.
[0141] If there are insufficient elements (YES in step S64), an additional question process is performed in step S65 to prompt the user to answer the missing elements according to the instruction information, and input of an additional actual answer sentence is accepted from the user.
[0142] Follow-up questions are asked using plain text or a dialogue template, and are defined in the dialogue scenario for each marker element (missing required answer element) for which an answer was not obtained. When setting a follow-up question using a dialogue template, you may generate a follow-up question by referencing any value (e.g., word ID) included in the actual answer.
[0143] For example, in the case below, an answer to the required answer element "age" has been obtained, but the "user" remains unknown. Therefore, an additional question is asked using the "Additional question template for when "user" is missing" linked to the marker element: "user". At this time, the value contained in the answer text (16 years old) is substituted directly into the additional question template, making the intention of the additional question clearer.
[0144] Question: "Please tell us who uses your service and their age." Marker elements: "User" and "Age" Answer template: "I'm (who) and (X years old)" Required answer elements: "User" and "Age"
[0145] Additional question template for when "user" is missing: "Are you (X years old)?" Additional question template for when "age" is missing: "Please tell me (someone's) age." User response with insufficient "user": "I'm 16 years old" Additional question in case of insufficient "user": "Are you 16 years old?" User's additional response: "It's me."
[0146] If the element shortage is resolved (NO in step S64), the process ends and the flow proceeds to the next step in the dialogue scenario.
[0147] As described above, according to the present invention, more natural dialogue can be carried out in natural language processing of Japanese. [Explanation of symbols]
[0148] 1 Natural Language Processing System 10 Input sentence acquisition section 20 Natural Language Processing Unit 21 Registration Department 22 Division 23 Word Processing Unit 24 Template processing section 25 Answer sentence generation section 26 Conversion processing section 27 Answer sentence estimation part 28 Dialogue processing unit 30 Answer text output section DB Database 100 Interactive device 200 Natural Language Processing
Claims
1. a computer that stores in a storage unit element data indicating elements that constitute a sentence, an element group indicating a set of said element data, a dialogue template in which one or more template elements including said element data and / or said element group are arranged, and attributes and attribute values for each of said element data, Determining a question template, which is a dialogue template corresponding to the question sentence; generating a predicted answer sentence based on the question template; In generating the estimated answer sentence, a process of converting the template elements arranged on an answer template to the question template based on the attributes and / or attribute values to generate predicted answer sentences; a process of generating an answer template by performing stretching to replace some of the template elements arranged on the question template with other template elements, and generating a predicted answer sentence based on the template elements arranged in the generated answer template; or a process of searching for other answer templates that share some of the template elements with the question template, and generating a predicted answer sentence based on the template elements arranged in the searched answer template; The natural language processing method of claim 1, wherein the estimated answer sentence is generated by one or more of the following.
2. Furthermore, the computer that stores the generated estimated answer sentences 2. The natural language processing method according to claim 1, wherein, when an input answer sentence is received from a user, the estimated answer sentence is searched for based on the input answer sentence, and the attribute and / or attribute value corresponding to the input answer sentence is acquired.
3. outputting the attribute and / or attribute value corresponding to the estimated answer sentence in association with the estimated answer sentence, and displaying a registration screen for an action to be executed by referring to the attribute and / or attribute value; storing conditions related to the input attributes and / or attribute values and actions to be executed; The natural language processing method according to claim 1 , wherein, when an input response sentence is received from a user, the attribute and / or attribute value corresponding to the input response sentence is acquired and the action is executed.
4. A computer program that causes a computer to execute the natural language processing method according to any one of claims 1 to 3.
5. a storage unit that stores element data indicating elements that constitute a sentence, element groups indicating sets of the element data, and dialogue templates in which one or more template elements including the element data and / or the element groups are arranged, as well as attributes and attribute values for each of the element data; a template processing unit that determines a question template that is a dialogue template corresponding to the question sentence; an answer sentence estimation unit that generates an estimated answer sentence based on the question template; The answer sentence estimation unit a process of converting the template elements arranged on an answer template to the question template based on the attributes and / or attribute values to generate predicted answer sentences; a process of generating an answer template by performing stretching to replace some of the template elements arranged on the question template with other template elements, and generating a predicted answer sentence based on the template elements arranged in the generated answer template; or a process of searching for other answer templates that share some of the template elements with the question template, and generating a predicted answer sentence based on the template elements arranged in the searched answer template; The natural language processing system generates the predicted answer sentence by one or more of the above.
Citation Information
Patent Citations
Man-machine conversation method and device, electronic equipment and computer storage medium
CN114462358A
Systems and methods for generating smart responses for natural language queries
US20170161320A1
Systems and methods for inserting dialogue into a query response
US20220138428A1
Functional expression complementing apparatus, method and program
JP2011164678A
Query generating device, method, and program
JP2017027233A