Method and system for automatic creation of schema annotation files

By automating the generation of schema annotation files, the problem of time-consuming database ontology generation is solved, enabling database queries without requiring specialized knowledge, thus improving efficiency and flexibility.

CN114846461BActive Publication Date: 2025-12-09INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202080086314.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-12-20
Filing Date
2020-12-18
Publication Date
2025-12-09
Estimated Expiration
2040-12-18

AI Technical Summary

Technical Problem

Generating a database ontology is usually a time-consuming and manual process, which is especially difficult to achieve in large or complex systems.

Method used

The system automatically extracts metadata from relational databases using computing devices, prompts users with text labels, automatically generates pattern annotation files, and uses these files to process natural language queries.

Benefits of technology

It enables the automatic generation of schema annotation files without requiring in-depth knowledge of the database structure or ontology, simplifying the database query process and improving efficiency and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114846461B_ABST
    Figure CN114846461B_ABST
Patent Text Reader

Abstract

Methods, systems, and computer-readable media are provided for automatically creating a semantic model of a relational database to process natural language queries. A computing device automatically extracts relational database metadata. The computing device prompts a user to input a text label for a column of the extracted metadata. The computing device automatically generates a schema annotation file based on the relational database metadata and the text label for the column. A natural language query of the relational database is processed using the schema annotation file.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present invention relate to rule-based systems for converting natural language queries to structured query language, and in particular to systems for automatically generating schema annotation files based on user annotations of metadata to describe relationships in a database for processing natural language queries.

[0002] Discussion of Related Art

[0003] Relational database management systems can be used to store and manage structured data. Data in a database can be accessed based on technical knowledge and expertise in structured query language, and is often a complex and time-intensive process. To improve access to stored data, a natural language interface to a database system can be used, which allows a user to access data by asking natural language questions and receiving answers from the database. A natural language interface to a database system converts natural language expressions to structured queries that provide simple and fast access to information in a database.

[0004] Rule-based natural language interfaces to database systems operate using a semantic model of database elements that define relationships between entities. Rule-based natural language interfaces to database systems rely on an ontological representation of the database, involving the classification of entities and the modeling of relationships between those entities.

[0005] However, generating a database ontology is typically a time-consuming and manually intensive process. A database ontology utilizes schemas to specify the types of relationships that entities have with each other. Typically, 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 traditional approach, creating a schema annotation file is performed by a user who is aware of the database structure and ontology and the schema annotation file structure and supported phrase formats and the markup statements used to create the schema annotation file.

[0006] Creating such a semantic model or ontology is a time-consuming manual process that requires in-depth knowledge of the database structure and schema, as each relationship is defined in a manual manner. For large or complex systems, this approach is not feasible.

[0007] Accordingly, there is a need in the art to address the above problems. SUMMARY

[0008] From a first aspect, the present invention provides an automated method for creating a semantic model of a relational database using a computing device for processing natural language queries, the method comprising: automatically extracting, by the computing device, relational database metadata; prompting, by the computing device, a user for a text label for a column of the extracted metadata; automatically generating, by the computing device, a schema annotation file based on the relational database metadata and the text label provided in the column; and processing a natural language query to the relational database using the schema annotation file.

[0009] From another aspect, the present invention provides a system for processing software services in a computing domain, the system 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, the program instructions comprising instructions for: automatically extracting, by the computing device, relational database metadata; prompting, by the computing device, a user for a text label for a column of the extracted metadata; automatically generating, by the computing device, a schema annotation file based on the relational database metadata and the text label provided in the column; and processing a natural language query to the relational database using the schema annotation file.

[0010] From another aspect, the present invention provides a computer program product for processing software services in a computing domain, the computer program product comprising one or more computer readable storage media collectively having program instructions collectively stored thereon, the program instructions executable by a computer to cause the computer to: automatically extract, by the computing device, relational database metadata; prompt, by the computing device, a user for a text label for a column of the extracted metadata; automatically generate, by the computing device, a schema annotation file based on the relational database metadata and the text label provided in the column; and process a natural language query to the relational database using the schema annotation file.

[0011] From 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 instructions for execution by the processing circuit for performing a method for performing the steps of the present invention.

[0012] Viewed from a further aspect, the present application provides a computer program stored on a computer readable medium and loadable into the internal memory of a digital computer, comprising software code portions, when said program is run on a computer, for performing the steps of the application.

[0013] According to embodiments of the present application, methods, systems, and computer readable media are provided for automatically creating a semantic model of a relational database to process natural language queries. A computing device automatically extracts relational database metadata. 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 to the relational database are processed using the schema annotation file. The system can generate lexical rules based on the automatic schema annotation file. This approach provides an automatic approach to generating schema annotation files based on annotated metadata as compared to traditional approaches of manually generating schema annotation files.

[0014] According to another aspect, the user annotates the extracted metadata without knowing the structure of the relational database or the ontology of the relational database. This approach provides the advantage of being able to generate a schema based on annotated metadata without requiring specialized knowledge of the underlying database or ontology.

[0015] In another aspect, the schema annotation file is processed into lexical rules with semantic annotations for the relational database. In a further aspect, a natural language question is received from a user. The received natural language question is converted into a structured query using the lexical rules generated based on the semantic annotations. An answer to the received natural language question is generated based on the results of the structured query. These approaches have the advantage of allowing a user to ask questions about the contents of a database and allowing the system to retrieve relevant contents of the database based on lexical rules generated from the schema annotation file. This approach does not require the user to generate a structured query to access contents in the database.

[0016] In other aspects, the annotations to the extracted metadata include text labels, where the text labels include at least a semantic type and an element label. Here, a minimal amount of annotations are required to generate a schema (e.g., only two columns are annotated in the example provided here).

[0017] In other aspects, natural language processing using user input is used to extract semantics, create a schema annotation file, and the extracted semantics are used to create relationships between entities of the relational database. Using natural language processing to create a schema annotation file allows relationships to be established in an automated manner.

[0018] In a further aspect, the machine learning system can be used to create pattern specific lexical rules with semantic annotations, where the machine learning system uses the pattern annotation files and template rules to create pattern specific lexical rules based on fixed grammatical rules of the English language. The advantage of this approach is to further automate the NLIDB system for interaction with users.

[0019] It is to be understood that the summary is not intended to identify key or essential features of embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features, details, and advantages of the disclosure will become apparent from the following description of the BRIEF DESCRIPTION OF DRAWINGS

[0020] The present application will now be described, by way of example only, with reference to preferred embodiments as illustrated in the following drawings:

[0021] Figure 1 is a schematic diagram of an example computing environment for an automatic pattern generation system according to embodiments of the application.

[0022] Figure 2 is an example computing device of the computing environment of Figure 1 according to embodiments of the application.

[0023] Figure 3A is an example of extracted metadata according to embodiments of the application.

[0024] Figure 3B is an example of extracted metadata that has been annotated by a user according to embodiments of the application.

[0025] Figure 3C is a flow diagram illustrating the operation of an automatic pattern generation system in a natural language processing system that interacts with users according to embodiments of the application.

[0026] Figure 4 is an example pattern annotation file generated by an automatic pattern generation system according to embodiments of the application.

[0027] Figure 5 is a flow diagram illustrating the determination and filtering of additional relationships for inclusion into a pattern annotation file according to embodiments of the application.

[0028] Figure 6 is a high level flow diagram illustrating the operation of an automatic pattern annotation file system according to embodiments of the application. DETAILED DESCRIPTION

[0029] Automated techniques are provided for creating an ontology representation or semantic model of a relational database in the form of a schema annotation file (SAF). The SAF is a text file that can be used to adapt a natural language interface to a database (NLIDB) system to a particular schema and without reliance on knowledge of the underlying database structure and ontology.

[0030] In embodiments, relational database metadata describing the structure of a database is automatically extracted. Users annotate (e.g., provide text-based labels) columns of the extracted metadata. Based on the techniques provided herein, semantic relationships between the tagged extracted database entities are automatically annotated to form a semantic model. In embodiments, the semantic model is produced in natural language text that can be processed by any natural language processing (NLP) system to generate lexical rules that are applied to the relational database. The generated SAF can be used to automatically adapt a NLIDB system to a particular database schema.

[0031] Techniques are provided herein for creating an ontology model in the form of a SAF, which is a text file representing a semantic model of a database. The SAF can be automatically generated based on minimal input from a user and without prior knowledge of the database.

[0032] Figure 1 An example environment for embodiments of the present application is shown. Specifically, the 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 systems 10 and the client systems 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 systems 10 and the client systems 20 can be local to each other and can communicate via any appropriate local communication medium, such as a local area network (LAN), a hardwire, a wireless link, an intranet, etc.

[0033] The client systems 20 enable users to provide annotations of the extracted metadata generated by the server systems 10 based on the structured database 50 for automatic SAF creation. The server systems 10 include an automated schema annotation file generation system 15 that includes a metadata extraction engine 105, a user interface engine 110, a SAF generation engine 115, a rules generation engine 120, and a NLIDB module 125, as described herein.

[0034] The database 30 can store various information for analysis, such as extracted data 32, extracted annotated data 34, created schema 36, and vocabulary rules 38, etc. The extracted data 32 can include information extracted from the database 50 (e.g., in a table format, in a tab delimited format, or any other suitable format, etc.). The extracted data 32 is provided to the user through the user interface engine 110 for annotation. Once annotated, the data can be stored as extracted annotated data 34. The schema 36 is created by the automatic schema annotation file generation system 15 from the extracted annotated data 34, and the system 15 can also generate vocabulary rules 38 from the generated schema.

[0035] The database system 30 and the structured database 50 can be implemented by any conventional or other database or storage unit, can be located locally 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), a wide area network (WAN), the Internet, a hardwire line, a wireless link, an intranet, etc. The client system can present a graphical user interface, such as a GUI, or other interface, such as a command line prompt, menu screen, etc., to request information from the user regarding metadata annotation, and the NLIDB module 125, through which questions are asked and answers are received regarding the contents of the structured database 50.

[0036] The server system 10 and the client system 20 can be implemented by any conventional or other computer system, preferably equipped with a display or monitor, a base unit including at least one hardware processor (e.g., a microprocessor, a controller, a central processing unit (CPU), etc.), one or more memories and / or internal or external network interfaces or communication devices (e.g., a modem, a network card, etc.), optional input devices (e.g., a keyboard, a 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.). As an example, the server / client includes at least one processor 16, 22, one or more memories 17, 24 and / or internal or external network interfaces or communication devices 18, 26, such as a modem or network card, and a user interface 19, 28, etc. The optional input devices can include a keyboard, a mouse or other input device.

[0037] Alternatively, one or more client systems 20 can perform automatic software service analysis as a stand-alone unit. In the stand-alone mode of operation, the client system stores or accesses data, such as extracted data 32, extracted annotated data 34, schema 36, and vocabulary rules 38. The stand-alone unit includes an automatic schema annotation file generation system 15. A graphical user or other interface 19, 28, such as a GUI, command line prompt, menu screen, etc., requests information from a corresponding user regarding metadata annotation, and an NLIDB module 125, through which questions are asked and answers received regarding the contents of the structured database 50.

[0038] The automatic schema annotation file generation system 15 can include one or more modules or units to perform the various functions of the embodiments of the application described herein. The various modules, metadata extraction engine 105, user interface engine 110, SAF generation engine 115, rules generation engine 120, and NLIDB module 125, etc., can be implemented by any number of software and / or hardware modules or units in any combination, and can reside within the memory 17 of the server for execution by the processor 16. These modules are described in more detail below.

[0039] 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 form.

[0040] The technology provided herein provides for connecting to a database and extracting metadata characterizing the database. The metadata includes entity / concept information, such as table names, column names, data types, and / or information about primary and foreign keys used to create relationships between tables, that exist in the database. A user can connect to the database with a user credential and use an application programming interface (API), such as a JDBC API, to retrieve various metadata information associated with the database.

[0041] The user interface engine 110 can prompt a user to annotate one or more columns from the extracted metadata. The user interface engine receives input from the user to generate annotated metadata.

[0042] The user interface engine 110 can create a view of the extracted metadata that illustrates 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 in the view are connected with links. The view allows for renaming of tables and data entries in the columns to provide a meaningful description of the extracted metadata.

[0043] In other aspects, the view also allows columns to be added to the table that are computed. For example, if the values of a column are frequently added for reporting purposes, the column can be added and the aggregated values assigned to the column. This approach can mask complexity, especially if the values are computed using values from multiple tables. In other cases, retrieving the data can be slower or more complex because the query can require a complex process to retrieve different pieces of data from a single table, or the query can need to address many different tables. While the examples provided herein are with respect to a single table, the present technology can be extended to multiple tables.

[0044] The SAF generation engine 115 automatically generates SAFs based on the annotated metadata and SAF-related files 117. The generation of SAFs is described in more detail throughout this application and the accompanying drawings (see also Figures 3A-3C ) SAF generation. The creation of SAFs requires various SAF-related files 117, including template rules (TR) files, parsers 116, word semantics (WS) files, irregular verbs (IV) files, and verb disambiguation (VP) files. Each file type is described in more detail below.

[0045] Template rules (TR) files are pre-existing files that contain template rules that match common sentence structures and syntax that can be used for SAF generation. The sentence structures can be in English or other natural languages.

[0046] Parsers 116 are tools that analyze words and phrases that describe database concepts. The parsers can determine the grammatical properties of the words and phrases (e.g., parts of speech, such as whether the word is in the form of a verb or a noun, etc.) from the annotated extracted data.

[0047] Word semantics (WS) files are files that contain lists of common words with associated semantic types that show certain properties. For example, the WS files can include identity words (e.g., names, types, styles, etc.), date types (e.g., dates, years, days, times, durations, etc.), location types (e.g., cities, countries, addresses, streets, etc.), and the like.

[0048] Irregular verbs (IV) files contain lists of irregular verbs and their past tense forms.

[0049] Verb disambiguation (VP) files are automatically created files of nouns in the SAF entries and their disambiguation verbs. For example, for an entry that corresponds to “employee has salary,” the word salary can be associated with verbs such as earn, make money, receive, and the like.

[0050] Using the parser, WS file, and IV file, the SAF generation engine processes the information for each column and produces one or more SAF entries. The SAF engine can also produce entries for a VP file, which can be used during the question answering process associated with the NLIDB module 125.

[0051] A SAF is a text file with one entry per row. Each entry consists of a fixed format word or phrase describing a relationship between entities / concepts in the database and a set of tags describing the entities / concepts. A SAF can contain at least three types of entries: "attribute / identity," "association," and "action" entries. Attribute / identity entries contain information that identifies a concept / entity (e.g., name, ID, type, etc.). Association entries contain information that is associated with a concept / entity (e.g., hire date, manager, etc.), but does not directly identify the concept / entity. Action entries define a semantic relationship between concepts / entities (e.g., typically two entities). In many cases, there is more than one relationship between entities / concepts, and thus, multiple entries can be needed to describe each relationship.

[0052] An example SAF entry for a human resources (HR) schema with a single "employee" table is shown below. The first entry is an attribute entry for the concept / entity of an employee. In particular, the word / phrase "employee" is followed by two tag statements. The first set of tags indicates that "employee" is identified by the table EMPLOYEE and column EMPNO, and has an integer data type. The second set of tags shows that the "name" concept / entity is identified by the table EMPLOYEE, column EMPNAME, and string data type. The second and third entries are association entries indicating that the "salary" and "hire date" concepts are associated with the employee tag, as identified in the first entry. The fourth, fifth, and sixth entries are "action" entries. These entries describe semantic relationships between concepts / entities. An example is shown below:

[0053] Employee has name; TableName is EMPLOYEE; columnName is EMPNO; DataType is integer; Tablenamei is EMPLOYEE; ColumnNamei is EMPNAME; DataTypei is string;

[0054] Employee has salary; TableName is EMPLOYEE; columnName is EMPNO; DataType is integer; Tablenamei is EMPLOYEE; ColumnNamei is SALARY; DataTypei is string;

[0055] An employee has a hire date; TableName is EMPLOYEE; columnName is EMPNO; DataType is integer; Tablenamei is EMPLOYEE; ColumnNamei is HIREDATE; DataTypei is date;

[0056] A manager manages an employee; TableName is EMPLOYEE; columnName is MGRNAME; DataType is string; Tablenamei is EMPLOYEE; ColumnNamei is EMPNO; DataTypei is integer;

[0057] An employee is hired on a date; TableName is EMPLOYEE; columnName is EMPNO; DataType is integer; Tablenamei is EMPLOYEE; ColumnNamei is HIREDATE; DataTypei is date;

[0058] A department hires an employee; TableName is EMPLOYEE; columnName is DPTNAME; DataType is string; Tablenamei is EMPLOYEE; ColumnNamei is EMPNO; DataTypei is integer;

[0059] The rules generation engine 120 generates lexical rules 38 based on the created SAFs. The NLIDB module 125 allows users to interact with the server system 10 to receive answers related to questions about the content of the structured database 50. These features and others are described in the specification and drawings.

[0060] The client system 20 and the server system 10 can be implemented by any suitable computing device, such as Figure 2 The computing device 212 for the computing environment 100 shown in FIG. 2. This example is not intended to suggest any limitation as to the scope of use or functionality of embodiments of the present application described herein. Regardless, the computing device 212 is capable of being implemented and / or performing any of the functionality set forth herein.

[0061] In computing, there are a variety of environments in which computer systems can be used. Examples of well-known computer systems, environments, and / or configurations that can be suitable for use with the computer system include, but are not limited to, personal computers, server computers, thin clients, thick clients, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed cloud computing environments that include any of the above systems or devices, and the like.

[0062] The computer system 212 can be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system (e.g., the automatic mode annotation file generation system 15 and its corresponding modules). Generally, program modules can include routines, programs, objects, components, logic, data structures, and the like that perform particular tasks or implement particular abstract data types.

[0063] The 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.

[0064] The bus 218 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0065] Computer system 212 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer system 212 and it includes both volatile and non-volatile media, removable and non-removable media.

[0066] The system memory 136 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 230 and / or cache memory 232. Computer system 212 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 234 can be provided for reading from and writing to non-removable, non-volatile magnetic media (not shown and typically called a "hard drive"). Although not explicitly shown, a magnetic disk drive can also be provided for reading from and writing to a removable, non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive can be provided for reading from or writing to a removable, non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical media). Each of these devices can be connected to the bus 218 by one or more data media interfaces. As will be further depicted and described below, the memory 136 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.

[0067] Program / utility 240 having a set (at least one) of program modules 242, such as automatic mode annotation file generation system 15 and corresponding modules, and the like, can be stored in memory 136 by way of example, and not limitation. Each of the operating system, one or more application programs, other program modules, and program data or some combination thereof, can include implementation of a networking environment. Program modules 242 generally carry out the functions and / or methodologies of embodiments of the application as described herein.

[0068] Computer system 212 can also communicate with one or more external devices 214 such as a keyboard, a pointing device, a display 224, etc.; one or more devices that enable a user to interact with computer system 212; and / or any devices (e.g., network card, modem, etc.) that enable computer system 212 to communicate with one or more other computing devices. Such communication can occur via Input / Output (I / O) interface(s) 222. Still yet, 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 network adapter 225. As depicted, network adapter 225 communicates with the other components of computer system 212 via bus 218. It should be appreciated that although not shown, other hardware and / or software components that can be used in conjunction with computer system 212 can also be utilized. These include, but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.

[0069] Figure 3A An example of extracting metadata from a single table HR database is shown. The table is generated by extracting data from a database that includes employee characteristics. In this example, metadata (e.g., table name, column name, and data type) is automatically extracted from the relational database 50, for example, using the metadata extraction engine 105.

[0070] For example, the extracted data is presented to the user in a browser format or any other appropriate interactive equivalent using the user interface engine 110, allowing 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 the column (e.g., employee ID, employee name, etc.). The annotator can also select a semanticType for each respective entry in the column "elementLabel" from a list of valid types (e.g., person, date, money, none, etc.).

[0071] In some embodiments, the user is presented with guidelines for annotating the columns and can be provided with a list of supported semantic types, with examples as 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 other aspects, the user can also provide an English word as the name of the table if the table name is not a standard English word (e.g., if the name of the table is a variable name such as EMP _ TABLE, the user can modify the table name to refer to "Employee").

[0072] In this example, as shown in Figure 3B the user annotates the first column and the last column based on the information provided in the columns extracted in the middle (e.g., tableName, columnName, and dataType). The user can annotate the presented columns, for example, in a text format or in a voice format that can be converted to text, to generate an annotated table.

[0073] This information (e.g., user annotations, extracted data, etc.) is processed using the techniques described herein to generate a SAF file by the automated schema annotation file generation system 15. Each entry of the SAF file includes a fixed format phrase describing a relationship between entities / concepts in the database (e.g., between two entities / concepts) and a set of tags describing each entity / concept. To generate the SAF file, the column descriptions and semantic types are analyzed and the semantics of the columns and their relationships to each other are determined. The SAF file can be stored as schema 36. This process is described in more detail, for example, see Figure 3C .

[0074] Figure 3CAn example workflow for automatically generating a SAF in a system including an NLIDB module 125 is shown. At operation 410, metadata is extracted from a database (e.g., a relational database). At operation 415, a user is prompted to annotate the metadata. At operation 420, the annotated metadata is received.

[0075] At operation 425, the annotated metadata is processed by the automatic schema annotation file generation system 15 to generate a SAF, typically including a plurality of entries. Words and / or phrases provided by the user to label the entries (column entries) can be categorized into a set of categories. For example, words can be categorized based on their type (e.g., identity, date, etc.). Words can be further categorized based on their part of speech (e.g., noun, verb, etc.). In some aspects, verb forms of nouns can be categorized as verbs.

[0076] Each set of categorization results corresponds to a particular pattern of semantic relationships. For example, if the label is "employee name," the SAF entry can be "employee has name." As another example, if the label is "date of hire," multiple entries can be created as "employee has date of hire" and "employee was hired on a date." Figure 4 Additional examples of entries in a SAF generated by the automatic schema annotation file generation system 15 are shown. Indented entries are created from the disambiguation engine 118 that identifies verbs to connect two nouns.

[0077] The main concept / entity of a table (e.g., the table name as "employee") can be paired with other columns that have a noun category and sent to the disambiguation engine 118, which produces verbs that semantically connect the concept / entity (e.g., two or more words). For example, for the entities "employee" and "manager," the disambiguation engine can produce verbs such as "works for," "reports to," "employed by," etc. The verbs can be ranked based on their frequency of use. These verbs can be used to create entries that describe relationships between entries in the same table or different columns and / or tables.

[0078] If the annotation of a column (element label) contains two or more words, the system will use supported grammar and will not allow unsupported grammar. For example, "employee hire / hired date" or "employee's hire / hired date" is supported, but "employee's hire / hired date" is not.

[0079] Additional details regarding SAF creation are provided as follows. Using the parser 116 and the SAF-related files 117 (e.g., WS files and IV files), the SAF generation engine 115 analyzes entries as follows:

[0080] Is the "identity" a concept / entity of the main table concept (e.g., employee name)? Does the phrase contain the table name as one of the concept / entities?

[0081] If yes, the entry describes a concept / entity that is directly related to the table name, and the semantic type of the other word is compared to the WS file. If the entry matches one of the "identity" words, the system determines that this is an identity entry.

[0082] Is this an "identity" entity / concept that is different from the primary table name (e.g., "manager name" or "department name")?

[0083] The system uses the same process as (a) to evaluate the concept / entity, where the entry is not the primary table name.

[0084] Is this a "non-identity" entity / concept (e.g., "employee salary," "employee manager," or "employee hire date")?

[0085] If the second concept / entity does not match an "identity" semantic provided in the WS file, the system uses the analysis to evaluate the entry. If the entity / concept contains multiple words (e.g., "hire date"), a list of individual words is created to represent the multi-word entity (e.g., hire date, hire, etc.).

[0086] These classifications can be used to determine which descriptive words / phrases are "unique" (e.g., there is a single reference in the table column, such as "manager" or "department") and which words / phrases are not unique (e.g., "name"). Certain concepts, such as the semantic type "date," receive a special classification. If there are multiple dates in the table (e.g., "hire date" and "separation date"), even if the individual words are unique, these words refer to the same concept type "date" and are therefore not considered unique.

[0087] Based on these classifications, the SAF entries are created, and the flag statements are configured based on the information extracted from the table. For the first classification, a single "property" entry is created for the primary element (e.g., "employee has name").

[0088] For the second classification, multiple entries are created as follows:

[0089] a) A "property" entry is created for the concept (e.g., "manager has name").

[0090] b) A second "property" entry is created for the primary element (i.e., "employee has manager").

[0091] c) The parser 116 extracts attributes of the concepts / entities. In this case, "manager" is shown as a "noun," but can also have a verb form "manage." Since there is a verb form of the primary element, a third entry is created, which is "manager manages employees." If the primary element does not have a verb form, the entry can be created with a non-specific default key verb (e.g., for the "department name" column, the entry can be "department name - verb - employees," with the verb set to a default verb (e.g., include, employ, etc.).

[0092] d) The fourth entry is produced with the syntax "primary element - verb - preposition - noun." The verb and preposition are default keys. The entry will have the format: "employee - verb - preposition - manager," which is equivalent to "employee reports to manager," without specifying the specific semantics of the verb and preposition. Similarly, "employee - verb - preposition - department" can be another entry produced.

[0093] e) In addition to the SAF entries, the two noun concepts (e.g., employee and manager) are processed by the paraphrasing engine 118, and a list of relevant verbs connecting the concepts is extracted (e.g., the verb "work" for "employee and department," and the verb "earn" for "employee" and "salary," etc.). The concept nouns and their associated verbs are added to the VP file for use during the question answering phase.

[0094] The third classification is similar to the second classification, except when multiple words characterize a concept and / or a specific semantic type such as date:

[0095] a) An attribute entry is created for the underlined individual word created from multiple words (e.g., "employee has hire date").

[0096] b) The attribute entry is created from the multiple words themselves (e.g., "hire has date")

[0097] c) The multiple words are compared to the WS file. If one of the words has a "date" or "location" type, and the parser 116 detects a verb form of the other word, the past tense of the verb is created or extracted from the IV file, and the entry is created using the verb form of the words. For example, "employee hires date" will produce "employee was hired on a date." If there is a column describing "country of residence of employee," the entry can be created as "employee resides in a country." The preposition used is "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.

[0098] This automatic process can produce a small number of entries with incorrect syntax or semantics, which can be eliminated by the lexical rules creation process. In any case, the overall population of entries provides enough ontological representation to enable answering of most questions.

[0099] At operation 425, a SAF file is generated based on the annotations and extracted metadata described herein (see also Figure 4 ). The parser, WS file, and IV file are pre-existing resources used during the creation of the SAF. The TR file is used during the training phase, when the SAF is processed to create semantic rules for the schema. The VP file is generated during the creation of the SAF and used during the operational phase to answer user questions.

[0100] At operation 435, lexical rules are created to automate the SAF entries. Once the SAF is generated, the pre-existing files containing lexical rules can be used to process the SAF to respond to user queries. The lexical rules can be used to match language syntax and structure.

[0101] For the SAF generation performed in an automated manner, the generated lexical rules include (1) rules that match phrases with precise lexical information, and (2) rules that match phrases more broadly and do not impose precise lexical information. Generating the SAF in an automated manner allows for entries that are more abstract and do not contain precise lexical information.

[0102] An example of a template rule for matching phrases with precise lexical information is (the first line is the name of the rule and specifies that there are two noun variables and one verb):

[0103] root = prop _ owner _ VAR1_ VAR2_ VAR3_

[0104] => VAR2 [ hasPartOfSpeech (“verb”), hasLemmaForm (“VAR2”) ]

[0105] { subj-=> VAR1 [ hasPartOfSpeech (“noun”), hasLemmaForm (“VAR1”) ]}

[0106] { obj-=> VAR3 [ hasPartOfSpeech (“noun”), hasLemmaForm (“VAR3”) ]}

[0107] The above rule matches any sentence against the "subject-verb-object" pattern. The first line is the title or name of the rule. VAR1 and VAR2 are general representations of the subject and object, and the verb is a representation of any verb. The lexical rule created by this template rule will match the exact words of the subject, verb, and object (because the rule imposes the lemma form of the words).

[0108] An example of template rules used in automated SAF processing is (not imposing precise lexical information to match phrases):

[0109] root = prop_owner_VAR1_ VAR2_ VAR3_

[0110] ->VAR2 [hasPartOfSpeech(“verb)]

[0111] { subj->VAR1[ hasPartOfSpeech ("noun"), hasLemmaForm ("VAR1") ]}

[0112] { obj->VAR3 [ hasPartOfSpeech ("noun"), hasLemmaForm ("VAR3") ]}

[0113] The above rules are grammatically similar to the first rule, but do not specify the lexical form of the verb. As a result, the created lexical rules lack explicit semantic information and are missing specific words for the verb (in some cases, created using default keyword verbs), and any sentence with matching grammar will match the words of the subject and object, regardless of the verb word. These types of rules can be identified as described in this paper.

[0114] As another example, for the column "Department Name" (which generates multiple SAF entries), the entries "Department Has Name" and "Manager Manages Employees" produce precise lexical rules. However, "Department-Verb-Employee" will match the following rule:

[0115] root = prop_owner_department_verb_employee_

[0116] - > _verb_ [ HASPARtOfSpeech("verb") ]

[0117] { subj->department[ hasLemmaForm (“department”) ]} ]

[0118] { obj -> employee [ hasLemmaForm ("employee") ]}

[0119] The above rule matches any sentence with the grammar "subject verb object" where the subject is a department and the object is an employee. A question such as "How many employees does the sales department employ?" will match one of the derivations of the above rule and will get the correct answer. However, for a question such as "How many employees in the sales department retired?" the question will be answered in exactly the same way as the previous question because the verb in the rule is non-specific. To avoid mismatches, during question processing, rules with non-specific verbs are checked against a VP file created during the SAF creation process. This file is created using the disambiguation engine 118 and includes a list of plausible verbs that associate employees with departments. If the verb in the sentence does not match any of the verbs listed for these two nouns, the rule will be eliminated.

[0120] The lexical rules are applied to the SAF entries to find matching grammars. When a SAF entry matches a rule, a new rule is automatically created with the grammar of the template rule but with the word from the SAF entry replacing the general variable. For example, applying the "subject verb object" rule of the template file to the fourth entry of the above example will create the following lexical rule:

[0121] Root = Prop owner manager manage employee

[0122] -> manage [ hasPartOfSpeech ("verb"), hasLemmaForm ("manage") ]

[0123] { subj -> manager [ hasLemmaForm ("manage") ]}

[0124] { obj -> employee [ hasLemmaForm ("employee") ]}

[0125] The above rule exactly matches the grammar and semantics of "manager manages employee." For each entry that matches one of the template rules, a range of derived rules with different grammars and with the same semantic information is automatically created to enable answering different types of questions. For example, the derived rules of entry four can match "John manages how many employees" or "Which manager manages Jack," or "Who manages more employees than Joe." The entry five derived words will support questions such as "Who was hired after 2013" or "How many employees did Jim hire after."

[0126] During the training process, template rules can be applied to the SAF entries and pattern-dependent lexical rules can be automatically created that match the syntax of the template rules but contain the semantic information of the SAF.

[0127] During the operational phase, the lexical rule files can be used to process input questions from users to SQL, as shown in operations 440, 445, and 450. The lexical rules for automatic SAFs are more extensive and can match input sentences to semantics that do not exist in the database. As a result, processing the automatically created SAF rules will require more resources and algorithmic analysis to identify incorrect rule matches. These techniques can be used with manually created lexical rules to match any input sentence with the precise syntax and semantics of the SAF entries.

[0128] Accordingly, the automatic pattern and lexical rules of the database can be used to answer user questions. In operation 445, a user can send a question to the system. The system can process the question with the lexical rules and automatic patterns to obtain an answer in the database 50. In operation 450, the system can provide the answer to the user question.

[0129] Figure 4 An example of entries in a SAF generated by the automated pattern annotation file generation system 15 is shown. Indented entries are created from the disambiguation engine 118 that identifies verbs to connect two nouns.

[0130] Figure 5 Another embodiment is shown in which corpus analysis and additional resources (e.g., online resources) can be used to connect concepts / entities to ontological relationships, i.e., using verbs with corresponding nouns as arguments. This type of analysis can be used to manage annotations that are single words.

[0131] According to this embodiment, extracting metadata from a relational database can occur in operation 505. 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. Additional ontological rules are provided in operation 518. The system can use various syntactic, ontological, and semantic rules.

[0132] In operation 530, the system analyzes the data corpus to learn relationships between words. In some aspects, the system computes the probability of occurrence of each verb in a particular syntactic position and then uses a chain probability equation to rank candidates, allowing precise and relevant relationships to be determined.

[0133] As an example of probability computation, for any noun (n) and for any syntactic position ((s) such as subject, object, or prepositional object of a preposition (e.g., to, at, from) and any verb (v)), the probability of v and s given n can be determined:

[0134] p(v,s | n) = p(v,s,n) / p(n) ~ p(v | n) * p(v | s) * p(n | v,s).

[0135] The probabilities p(v | n), p(v | s) p(n | s) from the corpus can be determined, which can be domain-specific or general. For any two nouns (n1 and n2), and for any combination of syntactic positions (s1, s2), the probabilities can be computed:

[0136] p(v, n1, n2) ~ p(v, s1 | n1) * p(v, s2 | n2)

[0137] And verbs can be ranked based on this probability. Verbs that are too high, too low, or too frequent are typically not considered. Ontology constraints can be automatically collected from information sources, such as from any online or digitized sources, and can be used to identify relationships.

[0138] At operation 520, the relationships identified from the corpus can be filtered based on ontology rules, such as by applying syntactic restrictions, ontology similarity, and / or semantic similarity. For example, ontology rules include nouns that co-occur together, verbs that co-occur with nouns, etc. As another example, restrictions can be imposed on possible combinations of syntactic combinations, such that complement positions such as "subject subject" are not considered. The filtered relationships are provided at operation 540.

[0139] In other aspects, a machine learning system can be trained to create pattern-specific lexical rules with semantic annotations. The machine learning system can use SAFs and template rules based on fixed grammar rules of the English language to create pattern-specific lexical rules. For example, additional lexical rules can be created through supervised machine learning training with natural language phrases that disambiguate the SAF entries. These additional rules extend the initial fixed rule set and create a richer set of lexical rules that enable processing a wider range of natural language phrases.

[0140] Figure 6is an operational flowchart showing high-level operations of the automatic schema annotation file generation system 15 provided herein. At operation 610, relational database metadata is automatically extracted by the computing device. At operation 620, the computing device prompts for text labels (e.g., provided by a user) for columns of the metadata. At operation 630, the computing device automatically generates a schema annotation file based on the relational database metadata and the text labels for the columns. At operation 640, natural language queries to the relational database are processed using the schema annotation file.

[0141] Features of embodiments of the invention include the automatic generation of SAFs. The generation of the SAF files is based on minimal annotation from the user, and the user does not need to know the structure or ontology of the database from which the metadata is obtained. Furthermore, the SAF entries are generated in a broader way than manually generated entries. Thus, the SAFs are more robust than the manual approach to creating SAF files. Still further, schema-specific lexical rules can be created from the automatically generated SAFs. The SAFs generated here can be used with systems that interact with users, for example, in a question and answer fashion. For example, lexical rules generated from the automatic SAFs are applied to user input questions to detect and process the content of the user questions. The created SAFs and fixed template rules are used to automatically create a set of lexical rules related to a particular database schema. The NLP engine applies these rules to natural language user questions to detect element and semantic relationships between words and create a set of intermediate structured phrases that will then be converted to SQL clauses.

[0142] The lexical rules from the automatically created SAFs are broad and can contain non-specific lexical information. The lexical rules can be refined with additional information (e.g., online or other text resources to extract the correct meaning from the elements of the input question) in order to construct proper SQL queries.

[0143] Thus, these techniques improve the operation of computers, and in particular, NLIDB systems that interact with users, as the SAFs can be automatically generated with minimal annotation. The SAFs provide a framework for generating lexical rules to access the contents of a database.

[0144] It will be understood that the embodiments described above and shown in the drawings represent merely a few of the many ways in which embodiments for automatically generating SAFs based on received annotations can be implemented.

[0145] The environment of embodiments of the application 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, where embodiments of the application can be applied in any desired type of computing environment (e.g., cloud computing, client-server, network computing, mainframe, standalone system, etc.). The computers or other processing systems employed by embodiments of the application can be implemented by any number of any type of personal or other computers or processing systems (e.g., desktops, laptops, PDAs, mobile devices, etc.) and can include any commercially available operating system and any combination of commercially available and custom software (e.g., browser software, communications software, server software, automated schema annotation file generation system 15, etc.). These systems can include any type of monitor and input devices (e.g., keyboard, mouse, voice recognition, etc.) to input and / or view information.

[0146] It should be understood that the software of embodiments of the application (e.g., automated schema annotation file generation system 15, including 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 by computer personnel based on the functional descriptions contained in the specification and flowcharts shown in the drawings. In addition, any reference to software performing various functions herein is generally intended to mean a computer system or processor executing that software under control of the software. The computer systems of embodiments of the application can optionally be implemented by any type of hardware and / or other processing circuitry.

[0147] The various functions of the computer or other processing systems can be distributed in any manner among any number of software and / or hardware modules or units, processing or computer systems and / or circuitry, where the computer or processing systems can be arranged locally or remotely to each other and communicate via any suitable communication medium (e.g., LAN, WAN, Intranet, Internet, hardwire, modem connection, wireless, etc.). For example, the functions of embodiments of the application can be distributed among various end-user / client and server systems and / or any other intermediate processing equipment in any manner. The software and / or algorithms described above and shown in the flowcharts can be modified in any manner that implements the functionality described herein. In addition, the functions in the flowcharts or descriptions can be performed in any order that implements the desired operations.

[0148] The software of embodiments of the application (e.g., the automated schema annotation file generation system 15, including 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, etc.) can be obtained via a non-transitory computer-usable medium (e.g., magnetic or optical media, magneto-optical media, floppy diskettes, CD-ROMs, DVDs, memory devices, etc.) on a fixed or portable program product device or equipment, to be used in conjunction with a standalone system or a system connected through a network or other communication medium.

[0149] The communication network can be implemented by any number of any type of communication network (e.g., LAN, WAN, the Internet, intranet, VPN, etc.). The computer or other processing system of embodiments of the application can include any conventional or other communication device to communicate over the network via any conventional or other protocol. The computer or other processing system can utilize any type of connection (e.g., wired, wireless, etc.) to access the network. The local communication medium can be implemented by any suitable communication medium (e.g., local area network (LAN), hardwired line, wireless link, intranet, etc.).

[0150] The system can employ any number of any conventional 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 annotation data 34, schema 36, vocabulary rules 38, etc.). The database system can be implemented by any number of any conventional 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 annotation data 34, schema 36, vocabulary rules 38, etc.). The database system can be included within or coupled to the server and / or client system. The database system and / or storage structure can be remote from or local to the computer or other processing system, and can store any desired data (e.g., extracted data 32, extracted annotation data 34, schema 36, vocabulary rules 38, etc.).

[0151] Embodiments of the application can employ any number of any type of user interface (e.g., graphical user interface (GUI), command line, prompts, etc.) to obtain or provide information (e.g., extracted data 32, extracted annotation data 34, schema 36, vocabulary rules 38, etc.), where the interface can include any information arranged in any way. The interface can include any number of any type of input or actuation mechanisms (e.g., buttons, icons, fields, boxes, links, etc.) arranged in any location to input / display information and initiate desired actions via any suitable input device (e.g., mouse, keyboard, etc.). Interface screens can include any suitable actuator (e.g., link, tab, etc.) to navigate between screens in any manner.

[0152] The output of the automatic schema annotation file generation system 15 can include any information arranged in any way and can be configured based on rules or other criteria to provide desired information (e.g., metadata, question answers, etc.) to a user.

[0153] Embodiments of the application are not limited to the particular tasks or algorithms described above, but can be used in any application where automatic schema generation is useful. Moreover, the method is generally applicable to a variety of technical fields, including but not limited to human resources, healthcare, finance, marketing, government, etc.

[0154] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises", "comprising", "includes" and / or "including" when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0155] All means or step plus function elements in the claims that follow the particular transition phrase "means for" or "step for" are intended to perform their corresponding function as described in the specification. The description herein of any embodiments demonstrating the best mode of the application is not meant to limit or restrict the scope of the application to such embodiments. Many modifications and variations of this application can be effected without departing from its spirit or scope, which is defined by the scope of the appended claims and their equivalents. The embodiments are chosen and described in order to best explain the principles of the application and its best mode of practice and to enable others skilled in the art to best utilize the application.

[0156] The description of the various embodiments of the present application has been presented for purposes of illustration, but is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application, or technical improvement over technologies found in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein.

[0157] The present application can be a system, a method, and / or a computer program product at any possible technical detail level of integration. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present application.

[0158] The computer readable storage medium can be a tangible device that can retain and store 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: 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 disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.

[0159] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions into the respective computing / processing device for storage in a computer readable storage medium within the respective computing / processing device.

[0160] Computer readable program instructions for carrying out operations of the present application can be assembly instructions, instruction-set-architecture (ISA) instructions, machine- related instructions, microcode, firmware instructions, state-setting data, configuration data for an integrated circuit, or source code or object code written in any combination of one or more programming languages, including an object-oriented programming language such as Smalltalk, C++, or the like, and a procedural programming language such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the latter scenario, the remote computer can 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 the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present application.

[0161] Aspects of the present application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. 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.

[0162] These computer readable program instructions can be provided to a processor of a computer or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and / or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including

[0163] The computer readable program instructions can also 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 apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0164] The flow and block diagrams in the drawings show the architectural, functional, and operational aspects of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flow or block diagrams can represent a module, segment, or portion of instructions, which includes one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or in the reverse order, depending on the functionality involved. Such variation, function, and elaboration cannot be readily parted by those skilled in the art. Further, those skilled in the art will appreciate that blocks in the block diagrams and / or flow diagrams can represent a combination of dedicated hardware or a combination of hardware and software.

Claims

1. An automated method for using computing devices to create semantic models of relational databases for processing natural language queries, the method comprising: The computing device automatically extracts metadata from the relational database; The computing device prompts the user with text labels for annotating columns of extracted metadata, wherein the text labels include semantic types and descriptions of the columns; The computing device automatically generates a schema annotation file based on the extracted metadata and the text tags provided by the user to annotate the columns. The schema annotation file is a text file including one or more entries describing entities in the relational database and the relationships between those entities. The automatically generated schema annotation file includes: The words describing the text tags are classified into a group of categories based on semantic type and part of speech, where the classification result for each word corresponds to a pattern of semantic relationship; Determine the verbs to use between the words in the description of text labels categorized as nouns; and Based on the semantic relationship, at least one entry is generated in the pattern annotation file, the entry including at least one text tag describing a word and a determined verb; The computing device processes the pattern annotation file into lexical rules having semantic annotations corresponding to the relational database, wherein the lexical rules indicate the grammar of natural language and include elements from the pattern annotation file containing descriptions of words with text tags; and Processing natural language queries to the relational database, wherein processing the natural language query includes: The vocabulary rules are applied to the natural language query to detect elements of the natural language query associated with the relational database and the semantic relationships between the elements; A set of structured phrases is created from the detected elements and semantic relationships within the natural language query; and The structured phrases are converted into structured query language clauses to generate structured queries.

2. The method according to claim 1, wherein, The user annotates the extracted metadata without knowing the structure of the relational database or the ontology of the relational database.

3. The method according to claim 1, wherein, The extracted metadata is provided in the form of a table, and the metadata includes the table name and one or more column names in the table.

4. The method according to claim 1, wherein the relational database is domain independent.

5. The method according to claim 1, wherein, Natural language processing using user input is used to extract semantics to create the pattern annotation file, and the extracted semantics are used to create relationships between the entities in the relational database.

6. The method according to any one of claims 1 to 5, further comprising: A machine learning system is used to create pattern-specific lexical rules with semantic annotations, wherein the machine learning system uses the pattern annotation file and template rules to create the pattern-specific lexical rules based on the fixed grammatical rules of the English language.

7. The method of claim 1, wherein processing the natural language query further comprises: Receive a natural language question from the user, as the natural language query; as well as Based on the results of the structured query, an answer to the received natural language question is generated.

8. A system for creating a semantic model for a relational database to process natural language queries, the system 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 one or more computer processors, the program instructions including instructions for the following operations: Metadata from relational databases is automatically extracted by computing devices; The computing device prompts the user with text labels for annotating columns of extracted metadata, wherein the text labels include semantic types and descriptions of the columns; The computing device automatically generates a schema annotation file based on the extracted metadata and the text tags provided by the user to annotate the columns. The schema annotation file is a text file including one or more entries describing entities in the relational database and the relationships between those entities. The automatically generated schema annotation file includes: The words describing the text tags are classified into a group of categories based on semantic type and part of speech, where the classification result for each word corresponds to a pattern of semantic relationship; Determine the verbs to use between the words in the description of text labels categorized as nouns; and Based on the semantic relationship, at least one entry is generated in the pattern annotation file, the entry including at least one text tag describing a word and a determined verb; The computing device processes the pattern annotation file into lexical rules having semantic annotations corresponding to the relational database, wherein the lexical rules indicate the grammar of natural language and include elements from the pattern annotation file containing descriptions of words with text tags; and Processing natural language queries to the relational database, wherein processing the natural language query includes: The vocabulary rules are applied to the natural language query to detect elements of the natural language query associated with the relational database and the semantic relationships between the elements; A set of structured phrases is created from the detected elements and semantic relationships within the natural language query; and The structured phrases are converted into structured query language clauses to generate structured queries.

9. The system according to claim 8, wherein, The user annotates the extracted metadata without knowing the structure of the relational database or the ontology of the relational database.

10. The system according to claim 8, wherein, The extracted metadata is provided in the form of a table, and the metadata includes the table name and one or more column names in the table.

11. The system according to claim 8, wherein, Natural language processing using user input is used to extract semantics to create the pattern annotation file, and the extracted semantics are used to create relationships between the entities in the relational database.

12. The system according to any one of claims 8 to 11, wherein, The instructions, which can be executed by the processor, are further configured to: Receive a natural language question from the user as the natural language query; as well as Based on the results of the structured query, an answer to the received natural language question is generated.

13. A computer program product for creating a semantic model of a relational database for processing natural language queries, the computer program product comprising: Instructions for execution by processing circuitry to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Platform-independent method and system for electronically engaging customers

    US20140143353A1

  • Database access

    US20150058337A1

  • Automated database schema annotation

    US20160371275A1

  • Natural language interface to databases

    US20170083569A1