Automatic creation of a schema annotation file for converting natural language queries into a structured query language
An automated method for creating a semantic model of a relational database addresses the manual-intensive process of generating ontologies by extracting metadata and generating schema annotation files, enabling efficient natural language query processing without requiring database expertise.
Patent Information
- Application Number
- JP2022534804
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-12-20
- Filing Date
- 2020-12-18
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2040-12-18
AI Technical Summary
Generating a database ontology is a time-consuming and manual-intensive process that requires in-depth knowledge of the database structure and schema, making it impractical for large and complex systems.
An automated method for creating a semantic model of a relational database that extracts metadata, prompts users for text labels, and generates a schema annotation file to process natural language queries, without requiring expertise in the underlying database or ontology.
Enables the automatic generation of a schema annotation file based on annotated metadata, allowing users to ask questions about the database content without needing to generate structured queries, thus simplifying access and improving efficiency.
Smart Images

Figure 0007710807000001 
Figure 0007710807000002 
Figure 0007710807000003
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to a rule-based system for converting natural language queries into structured query language. Specifically, the present invention relates to a system that automatically generates a schema annotation file based on user annotations of metadata that describes relationships in a database in order to process natural language queries.
Background Art
[0002] Relational database management systems can be used to store and manage structured data. Access to data in a database may be based on technical knowledge and specialized knowledge of structured query language, and is generally a complex and time-consuming process. To improve access to the stored data, a natural language interface to the database system can be used, which allows a user to access the data by asking natural language questions and receiving answers from the database. A natural language interface to a database system converts natural language expressions into structured queries and provides easy and quick access to information in the database.
[0003] A rule-based natural language interface to a database system operates using a semantic model of database elements that defines relationships between entities. A rule-based natural language interface to a database system depends on an ontological representation of the database, including the classification of entities and the modeling of relationships between those entities.
[0004] However, generating a database ontology is typically a time-consuming and manual-intensive process. A database ontology uses a schema to specify the types of relationships entities have with each other. Usually, the explicit nature of the relationships between entities is provided by an expert with in-depth knowledge of the underlying database structure and ontology. For example, in a conventional approach, creating a schema annotation file is done by a user with knowledge of the database structure and ontology, as well as the schema annotation file structure, the phrases and flag statements used to create the schema annotation file, and the support format.
[0005] Creating such a semantic model or ontology is a time-consuming manual process that requires in-depth knowledge of the database structure and schema because each relationship is defined manually. In large and complex systems, this approach is not applicable.
[0006] Therefore, there is a need in the art to address the above problems. SUMMARY OF THE INVENTION
[0007] Viewed from a first aspect, the present invention is an automated method for creating a semantic model of a relational database for processing natural language queries using a computing device, the method comprising: automatically extracting relational database metadata by the computing device; prompting the user for text labels for columns of the extracted metadata by the computing device; automatically generating a schema annotation file by the computing device based on the relational database metadata and the text labels given to the columns; and processing natural language queries for the relational database using the schema annotation file.
[0008] Viewed from yet another aspect, the present invention provides a system for processing software services in a computing area, the system comprising one or more processors, one or more computer-readable storage media, and program instructions for execution by at least one of the one or more computer processors stored on the one or more computer-readable storage media, the program instructions causing a computing device to automatically extract relational database metadata, prompting a user for text labels for columns of the extracted metadata by the computing device, automatically generating a schema annotation file by the computing device based on the relational database metadata and the text labels given in the columns, and including instructions for processing natural language queries for the relational database using the schema annotation file.
[0009] Viewed from yet another aspect, the present invention provides a computer program product for processing software services in a computing area, the computer program product comprising one or more computer-readable storage media collectively having program instructions collectively stored thereon, the program instructions being executable by a computer and causing a computing device to automatically extract relational database metadata, prompting a user for text labels for columns of the extracted metadata by the computing device, automatically generating a schema annotation file by the computing device based on the relational database metadata and the text labels given in the columns, and causing the computer to process natural language queries for the relational database using the schema annotation file.
[0010] Viewed from yet another aspect, the present invention provides a computer program product for creating a semantic model of a relational database for processing natural language queries, the computer program product comprising a computer-readable storage medium readable by a processing circuit and storing execution instructions for a processing circuit to perform a method of performing the steps of the present invention.
[0011] Viewed from yet another aspect, the present invention provides a computer program stored on a computer-readable medium and loadable into the internal memory of a digital computer, the computer program including software code portions for performing the steps of the present invention when executed on a computer.
[0012] Embodiments of the present invention provide a method, a system, and a computer-readable medium for automatically creating a semantic model of a relational database for processing natural language queries. A computing device automatically extracts metadata of a relational database. The computing device prompts a user to input text labels for columns of the extracted metadata and automatically generates a schema annotation file based on the relational database metadata and the text labels for each column. Natural language queries for the relational database are processed using the schema annotation file. The system can generate vocabulary rules based on the automated schema annotation file. This approach provides an automated approach for generating a schema annotation file based on annotated metadata, as opposed to conventional approaches where the schema annotation file is generated manually.
[0013] In another aspect, the user annotates the extracted metadata without knowledge of the structure of the relational database or the ontology of the relational database. This approach offers the advantage that a schema can be generated based on the annotated metadata without the need for expertise in the underlying database or ontology.
[0014] In another aspect, semantic annotations for the relational database are used to process the schema annotation file into vocabulary rules. In yet another aspect, a natural language question is received from the user. The received natural language question is transformed into a structured query using the vocabulary rules generated based on the semantic annotations. The answer to the received natural language question is generated based on the result of the structured query. These approaches have the advantage of enabling the user to ask questions about the content of the database and enabling the system to search for relevant content of the database based on the vocabulary rules generated based on the schema annotation file. This approach does not require the user to generate a structured query to access the content within the database.
[0015] In other aspects, the annotation of the extracted metadata includes text labels, and the text labels include at least semantic types and element labels. Here, a minimum amount of annotation (e.g., in the examples provided herein, only two columns are annotated) is required to generate the schema.
[0016] In other aspects, the schema annotation file is created by extracting semantics using natural language processing of user input, and the extracted semantics are used to create relationships between entities of the relational database. Creating the schema annotation file using natural language processing makes it possible to automatically establish relationships.
[0017] In yet another aspect, a machine learning system can be used to create schema-specific vocabulary rules using semantic annotations, where the machine learning system creates schema-specific vocabulary rules using a schema annotation file and template rules based on fixed syntactic rules of English. This approach has the advantage of further automating the NLIDB system for interaction with users.
[0018] It should be understood that the summary of the invention is not intended to identify key or essential features of the embodiments of the present disclosure, nor is it intended to be used to limit the scope of the present disclosure. Other features of the present disclosure will become readily apparent through the following description.
Brief Description of the Drawings
[0019] Next, the present invention will be described with reference to the preferred embodiments shown in the following drawings by way of example only.
[0020]
Figure 1
Figure 2
Figure 3A
Figure 3B
Figure 3C
Figure 4
Figure 5
Figure 6
DETAILED DESCRIPTION OF THE INVENTION
[0021] Automation techniques are provided for creating an ontological representation or semantic model of a relational database in the form of a schema annotation file (SAF). The SAF can be used to adapt a natural language interface to a database system (NLIDB) to a specific schema and is a text file that does not depend on knowledge of the underlying database structure and ontology.
[0022] In an embodiment, relational database metadata that describes the structure of the database is automatically extracted. The user annotates (e.g., gives a text-based label) the columns of the extracted metadata. Based on the techniques provided herein, the semantic relationships between the labeled and extracted database entities are automatically annotated to form a semantic model. In an embodiment, the semantic model is generated as natural language text that can be processed by any natural language processing (NLP) system to generate vocabulary rules applicable to the relational database. The generated SAF can be used to automatically adapt the NLIDB system to a specific database schema.
[0023] Techniques are provided herein for creating an ontology model in the form of an SAF, which is a type of text file representing the semantic model of a database. Based on minimal input from the user, the SAF can be automatically generated without prior knowledge of the database.
[0024] An exemplary environment for use according to an embodiment of the present invention is shown in FIG. 1. Specifically, this environment includes one or more server systems 10, one or more client or end-user systems 20, a database 30, and a network 45. The server system 10 and the client system 20 can be remote from each other and can communicate over the network 45. The network can be implemented by any number of any suitable communication media, such as a wide area network (WAN), a local area network (LAN), the Internet, an intranet, etc. Alternatively, the server system 10 and the client system 20 can be local to each other and can communicate via any suitable local communication media, such as a local area network (LAN), a wired connection, a wireless link, an intranet, etc.
[0025] The client system 20 enables a user to annotate the extracted metadata generated by the server system 10 based on a structured database for automatic SAF creation. The server system 10 includes an automatic schema annotation file generation system 15 having a metadata extraction engine 105, a user interface engine 110, a SAF generation engine 115, a rule generation engine 120, and an NLIDB module, as described herein.
[0026] The database 30 can store various information for analysis, such as the extracted data 32, the extracted annotated data 34, the created schema 36, and the vocabulary rules 38, etc. The extracted data 32 can include information extracted from the database 50 (such as in table format, tab-delimited format, or any other suitable format, etc.). The extracted data 32 is provided to the user for annotation via the user interface engine 110. Once annotated, the data can be stored as the extracted annotated data 34. The automatic schema annotation file generation system 15 creates a schema 36 based on the extracted annotated data 34. The system 15 can further generate vocabulary rules 38 based on the generated schema.
[0027] The database system 30 and the structured database 50 can be implemented by any ordinary or other database or storage unit, and can exist locally to or remotely from the server system 10 and the client system 20, and can communicate via any suitable communication medium, such as a local area network (LAN), wide area network (WAN), the Internet, wired connection, wireless link, intranet, etc. The client system can present a graphical user interface, such as a GUI, etc., or other interfaces, such as a command line prompt, menu screen, etc., for requesting information regarding metadata annotation from the user, and an NLIDB module 125 for asking questions related to the content of the structured database 50 and receiving answers.
[0028] The server system 10 and the client system 20 can be implemented by any ordinary or other computer system preferably equipped with a display or monitor, a base including at least one hardware processor (e.g., microprocessor, controller, central processing unit (CPU), etc.), one or more memories, and / or an internal or external network interface or communication device (e.g., modem, network card, etc.), an optional input device (e.g., keyboard, mouse or other input device), and any commercially available and custom software (e.g., server / communication software, automatic schema annotation file generation system software, browser / interface software, etc.). By way of example, the server / client includes at least one processor 16, 22, one or more memories 17, 24, and / or an internal or external network interface, or a communication device 18, 26 such as a modem or network card, and a user interface 19, 28, etc. The optional input device can include a keyboard, mouse, or other input device.
[0029] Alternatively, one or more client systems 20 can perform automatic software service analysis as a stand-alone unit. In stand-alone mode operation, the client system stores or has access rights to data such as the extracted data 32, the extracted annotated data 34, the schema 34 and the vocabulary rules 38, etc. The stand-alone unit includes an automatic schema annotation file generation system 15. The graphical user or other interface 19, 28 such as a GUI, command-line prompt, menu screen, etc. also requires an NLIDB module 125 that asks questions about the content of the structured database 50 and receives answers along with corresponding user information regarding metadata annotation.
[0030] The automatic schema annotation file generation system 15 can include one or more modules or units for performing various functions of the embodiments of the present invention described herein. Various modules, such as the metadata extraction engine 105, the user interface engine 110, the SAF generation engine 115, the rule generation engine 120, and the NLIDB module 125, can be implemented by any combination of any amount of software and / or hardware modules or units and can reside in the memory 17 of the server for execution by the processor 16. These modules are described in more detail below.
[0031] The metadata extraction engine 105 extracts metadata from a relational database such as the structured database 50. The metadata can include one or more tables in any suitable format.
[0032] The techniques provided herein provide for connecting to a database and extracting metadata that characterizes the database. The metadata includes entity / concept information such as table names, column names, the types of data present in the database, or information regarding primary and foreign keys used to create relationships between tables, or both. The user can connect to the database using user credentials and can retrieve various metadata information associated with the database using an application programming interface (API) such as the JDBC API.
[0033] The user interface engine 110 can prompt the user to annotate one or more columns from the extracted metadata. The user interface engine receives input from the user for generating annotated metadata.
[0034] The user interface engine 110 can create a view of the extracted metadata that shows the structure and relationships of the data stored in the relational database. In some aspects, the view can be an abstraction layer in which a set of entities / concepts within the view are connected by links. The view enables the renaming of data entries within tables and columns in order to provide a meaningful description of the extracted metadata.
[0035] In other aspects, the view also enables adding calculated columns to a table. For example, if the value of a column is frequently added for reporting purposes, a column can be added and an aggregated value can be assigned to that column. In particular, this technique can hide complexity when the value is calculated using values from multiple tables. In other cases, the data acquisition can be slower or more complex because the query requires a complex process to obtain different pieces of data from a single table or because the query needs to handle many different tables. The examples given herein relate to a single table, but the technology can be extended to multiple tables.
[0036] The SAF generation engine 115 automatically generates the SAF based on the annotated metadata and the SAF-related files 117. The SAF generation is described in more detail throughout this application and the drawings (see also FIGS. 3A - 3C). For SAF creation, various SAF-related files 117 are required, including a template rules (TR) file, a parser 116, a word semantic (WS) file, an irregular verb (IV) file, and a verb paraphrase (VP) file. Each file type is described in more detail as follows.
[0037] The template rules (TR) file is an existing file that contains template rules that conform to general sentence structures and syntax and can be used in SAF generation. The sentence structure can be in English or another natural language.
[0038] The parser 116 is a tool for parsing words or phrases that describe database concepts. The parser can determine the grammatical properties of words and phrases (e.g., part of speech such as whether a word is a verb or a noun form) from the extracted annotated data.
[0039] The word semantic (WS) file is a file that contains a list of common words with related semantic types indicating specific properties. For example, the WS file can include identifying words (e.g., name, type, style, etc.), date types (e.g., date, year, day, time, duration, etc.), location types (e.g., city, country, address, street, etc.), and so on.
[0040] The irregular verb (IV) file contains a list of irregular verbs and their past forms.
[0041] The verb paraphrase (VP) file is an automatically created file of nouns and their paraphrase verbs within the SAF entry. For example, in the case of an entry corresponding to "employee has salary", the word "salary" can be associated with verbs such as "earn", "make", "receive", etc.
[0042] Using the parser, WS file, and IV file, the SAF generation engine processes the information for each column and creates one or more SAF entries. The SAF generation engine can further create entries for the VP file that can be used during the question - answering process associated with the NLIDB module 125.
[0043] SAF is a text file having one entry per line. Each entry is composed of a fixed - format word or phrase that describes the relationship between an entry / concept in a database and a set of flags that explain the entry / concept. SAF can contain at least three types of entries: "property / identity", "association", and "action" entries. Property / identity entries contain information (e.g., name, ID, type, etc.) that identifies a concept / entity. Association entries contain information that is associated with a concept / entity (e.g., date of hire, manager, etc.) but does not directly identify the concept / entity. Action entries define the semantic relationship between concepts / entities (e.g., typically between two entities). Often, there is more than one relationship between entities / concepts, and thus multiple entries may be required to describe each relationship.
[0044] Exemplary SAF entries for a human resources (HR) schema having a single "EMPLOYEE" table are shown below. The first entry is a property entry for the concept / entity of an employee. Specifically, the word / phrase "employee" is accompanied by two flag statements. The first set of flags indicates that "employee" is identified by the table EMPLOYEE and column EMPNO and has an integer data type. The second set of flags indicates that the "name" concept / entity is identified by the table EMPLOYEE, column EMPNAME, and a string data type. The second and third entries indicate that the "salary" and "hiring date" concepts are associated with the employee, and flags identify each concept as in the first entry. The fourth, fifth, and sixth entries are "action" entries. These entries describe the semantic relationship between concepts / entities. An example is shown as follows. An employee has a name; the table name is EMPLOYEE; the column name is EMPNO; the data type is integer; the table name 1 is EMPLOYEE; the column name 1 is EMPNAME; the data type 1 is string; An employee has a salary; the table name is EMPLOYEE; the column name is EMPNO; the data type is integer; the table name 1 is EMPLOYEE; the column name 1 is SALARY; the data type 1 is string; An employee has a hire-date; the table name is EMPLOYEE; the column name is EMPNO; the data type is integer; the table name 1 is EMPLOYEE; the column name 1 is HIREDATE; the data type 1 is date; A manager manages an employee; the table name is EMPLOYEE; the column name is MGRNAME; the data type is string; the table name 1 is EMPLOYEE; the column name 1 is EMPNO; the data type 1 is integer; An employee is hired on a date; the table name is EMPLOYEE; the column name is EMPNO; the data type is integer; the table name 1 is EMPLOYEE; the column name 1 is HIREDATE; the data type 1 is date; A department hires an employee; the table name is EMPLOYEE; the column name is DPTNAME; the data type is string; the table name 1 is EMPLOYEE; the column name 1 is EMPNO; the data type 1 is integer.
[0045] The rule generation engine 120 generates vocabulary rules based on the created SAF. The NLIDB module 125 enables a user to interact with the server system and receive responses related to questions about the content of the structured database 50. These features and other features are described throughout this specification and the drawings.
[0046] The client system 20 and the server system 10 can be implemented by any suitable computing device, such as the computing device 212 shown in FIG. 2 with respect to the computing environment 100. This example is not intended to suggest any limitation to the scope of use or functionality of the invention described herein. Anyway, the computing device 212 can implement or execute or both any of the functionality described herein.
[0047] Within a computing device, there exists a computer system that can operate with a number of other general-purpose or special-purpose computing system environments or configurations. Well-known computing systems, environments or configurations or both that may be suitable for use with this computer system include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments including any of the above systems or devices, etc.
[0048] Computer system 212 can be described in the general context of computer system executable instructions, such as program modules (e.g., automatic schema annotation file generation system 15 and its corresponding modules) executed by a computer system. Generally, program modules can include routines, programs, objects, components, logic, data structures, etc., that perform specific tasks or implement specific abstract data types.
[0049] Computer system 212 is shown in the form of a general-purpose computing device. The components of computer system 212 can include, but are not limited to, one or more processors or processing units 155, a system memory 136, and a bus 218 that couples various system components including system memory 136 to processor 155.
[0050] Bus 218 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a high-speed graphics port, and a processor or local bus using any of various bus architectures. By way of example, and not limitation, such architectures can include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced (ISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0051] Computer system 212 typically includes various computer system readable media. The media can be any available media accessible by computer system 212 and includes both volatile and nonvolatile media, removable and non-removable media.
[0052] System memory 136 can include a computer system readable medium in the form of volatile memory such as, but not limited to, random access memory (RAM) 230, cache memory 232, or both. Computer system 212 can further include other removable / fixed, volatile / non-volatile computer system storage media. By way of example only, storage system 234 can be provided for reading from and writing to a fixed non-volatile magnetic media (not shown and typically called a "hard drive"). Although not shown, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk, such as a "floppy disk", and an optical disk drive for reading from and writing to a removable non-volatile optical disk such as a CD-ROM, DVD-ROM or other optical media can also be provided. In such instances, each can be connected to bus 218 by one or more data media interfaces. As will be further illustrated and described below, memory 136 can include at least one program product having a set of (at least one) program modules configured to carry out the functions of embodiments of the present invention.
[0053] A program / utility 240 having a set of (at least one) program modules 242, such as, by way of example and not limitation, an auto schema annotation file generation system 15 and corresponding modules, etc., and an operating system, one or more application programs, other program modules, and program data can, by way of example and not limitation, be stored in memory 136. Each of the operating system, one or more application programs, other program modules, and program data, or combinations thereof, can include an implementation of a networking environment. Program modules 242 generally carry out the functions or methods of embodiments of the present invention as described herein, or both.
[0054] The computer system 212 can also communicate with one or more external devices 214 such as a keyboard, a pointing device, a display 224, one or more devices that enable a user to interact with the computer system 212, and / or any device that enables the computer system 212 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication can be carried out via an input / output (I / O) interface 222. Further, the computer system 212 can communicate with one or more networks such as a local area network (LAN), a general wide area network (WAN), and / or a public network (e.g., the Internet) via a network adapter 225. As shown, the network adapter 225 communicates with other components of the computer system 212 via a bus 218. Although not shown, it should be understood that other hardware or software or both components can be used with the computer system 212. Examples include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data storage systems.
[0055] FIG. 3A shows an example of metadata extraction from a single-table HR database. This table is generated by extracting data from a database containing employee characteristics. In this example, the metadata is automatically extracted from the relational database 50 (e.g., table name, column name, and data type) using, for example, the metadata extraction engine 105.
[0056] The extracted data is presented to the user, for example, using the user interface engine 110, in browser format or any other suitable interactive equivalent, enabling the user to annotate the extracted data. In this example, the annotator provides a description for the column "elementLabel" by entering a description for each row in this column (e.g., employee ID, employee name, etc.). The annotator can also select a semantic type from a list of valid types (e.g., person, date, money, none, etc.) for each corresponding entry in the column "elementLabel".
[0057] In some embodiments, the user is presented with guidelines for annotating the columns, and a list of supported semantic types may be provided as an example along with the guidelines. Using the guidelines and the supported semantic types, the user annotates the metadata to include an element label and a semantic type for each entry. In yet another aspect, the user can also give an English word as the table name if the table name is not a standard English word (e.g., if the table name is a variable name like EMP_TABLE, the user can change the table name to refer to "employees").
[0058] In this example, the user annotates the first and last columns based on the information provided in the middle extracted columns (e.g., table name, column name, and data type) as shown in FIG. 3B. The user can annotate the columns shown, for example, in text format or in a voice format that can be converted to text to generate an annotated table.
[0059] This information (e.g., user annotations, extracted data, etc.) is processed using the techniques described herein so that the automatic schema annotation file generation system 15 generates a SAF file. Each entry in the SAF file contains a fixed-format phrase that describes the relationship between an entity / concept in the database and a set of flags that describe each entity / concept. To generate the SAF file, the column descriptions and semantic types are parsed, and the semantics of the columns and their interrelationships are determined. The SAF file can be stored as schema 36. This process is described in more detail; see, for example, FIG. 3C.
[0060] FIG. 3C shows an exemplary workflow for the automatic generation of SAF in a system comprising an NLIDB module 125. In operation 410, metadata is extracted from a database (e.g., a relational database). In operation 415, the user is prompted to annotate the metadata. In operation 420, the annotated metadata is received.
[0061] In operation 425, the annotated metadata is processed by the automatic schema annotation file generation system 15, typically generating a SAF that includes multiple entries. Words or phrases or both (column entries) given by the user to label the entries can be classified into a set of categories. For example, words can be classified based on their type (e.g., identification, date, etc.). Words can be further classified based on their part of speech (e.g., noun, verb, etc.). In some aspects, the verb form of a noun can be classified as a verb.
[0062] Each set of classification results corresponds to a specific pattern of semantic relationships. For example, if the label is "employee name", the SAF entry could be "employee has name". As another example, if the label is "hire date", multiple entries such as "employee has hire date" and "employee is hired on a date" can be created. Additional examples of entries in the SAF generated by the automatic schema annotation file generation system 15 are shown in FIG. 4. The indented entries are created by the paraphrase engine 118 that identifies the verb connecting two nouns.
[0063] The main concepts / entities of the table (e.g., the table name "employee") can be paired with other columns by noun classification and sent to the paraphrase engine 118 that generates verbs that semantically connect the concepts / entities (e.g., two or more words). For example, in the case of the entities "employee" and "manager", the paraphrase engine can generate verbs such as "work for", "report to", "hired by", etc. The verbs can be ranked based on their frequency of use. These verbs can be used to create entries that describe the relationships between entries within the same table or in different columns or tables or both.
[0064] If the annotation of a column (element label) contains two or more words, the system uses the supported syntax and does not allow the unsupported syntax. For example, "employee hire / hiring date" or "hire / hiring date of employee" is supported, but "date of hire / hiring of employee" is not supported.
[0065] Additional details regarding SAF creation are provided as follows. Using the parser 116 together with the SAF-related files 117 (e.g., WS files and IV files), the SAF generation engine 115 analyzes the entries as follows. a. Is there a "identification" concept / entity (e.g., employee name) for the main table concept? Does the phrase include the table name as one of the concepts / entities? If yes, the entry describes the concept / entity directly related to the table name, and the semantic types of other words are compared with the WS file. If the entry matches one of the "identification" words, the system determines that this is an identification entry. b. Is this an "identification" entity / concept other than the main table name (e.g., "administrator name" or "department name")? The system evaluates this concept / entity using the same process as (a), where the entry is not the main table name. c. Is this a "non-identification" entity / concept (e.g., "employee salary", "employee manager", or "employee hire date")? The system uses this analysis to evaluate whether the second concept / entity does not match the "identification" semantics given in the WS file. If the entity / concept contains multiple words (e.g., hire date), a list of single words is created to represent the multi-word entity (e.g., hire date, hire, etc.).
[0066] Using these classifications, it is possible to determine which descriptive words / phrases are unique (e.g., there is a single reference such as "administrator" or "department" within a table column), and which words / phrases are not unique (e.g., "name"). Some concepts such as the semantic type "date" receive special classification. If there are multiple dates within a table (e.g., "hire date" and "leaving - date"), although the individual words are unique, these words refer to the same concept type "date" and are thus not considered unique.
[0067] Based on these classifications, SAF entries are created and flag statements are constructed based on the information extracted from the table. In the first classification, a single "characteristic" entry is created for the main element (e.g., "employee has name").
[0068] In the second classification, multiple entries are created as follows. a) A "characteristic" entry is created for the concept (e.g., "manager has name"). b) A second "characteristic" entry is created for the main element (e.g., "employee has manager"). c) The parser 116 extracts the characteristics of the concept / entity. In this case, "manager" is shown as a noun, but it may also have a verb form "manage". Since there is a verb form for the main element, a third entry "manager manages employee" is created. If the main element does not have a verb form, the entry can be created using a non - specific default keyword verb (e.g., for the "department name" column, the entry would be "department name - verb - employee", where the verb is set as a default verb (e.g., includes, hires, etc.)). d) A fourth entry is created using the syntax "main element - verb - preposition - noun". The verb and preposition are the default keywords. The entry will have the format "employee - verb - preposition - manager", which is equivalent to "employee reports to manager" without specifying the particular semantics for the verb and preposition. Similarly, "employee - verb - preposition - department" can be another entry created. e) In addition to the SAF entries, two named concepts (e.g., employee and manager) are processed by the paraphrase engine 118, and a list of related verbs connecting these concepts is extracted (e.g., for "employee and department" the verb "work", for "employee" and "salary" the verb "earn", etc.). The nouns of the concepts and the verbs related to them are added to the VP file and used during the question - answering phase.
[0069] The third classification is similar to the second classification, except when a concept, or a specific semantic type such as a date, or both, and multiple words describing them characterize the concept. a) A characteristic entry is created for an emphasized single word created from multiple words (e.g., employee has hire date). b) A characteristic entry is created from the multiple words themselves (e.g., hire has date). c) Multiple words are compared with the WS file. If one of the words has a "date" or "location" type and the parser 116 detects the verb form of the other words, the past tense of the verb is created or extracted from the IV file, and an entry is created using the verb form of the words. For example, "employee hiring date" will generate "employee is hired on a date". If there is a column with the description "employee’s residence country", an entry can be created like "employee resides in a country". The prepositions used are "on" for date, "in" for location, and "for" for other types. However, the entry is created regardless of the specific preposition used as long as the syntax is correct.
[0070] This automated process may generate a few entries with incorrect syntax or semantics that may be rejected by the vocabulary rule creation process. Nevertheless, the collection of entries provides a sufficient ontology representation to enable answering most questions.
[0071] In operation 425, as described herein, a SAF file is generated based on the annotations and the extracted metadata (see also Figure 4). The parser, WS file, and IV file are the existing resources used in the creation of the SAF. The TR file is used during the training phase where the SAF is processed to create semantic rules for the schema. The VP file is generated during the creation of the SAF and used in the operation phase to answer the user's questions.
[0072] In operation 435, vocabulary rules are created to automate SAF entries. When an SAF is generated, an existing file containing the vocabulary rules can be used to process the SAF in response to a user query. The vocabulary rules can be used to conform to the language syntax and structure.
[0073] Regarding automatically performed SAF generation, the generated vocabulary rules include (1) rules that conform to phrases with accurate vocabulary information and (2) rules that conform to phrases more broadly without imposing accurate vocabulary information. Automatically generating SAF enables entries that do not contain more abstract and accurate vocabulary information.
[0074] An example of a template rule used to conform to a phrase with accurate vocabulary information (the first line is the name of the rule, specifying that there are two noun inflections and one verb) is as follows. root=prop_owner_VAR1_VAR2_VAR3_ -> VAR2 [ hasPartOfSpeech("verb"), hasLemmaForm(“VAR2”) ] { subj -> VAR1[hasPartOfSpeech(“noun”), hasLemmaForm("VAR1")]} { obj -> VAR3 [hasPartOfSpeech(“noun”), hasLemmaForm("VAR3")]}
[0075] The above rules conform to any sentence with the pattern of "Subject Verb Object". The first line is the title or name of the rule. VAR1 and VAR2 are general expressions of the subject and object, and the verb is an expression of any verb. The vocabulary rules created by this template rule will conform to the exact words for the subject, verb, and object (because the rule imposes the lemma form of the word).
[0076] An example of a template rule used for automatic SAF processing (matching phrases without imposing exact vocabulary information) is as follows. root=prop_owner_VAR1_VAR2_VAR3_ -> VAR2 [ hasPartOfSpeech("verb") ] { subj -> VAR1[hasPartOfSpeech(“noun”), hasLemmaForm("VAR1") ]} { obj -> VAR3 [hasPartOfSpeech(“noun”), hasLemmaForm("VAR3")]}
[0077] The above rule is syntactically similar to the first rule, but does not specify the lemma form for the verb. As a result, the resulting vocabulary rule has no explicit semantic information, has no specific words for the verb (in some cases, it is created with default keyword verbs), and any sentence with a matching syntax, regardless of what the word for the verb is, will match the words for the subject and object. These types of rules can be identified as described herein.
[0078] As another example, in the case of the column "department name" (generating multiple SAF entries), the entries "department has name" and "manager manages employee" generate exact vocabulary rules. However, "department - verb - employee" will conform to the rule as follows: root=prop_owner_department_verb_employee_ -> _verb_ [ hasPartOfSpeech("verb") ] { subj -> department[hasLemmaForm("department") ]} { obj -> employee [ hasLemmaForm("employee")]}
[0079] The above rule will be applicable to any sentence having a subject - verb - object syntax, where the subject is a department and the object is an employee. A question such as "how many employees did the sales department hire" will conform to one of the derivatives of the above rule and will be correctly answered. However, in the case of a question such as "how many employees in the sales department retired", since the verb in the rule is non - specific, this question will be answered accurately in the same way as the previous question. To avoid mismatches, during question processing, rules with non - specific verbs are checked against the VP file created during the SAF creation process. This file is created using the paraphrase engine 118 and contains a list of reasonable verbs that associate employees with departments. If the verb in the sentence does not match any of the verbs listed for these two nouns, this rule becomes invalid.
[0080] To find a matching syntax, lexical rules are applied to the SAF entry. When the SAF entry conforms to the rule, a new rule is automatically created according to the syntax of the template rule, but general variables are replaced with words from the SAF entry. For example, applying the "subject verb object" rule of the template file to the fourth entry in the above example will result in the creation of the following lexical rule. root=prop_owner_manager_manage_employee_ -> manage [ hasPartOfSpeech("verb"), hasLemmaForm(“manage”) ] { subj -> manager hasLemmaForm("manage") ]} {obj -> employee [hasLemmaForm("employee")]}
[0081] The above rule exactly conforms to the syntax and semantics of "manager manages employee". For each entry conforming to one of the template rules, a range of derived rules with different syntax and the same semantic information is automatically created to enable answering different types of questions. For example, the derived rule for entry 4 can conform to questions such as "how many employees does John manage", or "which manager manages Jack", or "who manages more employees than Joe". The derived rule for entry 5 will support questions such as "who was hired after 2013", or "how many employees were hired after Jim".
[0082] The template rules can be applied to SAF entries during the training process, and schema-dependent vocabulary rules that conform to the syntax of the template rules but contain the semantic information of SAF can be automatically created.
[0083] The vocabulary rule file can be used to process user input questions into SQL as shown in operations 440, 445, and 450 during the operation phase. The vocabulary rules of the automatic SAF are broader and can match input sentences with semantics that do not exist in the database. Therefore, the automatically created SAF rules will require more resources and algorithm analysis to identify inaccurate rule matches. These techniques can be used together with manually created vocabulary rules to match any input sentence with the correct syntax and semantics of the SAF entry.
[0084] Therefore, the automatic schema and vocabulary rules for the database can be used to answer user questions. The questions can be sent to the system by the user in operation 445. The system can process the questions using the vocabulary rules and the automatic schema to obtain answers in the database 50. The answers to the user questions can be provided by the system in operation 450.
[0085] Figure 4 shows an example of an entry in the SAF generated by the automatic schema annotation file generation system 15. The indented entry is created by the paraphrase engine 118 that identifies the verb connecting two nouns.
[0086] Figure 5 shows another embodiment in which corpus analysis and additional resources (e.g., online resources) can be used to connect concepts / entities in an ontological relationship, i.e., using verbs with their respective nouns as arguments. This type of analysis can be used to process annotations that are single words.
[0087] According to this embodiment, in operation 505, metadata extraction from a relational database can be performed. In operation 510, entries can be annotated, some with single words. In operation 515, single-word annotations can be identified and selected for further analysis. In operation 518, additional ontology rules are provided. The system can use various syntactic rules, ontology rules, and semantic rules.
[0088] In operation 530, the system analyzes a corpus of data to learn the relationships between words. In some aspects, the system calculates the probability of a verb appearing in a particular syntactic position for each verb, and then uses a chain of probabilities to rank candidates to enable the determination of accurate and appropriate relationships.
[0089] For any noun (n) and any syntactic position ((s), e.g., subject, object, or object governed by a preposition (e.g., to, at, from) of a preposition) and any verb (v), as an example of probability calculation, the probability of v and s for n can be determined. p(v,s|n) = p(v,s,n) / p(n) ~ p(v|n)*p(v|s)*p(n|v,s)
[0090] The probabilities p(v|n), p(v|s), p(n|s) from the corpus can be determined, which may be domain-specific or general. For any two nouns (n1 and n2) and any combination of syntactic positions (s1, s2), probabilities can be calculated, p(v,n1,n2) ~ p(v,s1|n1)*p(v,s2|n2) Based on this probability, verbs can be ranked. It is usually not considered that a verb is ranked too high, too low, or too frequently. Ontology constraints can be automatically collected from information sources such as any online or digital source and used to identify relationships.
[0091] In operation 520, the relationships identified from the corpus can be filtered based on ontology rules, for example, by applying syntactic constraints, ontology similarity, or semantic similarity, or all of them. For example, ontology rules include nouns that coexist, verbs that coexist with nouns, etc. As another example, restrictions can also be imposed on possible combinations of syntactic combinations, such as not considering the position of complements such as "subject subject". The relationships that have been filtered are provided in operation 540.
[0092] In other aspects, a machine learning system can be trained to create schema-specific vocabulary rules using semantic annotations. The machine learning system can use template rules based on the fixed syntactic rules of SAF and English to create schema-specific vocabulary rules. For example, additional vocabulary rules can be created through supervised machine learning training using natural language phrases that paraphrase SAF entries. These additional rules expand the initial set of fixed rules and create a richer set of vocabulary rules that enable the processing of a wider range of natural language phrases.
[0093] FIG. 6 is a flowchart of operations showing the high-level operations of the automatic schema annotation file generation system 15 provided herein. In operation 610, relational database metadata is automatically extracted by a computing device. In operation 620, the computing device prompts for text labels (e.g., provided by a user) for the columns of the metadata. In operation 630, the computing device automatically generates a schema annotation file based on the relational database metadata and the text labels of the columns. In operation 640, a natural language query for the relational database is processed using the schema annotation file.
[0094] Features of embodiments of the present invention include the automatic generation of SAFs. The generation of SAF files is performed based on minimal annotation from the user, and the user does not need knowledge of the structure of the database or ontology from which the metadata was obtained. Further, SAF entries are generated more broadly than entries generated manually. Thus, SAFs are more robust than methods of creating SAF files manually. Still further, schema-specific vocabulary rules can be created from the automatically generated SAF. The SAF generated here can be used, for example, in a system that interacts with the user in a question-and-answer format. For example, vocabulary rules generated from the automated SAF are applied to the user input question to detect and process the content of the user question. Using the created SAF and fixed template rules, a set of vocabulary rules related to a particular database schema is automatically created. The NLP engine applies these rules to natural language user questions to detect the elements and semantic relationships between words and create a set of intermediate structured phrases that will then be converted into SQL clauses.
[0095] Vocabulary rules by an automatically created SAF can include a wide range of unspecified vocabulary information. The vocabulary rules can be improved by additional information (e.g., online or other text resources for extracting the correct meaning from elements of an input question) to construct an appropriate SQL query.
[0096] Therefore, these techniques can improve computer operations, particularly operations on an NLIDB that interacts with a user, since they can automatically generate a SAF with minimal annotation. The SAF provides a framework for generating vocabulary rules for accessing the contents of a database.
[0097] It should be recognized that the embodiments described above and shown in the drawings represent only a small part of many ways of implementing embodiments for automatically generating a SAF based on received annotations.
[0098] The environment of the embodiments of the present invention can include any number of computers or other processing systems (e.g., client or end-user systems, server systems, etc.), and databases or other repositories arranged in any desired manner that can apply the embodiments of the present invention to any desired type of computing environment (e.g., cloud computing, client-server, network computing, mainframe, stand-alone systems, etc.). The computers or other processing systems used by the embodiments of the present invention can be implemented by any number of any personal or other type of computers or processing systems (e.g., desktop, laptop, PDA, mobile device, etc.), and can include any combination of any commercially available operating system, or commercially available and custom software (e.g., browser software, communication software, server software, automatic schema annotation file generation system 15, etc.). These systems can include any type of monitor and input device (e.g., keyboard, mouse, voice recognition, etc.) for inputting or viewing information or both.
[0099] The software of the embodiments of the present invention (e.g., the automatic schema annotation file generation system 15 including the metadata extraction engine 105, user interface engine 110, SAF generation engine 115, rule generation engine 120, and NLIDB module 125, etc.) can be implemented in any desired computer language and can be developed by one of ordinary skill in the computer technology field based on the description of the functionality included in the flowcharts shown in this specification and the drawings. Further, any reference in this specification to software that performs various functions generally relates to the computer system or processor that executes those functions under the control of the software. The computer system of the embodiments of the present invention can alternatively be implemented by any type of hardware or other processing circuit or both.
[0100] The various functions of a computer or other processing system can be distributed in any manner among any number of software or hardware or both modules or units, processes or computer systems or circuits or both, where the computers or processing systems can be located locally or remotely from each other and can communicate via any suitable communication medium (e.g., LAN, WAN, intranet, Internet, wired connection, modem connection, wireless, etc.). For example, the functions of embodiments of the present invention can be distributed in any manner among various end-user / client and server systems, or any other intermediate processing device, or all of them. The software or algorithms or both described above and shown in the flowcharts can be modified in any way to perform the functions described herein. Further, the functions in the flowcharts or descriptions can be executed in any order desired to accomplish the desired operations.
[0101] The software of embodiments of the present invention (e.g., an automatic schema annotation file generation system 15 including a metadata extraction engine 105, a user interface engine 110, a SAF generation engine 115, a rule generation engine 120, and an NLIDB module 125, etc.) can be utilized on a fixed-type computer-usable medium (e.g., magnetic or optical media, magneto-optical media, floppy disk, CD-ROM, DVD, memory device, etc.) of an installation-type or portable-type program product device or device for use using a stand-alone system or a system connected to a network or other communication medium.
[0102] The communication network can be implemented by any number and any type of communication network (e.g., LAN, WAN, Internet, intranet, VPN, etc.). The computer or other processing system of the embodiments of the present invention can include any ordinary or other communication device for communicating on the network via any ordinary or other protocol. The computer or other processing system can utilize any type of connection (e.g., wired, wireless, etc.) for accessing the network. The local communication medium can be implemented by any suitable communication medium (e.g., local area network (LAN), wired connection, wireless link, intranet, etc.).
[0103] This system can use any number and any ordinary or other database, data store, storage structure (e.g., file, database, data structure, data or other repository, etc.) to store information (e.g., extracted data 32, extracted annotated data 34, schema 36, vocabulary rules 38, etc.). The database system can use any number and any ordinary or other database, data store or storage structure (e.g., file, database, data structure, data or other repository, etc.) to store information (e.g., extracted data 32, extracted annotated data 34, schema 36, vocabulary rules 38, etc.). The database system can be included in or coupled to the server or client or both systems. The database system or storage structure or both can be located remotely from or locally to the computer or other processing system and can store any desired data (e.g., extracted data 32, extracted annotated data 34, schema 36, vocabulary rules 38, etc.).
[0104] Embodiments of the present invention can use any number and any type of user interfaces (e.g., graphical user interfaces (GUI), command lines, prompts, etc.) to obtain or provide information (e.g., extracted data 32, extracted annotated data 34, schema 36, vocabulary rules 38, etc.), where the interface can include any information arranged in any format. The interface can include any number and any type of input or actuation mechanisms (e.g., buttons, icons, fields, boxes, links, etc.) arranged anywhere to input / display information and initiate a desired action via any suitable input device (e.g., mouse, keyboard, etc.). The interface screen can include any suitable actuators (e.g., links, tabs, etc.) for navigating between screens in any manner.
[0105] The automatic schema annotation file generation system 15 can include any information arranged in any format and can be configured based on rules or other criteria for providing desired information (e.g., metadata, answers to questions, etc.) to the user.
[0106] Embodiments of the present invention are not limited to the specific tasks or algorithms described above, but can be used for any application where automated schema generation is useful. Further, this approach is generally applicable to various technical fields including, but not limited to, human resources, healthcare, finance, marketing, government, etc.
[0107] The terms used in this specification are for the purpose of describing particular embodiments only and are not intended to limit the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. Further, the terms "comprise", "comprising", "include", "including", "has", "have", "having", "with", etc., when used herein, specify the presence of the described features, integers, steps, operations, elements or components, or combinations thereof, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or groups thereof, or combinations thereof.
[0108] The corresponding structures, materials, acts, and equivalents of the "means or step plus function" elements in the following claims are intended to include any structure, material, or act for performing the function in combination with other claimed elements that are expressly claimed. The description of the present disclosure has been presented for purposes of illustration and description only and is not intended to be exhaustive or to limit the invention to the forms disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope of the invention. Embodiments were chosen and described in order to best explain the principles of the invention and its practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
[0109] The descriptions of the various embodiments of the present invention are presented for illustrative purposes, but they are not intended to be exhaustive or to limit the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, the practical application, or the technological improvements over the technologies found in the market, or to enable those skilled in the art to understand the embodiments disclosed herein.
[0110] The present invention can integrate a system, a method, a computer program product, or a combination thereof at any possible level of technical detail. The computer program product can include a computer-readable storage medium (s) having computer-readable program instructions for causing a processor to execute aspects of the present invention.
[0111] A computer-readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. The computer-readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer-readable storage medium includes the following, namely, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a punch card, or a mechanically encoded device such as a raised structure in a groove in which instructions are recorded, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not construed as a transitory signal itself, such as a radio wave, or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.
[0112] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to respective computing / processing devices or to an external computer or external storage device via a network, such as, for example, the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers, or edge servers, or combinations thereof. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and transfers the computer-readable program instructions for storage in a computer-readable storage medium within each respective computing / processing device.
[0113] The computer-readable program instructions for carrying out the operations of the present invention may be source code or object code described in any combination of one or more programming languages, including assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state-setting data, configuration data for integrated circuits, or object-oriented programming languages such as Smalltalk, C++, and conventional procedural programming languages such as the "C" programming language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, may be executed partly on the user's computer and partly as a stand-alone software package, may be executed partly on the user's computer and partly on a remote computer, or may be executed entirely on the remote computer or server. In the last scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, for example, an electronic circuit including a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA) may execute the computer-readable program instructions by utilizing the state information of the computer-readable program instructions to implement aspects of the present invention and to customize the electronic circuit.
[0114] Aspects of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0115] These computer-readable program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing apparatus create means for implementing the functions / operations specified in one or more blocks of a flowchart, a block diagram, or both. These computer program instructions can be stored in a computer-readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer-readable medium comprise a product including instructions for implementing the aspects of the functions / operations specified in one or more blocks of a flowchart, a block diagram, or both.
[0116] The computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions executed on the computer or other programmable apparatus provide a process for implementing the functions / operations specified in one or more blocks of a flowchart, a block diagram, or both.
[0117] The flowcharts and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart may represent a module, segment, or portion of code that contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently depending on the functionality involved, or these blocks may sometimes be executed in the reverse order. It should also be noted that each block of the block diagrams or flowchart diagrams, or combinations of blocks in the block diagrams or flowchart diagrams or both, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or that performs a combination of dedicated hardware and computer instructions.
Claims
1. An automated method for creating a semantic model of a relational database for processing natural language queries using a computer device, comprising: automatically extracting relational database metadata by the computer device; prompting the computer device to obtain text labels from a user to annotate columns of the extracted metadata; automatically generating, by the computer device, a schema annotation file that is a text file including one or more entries describing entities of the relational database and relationships between the entities based on the extracted metadata and the text labels provided by the user for annotating the columns, classifying the words or phrases or both of the text labels into a set of categories each corresponding to a pattern of semantic relationships; generating the one or more entries including the words or phrases or both based on the semantic relationships; automatically generating the schema annotation file including; processing natural language queries for the relational database using the schema annotation file, including converting the natural language queries into structured queries using vocabulary rules generated based on the schema annotation file; A method including the above.
2. The method according to claim 1, wherein the user provides the text labels for the extracted metadata without knowledge of the structure of the relational database or the ontology of the relational database. The method according to claim 1.
3. The method according to claim 1 or claim 2, wherein the extracted metadata is provided in a table format and includes a table name and one or more column names within the table.
4. The method according to claim 3, wherein the text labels include at least semantic types and element labels.
5. The method according to any one of claims 1 to 4, wherein the relational database is region-independent.
6. The method according to claim 4, wherein the schema annotation file is created by extracting semantics using natural language processing of user input, and the extracted semantics are used to create relationships between the entities of the relational database.
7. further comprising creating schema-specific vocabulary rules by a machine learning system, wherein the machine learning system creates the schema-specific vocabulary rules using the schema annotation file and template rules based on fixed syntax rules in English. The method according to any one of claims 1 to 6.
8. Processing the natural language query receiving a natural language question from the user, generating an answer to the received natural language question based on the result of the structured query, The method according to any one of claims 1 to 7, comprising:
9. A system for creating a semantic model of a relational database for processing natural language queries, comprising: one or more processors; one or more computer-readable storage media; program instructions stored on the one or more computer-readable storage media for execution by at least one of the one or more computer processors; and the program instructions instructions for automatically extracting relational database metadata by a computing device; instructions for prompting the user for text labels to annotate columns of the extracted metadata by the computing device; instructions for automatically generating, by the computing device, a schema annotation file that is a text file including one or more entries describing entities of the relational database and relationships between the entities based on the extracted metadata and the text labels provided by the user to annotate the columns; classifying the words or phrases or both of the text labels into a set of categories each corresponding to a pattern of semantic relationships; generating the one or more entries including the words or phrases or both based on the semantic relationships Instructions for automatically generating the schema annotation file, including commands; Instructions for processing natural language queries for the relational database using the schema annotation file, including converting the natural language query into a structured query using vocabulary rules generated based on the schema annotation file; A system comprising the above. **Claim 10** The system according to claim 9, wherein the user provides the text label for the extracted metadata without knowledge of the structure of the relational database or the ontology of the relational database. **Claim 11** The system according to claim 9 or claim 10, wherein the extracted metadata is provided in the form of a table and includes a table name and one or more column names within the table. **Claim 12** The system according to claim 11, wherein the text label includes at least a semantic type and an element label. **Claim 13** The system according to claim 12, wherein the schema annotation file is created by extracting semantics using natural language processing of user input, and the extracted semantics are used to create relationships between the entities of the relational database. **Claim 14** The program instructions executable by the processor further comprise: Receiving a natural language question from the user; Generating an answer to the received natural language question based on the result of the structured query; The system according to any one of claims 9 to 13, further configured as above. **Claim 15** A computer-readable storage medium storing a computer program for creating a semantic model of a relational database for processing natural language queries, readable by a processing circuit and storing execution instructions for the processing circuit to perform the method according to any one of claims 1 to 8. **Claim 16** A computer program stored on a computer-readable medium and loadable into the internal memory of a digital computer, including a software code portion for performing the method according to any one of claims 1 to 8 when executed on a computer.
Citation Information
Patent Citations
Schema managing method
JP1996221310A
Information processing apparatus, information processing system, information processing method, and program
JP2016189155A
Methods, systems, and computer program products for natural language interfaces to databases
JP2018533126A
Database access
US20150058337A1