The present disclosure relates to a structured natural language knowledge system capable of handling both a descriptive sentence and an interrogative sentence.
The Structured Query Language (SQL) is used for relational database systems, for example. It is convenient that a Structured Natural Language (SNL) sentence is automatically translated to SQL sentence. Patent Literature 1 (PTL 1) discloses a structured natural language query and knowledge system including a translator which translates SNL to SQL.
However, since the system disclosed in PTL 1 treats only an imperative sentence for generating a query in order to assist a user who lacks programing skill in specifying a query to an application database, the system can only search data from a database. Further, the system is used effectively only when the database stores application data.
An exemplary object of the present invention is to provide a structured natural language system capable of storing sentences in a database retrieving sentences from a database. Further, it is another object of the present invention to create various SNL sentences on the basis of inputted elements by the user.
A structured natural language knowledge system according to the present invention includes: a structured natural language sentence composition module which composes an SNL (Structured Natural Language) sentence, and a sentence translator which translates an SNL descriptive sentence or an SNL question sentence to SQL (Structured Query Language) queries so that the components of a descriptive or question sentence are stored in a database.
An SNL-SQL translation method, the method according to the present invention includes: composing an SNL (Structured Natural Language) sentence, and translating an SNL descriptive sentence or an SNL question sentence to SQL (Structured Query Language) queries so that the components of a descriptive or question sentence are stored in a database.
An SNL-SQL translation program according to the present invention causes a computer to execute: composing an SNL (Structured Natural Language) sentence, and translating an SNL descriptive sentence or an SNL question sentence to SQL (Structured Query Language) queries, and stores the components of an SNL sentence in a database.
The present invention can provide a structured natural language system capable of storing SNL sentences in a database, in addition to retrieving SNL sentences from a database. In addition, the present invention can create an SNL sentence based on the elements inputted by the user.
The SNL knowledge system 100 includes at least a structured natural language sentence composition module 120 which composes an SNL sentence, a sentence translator such as a SNL-SQL translator 130 which translates an SNL sentence to an SQL sentence, a database 150, and a question generator 160 which is another example of the sentence translator. The question generator 160 can create a question on the basis of data stored in the database 150.
First of all, we explain a basic concept of the SNL knowledge system 100.
As explained below, when a user selects a pattern and a tense, and inputs one or more elements, the output from the SNL knowledge system 100 is displayed on the output segment 220.
As shown in
Next, some general operations of the SNL knowledge system 100 are explained, referring to
A user selects the “S+V+O” pattern from the pattern pull-down menu 211. The user selects “Present” from the tense pull-down menu 212. The user inputs “John” as the subject. The user inputs “like” as the verb. The user inputs “Mary” as the object. In addition, the user selects “.” (period) as the terminator.
The structured natural language sentence composition module 120 makes an SNL sentence based on the inputted elements. Next, the SNL-SQL translator 130 transforms the SNL sentence to an SQL query, then, stores the information (elements) by SQL into the database 150. For example, the SNL-SQL translator 130 inserts the elements into a table in the database 150.
A user selects “S+V+O” from the pattern pull-down menu 211. The user selects “Present” from the tense pull-down menu 212. The user inputs “what” as the subject. The user inputs “like” as the verb. The user inputs “Mary” as the object. In addition, the user selects a question mark (?) as the terminator.
The SNL-SQL translator 130 makes an SNL sentence on the basis of the inputted elements. Further, the SNL-SQL translator 130 transforms the SNL sentence to SQL. The SNL-SQL translator 130 inquires the database 150. Then, the SNL-SQL translator 130 retrieves a result of search from the database 150. The SNL-SQL translator 130 outputs the result. For example, the SNL-SQL translator 130 displays the result on the output segment 220. In
At first, the question generator 160 issues an SQL query to the database. In the example shown in
Next, an operation of the SNL knowledge system 100 is explained.
In the SNL knowledge system 100, the structured natural language sentence composition module 120 displays different components of a sentence as shown in
When input of the user is completed, the structured natural language sentence composition module 120 outputs selected elements from the pattern pull-down menu 211, the tense pull-down menu 212, the negative pull-down menu 213, and the inputted element in the auxiliary input box 214 to the SNL-SQL translator 130 (step S103).
The structured natural language sentence composition module 120 outputs the elements inputted by a user for the subject input box 2151, the verb input box 2152, the object input box 2153 to the SNL-SQL translator 130 (step S104).
Further, the structured natural language sentence composition module 120 outputs selected element from the terminator pull-down menu 2154 to SNL-SQL translator 130.
The structured natural language sentence composition module 120 determines whether an end is selected or not (step S105). Specifically, the structured natural language sentence composition module 120 determines whether an element is inputted by a user for the terminator pull-down menu 2154. When an element is inputted, the structured natural language sentence composition module 120 terminates the process shown in
Thereafter, the structured natural language sentence composition module 120 composes an SNL sentence based on the inputted elements. The SNL-SQL translator 130 translates an SNL sentence to SQL queries to its components. The SNL-SQL translator 130 stores the inputted elements to the database 150 or searches the data in the database 150 by using SQL.
In addition, preferably, the structured natural language sentence composition module 120 asks the user to enter the value(s) of one or more components whose value(s) are not known based on what have been entered to develop a more complete sentence incrementally. A component of a sentence may be at least one of a subject, an object, a verb, a compliment, an adverb, and an adjective.
As described above, the structured natural language sentence composition module 120 receives elements of a positive sentence in SNL.
As described above, the structured natural language sentence composition module 120 receives elements of a negative sentence of SNL.
As described above, the structured natural language sentence composition module 120 receives elements of an interrogative sentence (yes-no question) in SNL. Additionally, in the example shown in
As described above, the structured natural language sentence composition module 120 receives elements of an interrogative sentence (wh-question) of SNL.
Given an interrogative sentence, the operations of the SNL-SQL translator 130 are explained now in more detail.
As shown in
As shown in
As shown in
As shown in
As shown in
As shown in
As shown in
Following are examples of various sentence patterns shown in
The user inputs “John” as the subject. The user inputs “run” as the verb.
In this example, the user further inputs “very fast” to “Adverb”, “in the park” to “Place”, and “with Mary” to “Attendant” in the subject subarea 2161 and the verb subarea 2162 (refer to
The user inputs “flower” as the subject. The user inputs “smell” as the verb. The user inputs “good” as the adjective. In this case, in the word input area 215, there are a C-1 Noun input box, a C2-Adjective input box and a C3-Place input box, instead of the object input box 2153.
In this example, the user further inputs “this” to “S-Adjective” in the subject subarea 2161 (refer to
The user inputs “I” as the subject. The user inputs “watch” as the verb. The user inputs “TV” as the object. It should be noted that the user selects “Past” from the tense pull-down menu 212.
In this example, the user further inputs “last night” to “Time” in the verb subarea 2162 (refer to
The user inputs “I” as the subject. The user inputs “give” as the verb. The user inputs “mother” as the indirect object. The user inputs “flowers” as the direct object. It should be noted that the user selects “Past” from the tense pull-down menu 212.
In this example, the user further inputs “yesterday” to “Time” in the verb subarea 2162 (refer to
The user inputs “I” as the subject. The user inputs “name” as the verb. The user inputs “dog” as the object. It should be noted that the user selects “Past” from the tense pull-down menu 212. In this case, in the word input area 215, there are a C1-Noun input box (C1-Noun) and a C2-Adjective input box (C2-Adjective), instead of the object input box 2153.
In this example, the user further inputs “my” to “O-Possessive” in the object subarea 2163 (refer to
The user inputs “John” as the subject. The user inputs “be” as the verb. It should be noted that the user selects “Comp” from the pattern pull-down menu 211. In this case, in the word input area 215, an adjective/adverb input box (“Adjective/Adverb”) and a target input box (“Target”) are added. The user further inputs “tall” to “Adjective/Adverb”, and “Mike” to “Target”.
In this example, the user further inputs “by 10 cm” to “Difference” in the subarea. That is how the structured natural language sentence composition module 120 receives elements of a comparative sentence.
The user inputs “John” as the subject. The user inputs “be” as the verb. It should be noted that the user selects “Comp-E” from the pattern pull-down menu 211. In this case, in the word input area 215, an adjective/adverb input box (“Adjective/Adverb”) and a target input box (“Target”) are added. The user further inputs “heavy” to “Adjective/Adverb”, and “Mike” to “Target”.
In this example, the user further inputs “twice” to “Multiplicative” in the subarea. That is how the structured natural language sentence composition module 120 receives elements of a comparative sentence.
The user inputs “John” as the subject. The user inputs “be” as the verb. It should be noted that the user selects “Super”, i.e. “Superlative”, as the pattern. In this case, in the word input area 215, an adjective/adverb input box (“Adjective/Adverb”) and a Noun input box (“Noun”) are added. The user further inputs “tall” to “Adjective/Adverb”, and “student” to “Noun”.
In this example, the user further inputs “second” to “Ordinal” in the subarea, and “in the class” to “Domain” in the subarea. That is how the structured natural language sentence composition module 120 receives elements of a superlative sentence.
Composing a Sentence that Includes Elements of an Adverbial Syntax
In this case, in the word input area 215, a there be/here be input box (“There be/Here be”) is added. The user inputs “There be” as “There be/Here be”. The user inputs “volcanos” as the subject. It should be noted that the user selects “There is” as the pattern.
In this example, the user further inputs “many” to “S-Adjective” in the subject subarea 2161 (refer to
While the present invention has been described with reference to the example embodiments and examples, the present invention is not limited to the aforementioned example embodiments and examples. Various changes understandable to those skilled in the art within the scope of the present invention can be made to the structures and details of the present invention.
Each of the foregoing example embodiments may be realized by hardware or a computer program.
An information processing system shown in
In the information processing system shown in
The foregoing example embodiments may be partly or wholly described in the following supplementary notes, though the structure of the present invention is not limited to such.
Incremental Composition with Interactions
A sentence may be composed incrementally. For example, a sentence of pattern S+V+O may be expanded to a sentence of pattern S+V+O+C if the sentence composition module prompts the user if one or more complements can be added to the sentence. Indeed, a sentence can be expanded into a longer sentence as more details are added. For example, the sentence “John likes Mary.” can be expanded to “John who lives in Irvine likes Mary.” which can further expanded to “John who lines in Irvine likes Mary who lives in San Diego.”, and so on.
(Supplementary note 1) A structured natural language knowledge system, the system comprised of:
a structured natural language sentence composition module which composes an SNL (Structured Natural Language) sentence, and
a sentence translator which translates an SNL descriptive sentence or an SNL question sentence to SQL (Structured Query Language) queries so that the components of a descriptive or question sentence are stored in a database.
(Supplementary note 2) The structured natural language knowledge system of Supplementary note 1,
wherein the sentence translator includes an SNL-SQL translator which translates an SNL descriptive sentence to SQL queries for storing elements of the SNL descriptive sentence to a database, and translates an SNL question sentence to SQL queries for inquiring of the database.
(Supplementary note 3) The structured natural language knowledge system of Supplementary note 1,
wherein the sentence translator includes a question generator which creates an SNL question sentence using the data in a database, and retrieves elements of the sentence from the database using SQL for creating the SNL question sentence.
(Supplementary note 4) The structured natural language knowledge system of Supplementary note 1,
wherein the structured natural language sentence composition module displays the different components of a sentence and prompts a user to enter the values of some or all of the different components in a sentence, wherein a component of a sentence may be at least one of a subject, an object, a verb, a compliment, an adverb and an adjective.
(Supplementary note 5) The structured natural language knowledge system of Supplementary note 4,
wherein the sentence pattern may be “S+V” and its components include a Subject which can have modifiers such as an Amount, an Adjective, a Possessive and a Clause and a Verb, wherein Subject can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, Verb can have modifiers such as an Adverb, a Place, a Time, a Frequency, a Reason, an Actor, a Method and an Attendant (See
(Supplementary note 6) The structured natural language knowledge system of Supplementary note 4,
wherein the sentence pattern may be “S+V+C” and its components include a Subject, a Verb, C1-Noun, C2-Adjective, C3-Place, C3-Time, C3-Age, C3-Length and a C3-Weight, wherein Subject can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, Verb can have modifiers such as an Adverb, a Place, a Time, a Frequency, a Reason, an Actor, a Method and an Attendant, C1-Noun can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, and C2-Adjective can have modifier an Adverb (See
(Supplementary note 7) The structured natural language knowledge system of Supplementary note 4,
wherein the sentence pattern may be “S+V+O” and its components include a Subject, a Verb and an Object. Subject can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, wherein Verb can have modifiers such as an Adverb, a Place, a Time, a Frequency, a Reason, an Actor, a Method and an Attendant, and Object can have modifiers such as an Amount, an Adjective, a Possessive and a Clause (See
(Supplementary note 8) The structured natural language knowledge system of Supplementary note 4,
wherein the sentence pattern may be “S+V+IO+DO” and its components include a Subject, a Verb, an I-Object and a D-Object, wherein Subject can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, Verb can have modifiers such as an Adverb, a Place, a Time, a Frequency, a Reason, an Actor, a Method and an Attendant, I-Object can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, and D-Object can have modifiers such as an Amount, an Adjective, a Possessive and a Clause (See
(Supplementary note 9) The structured natural language knowledge system of Supplementary note 4,
wherein the sentence pattern may be “S+V+O+C” and its components include a Subject, a Verb, an Object, a C1-Noun and a C2-Adjective, wherein Subject can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, Verb can have modifiers such as an Adverb, a Place, a Time, a Frequency, a Reason, an Actor, a Method and an Attendant, Object can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, C1-Noun can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, and C2-Adjective can have modifier an Adverb (See
(Supplementary note 10) The structured natural language knowledge system of Supplementary note 4,
wherein the sentence pattern may be “Comp” and its components include a Subject, a Verb, an Object, an Adjective/Adverb and a Target, wherein Subject can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, Verb can have modifiers such as an Adverb, a Place, a Time, a Frequency, a Reason, an Actor, a Method and an Attendant, Object can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, Adjective/Adverb can have modifier a Difference, and Target can have modifiers such as an Amount, an Adjective, a Possessive and a Clause (See FIG. 31).
(Supplementary note 11) The structured natural language knowledge system of Supplementary note 4,
wherein the sentence pattern may be “Comp-E” and its components include a Subject, a Verb, an Object, an Adjective/Adverb and a Target, wherein Subject can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, Verb can have modifiers such as an Adverb, a Place, a Time, a Frequency, a Reason, an Actor, a Method and an Attendant, Object can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, Adjective/Adverb can have modifier a Multiplicative, and Target can have modifiers such as an Amount, an Adjective, a Possessive and a Clause (See
(Supplementary note 12) The structured natural language knowledge system of Supplementary note 4,
wherein the sentence pattern may be “Super” and its components include a Subject, a Verb, an Object, an Adjective/Adverb and a Noun, wherein Subject can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, Verb can have modifiers such as an Adverb, a Place, a Time, a Frequency, a Reason, an Actor, a Method and an Attendant, Object can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, and Adjective/Adverb can have modifiers such as an Ordinal, a Domain and Candidates (See
(Supplementary note 13) The structured natural language knowledge system of Supplementary note 4,
wherein the sentence pattern may be “There is” and its components include a There be/Here be and a Subject, wherein Subject can have modifiers such as an Amount, an Adjective, a Possessive and a Clause, and the sentence can have modifiers such as a Place, a Time and a Reason (See
(Supplementary note 14) The structured natural language knowledge system of Supplementary note 4,
wherein a sentence pattern may be chosen among a set of sentence patterns by the user to compose a sentence.
(Supplementary note 15) The structured natural language knowledge system of Supplementary note 4,
wherein the structured natural language sentence composition module asks the user to enter the value(s) of one or more components whose value(s) are not known based on what have been entered to develop a more complete sentence incrementally, wherein A component of a sentence may be at least one of a subject, an object, a verb, a compliment, an adverb, and an adjective.
(Supplementary note 16) An SNL-SQL translation method, the method comprised of:
composing an SNL (Structured Natural Language) sentence, and
translating an SNL descriptive sentence or an SNL question sentence to SQL (Structured Query Language) queries so that the components of a descriptive or question sentence are stored in a database.
(Supplementary note 17) The SNL-SQL translation method of Supplementary note 16,
wherein when translating, an SNL descriptive sentence is translated to SQL queries for storing elements of the SNL descriptive sentence to a database, and an SNL question sentence is translated to SQL queries for inquiring of the database.
(Supplementary note 18) The SNL-SQL translation method of Supplementary note 16 or 17, further comprising:
creating an SNL question sentence using the data in a database, and retrieves elements of the sentence from the database using SQL for creating the SNL question sentence.
(Supplementary note 19) The SNL-SQL translation method of Supplementary note 16, 17 or 18, further comprising:
inputting the elements, and outputting an SNL sentence including the elements to a user.
(Supplementary note 20) An SNL-SQL translation program for causing a computer to execute:
composing an SNL (Structured Natural Language) sentence, and
translating an SNL descriptive sentence or an SNL question sentence to SQL (Structured Query Language) queries, and stores the components of an SNL sentence in a database.
(Supplementary note 21) The SNL-SQL translation program of Supplementary note 20, causing the computer to execute:
after translating an SNL descriptive sentence to SQL, storing the elements of the SNL descriptive sentence to a database, translating an SNL question sentence to SQL queries for inquiring of the database.
(Supplementary note 22) The SNL-SQL translation program of Supplementary note 20 or 21, further causing the computer to execute:
creating SQL queries using data in a database, and retrieves elements of a sentence from the database by the SQL queries for creating the SNL question sentence.
(Supplementary note 23) The SNL-SQL translation program of Supplementary note 22, further causing the computer to execute:
inputting the elements, and outputting an SNL sentence including the elements to a user.
(Supplementary note 24) A structured natural language knowledge system, the system comprised of:
a memory storing a software component, and
at least one processor configured to execute the software component to perform:
composing an SNL (Structured Natural Language) sentence, and
translating an SNL descriptive sentence or an SNL question sentence to SQL (Structured Query Language) queries so that the components of a descriptive or question sentence are stored in a database.
(Supplementary note 25) The structured natural language knowledge system of Supplementary note 24, wherein the processor further performs:
displaying the different components of a sentence and prompts a user to enter the values of some or all of the different components in a sentence, wherein a component of a sentence may be at least one of a subject, an object, a verb, a compliment, an adverb and an adjective.
(Supplementary note 26) A computer-implemented method, the method comprised of:
composing an SNL (Structured Natural Language) sentence, and
translating an SNL descriptive sentence or an SNL question sentence to SQL (Structured Query Language) queries so that the components of a descriptive or question sentence are stored in a database.
(Supplementary note 27) A non-transitory computer readable information recording medium storing an SNL-SQL translation program, when executed by a processor, performs:
composing an SNL (Structured Natural Language) sentence, and
translating an SNL descriptive sentence or an SNL question sentence to SQL (Structured Query Language) queries, and stores the components of an SNL sentence in a database.
This application claims priority based on U.S. Provisional Application No. 62/535,965 filed on Jul. 24, 2017, the disclosures of which are incorporated herein in their entirety.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/US2018/043214 | 7/23/2018 | WO | 00 |
Number | Date | Country | |
---|---|---|---|
62535965 | Jul 2017 | US |