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 enhance dialogue accuracy and naturalness in human-computer interaction.
Patent Information
- Application Number
- JP2023034573
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2025-01-22
- Estimated Expiration
- 2043-03-07
AI Technical Summary
Existing Japanese natural language processing technologies struggle with accurately recognizing the meanings in colloquial expressions and maintaining natural dialogue due to the lack of clear grammatical definitions and dependency relationships in Japanese language, particularly when word order changes.
A natural language processing system that utilizes a word dictionary with attached attribute information and templates that define combinations of elements, allowing for the classification and abstraction of input sentences to recognize dependency relationships and generate appropriate responses.
Enhances the ability to conduct more natural and accurate dialogue by abstractly recognizing input sentences, including colloquial expressions, and generating appropriate responses, thereby improving human-computer interaction.
Smart Images

Figure 0007618944000001 
Figure 0007618944000002 
Figure 0007618944000003
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, there are known technologies for humans to interact with computers that perform natural language processing. By using natural language processing suited to each language, it is possible to realize a more natural interaction between computers and humans, and natural language processing technologies suited to the Japanese language in particular are known.
[0003] Patent Document 1 discloses a technology for more appropriately completing a functional word that needs to be supplemented in a middle predicate. Patent Document 1 gives semantic labels to the functional expressions of the predicate, and further classifies them into three types, Mod, Foc, and T. A tense determination unit 71 judges whether or not a functional expression needs to be supplemented for the middle predicate based on the meaning and type of the functional expression of the middle predicate to be supplemented and the conjunction following the middle predicate. For a middle predicate that is judged to need a functional expression to be supplemented, a completion processing unit 72 compares the semantic labels of the middle predicate and the functional expression of the predicate to be complemented immediately after it. Based on the type (Mod, Foc, T) of the functional expression of the middle predicate, the function expression that is "missing" in the middle predicate is determined. It discloses that only the functional expression of the immediately following predicate that is missing is supplemented.
[0004] Patent Document 2 discloses a technique for generating appropriate questions at low cost. Patent Document 2 discloses that a question candidate generating 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 the 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 for each of the question candidates using a language model corresponding to the input label, and outputs a question candidate with a high likelihood as a question. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] JP 2011-164678 A [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 problems described above, the present invention provides 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 have meaning in themselves, and templates in which combinations of a plurality of 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 comprising: 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 a plurality of 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 which 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 groups to which elements constituting the input sentence belong according to the order.
[0011] In Japanese, there is no clear grammatical definition regarding the order of words, and it is difficult to recognize the dependency relationship between words when the word order is changed. In addition, in Japanese, there is no clear grammatical definition regarding colloquial expressions. Some colloquial expressions contain important meanings that affect the meaning of the entire sentence, but it has been difficult to accurately recognize the meaning contained in the collapsed expressions in natural language processing. With the above-mentioned configuration, the input sentence can be classified as a combination of attributes, so that it is possible to recognize the dependency relationship and the collapsed expression in an abstract manner.
[0012] In a preferred form 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 of element, the plurality of consecutive elements constituting the input sentence are grouped into a single unit of 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 the input sentence is further stored in association with the template, and a reply sentence to the input sentence is generated according to 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 form 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 specified word that is identified by manipulating the first attribute of a word included in the input sentence by manipulating its positional relationship in the hierarchical structure. In a preferred form of the present invention, the elements include elements that have meaning in combination with words, an element dictionary in which the elements are assigned attribute information indicating the meaning of 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 specific word included in the input sentence into different positional information.
[0015] Even when a common subject is the topic, the expression of the subject changes depending on the speaker. In a dialogue between a human and a computer, if the computer does not change the expression of the subject appropriately, the human will feel uncomfortable in the dialogue. With this configuration, the meaning of the input sentence can be abstracted by recognizing the input sentence as a combination of attribute information, and a favorable answer sentence for that meaning can be generated, and a natural answer sentence that reflects the change in the expression of the subject can be generated.
[0016] In a preferred embodiment of the present invention, groups of elements that constitute an input sentence are determined, 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 constitute 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 storage 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] With this configuration, new templates can be easily generated, and the variety of recognizable input sentences can be increased. Effect of the Invention
[0018] According to the present invention, it is possible to provide a novel technique for carrying out more natural dialogue in Japanese natural language processing. [Brief description of the drawings]
[0019] [Figure 1] FIG. 1 is a configuration diagram of a natural language processing system according to an embodiment of the present invention. [Diagram 2] FIG. 2 is a diagram showing the hardware configuration of the present embodiment. [Diagram 3] 3A to 3C are conceptual diagrams of words, elements, etc. according to the present embodiment. [Figure 4] FIG. 2 is a data structure diagram of a word dictionary according to the embodiment. [Diagram 5] FIG. 2 is a data structure diagram of a word dictionary according to the embodiment. [Figure 6] FIG. 2 is a data structure diagram of the usage dictionary of the present embodiment. [Figure 7] FIG. 2 is a schematic diagram of components of dialogue data according to the present embodiment. [Figure 8] FIG. 4 is a schematic diagram of a word template according to the present embodiment. [Figure 9] FIG. 4 is a schematic diagram of a dialogue template according to the present embodiment. [Figure 10] 4 is a process flowchart relating to registration of a dialogue template according to the present embodiment. [Figure 11] 4 is a process flowchart relating to word template registration according to the embodiment. [Figure 12] 4 is a process flowchart for interacting with a user according to the present embodiment. [Figure 13] 5 is a flowchart showing a process for identifying a dialogue template from an input sentence according to the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0020] The natural language processing system 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 embodiment described below, and various configurations can be adopted.
[0021] In this embodiment, the configuration, operation, etc. of a natural language processing system will be described, but a method, device, computer program, and program recording medium storing the program having a similar configuration can also achieve the same 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 this embodiment, the program may be in the form of so-called cloud computing, in which the program is started on an external computer to realize its functions in a client terminal.
[0022] 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 with the arithmetic unit. The natural language processing method is realized by processing of the computer device including the natural language processing device.
[0023] <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, a response sentence output unit 30, and a database DB.
[0024] The input sentence acquisition unit 10 acquires text data as an input sentence from input data by an interlocutor. The input sentence acquisition unit 10 outputs the input sentence to the natural language processing unit 20. The input data may be any of voice data, image data, and text data. When the input data is voice data, the input sentence acquisition unit 10 acquires the input sentence by performing transcription (text recognition) processing on the voice data. When the input data is image data, the input sentence acquisition unit 10 acquires the input sentence by performing OCR processing or the like on the image data.
[0025] The natural language processing unit 20 acquires an input sentence from the input sentence acquisition unit 10, and generates an answer sentence by performing natural language processing on 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.
[0026] 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.
[0027] The database DB is configured to be able to communicate data with the natural language processing unit 20 .
[0028] <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 or a terminal device, etc., and has an input sentence acquisition unit 10 and a response sentence output unit 30. The natural language processing device 200 includes a server device, etc., and has 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.
[0029] 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.
[0030] The communication unit 101 controls communication with a communication network, and performs input required to operate the interactive device 100 and outputs data related to the operation results.
[0031] 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 processing of the dialogue device 100. The control unit 102 executes processing based on a dialogue program stored in the storage unit 103, thereby causing the computer device to function as the dialogue device 100, and realizing functional components described below.
[0032] The memory unit 103 is a hard disk drive (HDD), a read only memory (ROM), a random access memory (RAM), etc., and stores an interactive program and data used when the control unit 102 executes processing based on the program.
[0033] The input unit 104 inputs input data including voice data or text data to the control unit 102. The input unit 104 is composed of a microphone for acquiring voice data, a keyboard for acquiring text data, a touch panel, and the like.
[0034] The output unit 105 outputs output data including voice data or text data, and is composed of a speaker for outputting voice data, a display for displaying text data, and the like.
[0035] 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 the hardware configuration.
[0036] The communication unit 201 controls communication with a communication network, and performs input required to operate the natural language processing device 200 and outputs data related to the operation results.
[0037] 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.
[0038] The memory unit 203 is a hard disk drive (HDD), a read only memory (ROM), a random access memory (RAM), etc., and stores a natural language processing program and data used when the control unit 202 executes processing based on the program.
[0039] <1.3.Database> The database DB comprises a word DB1 which stores a word dictionary, an element DB which stores an element dictionary (an application DB2 which stores an application dictionary, and an ending DB3 which stores an ending dictionary), a word template DB4 which stores word templates, a dialogue template DB5 which stores dialogue templates, an answer template DB6 which stores answer templates, a dialogue scenario DB7 which stores dialogue scenarios, and a word group DB8.
[0040] <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." Words include, for example, "I," "eat," and "today." Words include, as conventional parts of speech, nouns, verbs, adjectives, adjectival verbs, adverbs, conjunctions, conjunctions, and interjections. Words are stored in a word dictionary in word DB1.
[0041] 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" (I am), "no" (I am), "tabe" (I want to eat), etc. Elements include particles and auxiliary verbs as conventional parts of speech. Conjugations are stored in the conjugation dictionary of the conjugation DB2.
[0042] Additionally, elements may further include endings that are connected to words or other elements (conjugations). Endings include, for example, tabetai "desu" and tabetai "wa". The endings are stored in an ending dictionary in ending DB3. The conjugation DB2 and ending DB3 are referred to as element DBs.
[0043] <2.2.Word> In this embodiment, a combination of elements including at least one or more and indicating a semantic unit included in an input sentence is called 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", "I want to eat: word + conjugation + suffix", etc. Also, a word may be formed by combining multiple words with one or more elements, such as "bones of the fingers". "I: word" may also be treated as a word.
[0044] <2.3. Word Groups, Element Groups> Here, a group that defines a set of words is a word group (dashed line in FIG. 3), and a group that defines a set of elements is 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 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, and groups defined by adding words to a group list, etc.
[0045] Moreover, elements stored in the element DB belong to one or more element groups. Here, the words in the word DB1 are associated with element groups that refer to them (indicating 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, stems, etc. The element group includes 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 do not sound strange when substituted in Japanese expressions.
[0046] 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 that is 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.
[0047] <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 is information indicating the meaning of the element, and includes word attributes related to the word and element attributes related to the element.
[0048] The word attribute is information indicating the meaning or quality of a word itself, and in this embodiment, includes a first attribute and a second attribute. The first attribute is defined as a word category indicating the semantic content or quality of a word. In this embodiment, the word category is a classification indicating the meaning of a word, and has a hierarchical structure of two or more layers. The meaning of a word is expressed by a combination of classifications. The second attribute is defined as a modifier attribute indicating the meaning 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 by text, numerical values, 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.
[0049] The element attributes are information about an element that supplements a word, and indicate the speaker's emotion, intention, nuance, or situation caused by the element, and in this embodiment, include a third attribute and a 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 by a text, a numerical value, 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 given to the word by text, numerical value, or logical value (truth value).
[0050] <2.5. Word Dictionary> The word DB1 stores a word dictionary that defines a plurality of words. The words are classified into word categories based on the meanings of the words. In this embodiment, the word categories have a hierarchical structure according to the abstraction of the meanings. The hierarchical structure has two or more layers, and the number of layers is not limited.
[0051] <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, which indicates a related word category, and a word category name. The related word category includes a word category ID indicating a parent-child relationship in a hierarchical structure, and in this embodiment, indicates a parent word category ID. For example, the word category name "brand" has a related word category ID of the word category name "distribution" corresponding to the parent relationship, and the word category name "distribution" has a related word category ID of the word category name "food" corresponding 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, a sibling relationship, or a cousin relationship.
[0052] FIG. 4(b) is a data configuration example showing the first attribute of a word in a word dictionary. A configuration example is shown. FIG. 4(c) is a conceptual diagram showing the first attribute of a word defined by FIG. 4(a) and FIG. 4(b). The word categories in FIG. 4(c) are defined in a hierarchical structure by the related word category IDs shown in FIG. 4(a), with the left side showing the word categories in the upper 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 upper hierarchy and indicate their meaning in combination with the classification in the upper hierarchy. In FIG. 4(c), the meaning of the word "Brand A" (word name) is defined by the hierarchical structure of word categories indicating, for example, food, distribution system, and brand, in that order from the top. 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.
[0053] The word categories and parts of speech classified by the word categories are not limited to the example shown in Fig. 4. In this embodiment, the word category names and word names are distinguished by the word category ID and word ID, and words with the same word name may exist under different word categories. Also, each word indicating a word category name (word category name in Fig. 4(a)) may be given a word identifier instead of a word category identifier and treated as a word.
[0054] Fig. 5(a) shows an example of a data configuration showing 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 that is an identifier of the word. Note that the word data has a word category ID and a word group ID as exemplified in Fig. 4, depending on the table shown in Fig. 5 and the data stored in the word group DB8. 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.
[0055] The inflection type indicates the classification of inflected words such as verbs, and in this embodiment is information for identifying an inflection table corresponding to a word. It may be an inflection table ID, etc.
[0056] A modification attribute is data associated with a word and defines an additional meaning of the word. The modification attribute may be defined for each word group. For example, in this embodiment, a common modification attribute item is set for a word group defined by a word category. A word group to which a common modification attribute is assigned is called a word modification group.
[0057] In the illustrated example, when a word modification group is defined by a word category ID=1 (word category: food), modification attributes such as "deliciousness", "junkness", and "luxury" may be defined for the word. A modification attribute value is set for each item of the modification attribute, and for example, the word "fast food" is set to a high junkness, and the word "French" is set to a high luxury. The modification attribute value is set as text, a numerical value, or a logical value. In this embodiment, a word modification group is set for each word category, but any other set of words may 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 be defined using the AND or OR of multiple word categories as a condition.
[0058] The word group DB8 stores a word group table that defines word groups. The word group table has a word group name and an identifier (word ID) of one or more words belonging to the word group, using an identifier of the word group such as a word group ID as a key. When storing information indicating a word modification group, one or more modification attribute names or identifiers given 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 when defined by one word category, it does not have to be stored in the word group DB8.
[0059] <2.7. Conjugation Dictionary> The inflection DB2 (element DB) stores a conjugation dictionary (inflection table) that defines multiple inflection data and their groups. In this embodiment, an inflection table ID is assigned to the inflection table, and it is defined as an inflection group to which inflection that can be combined with a common word belongs. Fig. 6 shows an example of the data structure of the inflection dictionary. As shown in Fig. 6, the inflection data has an inflection ID, which is an identifier specific to the 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, an inflection name, an inflection attribute, and an interrogative phrase marker.
[0060] The conjugation attribute items indicate the meanings that the conjugation contains, and are classified into basic, negative, question, future intention, past perfect, perfect, wish, regret, antonym, and possible. The conjugation attributes have conjugation attribute values that indicate the strength of their meanings. For example, conjugations that have the meaning of future intentions, such as "I intend to eat" and "I decided to eat," are defined as containing the 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 "1" and "2," respectively.
[0061] The conjugation table is set according to the conjugation type of the word. The conjugation type indicates general conjugation forms of words such as 5-step conjugation and shimoichi-step conjugation. The conjugation table in the illustrated example is linked to words whose conjugation type is shimoichi-step conjugation, such as "taberu" (eat) and "ne" (sleep). In this embodiment, conjugation includes phrases defined as conventional conjugation forms and phrases not defined as conventional conjugation forms, and is defined as phrases used as part of conjugated expressions such as verbs. Taking the verb "taberu" (eat), "taberu" is a stem that does not conjugate, and "ru" is a conjugation that can be conjugated. Conjugation is set according to the conjugation type of the stem. When the conjugation type is a joichi-step or shimoichi-step conjugation verb, examples of conjugation include "ru", "masu", "nai", "masen", "ru?", "masu?", "masu?", "ru ki na shinai", "ru ki na shinai", "you kana", "youtto", "miru ka", and "ru tsumori". Note that the conjugations listed here are just examples, and various conjugations are defined.
[0062] Conjugations include colloquial idiomatic expressions, each of which has its own meaning. Traditionally, the conjugation forms of Japanese verbs 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 classify conjugations such as colloquial language, and the meanings contained in the conjugations could not be processed as natural language. A conjugation dictionary is a dictionary set up with the purpose of processing colloquial idiomatic expressions as natural language by defining conjugations and conjugation attributes.
[0063] 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, interjections, etc., or parts of speech not traditionally defined.
[0064] The conjugation dictionary may include a dictionary that defines conjugations that assign meaning to stems that are parts of speech other than verbs. For example, particles such as "wa," "no," and "ga" that conjugate "person" may be grouped together to form a conjugation group. In this case, for example, a conjugation group may be defined by a word category linked to a word. A word having a conjugation type in the word dictionary is associated with a conjugation dictionary that corresponds to the conjugation type.
[0065] <2.8. Suffix Dictionary> The ending DB 3 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 that is an identifier unique to the ending, an ending name, and an ending attribute.
[0066] The item of the ending attribute 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 the meaning of a question, such as "desu ka" (isn't it) and "desu ka" (isn't it) are defined as containing the stronger meaning of "question" when expressed as "desu ka" (isn't it) rather than "desu ka" (isn't it) and are defined as question attribute values "1" and "2", respectively.
[0067] <2.9. Examples of components of dialogue data> FIG. 7 is a schematic diagram of components of dialogue data in this embodiment. In FIG. 7(a), the symbol A indicates dialogue data (input sentence), the symbol B indicates words, and the symbol C indicates elements. The dialogue data A1 is divided into words B1 to B3 and elements C1 to C3 with reference to the word dictionary and the element dictionary. Since each of the words B1 to B3 is associated with a common conjugation group (elements in the element DB) in the word DB1, a 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)". The first to fourth attributes set for the words D1 to D3 are determined by referring to the word dictionary. Based on the words and elements contained in the words, the words are given unique identifiers and attribute values (word category ID, attribute name, attribute value, etc.) 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...
[0068] <3.1.Template> A template is information that defines a combination of groups of multiple elements and their order. In this embodiment, the template has one or more thrones. The thrones are comparison targets to be compared with one or more words included in the input sentence, and one or more applicable word groups and / or element groups are defined in each throne. This word group may be a set of words with common attribute information (e.g., word categories, etc.), or may be a set of any words collected for a specific purpose in the word group DB8. Similarly, the element group may be a set of inflections (elements) defined by an inflection table or the like, or may be a set of any elements. In addition, the template has position information indicating 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, matching of the template with the input sentence can be performed. The position information indicates the order of words in the throne, i.e., included in the sentence, and the words constituting the input sentence are compared in order of appearance with the comparison targets whose order corresponds to the order, and template matching is performed.
[0069] In this embodiment, the templates include word templates, dialogue templates, and answer templates. The word templates are templates for determining the type, grouping, case, etc. of words, and are stored in the word template DB4. The dialogue templates are templates for grasping the content, type, etc. of an input sentence, and are stored in the dialogue template DB5. The answer templates are templates for creating an answer sentence, and are stored in the answer template DB6.
[0070] <3.2. Word template> A word template is a template for recognizing multiple elements, such as a word modified by another word, as one word. 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 can be determined as a word by the word template. FIG. 8 shows a data structure diagram of word template data. In this embodiment, the word template has a word template ID, which is an identifier unique to the word template, a sample sentence, a word template name, and one or more thrones E to be compared with a combination of consecutive elements in an input sentence or the like. The throne E includes position information, one or more words and / or elements to be applied to the throne. In this embodiment, a word group or an element group is applied to the throne, and by referring to these groups, it is possible to recognize multiple types of words consisting of a combination of a first element group and a second or subsequent element group that are arranged consecutively. The group is a word group or an element group, and in this embodiment, a set of a word group ID and an inflection table ID is specified in each throne.
[0071] The word template ID=1 is a word template that is matched when an input sentence including words such as "hand" or "foot" is input. The first throne E1 corresponds to the word "hand" and the associated phrase "of". The first throne E1 has position information of 1, a word group ID (=11) including "hand" and "foot", and a conjugation table ID (=2) related to "of". In this embodiment, the first throne E1 includes a pair of a word group and an element group. For example, as shown by thrones E11 and E12, the word group and the element group may be applied to the throne. In the illustrated example, the first throne E11 has position information of 1 and a word group ID (=11) including "hand" and "foot", and the second throne E12 has position information of 2 and an inflection table ID (=2) related to "of". In this embodiment, a group is applied to each throne, but as shown by throne 21, in a throne included in a word template, a word itself or an element itself may be applied instead of some or all of the groups. For example, the first throne E21 has position information of 1 and has a word ID (=111) of "hand" and an inflection ID (=222) of "of". Furthermore, a group including only one element may be defined and applied to a throne.
[0072] The word template ID=2 is a word template that is matched when an input sentence including, for example, the words "fingers," "back of the hand," and "toes" is input. The first throne E2 corresponds to the word "hand," and the second throne E3 corresponds to the word "finger." The first throne E2 has position information of 1, a group ID (=11) for "hand," and an inflection table ID (=2) for "of." The second throne E3 has position information of 2, a word group ID (=12) for "finger," and an inflection table ID (=1) indicating that "finger" is a base form (not including elements). In the illustrated example, an inflection table ID=1 is assigned to a throne that does not include inflection. If the target throne does not include inflection data, the inflection table ID may be omitted.
[0073] The word template ID=3 is a word template that is matched when an input sentence including words such as "bone of finger", "skin of finger", and "bone of toe" is input. 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.
[0074] 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 according to the division rules shown below. The division unit 22 refers to the word dictionary of the word DB1 and identifies words included in the input sentence. The division unit 22 further refers to the element DBs (inflection DB2, suffix DB3) and identifies elements (inflection, suffix) included in the input sentence.
[0075] The word processing unit 23 determines a word from the elements included in the input sentence. The word processing unit 23 refers to the word template DB4 and judges whether or not a combination of elements arranged consecutively from the first word of the input sentence corresponds to a registered word template. If there is a combination that corresponds to the word template, the word processing unit 23 confirms it as a word based on the word template. Then, the word processing unit 23 searches for a word to which a word template is not 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 specified, it is determined to be a word consisting of only a single word. If a word or element can be specified, it is checked whether there is a further consecutive word or element. If a further consecutive word or element cannot be specified, it is determined to be a word consisting of, for example, a word and an element (conjugation). If it can be specified, 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 treats 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.
[0076] <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 are allowed to be omitted in the 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 times or objects, subjects, etc. (in this example, "yesterday", "I", "for dinner", etc.) may be omitted, and even when they are omitted, they can be matched to the same template.
[0077] FIG. 9 shows a data structure diagram of dialogue template data. In FIG. 8, the dialogue template has 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 4) to be compared. In this embodiment, the throne includes position information, a required flag, and a group of elements to be applied to the throne. The group is a word group or a word group and an element group, and in this embodiment, is a set of a word group ID and an inflection table ID. The required flag is a logical value indicating whether or not the word corresponding to the throne is required in the dialogue data. For a word determined by matching with a word template, the word or the word and element at the end of the word template is used when matching with the throne in the dialogue template.
[0078] The dialogue template ID=1 is a greeting template. The word group ID=1 includes words such as "good morning" and "hello", and is matched when an input sentence consisting of these words is input (throne W1). If the target throne does not include conjugation data, the conjugation table ID may be omitted or an ID indicating the base form may be defined. In the illustrated example, the conjugation table ID=1 is assigned to the throne that does not include conjugation. 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 21 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.
[0079] The dialogue template CT2 is a template for a weather question, and is a template that matches when dialogue data such as "Tell me about the weather today" is input. The first throne W2 has position information of 1, a mandatory 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 position information of 2, a mandatory 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 position information of 3, a mandatory flag of false, and has a word group ID for "teacher" included in "oshiete", and a conjugation table ID for "te".
[0080] 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 selects a template corresponding to the input sentence based on the degree of match of the combination of groups to which each element constituting the input sentence belongs, by referring to the dialogue templates in the dialogue template DB5. 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 by the match rate of the thrones, etc.
[0081] <3.4. Dialogue scenario> In this embodiment, the dialogue between the person and the dialogue device progresses based on a dialogue scenario. A dialogue scenario is data that sets out 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 (the input sentence and its response sentence). The dialogue scenario is stored in a dialogue scenario DB7.
[0082] <3.5. Instruction information> The instruction information is set in association with a dialogue template, and is information indicating 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, and generating and outputting an answer sentence. The answer sentence generation unit 25 executes an action based on the instruction information associated with the dialogue template.
[0083] <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. Then, the answer sentence generating unit 25 acquires instruction information defined in advance 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 the referenced throne or thrones. At this time, the answer sentence generating unit 25 acquires the answer template by referring to the answer template DB6.
[0084] <3.7. Answer template> An answer template is a template for an answer 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 an input sentence "I ate cup ramen" is recognized as a dialogue template of "Throne 1: I ate cup ramen" and "Throne 2: I ate", the answer sentence "I ate cup ramen" can be generated by directly referring to the word "Cup ramen" in Throne 1. An answer template may further include conversion rules for the referenced throne or dialogue template (when it includes references to all thrones). For example, the word category of the word "Cup ramen" in Throne 1 can be superordinated to generate the answer sentence "Ramen". In combination with the reference to the throne of the dialogue template, a fixed answer sentence may be included. For example, the word "Cup ramen" in Throne 1 can be combined with a fixed phrase "I ate" to generate the answer sentence "I ate cup ramen".
[0085] <3.8. Conversion rules> The conversion rules include nominative conversion, interrogative conversion, inversion conversion, omission conversion, first attribute conversion, second attribute conversion, third attribute conversion, and fourth attribute conversion. The conversion rules are not limited to these, and any rule can be set. The conversion rules can be set by specifying attribute information of an element included in a specific throne referenced in the dialogue template. A response template may include a combination of multiple conversion rules.
[0086] 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 position of the speaker and the listener. A question transformation is a transformation rule that transforms an input sentence into a question, for example, by transforming an element of the input sentence into an element that becomes a question or by adding an element to the input sentence. Inversion is a rule that converts the position information of a specific word (throne) included in an input sentence to the end of the sentence, making it an inverted expression. An omission transformation is a rule that omits certain words contained in an input sentence.
[0087] The first attribute conversion is a rule for converting the word category of the words included in the input sentence. The first attribute conversion sets the conversion conditions related to the first attribute, such as whether the word category belongs to the same word group or a different word group, and the number of layers 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. In the second attribute conversion, a condition for changing the modifier attribute or the modifier attribute value of a specific word is set. For example, a value to be added or subtracted from the modifier attribute value of a specific word included in an input sentence is 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. In the third attribute conversion, a condition for changing the inflection attribute or the inflection attribute value is set. For example, a value to be added or subtracted from the inflection attribute value of a specific inflection included in the input sentence is set, and another inflection having the inflection attribute value after the addition or subtraction 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. In the fourth attribute conversion, a condition for changing the ending attribute or ending attribute value is set. 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 ending attribute value after the addition or subtraction can be obtained from the element DB.
[0088] <3.9. Control Commands> The action based on the instruction information may further include a control command to any device. The control command includes the output of operation information for operating any device, and includes, for example, 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, and control of an actuator, display, or speaker mounted on the dialogue device. The operation information may include any word or phrase included in the input sentence, and may also include a generated answer sentence.
[0089] <4.1. Registration process of new dialogue template> Next, the process of registering a new dialogue template based on an input sentence will be described. Figure 10 shows a process flow for registering a dialogue template.
[0090] 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).
[0091] The registration unit 21 registers a new dialogue template from the input sentence. In step S14, the registration unit 21 refers to the word groups of the words and element groups of the 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.
[0092] In step S15, the dialogue template is stretched as necessary. The stretching process is a process for changing the contents of the template generated according to the input sentence, such as widening, shrinking, or changing the attributes of each throne of the new dialogue template to be registered to a different range. In this embodiment, the registration unit 21 presents the groups of each word included in the input sentence to the terminal device of the user who is going to register the new dialogue template, so that the dialogue template with the changed range of application can be registered. For example, a word group (e.g., a word category) of a word included in the word in the input sentence can be set as a word group of the throne in the new dialogue template. In addition, an arbitrary word group, such as a higher-level word category, a lower-level word category, a word modification group of the word, or any other group including an arbitrary word, can be specified to generate a dialogue template in which the specified word group is linked to the throne. In addition, in the stretching process, a word dictionary may be searched and a group may be specified for another word not included in the input sentence. In addition, for an element, an element group corresponding to a specified word may be selected in conjunction with the specified word group, or an arbitrary element group may be specified. It may also be possible to delete the throne set by a word in the input sentence, or to replace the position information.
[0093] 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.
[0094] <4.2. New Word template registration process> Fig. 11 shows a processing flowchart for registering a word template. In this embodiment, a word template is set by a plurality of 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 the element group and registers a new word template.
[0095] First, the registration unit 21 receives a registration instruction request for the word template from the terminal device of the user who is to register a new word template (step S21). The registration unit 21 receives the selection of the first word group and the first element group to be applied to the first throne (step S22). Here, the registration unit 21 may be configured to receive the selection of a word category or arbitrary word data, and to be able to specify the word group. For example, when a word template for combining the word "A: finger" and the element "B: of" is registered, the word group that applies to A is defined by the word group according to the word category or the word group to which the arbitrarily selected word belongs. For example, first, a word group including "finger", "hand", "foot", "head", etc. is specified as A. Then, an element (inflection) group including "of" is specified as B. The specified groups A and B are set to the throne (position information 1 in FIG. 8) of the new word template, respectively. For a throne that does not include an element, an indication that it does not include an element is registered (for example, null data, a specified character string, etc.).
[0096] The registration unit 21 accepts a selection as to 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 setting process of the word template.
[0097] 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 to specify the word group to which the selected word belongs and the element group to which the element belongs. For a throne that does not include a word or element, it is registered to indicate that it does not include a word or element (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 the word group and the element group. If the combination is to be completed (YES in step S25), the registration unit 21 proceeds to the subsequent step S26 and completes the setting process of the word template. If the combination is to be continued (NO in step S25), that is, if a third or subsequent throne is to be set, the registration unit 21 returns to step S24, and further accepts the selection of the word group and element group to be combined, and links them to the throne.
[0098] 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 aspect of the configuration of the word template, the word template may be composed of only a plurality of word groups. An example of the word template in this aspect is text data such as "Tokyo Station" and "bookshelf". A word template consisting of only word groups includes so-called phrases. The registration unit 21 can accept the registration of a word template consisting of only word groups by accepting a selection to omit the element group in steps S22 and S24. Note that when a plurality of word groups are designated for the same throne, the registration unit 21 may register a word template for each word group.
[0099] <5.1. Natural language processing of input text> Next, a process for carrying out a dialogue with a user will be described using the dialogue template etc. Fig. 12 shows a process flowchart for carrying out a dialogue with a user according to this embodiment.
[0100] <5.2. Identifying Dialogue Templates> First, in step S31, a dialogue template corresponding to an 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.
[0101] <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 provisional word by sequentially combining the divided elements from the beginning of the input sentence (step S45). In step S46, the word processor 23 judges whether a combination of provisional words arranged consecutively matches a word template stored in the word template DB4. If the combination of provisional words 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 judges 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 a word based on the word template (step S47).
[0102] The word processing unit 23 repeatedly executes the processes of steps S44 to S49 until the word templates to be applied to all words in the input sentence are determined (step S48). In step S47, an element without a corresponding word template is determined as a single word. When the word processing unit 23 completes the determination process for all words in the input sentence, the process 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.
[0103] The template processing unit 24 refers to the dialogue template DB5 and extracts a dialogue template having the highest matching rate with the combination of words arranged in the predetermined order determined in step S49 (step S50). For the words determined by the word template, the last word or the group of words and elements is compared with the group set in the dialogue template throne. If there are multiple dialogue templates with the highest matching rate (YES in step S51), the template processing unit 24 proceeds to the next step S52 and executes a dialogue template narrowing-down process (step S52). If there is only one dialogue template with the highest matching rate (NO in step S51) or the narrowing-down process is completed, the process proceeds to step S53. In the narrowing-down process, if multiple dialogue templates have the same matching rate, the dialogue scenario DB7 is referred to and a dialogue template is determined according to the priority of the dialogue template set in the scenario. For example, a history of the determination of each template in the dialogue scenario may be recorded, and a dialogue scenario with a high ratio may be applied. In step S53, the template processing unit 24 specifies 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.
[0104] <5.4. Determining Instruction Information> 11, when the dialogue template is determined, the answer sentence generation unit 25 refers to the dialogue scenario stored in the scenario DB and determines whether or not 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).
[0105] 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.
[0106] <6.1.Sample> The following is a sample showing the process from obtaining a dialogue template corresponding to an input sentence to outputting a response sentence.
[0107] <6.2. Sample 1> The input sentence X1 is text data of "Thank you." The natural language processing unit 20 acquires the input sentence X1 and classifies it into a dialogue template X2 related to "Thank you." When the answer sentence generation unit 25 acquires the dialogue template X2, it refers to a dialogue scenario X3 related to "Thank you" and acquires instruction information X4. Here, if the instruction information X4 is instruction information including a fixed-length answer sentence X5 of "You're welcome," the answer sentence generation unit 25 generates the answer sentence X5 of "You're welcome."
[0108] <6.3. Sample 2> The input sentence Z1 is text data of "I am 18 years old today". The natural language processing unit 20 acquires the input sentence Z1 and classifies it into the dialogue template Z2 related to "age". The input sentence is a combination of words "I am", "Today", and "18 years old". The word "I am" is a word Z3 corresponding to throne 1 of the dialogue template Z2, and has a word group (word category) of "person / first person" as a first attribute of the word. The word "Today" Z4 is a word corresponding to throne 2, and has a word group of "tense / today" as a first attribute of the word. The word "I am 18 years old" is a word Z5 corresponding to throne 3, and has "age" as an attribute of the word. The dialogue scenario Z7A is associated with the dialogue scenarios Z7A to C, and is described to refer to the dialogue scenario Z7B related to "age" when the input sentence Z1 corresponding to the dialogue template Z2 is input. When the dialogue template Z2 is determined, the answer sentence generating unit 25 refers to the dialogue scenario Z7B related to "age" and acquires the instruction information Z8. Here, the instruction information Z8 is instruction information including a command to generate an answer sentence by the answer template Z9. The answer template Z9 refers to all thrones 1 to 3 of the dialogue template Z2, and has the following conversion rules set: Z10: a conversion rule for omitting (deleting) throne 1 by referring to throne 1, Z11: a conversion rule for performing inversion by referring to throne 2, and Z12: a conversion rule for converting to a question by referring to throne 3. The answer sentence generating 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 generating unit 25 generates an answer sentence such as "Are you 18 years old? Today" according to the conversion rules of the answer template.
[0109] 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 a dialogue means. The terminal device includes a smartphone, a tablet terminal, a smart speaker, and the like. 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.
[0110] As described above, according to the present invention, more natural dialogue can be carried out in natural language processing of Japanese. [Explanation of symbols]
[0111] 1. Natural Language Processing System 10 Input text 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 30 Answer text output section DB Database 100 Interactive device 200 Natural Language Processing Device
Claims
1. A word dictionary in which a computer assigns attribute information to words, which are elements having meaning in themselves; an element dictionary in which attribute information is assigned to elements that have meaning in combination with words; A dialogue template for designating one or more word groups, designating one or more element groups, defining their arrangement, and recognizing an input sentence from a combination of elements included in the input sentence and the arrangement thereof; a word template for specifying a plurality of word groups, specifying zero, one or a plurality of element groups, and defining their arrangement, and recognizing a group of consecutive elements included in an input sentence as a single unit of element; decomposing the input sentence into elements, matching a group of a plurality of consecutive elements which are part of the elements constituting the input sentence with the word template, and treating the group matched with the word template as one unit of element; A natural language processing method for selecting a template corresponding to an input sentence based on the one unit element and other elements constituting the input sentence.
2. A natural language processing method as described in claim 1, wherein, in matching a dialogue template using the word template, a template corresponding to an input sentence is selected based on an element that represents the group that has been made into a unit element by the word template and other elements that make up the input sentence.
3. Registering instruction information indicating an action to be executed in response to the input sentence, in association with the dialogue template; The natural language processing method according to claim 1 , further comprising the step of: executing the associated instruction information in accordance with the dialogue template selected for the input sentence.
4. A natural language processing method as described in claim 1, wherein the instruction information includes generating an answer sentence, outputting an answer sentence, or sending a control command.
5. The natural language processing method described in claim 4, wherein the instruction information is an instruction to generate an answer sentence using an answer template.
6. A natural language processing method as described in claim 4 or claim 5, wherein the instruction information relating to instructions for generating an answer sentence includes any of the following processes: replacing a specific element contained in the input sentence with a word having a common attribute, converting the conjugated form of the element, converting the word into a superordinate concept, or converting the position of the word, using attribute information of the specific element contained in the input sentence.
7. 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; 7. The natural language processing method according to claim 6, wherein the instruction information relating to an instruction to generate an answer sentence includes an instruction to generate an answer sentence by using a predetermined word identified by manipulating the positional relationship in the hierarchical structure as the first attribute of a word included in the input sentence.
8. The natural language processing method described in Claim 6, wherein the instruction information relating to an instruction to generate an answer sentence includes 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.
9. A natural language processing method as described in claim 6, wherein the instruction information relating to an instruction to generate an answer sentence includes an instruction to convert position information defining a sequence of specified words contained in the input sentence into another position information to generate an answer sentence.
10. 2. The natural language processing method according to claim 1, further comprising the steps of: accepting an input sentence; determining an element group including each element constituting the input sentence; and arranging the determined element group according to an arrangement of the elements in the input sentence to generate a new template.
11. 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; The natural language processing method according to claim 10, further comprising generating a new template based on a group of words defined by a first attribute of words constituting an input sentence.
12. 12. The natural language processing method according to claim 10, further comprising the step of generating a new template based on a group of elements defined by attribute information of elements constituting an input sentence.
13. a word dictionary in which attribute information is assigned to words, which are elements that have meaning in themselves; an element dictionary in which attribute information is assigned to elements that have meaning in combination with words; A dialogue template for designating one or more word groups, designating one or more element groups, defining their arrangement, and recognizing an input sentence from a combination of elements included in the input sentence and the arrangement thereof; a storage unit for storing a word template for specifying a plurality of word groups, specifying zero, one or a plurality of element groups, defining their arrangement, and recognizing a group of consecutive elements included in an input sentence as a single unit element; decomposing the input sentence into elements, matching a group of a plurality of consecutive elements which are part of the elements constituting the input sentence with the word template, and treating the group matched with the word template as one unit of element; a template processing unit that selects a template corresponding to the input sentence based on the one unit element and other elements that constitute the input sentence.
14. a word dictionary in which attribute information is assigned to words, which are elements that have meaning in themselves; an element dictionary in which attribute information is assigned to elements that have meaning in combination with words; A dialogue template for designating one or more word groups, designating one or more element groups, defining their arrangement, and recognizing an input sentence from a combination of elements included in the input sentence and the arrangement thereof; a word template for specifying a plurality of word groups, specifying zero, one or a plurality of element groups, and defining their arrangement, and recognizing a group of consecutive elements included in an input sentence as a single unit of element; decomposing the input sentence into elements, matching a group of a plurality of consecutive elements which are part of the elements constituting the input sentence with the word template, and treating the group matched with the word template as one unit of element; a natural language processing program that causes the program to function as a template processing unit that selects a template corresponding to the input sentence based on the one unit element and other elements that constitute the input sentence.
Citation Information
Patent Citations
Japanese sentence processor
JP1995219952A
Method for deciding parallel element of natural language sentence and device for executing same
JP1996147297A
Language processor, language processing method, language processing program, and recording medium recording same program
JP2009176168A
Functional expression complementing apparatus, method and program
JP2011164678A
Query generating device, method, and program
JP2017027233A