A method for natural language understanding based on a concept network

CN115859955BActive Publication Date: 2026-10-20HANGZHOU GEWO INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210484567.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-04
Publication Date
2026-10-20
Estimated Expiration
2042-05-04

AI Technical Summary

Benefits of technology

[0174]本发明基于概念网络提出了一种全新的自然语言理解方法,其更大的意义在于全面讲述如何将自然语言转换为机器可以运行的概念定义(DEF),从而能够准确理解篇章/段落、单轮/多轮对话。同时也提供了一种基于GScript语言的GTL模板引擎技术的DEF运行处理方法,该方法将能准确的生成与操纵UI界面、数据、程序设计语言代码或者生成回复DEF。本文所述的方法及系统为机器理解自然语言提供了一种方法论,更是提供了一种全新的解决方案。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115859955B_ABST
    Figure CN115859955B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence, and particularly provides a natural language understanding method based on a concept network.The natural language understanding method described in the present application comprises the following steps: based on the concept network, sequentially performing the following on the natural language: sentence segmentation, concept word segmentation, concept definition (DEF) dependency analysis, and concept definition (DEF) operation; the present application proposes a brand new natural language understanding method based on the concept network, and the greater significance thereof lies in comprehensively describing how to convert the natural language into concept definitions (DEF) that can be operated by machines, so as to accurately understand a chapter / paragraph, a single round / multi-round dialogue; meanwhile, a DEF operation processing method based on a GTL template engine technology of a GScript language is provided, and the method can accurately generate and manipulate a UI interface, data, a program design language code or a reply DEF.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence, and specifically provides a natural language understanding method based on concept networks. Background Technology

[0002] The third wave of artificial intelligence (AI) is sweeping across the industry, with AI finding real-world applications in fields such as speech recognition, machine vision, and data mining. Natural language processing (NLP) technology, as a key area of ​​development, has also seen rapid advancements and widespread adoption. Enabling machines to understand natural language remains one of the most challenging problems in artificial intelligence.

[0003] The theoretical foundation of concept networks can be traced back to the concept subordination theory proposed by American artificial intelligence expert R.C. Shank in 1973. Concept subordination theory (CD theory) is a theory in natural language automatic processing. Shank believed that there is a certain conceptual foundation in the human brain, and the process of language understanding is the process of mapping sentences to the conceptual foundation. Summary of the Invention

[0004] To address the above problems, this invention provides a natural language understanding method based on concept networks.

[0005] The natural language understanding method described in this invention includes the following steps: based on a concept network, the natural language is sequentially processed as follows: sentence segmentation, concept word segmentation, concept definition (DEF) dependency analysis, and concept definition (DEF) operation;

[0006] Characteristics of the natural language understanding process:

[0007] (1) Based on conceptual networks;

[0008] (2) The process is as follows: sentence segmentation, concept word segmentation, concept definition (DEF) dependency analysis, and concept definition (DEF) execution. The purpose is to accurately understand chapters / paragraphs, single-turn / multi-turn dialogues, and even generate and manipulate UI interfaces (i.e., human-computer interaction interfaces), data, programming language code, or generate response DEFs.

[0009] (3) Contextual sessions are used throughout the entire analysis and execution process.

[0010] Specific process:

[0011] (1) Sentence segmentation

[0012] Whether it's a passage / paragraph or a single / multi-turn dialogue, the sentence is the most basic unit of language use; therefore, sentence segmentation is a crucial step. There are two main methods for sentence segmentation: one is based on sentence segmentation rules; the other is based on training / recognizing sentence segmentation symbols. If a natural language statement is clearly a single sentence, this sentence segmentation step can be skipped.

[0013] (2) Segmenting conceptual terms

[0014] The segmentation of concept words mainly consists of three stages: segmentation words, part-of-speech tagging, and concept recognition.

[0015] A. Segmentation words

[0016] In Latin-based languages, such as English, spaces serve as natural separators between words. Chinese, however, uses characters as the basic unit of writing, with no obvious markers between words, and words are more semantically expressive than individual characters. Therefore, Chinese word segmentation is fundamental and crucial for Chinese information processing.

[0017] There are already many methods for Chinese word segmentation, such as word segmentation methods based on lexicons (or dictionaries), including forward minimum matching, backward minimum matching, forward maximum matching, backward maximum matching, and minimum segmentation; and statistical word segmentation methods based on Hidden Markov Models (HMM), Big Grammar, Conditional Random Fields (CRF), and seq2seq using bidirectional LSTM. However, technical challenges in word segmentation, such as ambiguity recognition and new word recognition, still exist.

[0018] This article describes a word segmentation method that combines several approaches, including character-based sequence labeling models, word-based n-gram models, and lexicon-based methods. The word segmentation process is as follows:

[0019] I dynamically add words that directly or indirectly correspond to concepts in the concept network to the dictionary. If a word contains components or is a compound word, the components are ignored, the word is extracted, and then added to the dictionary.

[0020] II. Sentence segmentation is performed using word-based sequence labeling models such as Maximum Entropy Hidden Markov Model, Conditional Random Field (CRF), and Bidirectional LSTM seq2seq. This segmentation result can be used as the final segmentation result.

[0021] III. A dictionary-based full segmentation method for sentence word segmentation;

[0022] IV merges the words segmented by the two methods mentioned above, and during the merging process, only one of the words that are in the same position and are identical is retained.

[0023] V then uses algorithms such as bigram, shortest distance (minimum number of words), reverse maximum matching, forward maximum matching, reverse minimum matching, and forward minimum matching to eliminate ambiguity and obtain the final word segmentation result.

[0024] Different algorithms may produce different word segmentation results. Therefore, we can assign priorities to these algorithms and then iterate through them in descending order of priority. The process is as follows:

[0025] First, the highest priority algorithm is used to segment the data into words;

[0026] ii. Then, perform subsequent semantic understanding processing on the segmented result. If the processing is successful, the process ends; otherwise, select a higher-priority algorithm from the algorithms that have not been traversed and segment the result again. If the segmented result has already been processed, select the next higher-priority algorithm; otherwise, repeat step ii.

[0027] iii. Continue until semantic understanding processing is successful, or the entire algorithm has been traversed;

[0028] B. Part-of-speech tagging

[0029] Part-of-speech (POS) describes the function of a word in a context, and POS tagging is the process of identifying the POS of these words to determine their function in the context. Generally, POS tagging is based on word segmentation, assigning a correct POS to each word in the segmentation result, that is, determining whether each word is a noun, verb, adjective, or other part of speech.

[0030] In a concept network, words that directly or indirectly correspond to concepts can be assigned part-of-speech tags. However, if there are no words with specific part-of-speech tags, the part-of-speech tagging step can be skipped. Otherwise, part-of-speech tagging plays a crucial role in the subsequent concept recognition process.

[0031] There are many part-of-speech tagging methods, most of which are based on statistical models, such as Hidden Markov Models (HMMs).

[0032] C. Concept Identification

[0033] The concept network identifies a concept for each word in the segmentation result. A word can correspond to one or more word concepts or no word concept. Words that are not identified with any concept are marked as unknown word concepts. Therefore, this segmentation result can be called a concept word sequence.

[0034] For word concepts, I identify them by matching words. If it is a word with components or a compound word, the components are ignored and the word is extracted before matching. Usually, the positions of the associated words in the sentence are also marked for the identified compound word concepts.

[0035] II. For wordless concepts, they are identified through their concept recognizer. The identified concepts typically also include a transformer that implements the concept definition (DEF).

[0036] (3) Concept Definition (DEF) Dependency Analysis

[0037] Concept definition (DEF) dependency parsing is mainly implemented using the following methods:

[0038] (1) Dependency parsing based on ①Arc-Standard action transfer and ②classifier, while performing ③definition of concept (DEF) analysis during action transfer in the analysis process;

[0039] (2) Model training from concept word sequences to dependency structure trees is performed based on pre-trained language representation models such as BERT. This model can output a dependency structure tree from concept word sequences, and then perform ③ concept definition (DEF) analysis using the output dependency structure tree.

[0040] ①Arc-Standard based transfer action

[0041] Transfer-based dependency parsing uses a series of states from initial to final to represent the parsing process. A state consists of a stack, a buffer, and some parsed dependency arcs. The stack stores parsed words, and the buffer represents words to be parsed.

[0042] Initially, the stack contains only a root node, and the cache stores all the words in the sentence. A state transforms into a new state through a transition action. There are three transition actions: shift, left-reduce, and right-reduce. The shift action pushes the first word in the cache onto the stack; the left-reduce action creates a left-pointing dependency arc between the top two words of the stack and simultaneously removes the second word from the stack.

[0043] Right reduction creates a right-pointing dependency arc between the two words at the top of the stack, while simultaneously removing the top word from the stack.

[0044] After a series of transfer actions, the system eventually reaches a termination state, where the stack contains only one root node and the cache is empty. At this point, a complete dependency tree is formed, and the dependency parsing process for a sentence is completed.

[0045] ② Based on classifier

[0046] Transfer-based dependency parsing also requires a classifier, whose input is a state and whose output is the most likely action in that state.

[0047] Traditional classifiers require manually defining a series of features and various combinations of feature templates, which is extremely cumbersome, requires extensive knowledge of syntactic analysis, and has low accuracy.

[0048] Neural network-based classifiers are completely different. They only require some scattered raw features to be directly fed into the neural network model. As for how the features are combined, it is no longer determined by manually written feature templates, but is automatically extracted by the hidden layers of the neural network model.

[0049] ③ Concept Definition (DEF) Analysis

[0050] I. Definition of Concept (DEF)

[0051] A concept definition (DEF) refers to the specific definition or implementation of a concept, and can also be called a concept instance.

[0052] Concept definitions (DEFs) are defined by DEF converters, which are configured and defined within the concept network. A DEF converter generates one DEF based on one concept, and multiple DEFs are generated for multiple concepts.

[0053] DEF can be divided into two categories: simple DEF and compound DEF. Simple DEF includes three types: general DEF, DEF with appended terms, and DEF with appended terms and limitations. Compound DEF mainly includes two types: conjunction and introduction DEF, and subject-verb-object DEF.

[0054] iSimpleDEF

[0055] ●Generally, DEF is the most basic one, without any additional or limited DEFs. The generated DEF may not support merging with any other DEFs.

[0056] ● A DEF with appendices refers to a DEF with a series of left appendices, right appendices, and punctuation appendices. The generated DEF should support merging other DEFs and be marked as appendices when merging.

[0057] ● A DEF with appendices and limitations refers to a DEF that, in addition to the appendices mentioned above, also has a series of limitations. The generated DEF should also support merging with other DEFs, and the merge should be marked as appendices or limitations.

[0058] ii. Subject, Verb, Object, DEF

[0059] A subject-verb-object (DEF) structure contains a subject, action, object, pivot or object complement, and a series of supplementary DEFs. The generated DEF typically expresses an action, behavior, or method. This DEF should support the merging of the subject DEF, object DEF, pivot or object complement DEF, and a series of supplementary DEFs.

[0060] iii. Connections and referencing (DEF)

[0061] The join and referencing DEFs contain the start DEF of the join or referencing, and a series of end DEFs of the join or referencing, which are processed according to their different functions.

[0062] ● Table joins

[0063] The expression connecting two DEFs typically generates a grouped DEF. This DEF should support merging DEFs that start with a series of ending DEFs, with a grouping type between the start and each ending. This grouping type depends on the semantics.

[0064] ●Table Introduction

[0065] The expression introduces the preceding or following DEF. The beginning DEF is often a preposition used to introduce the part, while the ending DEF is the headword of the introduced part.

[0066] The generated DEF is the same DEF generated from the starting DEF. This DEF should support merging a series of ending DEFs into a single DEF, with a preamble type between it and each ending DEF. This preamble type also depends on the semantics.

[0067] The function of a DEF can usually be determined by the concepts used for connection and referencing. If the starting DEF is one of these concepts, it is considered a table referencing; otherwise, it is a table join. If it is a table referencing, the semantics of the concept is the referencing type. If it is a table join, it is further determined whether the concepts dependent on the starting or ending DEF exist; if so, the semantics of the concept is the composite type.

[0068] Conceptual definitions (DEFs) have both basic and dynamic necessary and optional dependencies. If the language expression is incomplete, its meaning cannot be understood. Similarly, some DEFs require the existence of other DEFs that depend on them; these are called necessary dependencies. Conversely, if the intended meaning can be understood without these dependent DEFs, then these are called optional dependencies.

[0069] There are two main methods for defining the basic necessary and optional dependencies of DEF:

[0070] i is a word with DEF that corresponds directly or indirectly to the concept. The DEF signifies the necessary condition for defining the DEF of the concept.

[0071] If this DEF part is missing, the semantics will be incomplete;

[0072] ii. Generate DEFs with necessary and optional dependencies using a DEF converter;

[0073] There are two main methods for defining the necessary and optional dependencies of a DEF dynamic:

[0074] i generates DEF files that can define these conditions during the merge process using a DEF converter. Alternatively, the definitions during the merge process can be implemented through configuration and other techniques.

[0075] ii. Concept Definition (DEF) determines whether necessary DEF dependencies are missing during runtime.

[0076] II DEF Analysis Process

[0077] The analysis process of concept definitions (DEF) is mainly the process of merging DEFs. The analysis process mainly includes concept connectivity analysis, dependency analysis, and context analysis.

[0078] In a dependency structure tree, the dependency relationships between child nodes and parent nodes can be handled using the same approach as transitions. A child node on the left depends on its parent node on the right, which can be considered a left-reduce; a child node on the right depends on its parent node on the left, which can be considered a right-reduce.

[0079] Concept Definition (DEF) analysis is performed concurrently with action transitions. A state contains a DEF stack (CompositionStack). The DEF stack stores the defined DEFs. After a series of transition actions, the final terminating state will have only one DEF in its DEF stack. The process is as follows: i. During a shift action, the first word in the cache is pushed onto the stack, and a general DEF is generated for that word and pushed onto the DEF stack; ii. During a left-reduce action, the second DEF at the top of the DEF stack...

[0080] The DEF at the top of the DEF stack depends on the DEF at the top and is then pushed off the stack. When the transition action is a right-reduce, the DEF at the top of the DEF stack depends on the second DEF at the top of the DEF stack and is then pushed off the stack.

[0081] Dependencies between DEFs depend on the dependency relationship. During dependency parsing, a DEF can be converted to other types of DEFs. The validity of a DEF dependency can be determined during DEF parsing. If a dependency is deemed invalid, it means the current transfer action is invalid, causing the current parsing thread (including the original thread) to be prematurely terminated.

[0082] DEF is generated based on the word when the transition action is a shift, therefore:

[0083] When a word corresponds to one or more word concepts, one or more DEFs are defined based on the DEF converter of the word concepts;

[0084] ii. When a word corresponds to one or more wordless concepts, the DEF converters contained in the concepts identified by its concept recognizer define one or more

[0085] DEF;

[0086] iii When a word is tagged as an unknown word concept, the DEF does not exist and will be ignored during the analysis.

[0087] It is evident that a DEF may not exist, there may be only one, or there may be multiple DEFs. Multiple DEFs express the ambiguity of the language, while the absence of a DEF means that the current statement cannot be understood.

[0088] During the analysis process, DEF is not static. It may change from one to zero (i.e., it does not exist), or it may change from multiple to one or even zero. This depends on the dependency analysis under the context of the session.

[0089] (4) Concept Definition (DEF) Operation

[0090] A concept definition (DEF) is a specific definition or implementation of a concept. It is an object generated during program execution and can therefore be directly processed.

[0091] Prerequisites for DEF to run:

[0092] A. is valid, and all its necessary dependencies are met;

[0093] B. The execution method within the context of the running session has been implemented;

[0094] This article describes a novel processing method based on DEF execution, which can accurately generate and manipulate UI interfaces, data, programming language code, or generate DEF responses. This method is based on the GTL template engine technology of the GScript language. This technology can parse or compile GTL text files to generate GScript language code, and then the GScript engine calls different instruction function libraries according to the GTL text file type to parse or compile and execute the code to generate other programming languages. These generated programming languages ​​can then be executed by their corresponding executors or tools; for example, HTML can be executed by a browser.

[0095] The GTL template engine executes GTL text files of different formats under different running modes. The GTL template engine supports the `<%! %>` tag syntax. Using this tag syntax, other GTL text files can be imported, even nested imports, thus solving a key real-world problem: "The existence of multiple running modes and sub-modes significantly increases the workload of developing GTL text files, much of which is repetitive," thereby greatly reducing the development workload.

[0096] The GTL template engine selects a GTL text file to execute the following method:

[0097] a. If a GTL text file has already been specified for DEF, then that file will be selected for execution;

[0098] b. Otherwise, proceed as follows:

[0099] b.1. DEF expressing actions, behaviors, or methods

[0100] Select the GTL text file to execute based on the concept ID of the action.

[0101] b.2. Grouping (DEF)

[0102] The members of the combination are iterated and processed, and then the processing results are merged according to the current running mode and combination type.

[0103] b.3. Table-referenced DEF

[0104] This DEF usually depends on other DEFs, so it is ignored and not processed. However, it needs to be pushed into the context analysis session queue and marked as a DEF to be merged.

[0105] b.4. Other DEF

[0106] If the current DEF belongs to the concept ID=object, it defaults to the action of a table query (concept ID=query), that is, it is converted into a DEF that expresses an action, behavior or method before processing.

[0107] c. If the corresponding GTL text file cannot be found for execution, it means that the code cannot be processed, indicating that the statement is uncomprehensible.

[0108] The GTL template engine allows externally passed cached data, enabling DEF files to be passed as cached data during execution. This allows for the processing of dependent (i.e. merged) DEF files during execution.

[0109] Context Session

[0110] The context session runs throughout the entire analysis and execution process. Both the analysis session and the execution session are generated from the context session. The analysis session operates during the analysis phase. The execution session depends on the analysis session and operates during the execution phase. When DEF runs successfully, before the analysis session and the execution session end, the data contained therein (such as events, objects, and relationships between objects in the execution session) is merged into the context session to facilitate analysis and execution in the following text or the next round of dialogue.

[0111] This invention is based on the following definition of a conceptual network:

[0112] A conceptual network for artificial intelligence, a system for defining concepts and semantic relationships between concepts, including concepts and concept connections, wherein a concept can form one or more semantic relationships with multiple concepts, and the semantic relationships between concepts can be multi-layered.

[0113] (1) Definition of concept network: concepts and concept connections.

[0114] Each concept has a unique ID. The concept ID can be in any form, such as a string, number, or word vector. Concepts are divided into three categories: word concepts (WORD), non-word concepts (NON_WORD), and unknown concepts (UNKNOWN).

[0115] The concept of a word includes general word concepts, word concepts with relational components, compound word concepts, and word set concepts. A key characteristic of a word concept is the existence of natural language words that directly correspond to it, as well as the existence of a converter that implements the concept's definition (DEF).

[0116] Wordless concepts include wordless concepts without ontology concepts and wordless concepts with ontology concepts. The characteristic of wordless concepts is that there is no natural language word that directly corresponds to this concept, but there is usually a concept recognizer that allows natural language words to indirectly correspond to the concept.

[0117] Unknown concepts include unknown word concepts and unknown word set concepts. A key characteristic of unknown concepts is that a definition-definition (DEF) cannot be generated for them, and they will be ignored during natural language processing.

[0118] Conceptual connections, or semantic relationship chains between concepts, are used to describe multi-level semantic relationships between concepts. Their characteristics are:

[0119] A concept can form one or more semantic relationships with multiple concepts, and the semantic relationships between concepts can be multi-layered. Of course, not all concepts can form semantic relationships with each other.

[0120] b / Some conceptual connections are not inherent or generated during the construction of the conceptual network, but are gradually formed during the understanding of natural language.

[0121] c / Existence characteristics. These characteristics represent the affirmation, negation, possibility, scope, probability, degree, frequency, time, tone, etc., reflecting the relationship in conceptual connections.

[0122] In addition, the present invention also provides a method for generating conceptual networks.

[0123] Methods for generating conceptual networks include: basic definition, generation, extended definition, and dynamic formation.

[0124] The basic definition defines the fundamental concepts and conceptual connections. In terms of implementation techniques, XML and JSO format configuration files are primarily used to define these concepts and connections, and then the concepts and connections are generated by parsing these configuration files.

[0125] The generation method transforms data structures, programming languages, semantic networks / dictionaries / knowledge bases, etc., into concepts and concept connections. The main program that implements this transformation and generation is the concept generation engine.

[0126] Data Structures

[0127] A. It includes two formats: row-column and key-value pair. Row-column format is often used in Excel, relational databases, etc., to represent and store data. It is a two-dimensional data format with rows and columns and a predefined data model. Key-value pair format is often used in non-relational databases to store data. It does not require a predefined structure.

[0128] B. Generation method process:

[0129] ① The concept generation engine treats each table as a separate concept, with the table name or the word referring to the table serving as the term for that concept. Simultaneously, the concept ID = object in the base definition and the concepts generated from these tables form a SPECIES relationship.

[0130] ② The engine treats each field in the table as a separate concept, with the field name or the word referring to that field serving as the term for that concept. Furthermore, the concepts generated from the parent table and the concepts generated from these fields form an ATTRIBUTE attribute relationship.

[0131] ③ The engine can treat each field type as a separate concept. These concepts are usually wordless, and their respective concept recognizers identify whether a word matches the concept. Simultaneously, the concepts generated by fields with corresponding field types form a VALUE relationship with the concepts generated by these field types.

[0132] ④ Of course, for some fields, their values ​​have certain constraints or special characteristics. For example, dictionary data can have a custom concept of no words.

[0133] ⑤ In addition, some fields form foreign key relationships with other tables. In this case, the concepts generated by these field types and the concepts generated by the associated main table form a VALUE value relationship.

[0134] C. Implemented through object data management technology. Object data management technology uses XML-formatted object template files to define object structures and establish mapping relationships with database tables. The concept generation engine can generate concepts and concept chains based on the object template XML.

[0135] Next. Generation method process:

[0136] ① The concept generation engine can treat each object template (or object) as a concept, with the object's name or the word referring to the object serving as the concept's term. Simultaneously, the base definition of the concept ID = object and the concepts generated from these objects form a SPECIES relationship.

[0137] ② The engine can treat each attribute defined in the template as a separate concept, with the field name of that attribute or the word referring to that attribute serving as the term for that concept. Simultaneously, the concepts generated from the object to which the engine belongs, and the concepts generated from these attributes, form an ATTRIBUTE attribute relationship.

[0138] ③ The engine can treat each attribute data type as a separate concept. These concepts are usually wordless, and their respective concept recognizers identify whether a word matches the concept. Simultaneously, the concepts generated by attributes with corresponding data types form a VALUE relationship with the concepts generated by these attribute types. Of course, custom concepts for attribute values ​​can also be configured. For object-type attributes, the attribute is associated with the object specified in the type, forming a VALUE relationship. For composite-type attributes, the attribute forms a PART relationship with the members (sub-attributes) specified in the type. For structure-type attributes, the attribute forms an ATTRIBUTE relationship with the members (sub-attributes) specified in the type.

[0139] Programming Languages

[0140] A. The essence of a programming language is its syntax rules. The generation method of a concept generation engine lies in analyzing and transforming these syntax rules to generate concepts and concept connections.

[0141] B. GScript, a formatted scripting language, is also a programming language. GScript has a parser that can convert code into a syntax tree and vice versa. A key feature of GScript is its ability to call different instruction libraries to parse or compile code into other programming languages. Current versions of GScript support generating the following programming languages: Java, JavaScript, HTML, CSS, XML, JSON, etc.

[0142] The concept generation engine uses GScript syntax rules, Java syntax rules, and the syntax rules of the target programming language to generate text.

[0143] Generate concepts and concept connections. Generation method process:

[0144] ① The GScript language syntax consists of three parts: instruction functions, operators, and operation functions. The preferred configuration for the concept generation engine is to define a series of concepts and concept connections using the instruction functions, operators, and operation functions of the GScript language syntax.

[0145] The configuration method can use techniques consistent with the basic definition.

[0146] ② Java language syntax includes classes, attributes, methods, data types, enumerations, annotations, etc. The concept generation engine preferentially uses configuration and Java annotations to configure and define concepts and concept connections. Configuration methods can use techniques consistent with the basic definitions. Java annotations, on the other hand, utilize Java's language features, allowing the definition of concepts and concept connections to be performed during code development.

[0147] The concept generation engine can treat each class as a separate concept, using the class name or a word referring to the class as the term for that concept. Multiple classes can refer to the same concept; for example, an interface and its implementing classes often represent the same concept.

[0148] At the same time, the basic definition of the concept ID=object and the concepts generated from these classes constitute a SPECIES relationship.

[0149] II. Although Java enumerations are classes, they require different treatment. They must define two concepts. One concept is a wordless concept with an ontology and is the value of the other concept, while the other concept is the ontology of that wordless concept.

[0150] Engine III handles each field of a class differently depending on its reference status:

[0151] If a field is configured or annotated to define a concept, then the concept of this class constitutes the concept of that field.

[0152] ATTRIBUTE attribute relationships;

[0153] ii. If the data type of the field points to a class (or Java enumeration), and the component type of that class is...

[0154] If (Component Type) is a class with a defined concept, then the concept of this class and the concept of the data type of this field form an ATTRIBUTE attribute relationship;

[0155] iii Otherwise, the engine defines a concept for the field, using the field name or the word that refers to the field as the word of the concept, and then this concept and the concept generated by the field form an ATTRIBUTE attribute relationship.

[0156] The IV engine also needs to handle different data types separately:

[0157] ①Class: Basic data types and their corresponding object types.

[0158] ②Classes: Collection types, mainly including arrays and classes that implement java.lang.Collection.

[0159] ③ Classes: Other types, including java.lang.Object, java.lang.Class, enumerations, etc.

[0160] V-engine defines class fields: If a field is not configured or has no conceptual connection defined by annotations, then:

[0161] If a field is a fixed constant, a concept is defined, and the constant value or the word referring to that constant value is used as the word of the concept. Then, the concept of the field and the generated concept form a VALUE value relationship.

[0162] ii. If the concept ID of a field is inconsistent with the concept ID of its data type, a VALUE value relationship is formed between the two.

[0163] The VI engine defines class methods: if the method is not configured or has no annotations defining concepts and concept connections,

[0164] So:

[0165] If the method names conform to the JavaBean specification (i.e., getter and setter methods), then no definition is needed. This is because the basic definition often defines the concepts ID=get, ID=set, and ID=object to form a subject-predicate relationship.

[0166] ii. Otherwise, define a concept, the method name, or the word referring to the method as the word of the concept, and then the concept of this class and the generated concept form an SV subject-predicate relation.

[0167] The VII engine defines class inheritance (extends): if the concept IDs of the parent class and the child class are inconsistent, a SPECIES relationship is formed between the concepts of the parent class and the child class.

[0168] ③ The concepts of the target programming language and the generation of conceptual connections are consistent with the corresponding chapter of GScript "Instruction Functions - Extended Instructions".

[0169] Semantic networks / dictionaries / knowledge bases

[0170] Conceptual networks are also a type of semantic network, and therefore, technically, they can be converted to and from existing mainstream semantic networks / dictionaries / knowledge bases.

[0171] The extended definition further expands the defined concepts and conceptual connections. The same technical means as the basic definition can be used for implementation.

[0172] Dynamically forming concepts and concept connections. For example, dynamically forming connections between concepts during natural language understanding, or manually adding words to concepts and increasing concept connections.

[0173] The use of word vectors. Words that directly or indirectly correspond to a concept can be replaced using word vectors. Concept IDs can be directly represented using word vectors.

[0174] This invention proposes a novel natural language understanding method based on concept networks. Its greater significance lies in comprehensively explaining how to convert natural language into machine-executable concept definitions (DEFs), thereby enabling accurate understanding of passages / paragraphs and single / multi-turn dialogues. It also provides a DEF processing method based on the GTL template engine technology of the GScript language. This method can accurately generate and manipulate UI interfaces, data, programming language code, or generate response DEFs. The methods and systems described in this paper provide a methodology for machine understanding of natural language, and more importantly, a completely new solution. Attached Figure Description

[0175] Figure 1 Process diagram of natural language understanding method based on concept network

[0176] Figure 2 Word segmentation diagram

[0177] Figure 3The statement "Create a variable named 'a'" outputs the dependency structure CoNLL or dependency tree in the Standard NLP Chinese model.

[0178] Figure 4 The statement "Create a variable named 'a'" outputs the dependency structure CoNLL or dependency tree in the SyntaxNet Chinese model.

[0179] Figure 5 The statement "Create a variable named 'a'" is from the Harbin Institute of Technology LTP Language Cloud. It outputs the dependency structure CoNLL or dependency tree.

[0180] Figure 6 The statement "List news items published yesterday" outputs the dependency structure CoNLL or dependency tree in the Standard NLP Chinese model.

[0181] Figure 7 The statement "List news items published yesterday" outputs the dependency structure CoNLL or dependency tree in the SyntaxNet Chinese model.

[0182] Figure 8 The statement "List news items published yesterday" is from the Harbin Institute of Technology LTP Language Cloud. It outputs dependency structures (CoNLL or dependency tree).

[0183] Figure 9 The statement "Book a flight from Nanjing to Hangzhou after 10 PM tomorrow" is output by the Standard NLP Chinese model, which defines the dependency structure (CoNLL) or dependency tree.

[0184] Figure 10 The statement "Book a flight from Nanjing to Hangzhou after 10 PM tomorrow" outputs the dependency structure CoNLL or dependency tree in the SyntaxNet Chinese model.

[0185] Figure 11 The statement "Book a flight from Nanjing to Hangzhou after 10 PM tomorrow" is from Harbin Institute of Technology's LTP Language Cloud, which outputs a dependency structure (CoNLL or dependency tree).

[0186] Figure 12 Conceptual connection for the statement "Create a variable named 'a'"

[0187] Figure 13 The Chinese statement dependency parsing results for the statement "Create a variable named 'a'"

[0188] Figure 14 Example of DEF necessary and optional dependency configuration and definition

[0189] Figure 15 Example of selecting a concept between a dependency word and its headword

[0190] Figure 16 Examples of handling dependencies where there is a non-overlapping concept between the dependency word and its headword.

[0191] Figure 17 The DEF dependency parsing results for the statement "Create a variable named 'a'"

[0192] Figure 18 Concept definitions (DEF) require different processing methods in different application scenarios.

[0193] Figure 19 DEF analysis and execution conclusions of the statements "create a variable named 'a'" and "create two variables named 'a'".

[0194] Figure 20 A DEF execution process diagram implemented using GTL template engine technology based on the GScript language.

[0195] Figure 21 The output of the GTL executable file in the "List Departments" statement development mode.

[0196] Figure 22 The statement "View the department whose name is the management group" returns the result of running the GTL executable in development mode.

[0197] Figure 23 The statement "Create a variable named 'a' with the value 'b'" will produce the following result when the GTL executable is run in development mode. Detailed Implementation

[0198] The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings:

[0199] like Figure 1 Generally speaking, the natural language understanding of this invention has the following characteristics:

[0200] ■ Based on conceptual networks;

[0201] ■Through multiple stages including sentence segmentation, concept word segmentation, concept definition (DEF) dependency analysis, and concept definition (DEF) execution, it can accurately understand texts / paragraphs, single-turn / multi-turn dialogues, and generate and manipulate UI interfaces (i.e., human-computer interaction interfaces), data, programming language code, and generate response DEFs. The response DEFs are generated based on the intended message and can be generated using the natural language generation techniques described in this paper.

[0202] ■Contextual sessions are used throughout the entire analysis and execution process;

[0203] A concept network is a system that defines concepts and semantic relationships between them. Essentially a semantic network, it provides the semantic foundation for natural language understanding and generation as described in this paper. In the following text, "natural language word" (or "word") refers broadly to characters, words, and phrases in natural language.

[0204] 1.1. Definition

[0205] A concept network consists of two parts: the concepts themselves and the connections between them.

[0206] 1.1.1. Concept

[0207] Each concept has a unique ID to identify its uniqueness within the concept network. The concept ID can be in any form, such as a string, number, or word vector. Concepts are divided into three categories: word concepts (WORD), non-word concepts (NON_WORD), and unknown concepts (UNKNOWN).

[0208] 1.1.1.1. Word Concept

[0209] This indicates the existence of a natural language term that directly corresponds to this concept, as well as a converter that implements the concept's definition DEF. This concept is also called a direct concept.

[0210] A concept definition (DEF) refers to the specific definition or implementation of a concept, and can also be called a concept instance.

[0211] A natural language word can correspond to one or more concepts. Some words have multiple parts of speech, so it is also possible to assign a word with a specific part of speech to one or more concepts.

[0212] √ For example, the concept ID = unit, which can be represented by the word "unit". In the statement "What is the unit of quantity?", "unit" refers to this concept.

[0213] The word concepts in the above examples do not contain any relational components and are called general word concepts.

[0214] The concept of words also includes:

[0215] ◆Word concepts containing relational elements

[0216] These types of concepts have relational components, meaning that the two sides or one side of the word serve as the relational components of the concept.

[0217] √ For example, the concept ID = selt can contain words with components such as "{0} or {1}", and the sentence "apple or watermelon". The "apple" and "watermelon" on both sides of "or" are the relational components of the concept, indicating a choice.

[0218] Furthermore, semantic relationships expressed in natural language can be indirectly achieved through relational components. Examples are as follows:

[0219]

[0220]

[0221] ◆ Concept of compound words

[0222] Such concepts are composed of multiple words, or at least the words are related to the concept.

[0223] √ For example, the concept ID = eban can be combined with the compound words "rather than {1} than {2}", and the sentence "I would rather die of exhaustion than trouble you". The right side of "rather" and the right side of "not" are both relational components of the concept, indicating selection or choice, taking first and then discarding, or discarding first and then taking.

[0224] ◆ Concept of word set

[0225] This type of concept indicates that there are multiple words, words with components, or compound words that correspond to the concept.

[0226] √ For example, the concept ID = caru can have meanings such as "because {1} therefore {2}", "the reason {2} is because {1}", "since {1} then {2}", "because {1}", "because {1}", etc.

[0227] Because {1}", "for {1}", "for {1}", "for {1}", "therefore {2}", "so {2}", "the reason {2}", "for {1}"

[0228] The terms "for the sake of" and "so that {1}" correspond to causality, where the cause or purpose is stated first, and the result is explained later; for example, the concept ID = create can have "definition",

[0229] The words "create", "new", "establish", "build", "build", "construct", "initial", "build", "build", and "create" correspond to each other and indicate the action of creation.

[0230] 1.1.1.2. Concept of No Word

[0231] This indicates that there is no direct natural language word corresponding to this concept, but there is usually a concept recognizer that allows natural language words to be indirectly associated with the concept. This concept is also called an indirect concept.

[0232] √ For example, the concept ID = @time is used to refer to time and date, such as the words "20150712", "tomorrow", "a few days ago", or "a certain day". Concept recognition is required.

[0233] The instrument is used to identify whether a word is a time-related concept.

[0234] Some wordless concepts express a certain class of concepts; this class of concepts is called ontological concepts. Therefore, wordless concepts are divided into wordless concepts without ontological concepts and wordless concepts with ontological concepts. For example:

[0235] ◆Wordless concepts with ontological connotations

[0236] These types of concepts are usually used to describe a class of concepts, and they have specific word concepts that correspond to them.

[0237] √ For example, concept ID = *action, used to describe the concept relationship role—action, the ontology concept of this concept is word concept ID = &action, and the word concept ID = &action can correspond to the words "action", "behavior", or "operation"; for example, concept ID = *attribute, used to describe the concept relationship role—attribute, the ontology concept of this concept is word concept ID = &attribute, and the word concept ID = &attribute can correspond to the word "attribute"; for example, concept ID = *part, used to describe the concept relationship role—part, the ontology concept of this concept is word concept ID = &part, and the word concept ID = &part can correspond to the word "part"; for example, concept ID = *value, used to describe the concept... Relationship Roles – Values: The ontology of this concept is the word concept ID = &value, and the word corresponding to the word concept ID = &value can be "value". For example, concept ID = @string is used to describe words like strings, and the ontology of this concept is the word concept ID = string, and the word corresponding to the word concept ID = string can be "string". For example, concept ID = @number is used to describe words like numbers, and the ontology of this concept is the word concept ID = number, and the word corresponding to the word concept ID = number can be "number". For example, concept ID = @time is used to describe words like time, and the ontology of this concept is the word concept ID = time, and the word corresponding to the word concept ID = time can be "time" or "date".

[0238] 1.1.1.3. Unknown Concept

[0239] This indicates that a concept definition (DEF) cannot be generated for this concept and will be ignored during natural language processing.

[0240] These types of unknown concepts also include:

[0241] ◆Unknown word concept

[0242] These types of concepts have a single natural language word corresponding to them.

[0243] ◆ Concept of Unknown Word Set

[0244] There are multiple natural language terms that correspond to this type of concept.

[0245] 1.1.2. Conceptual Connections

[0246] 1.1.2.1. Basic

[0247] This refers to the semantic relationship chain between concepts, used to describe multi-level semantic relationships between concepts. Examples of such semantic relationships include:

[0248] ■Species

[0249] The genus-species relationship also includes hypernym / hypernym relationships. A word with stronger specificity is called a hyponym of a word with stronger generality, and a word with stronger generality is called a hypernym of a word with stronger specificity. This relationship also exists between actions.

[0250] √ For example, thing – event | object; object – news | user | department; red – vermilion | carmine | crimson.

[0251] ■ Parts

[0252] The relationship between the whole and its components.

[0253] √ For example, quantity—number | unit; time—year | month | day | hour | minute | second | millisecond; human—head | body.

[0254] ■Attribute

[0255] Relationships such as host-attribute, host-possession, host-characteristic, material-finished product, etc. The host also includes actions.

[0256] √ For example, variable var - name | value; news - title | content | attachments | author; personality - good or bad; format - pattern.

[0257] ■Value

[0258] The relationship between attribute-value and entity-value.

[0259] √ For example, quantity — @quantity; title — @string; color — @color.

[0260] ■Subject-Verb (SV)

[0261] Source of action - Relationship of actions.

[0262] √ For example, "me" means create, modify, delete, query, or publish; for example, "@number" means add or subtract.

[0263] ■ Verb-Object (VO)

[0264] The relationship between action and action target.

[0265] √ For example, create—var; publish—news.

[0266] ■Related(R)

[0267] Correlation, it has Synonyms , Antonyms , Lower righteousness , incompatible , related Five types of sub-relationships. Among them, Lower righteousness The semantics of one concept lies within the semantics of another concept. incompatible To exclude the semantics of one concept from the semantics of another concept, related This refers to two related concepts, but the specific relationship between them is unclear.

[0268] √ For example, cold — hot; good — bad.

[0269] A concept can form one or more inherent semantic relationships with multiple concepts, and the semantic relationships between concepts can be multi-layered.

[0270] 1.1.2.2. Dynamic Formation

[0271] A concept can gradually form new conceptual connections with multiple concepts during the natural language understanding process.

[0272] √ For example, the statement "I have a bag" expresses that an ATTRIBUTE connection has been formed between me (me) and the bag (bag). However, before stating this statement, this connection between me (me) and the bag (bag) may not have been formed yet.

[0273] 1.1.2.3. Features

[0274] This indicates that the connection between concepts reflects the relationship. affim , negative , possible , scope , probability , degree , frequency , time , tone wait.

[0275] √ For example, the statement "I don't have a bag" expresses an ATTRIBUTE connection between "me" and "bag," but the characteristic of this connection is... negative For example, the statement "I may not have a bag" expresses connection features in addition to... negative In addition possible For example, the statement "I'm 80% sure I don't have a bag" expresses connection features other than... negative , possible In addition probability .

[0276] 1.2. Construction Methods

[0277] The construction of conceptual networks can be achieved through several aspects, including basic definition, generation, extended definition, and dynamic formation.

[0278] 1.2.1. Basic Definitions

[0279] Define the basic concepts and their connections. The primary technical approach is to use XML or JSON format configuration files to define these concepts and connections, and then generate the concepts and connections by parsing these configuration files. However, the use of other configuration file formats is not excluded.

[0280] √ For example, concept configuration files concepts / base1.json and concepts / action1.json, and concept connection configuration files connectivities / base1.json and connectivities / action1.json.

[0281] 1.2.2. Generation

[0282] The concept generation engine transforms data structures, programming languages, semantic networks / dictionaries / knowledge bases, etc., into concepts and concept connections. The main program that implements this transformation and generation is the concept generation engine.

[0283] 1.2.2.1. Data Structure

[0284] ■ Structured Data

[0285] Structured data, in row-column format, refers to data that can be represented and stored using databases such as Excel and relational databases. It is presented in a two-dimensional format with rows and columns and a predefined data model. In the definition of structured data storage, tables are used to represent the basic units for processing data and building Excel, relational databases, and applications. The "columns" of a table are often called "fields." Each field consists of several data items of the same data type, divided according to certain boundaries. For example, in a "contact list" database, attributes such as "name" and "phone number" are common to all rows in the table, so these columns are called "name" fields and "phone number" fields. The data stored at the intersection of rows and columns in a table is called a "value," which is the most basic storage unit. The field type defines the data type of the values ​​that can be stored.

[0286] √ For example, Excel field types (defined in cell format) include: number, currency, date, time, text, etc.; Microsoft Access field types include: text, byte, integer, long, single, double, date / time, etc.; MySQL field types include: CHAR, VARCHAR, TINYTEXT, TEXT, MEDIUMTEXT, INT, BIGINT, FLOAT, DOUBLE, DATE, DATETIME, etc.

[0287] In relational databases, defining a primary key for a table means that each record in the table can be uniquely represented by that key. A foreign key, on the other hand, represents a relationship between two relations. The table that uses a foreign key from another relation as its primary key is called the parent table, and tables with that foreign key are called child tables of the parent table.

[0288] ● The relational model refers to a two-dimensional table model, and a relational database is a data organization composed of two-dimensional tables and the relationships between them. Commonly used concepts in the relational model include: Relation – which can be understood as a two-dimensional table, each relation has a relation name, i.e., the table name; Tuple – which can be understood as a row in a two-dimensional table, often called a record in the database; Attribute – which can be understood as a column in a two-dimensional table, often called a field in the database; Domain – the range of values ​​an attribute can take, i.e., the value restrictions of a column in the database; Key – a set of attributes that uniquely identify a tuple, often called the primary key in the database, composed of one or more columns; Relation schema – a description of the relation, its format is: relation name (attribute1, attribute2, ..., attributeN), which is called the table structure in the database.

[0289] ■Non-relational databases

[0290] No relational databases, using key-value pairs, are a collection of data structure storage methods. They do not require a predefined structure, storing data in key-value pair format, thus easily adapting to changes in data types and structures. Commonly used no relational databases include:

[0291] √BigTable—BigTable is a key-value mapping, but it uses many relational database terms, such as table, row, column, etc.

[0292] √HBase—HBase stores data in the form of tables. Tables consist of rows and columns. Columns are divided into column families. A column family is a collection of columns, and a column family contains multiple columns. The row key is the ID of each row; this field is automatically created. Each column in the table belongs to a column family. Column families are part of the table schema and must be defined before the table is used. Column names are prefixed with their column family names. In HBase, a storage unit defined by rows and columns is called a cell. Each cell stores multiple versions of the same data. Versions are indexed by 64-bit integer timestamps. Data in a cell is untyped and stored entirely in bytecode format.

[0293] √MongoDB—A document is the basic unit of data in MongoDB, similar to a row in a relational database. Documents are stored as key-value pairs, where values ​​can be strings, integers, arrays, or other document types. The key of a document is a string enclosed in double quotes, equivalent to a column name. A collection in MongoDB is a group of documents, similar to a table in a relational database. Collections are identified by unique names. Documents with different key-value pair formats can be stored in the same collection. Multiple documents in MongoDB form a collection, and multiple collections form a database.

[0294] 1.2.2.1.1. Generation Method

[0295] The concept generation engine treats each table as a separate concept, with the table name or the word referring to the table serving as the term for that concept.

[0296] √ For example, for the table user, generate the concept ID = user, which can include words such as "user" and "user"; for example, for the table news, generate the concept ID = news, which can include words such as "news", "news", and "information".

[0297] At the same time, the concept ID=object in the basic definition and the concepts generated from these tables constitute a SPECIES genus-species relationship.

[0298] √ For example, the concept ID = object and the concepts ID = user and ID = news in the above example constitute a genus-species relationship.

[0299] The engine treats each field in the table as a separate concept, with the field name or the word referring to that field serving as the term for that concept.

[0300] √ For example, the `name` field in the `user` table generates the concept ID `user.name`, which can include words like "name", "name", "first name", "first name", "first name", etc.; the `sex` field in the `user` table generates the concept ID `user.sex`, which can include words like "sex" and "gender"; the `title` field in the `news` table generates the concept ID `news.title`, which can include words like "title", "headline", "main title", etc.; the `creator` field in the `news` table generates the concept ID `news.creator`, which can include words like "creator" and "creator".

[0301] At the same time, the concepts generated by the table and the concepts generated by these fields form an ATTRIBUTE attribute relationship.

[0302] √ For example, in the above example, the concepts ID = user, ID = user.name, and ID = user.sex form an ATTRIBUTE attribute relationship; for example, in the above example, the concepts ID = news and ID = news.title form an ATTRIBUTE attribute relationship.

[0303] The engine can treat each field type as a separate concept. These concepts are usually wordless, and each concept recognizer identifies whether a word is a matching concept.

[0304] √ For example, for text field types, generate a wordless concept ID=@string with ontology, and the ontology is ID=string; for numeric field types, generate a wordless concept ID=@number with ontology, and the ontology is ID=number; for date and time field types, generate a wordless concept ID=@time with ontology, and the ontology is ID=time.

[0305] At the same time, the concepts generated by fields with corresponding field types and the concepts generated by these field types constitute a VALUE value relationship.

[0306] √ For example, if the field name in the user table and the field title in the news table are both text fields, then the concepts ID = user.name, ID = news.title, and ID = @string form a VALUE relationship.

[0307] Of course, some fields have certain constraints or special characteristics in their values. For example, dictionary data can have a custom concept of no words.

[0308] √ For example, the field 'sex' in the 'user' table has dictionary values: male, female. A custom concept ID = @sex can be defined, and a custom concept recognizer can identify words like "male," "female," "male," and "female." Simultaneously, the concept ID = user.name and the concept ID = @sex form a VALUE relationship.

[0309] In addition, some fields form foreign key relationships with other tables, and the concepts generated by these field types form a VALUE value relationship with the concepts generated by the associated main table.

[0310] √ For example, if the field "creator" in the table "news" has a foreign key relationship with the table "user", then the concept ID = "news.creator" and the concept ID = "user" have a VALUE relationship.

[0311] 1.2.2.1.2. Object Data Management Technology

[0312] Existing mainstream object-relational mapping frameworks, such as Hibernate, provide a convenient framework for mapping object-oriented domain models to traditional relational databases. Based on the generation method described above, such frameworks can be easily extended to implement concept generation engines.

[0313] This section describes an object data management technology, which is also an object-relational mapping framework in Java. It provides a very lightweight object encapsulation of JDBC. It treats tables as objects, table fields as object attributes, and uses value types to express attribute components, primary and foreign keys between tables, and parent-child table relationships. It uses XML-formatted object template files to define the object structure and establish mapping relationships with database tables.

[0314] √ Commonly used NoSQL databases such as HBase and MongoDB have implemented JDBC drivers, allowing access to these databases using JDBC. This technology encapsulates the APIs for accessing these NoSQL databases into objects, and also performs normalization for MongoDB, ensuring that documents in collections and embedded documents use a consistent key-value pair format;

[0315] The object template file supports multiple languages, including Chinese and English. It defines the terms referring to the table, attribute field names, terms referring to those attributes, and the data types of the attributes. The object template file can be dynamically managed at runtime; for example, users can define new object templates, create or modify attributes through the data management interface. √ For example, the object template file is department.xml.

[0316] In object data management technology, data types are defined into three types: simple type SIMPLE, composite type COMPLEX, and structured type STRUCTURE.

[0317] ■Simple Type SIMPLE

[0318] This includes string, integer, short integer, double, float, long integer, boolean, text (htext:string), HTML text (htext:html), BBCode text (htext:bbcode), XML text (htext:xml), JSON text (htext:json), date (htime:date), time (htime:timestamp), object template type (thing:base), integer number type (hidentity:integer), long integer number type (hidentity:long), string number type (hidentity:string), and object types. Among these, object types indicate that the defined attribute (field) forms a foreign key relationship with the current table or other tables.

[0319] √ For example, in the above object template file department.xml, the parent attribute is of object type and points to the current object table.

[0320] ■Composite Type COMPLEX

[0321] This type indicates that an attribute is composed of multiple sub-attributes; for example, price can be composed of numerical values ​​and units. In other words, the attribute and its sub-attributes form a part relationship.

[0322] √MongoDB can use embedded document types;

[0323] √ For example, the attribute (field) price definition indicates that the price consists of a numerical value and a unit;

[0324] ■Structure Type

[0325] This type indicates that a certain attribute has multiple rows, i.e., a master table-child table relationship. For example, if a role has multiple authorized functions, then these authorized functions are an attribute of the role, and are of structure type. This type of attribute also consists of multiple sub-attributes, and the attributes and sub-attributes also form an ATTRIBUTE attribute relationship.

[0326] √MongoDB can use array types with their elements being embedded document types, representing a document-embedded document relationship;

[0327] √ For example, the definition of attribute (field) authorization functions.

[0328] Object data management technology not only maps object / attribute definitions to database tables (including mapping object attribute data types to SQL / NoSQL database data types), but also provides an object-oriented data query / management mechanism, allowing Java programmers to manipulate databases using object programming thinking at will.

[0329] The concept generation engine can generate concepts and concept connections based on object template XML.

[0330] The concept generation engine can treat each object template (or object) as a concept, with the object's name or the word referring to the object serving as the concept's term. Simultaneously, the base concept ID = object and the concepts generated from these objects form a SPECIES relationship.

[0331] The engine can treat each attribute defined in the template as a separate concept, with the field name of that attribute or the word referring to that attribute serving as the term for that concept. Furthermore, the concepts generated from the object to which the engine belongs, and the concepts generated from these attributes, form an ATTRIBUTE attribute relationship.

[0332] The engine can treat each attribute data type as a separate concept. These concepts are typically wordless, and their respective concept recognizers identify whether a word matches the concept. Simultaneously, the concepts generated by attributes with corresponding data types form a VALUE relationship with the concepts generated by these attribute types. Of course, custom concepts for attribute values ​​can also be configured. For object-type attributes, the attribute is associated with the object specified in the type, forming a VALUE relationship. For composite-type attributes, the attribute forms a PART relationship with the members (sub-attributes) specified in the type. For structure-type attributes, the attribute forms an ATTRIBUTE relationship with the members (sub-attributes) specified in the type.

[0333] √For example, data types and concepts.

[0334]

[0335]

[0336] The above example object template file, department.xml, generates concepts and concept links. Concepts ID=@phone and ID=@fax are custom, wordless concepts.

[0337] They are used to identify telephone numbers and fax numbers, respectively.

[0338] 1.2.2.2. Programming Languages

[0339] A programming language is a set of syntactic rules used to define computer programs. It is a standardized communication technique used to give instructions to a computer. A computer language allows programmers to accurately define the data the computer needs to use and precisely define the actions that should be taken in different situations.

[0340] Programming languages ​​generally have a parser that can convert code into a syntax tree and vice versa, as shown in the table below:

[0341]

[0342] In addition, template languages ​​are also programming languages. They have their own syntax rules and template engines, which can be compiled and executed by computers, and can even generate other languages. For example, FreeMarker and Velocity can generate HTML, SQL, PostScript, XML, RTF, Java source code, and so on from templates.

[0343] This article discusses GScript, a formatted scripting language that is also a programming language, currently written in Java. It has a dual-engine architecture, supporting both interpreted and compiled execution. During compilation, code is converted into Java bytecode, significantly improving execution efficiency. It can also function as a template engine, similar to FreeMarker and Velocity, generating text output based on templates. GScript also has a parser that converts code into a syntax tree and vice versa. A crucial feature of GScript is its ability to call different instruction libraries to parse or compile code into other programming languages.

[0344] 1.2.2.2.1. Generation Method

[0345] The essence of a programming language is its syntax rules. Therefore, the generation method of a concept generation engine lies in analyzing and transforming these syntax rules to generate concepts and concept connections. The next section of this article will focus on the generation method for the GScript language. The methods for most other programming languages, such as Java, HTML, JS, CSS, JSON, and XML, are essentially the same and will not be detailed here.

[0346] 1.2.2.2.2.GScript Language

[0347] 1.2.2.2.2.1. GScript Syntax Rules

[0348] The GScript language syntax consists of three parts: instruction functions, operators, and operation functions.

[0349] ■Instruction Functions

[0350] The instruction function takes the form of:

[0351] <function name>(<function parameter 1>, <function parameter 2>, ...){

[0352] <function body>

[0353] };

[0354] Function parameters: Parameters following the function name are enclosed in parentheses (), and multiple parameters are separated by commas. Not all functions have parameters. If there are no parameters, the parentheses can be omitted. Function body: The function body is enclosed in curly braces {}. Multiple instruction functions can be written inside the function body. Not all functions have a function body. If there is no function body, the curly braces {} can be omitted. Function terminator: Use semicolon (;) as the terminator.

[0355] The instruction library includes basic instructions and extended instructions. Basic instructions include code blocks (script), variable definition and assignment (var, assign), conditional control (if, else), loops (do, while, for), iteration (loop, list), loop and process interruption (break, continue, return), function definition and call (function, call), throwing and catching exceptions (throw, try, catch, finally), loading external scripts (include), void execution (void), printing (print, printf, println), debugging (info, debug, trace, warn, error), sorting (sort), and marking (mark). Extended instructions are related to the target programming language and can be dynamically expanded during use.

[0356] ◆ Operators

[0357] GScript supports the following characters, and their priority order is shown in the table below:

[0358]

[0359]

[0360] Operators are classified according to their function into arithmetic operators, relational operators, logical operators, bitwise operators, ternary operators, type conversion operators, NULL assignment operators, value retrieval operators, escape operators, comment operators, character or string operators, and reserved operators.

[0361] ■ Operational Functions

[0362] The main operational functions include mathematical, string, HTML, date, array, object, value retrieval, JSON, debugging, and other extended operational functions.

[0363] GScript offers many advanced features, such as type inference, constant optimization, and function parameterization. The current version of GScript is written in Java and interacts seamlessly with Java. Java constants, classes, properties, and methods can be accessed through getter operators and getter functions. The current version of GScript supports the following computer languages, as shown in the table below:

[0364] Java Basic javascript Basic, JavaScript extensions html Basic, HTML extension CSS Basic and CSS extensions xml Basic, XML extension json Basic, JSON extension text Basic, text extension

[0365] Of course, these computer languages, along with their corresponding parsers, can be directly converted into GScript by the GScript parser, thus allowing concepts and concept connections to be generated indirectly through GScript.

[0366]

[0367] The GScript parser analyzes the GScript language into an instruction function tree. This instruction function tree is the GScript syntax tree. Conversely, the GScript parser can generate the corresponding GScript language from the instruction function tree. Therefore, using the GScript language has a significant advantage: it can generate a unified syntax tree for different computer languages, facilitating analysis and processing.

[0368] 1.2.2.2.2.2. Java Syntax Rules

[0369] Java is an object-oriented programming language. Object-oriented programming features encapsulation, inheritance, and polymorphism. (1) Encapsulation: Combining the attributes and operations of an object to form an independent object. Through the use of modifiers, external objects cannot directly manipulate the attributes of the object, but can only use the services provided by the object. (2) Inheritance: That is, extension. Subclasses inherit almost all attributes and behaviors of the parent class, but inheritance can only be single inheritance. A subclass can only have one direct parent class; inheritance can be transitive. A subclass can be regarded as a parent class. (3) Polymorphism: Achieved through method overloading and method overriding.

[0370] A class is an abstraction of objects, while an object is an instance of a class. Objects have two main components: attributes and behaviors. Attributes provide a static description of an object, while behaviors embody its functionality and actions. A class is used by instantiating it.

[0371] Attributes and behaviors constitute the members of a class. Attributes can be primitive data types or reference types; methods embody behaviors; get and set methods are used as a convention to provide operations on attributes. A class can be an attribute of another class; that is, attributes can be reference data.

[0372] Class inheritance is extension, and its keyword is `extends`. Inheritance principles: always allow subclasses to perform all behaviors that the superclass can perform; ensure that subclasses contain all the information of the superclass; add members to subclasses to define subclass-specific behaviors; transfer common characteristics to the superclass; allow subclasses of the same superclass to perform the same behaviors, but in different ways—method overriding.

[0373] An interface is a collection of abstract behaviors. Multiple inheritance is implemented through interfaces. A better approach to class design is to encapsulate the properties and behaviors of the object it represents. External functionality can be implemented through interfaces.

[0374] Enumerations are a way to limit the possible values. Using enumerations can reduce the chance of program errors and improve code readability and maintainability. In Java, an enumeration is not a simple collection of constants, but an object; its essence is still a class.

[0375] 1.2.2.2.2.3. Concept Generation Engine

[0376] The concept generation engine generates concepts and concept connections based on GScript syntax rules, Java syntax rules, and the syntax rules of the target programming language.

[0377] 1.2.2.2.2.3.1.GScript

[0378] The preferred configuration for the concept generation engine is to define a series of concepts and their connections using GScript language syntax, including instruction functions, operators, and computation functions. The configuration method can employ techniques consistent with the underlying definitions.

[0379] ■Instruction Functions

[0380] ◆Basic Instructions

[0381]

[0382]

[0383] ◆Extended Instructions

[0384] ●TEXT

[0385]

[0386] ●JSON

[0387]

[0388] ●XML

[0389]

[0390] ●HTML

[0391]

[0392]

[0393] ●CSS

[0394]

[0395]

[0396] ●JS (JavaScript)

[0397]

[0398] ■ Operators

[0399]

[0400]

[0401] ■ Operational Functions

[0402]

[0403]

[0404]

[0405] 1.2.2.2.2.3.2.Java

[0406] GScript seamlessly interacts with Java's constants and objects through getter operators and getter functions. Local and global variables defined using the `var` and `assign` directives are also stored as Java objects in the memory location, and can be accessed using the `@@` and `@` operators and getter functions like `@@`, `@`, and `fromContext`. Third-party JAR files can also be accessed through plugin methods.

[0407] The preferred approach is to use configuration and Java annotations to configure and define concepts and concept connections. Configuration methods can employ techniques consistent with the basic definitions. Java annotations, on the other hand, utilize Java's language features, allowing the definition of concepts and concept connections to be performed during code development.

[0408] √Java annotations are metadata appended to the code, used by tools to parse and use them during compilation and runtime, serving as explanations and configurations.

[0409] √ For example, you can use the concept of package name index table to configure concepts / cogpciActionContext.json and connectivities / cogpciActionContext.json, and Java annotations com.onegrid.grid.platform.nlp4.impl.conceptnetwork.annotation.ClassConcept and com.onegrid.grid.platform.nlp4.impl.conceptnetwork.annotation.ClassConceptConnectivity.

[0410] The concept generation engine can treat each class as a separate concept, using the class name or a word that refers to the class as the term for that concept. Multiple classes can refer to the same concept; for example, an interface and its implementing classes often represent the same concept.

[0411] A common trick for class concept IDs is to use a package name index table to shorten the length of the concept ID, with the index cogpci representing the package name com.onegrid.grid.platform.context4.

[0412] At the same time, the basic definition of the concept ID=object and the concepts generated from these classes constitute a SPECIES relationship.

[0413] √ For example, the concept ID = object and the concepts ID = cogpciActionContext and ID = cogpciApplicationContext in the above example constitute a SPECIES relationship;

[0414] Although Java enumerations are classes, they require different treatment. They must define two concepts. One concept is a wordless concept with an ontology and is the value of the other concept, while the other concept is the ontology of that wordless concept.

[0415] The engine handles each field of a class differently depending on how it is referenced:

[0416] ① If a field is configured or annotated to define a concept, then the concept of this class and the concept of this field form an ATTRIBUTE attribute relationship;

[0417] ② If the data type of the field points to a class (or Java enumeration), and the component type of that class is a class with a defined concept, then the concept of that class and the concept of the data type of the field form an ATTRIBUTE attribute relationship.

[0418] √ For example, class com.onegrid.grid.platform.context4.impl.ActionContext(conceptID = cogpciActionContext).

[0419] ③ Otherwise, the engine defines a concept for the field, using the field name or the word that refers to the field as the word of the concept, and then this type of concept and the concept generated by the field form an ATTRIBUTE attribute relationship.

[0420] √ For example, class com.onegrid.grid.platform.core4.impl.bean.RequestPage(concept ID = cogpcibRequestPage).

[0421] The engine also needs to handle different data types separately:

[0422] ①Class: Basic data types and their corresponding object types.

[0423] ②Classes: Collection types, mainly including arrays and classes that implement java.lang.Collection.

[0424] ③ Classes: Other types, including java.lang.Object, java.lang.Class, enumerations, etc.

[0425] Engine-defined class fields: If a field is not configured or has no conceptual connection defined by annotations, then:

[0426] ◆If a field is a fixed constant, a concept is defined, and the constant value or the word referring to that constant value is used as the word of the concept. Then, the concept of the field and the generated concept form a VALUE value relationship.

[0427] ◆If the concept ID of a field is inconsistent with the concept ID of its data type, a VALUE value relationship is formed between the two.

[0428] √ For example, in the above example, concept ID = cogpcibRequestPage.uri and concept ID = @string have a VALUE value relationship; for example, in the above example, concept ID = cogpcibRequestPage.titles and concept ID = map have a VALUE value relationship.

[0429] Engine-defined class methods: If a method is not configured or annotated with concepts and concept connections, then:

[0430] ◆If the method names conform to the JavaBean specification (i.e., getter and setter methods), then no definition is needed. This is because the basic definition often defines the concepts ID=get, ID=set, and ID=object to form a subject-predicate relationship.

[0431] ◆Otherwise, define a concept, the method name, or the word referring to the method as the word of the concept, and then the concept of this class and the generated concept form an SV subject-predicate relation.

[0432] Engine-defined class inheritance (extends): If the concept IDs of the parent class and child class are inconsistent, a SPECIES relationship is established between the concepts of the parent class and the child class. 1.2.2.2.2.3.3.Html

[0433] The main HTML syntax includes: HTML documents are defined by HTML elements; HTML elements begin with a start tag and end with an end tag; the content of an element is the content between the start and end tags; some HTML elements have empty content; empty elements are closed in the start tag (and end with the end of the start tag); HTML tags can have attributes, which always appear as name / value pairs; HTML documents have external styles, introduced by the `link` tag; HTML documents have internal styles, defined by the `style` tag; HTML elements have inline styles, mainly defined by the `style` attribute; HTML element events exist as attributes, that is, the ability to trigger actions in the browser through event attributes. For concepts and the generation of conceptual connections, see the previous section GScript "Instructions and Functions - Extended Instructions - HTML". 1.2.2.2.2.3.4. CSS

[0434] The main CSS syntax includes: CSS rules consist of two main parts: a selector and one or more declarations; `selector{declaration1; declaration2; ... declarationN}`; each declaration consists of a property and a value; `selector{property:value}`; each property has a value, separated by a colon; styles can be defined based on the context of an element's position; id selectors can specify specific styles for HTML elements marked with a specific id, and are defined with "#"; class selectors are displayed with a dot; styles can be set for HTML elements that have specified properties, not just class and id properties. For concepts and the generation of conceptual connections, see the previous section, GScript "Directives and Functions - Extended Directives - CSS".

[0435] 1.2.2.2.2.3.5.Xml

[0436] XML stands for Extensible Markup Language, designed for transmitting and storing data. XML syntax rules are simple and logical. The main XML syntax rules are: XML documents must have a root element; XML element tags are not predefined and must be defined manually; all XML elements must have a closing tag; XML element tags are case-sensitive; similar to HTML elements, XML elements can also have attributes (name / value pairs); XML element attribute values ​​must be enclosed in quotes. For a discussion of concepts and their connections, see the previous section, GScript "Instructions and Functions - Extended Instructions - XML".

[0437] 1.2.2.2.2.3.6.Json

[0438] JSON: JavaScript Object Notation. JSON is a syntax for storing and exchanging text information. Similar to XML, JSON is smaller, faster, and easier to parse than XML. JSON syntax is a subset of JavaScript syntax. The main JSON syntax elements are: JSON name / value pairs: Name / value pairs consist of the field name (enclosed in double quotes), followed by a colon, and then the value; JSON values ​​can be: numbers (integers or floating-point numbers), strings (enclosed in double quotes), boolean values ​​(true or false), arrays (enclosed in square brackets), objects (enclosed in curly braces), and null; JSON objects are written in curly braces and can contain multiple name / value pairs; JSON arrays are written in square brackets and can contain multiple objects. For a detailed explanation of these concepts and their connections, see the previous section, GScript "Instructions and Functions - Extended Instructions - JSON". 1.2.2.2.2.3.7.Js (JavaScript)

[0439] GScript seamlessly interacts with JavaScript's browser objects and functions through getter operators and getter functions. It also uses the `var` and `assign` directives to map to JavaScript's variable definitions (`var`); the `function` directive to map to JavaScript's function definitions (`function`); and the `@` getter operator and getter functions, along with `fromContext`, to JavaScript's variable retrieval mechanisms, and so on.

[0440] √ For example, executing GScript Js (Javascript) code generates Javascript code.

[0441] The GScript language can be configured to include built-in objects and functions from browsers and external scripts such as the jQuery framework, making these objects and functions accessible within GScript.

[0442] √ For example, the default GScript configuration.

[0443] JavaScript is a lightweight programming language that can be executed by all modern browsers. Like Java, JavaScript has variables, data types, objects, functions, operators, comparison and logical operators, if...else conditions, switch, for, while, return, break and continue, throw, try, and catch. JavaScript objects also have properties and methods; properties are values ​​associated with the object, while methods are actions that can be performed on the object. For some concepts and connections, please refer to the previous sections of GScript: "Instructions and Functions - Extended Instructions - JS (JavaScript)" and "Operation Functions - Extended Operation Functions - JS (JavaScript)".

[0444] 1.2.2.3. Semantic Networks / Dictionaries / Knowledge Bases

[0445] Currently, the mainstream semantic networks / dictionaries / knowledge bases include ConceptNet, FrameNet, and WordNet. The ConceptNet described in this article is also a type of semantic network, and therefore, technically, it is possible to convert between it and existing mainstream semantic networks / dictionaries / knowledge bases.

[0446] 1.2.3. Extended Definition

[0447] The methods described above for generating concepts and concept connections may have certain limitations, or may not fully meet the needs of semantic analysis and reasoning. Therefore, further extended definitions are possible. The same technical methods used in implementing these definitions can be employed.

[0448] In addition, using dictionaries such as the "Thesaurus of Synonyms and Antonyms" and tools like Word2Vec can help expand the vocabulary of concepts and the relationships between them.

[0449] √ The Dictionary of Synonyms and Antonyms is a book published by East China Normal University Press. It contains more than 1,200 entries of synonyms and antonyms.

[0450] Word2Vec is a tool that converts words into vector form. It simplifies text processing into vector operations in a vector space, calculating the vectors.

[0451] Spatial similarity is used to represent the semantic similarity of texts.

[0452] 1.2.4. Dynamic Formation

[0453] For example, as described in the chapter on "Dynamic Formation" of concept connections, connections, or relationships, are dynamically formed between concepts during natural language understanding. Therefore, these concept connections can be dynamically added to the concept network. Typically, the concept connections added to the concept network each have only one characteristic. affim The purpose is that concept connections in concept networks not only meet the needs of natural language understanding, but can also be applied to different contexts.

[0454] √ For example, the statement "I don't have a bag" expresses an ATTRIBUTE connection between "me" and "bag," but this connection is not valid in the current context.

[0455] The following features are negative However, the characteristics of the connections added to the conceptual network are... affim .

[0456] For example, human intervention in the natural language understanding process, such as adding words to concepts or adding connections between concepts.

[0457] This depends on the specific application.

[0458] 1.2.5. Word Vectors

[0459] Word vectors are a way to mathematically represent words in a language. As the name suggests, a word vector represents a word as a vector. There are two main representation methods:

[0460] √One-hot Representation. Create a vocabulary and number each word sequentially. In practical applications, sparse encoding is generally used for storage, primarily employing...

[0461] Word numbering. One of the biggest problems with this representation method is that it cannot capture the similarity between words; even synonyms cannot reveal any relationship from the word vectors. Furthermore, this representation method is prone to the curse of dimensionality, especially in some Deep Learning applications.

[0462] √Distributed representation. Its basic idea is to map each word into a K-dimensional real vector (K is generally a hyperparameter in the model) through training, and to determine the semantic similarity between words by the distance between them (such as cosine similarity, Euclidean distance, etc.). Word2Vec uses this word vector representation method.

[0463] Traditionally, Natural Language Processing (NLP) systems encode words as strings. This approach is arbitrary and doesn't provide useful information about potential relationships between words. Word vectors are an alternative in NLP. They map words or phrases to real-valued vectors, reducing features from a high-dimensional space the size of the vocabulary to a relatively low-dimensional space. The most popular word vector model currently is Word2Vec, proposed by Mikolov et al. in 2013.

[0464] There are two main ways to combine it with word vectors.

[0465] ■ Words that directly or indirectly correspond to a concept are replaced with word vectors. It is impossible for humans to accurately assign all words to a concept, but word vectors capture the similarity between words, which helps to expand the vocabulary for a concept or establish relationships between concepts.

[0466] ◆ Concept IDs use word vectors directly.

[0467] 2.1. Implementation Process of Natural Language Understanding

[0468] 2.1.1. Sentence segmentation

[0469] ■Chapter / Paragraph

[0470] A text typically consists of one or more paragraphs. A paragraph is a collection of sentences. It is conventionally called a "natural paragraph" and is marked by a new line break.

[0471] ■Natural Language Dialogue

[0472] In other words, computers and humans interact through human language (natural language). Natural language dialogue can be divided into single-turn dialogue and multi-turn dialogue, with single-turn dialogue being the foundation. Users engage in single-turn / multi-turn conversations with the dialogue system using natural languages ​​such as English and Chinese, and the system assists users in completing tasks.

[0473] Whether it's a passage / paragraph or a single / multi-turn dialogue, the sentence is the most basic unit of language use; therefore, sentence segmentation is a crucial step. There are two main methods for achieving sentence segmentation:

[0474] ■Based on symbol rules. For example, English and Chinese have explicit clause-breaking symbols, but it is also necessary to consider that some words may contain these symbols.

[0475] √ For example, the punctuation marks at the end of an English sentence are “.!?;”, while the punctuation marks at the end of a Chinese sentence are “。!?…!?”. Paired symbols “()” in English and “《》” in Chinese can form clauses, and the sentence-ending marks within these clauses should be ignored. Periods in English abbreviations are not used as sentence-ending marks. Decimal point recognition is also important in English. If a period is immediately followed by numbers, it is a decimal point; if it is flanked by non-numeric characters, it is either a sentence-ending punctuation mark or a period in an abbreviation.

[0476] √ Open-source projects such as Apache OpenNLP and Stanford NLP provide sentence segmentation tools.

[0477] ■Based on training / recognition. For example, the Apache OpenNLP Sentence Detector can detect whether a punctuation mark marks the end of a sentence.

[0478] Of course, if the natural sentence is clearly defined as a single sentence, it means that there is no need to further segment the natural sentence, and the step of segmenting the sentence can be skipped.

[0479] 2.1.2. Segmenting conceptual terms

[0480] The segmentation of concept words mainly consists of three stages: segmentation words, part-of-speech tagging, and concept recognition.

[0481] 2.1.2.1. Segmentation words

[0482] In Latin-based languages, such as English, spaces serve as natural separators between words. Chinese, however, uses characters as the basic unit of writing, with no obvious markers between words, and words are more semantically expressive than individual characters. Therefore, Chinese word segmentation is fundamental and crucial for Chinese information processing.

[0483] There are already many methods for Chinese word segmentation, such as word segmentation methods based on lexicons (or dictionaries), including forward minimum matching, backward minimum matching, forward maximum matching, backward maximum matching, and minimum segmentation; and statistical word segmentation methods based on Hidden Markov Models (HMM), Big Grammar, Conditional Random Fields (CRF), and seq2seq using bidirectional LSTM. However, technical challenges in word segmentation, such as ambiguity recognition and new word recognition, still exist.

[0484] This article discusses word segmentation, which can utilize one or a combination of methods such as character-based sequence labeling models, word-based n-gram models, and lexicon-based models. Figure 2Word segmentation methods based on n-gram grammar models show good performance in processing dictionary words, while word segmentation methods based on character sequence labeling models are more robust to out-of-vocabulary words in the dictionary. The word segmentation process combining multiple methods is as follows:

[0485] 1) Dynamically add words that directly or indirectly correspond to concepts in the concept network to the dictionary. If the word contains a relational component or is a compound word, ignore the relational component, extract the word, and then add it to the dictionary;

[0486] √ For example, if the concept ID = create, it can have corresponding words such as "define", "create", "new", "establish", "build", "build", "construct", "initial", "build", "build", "create", etc., and these words will be dynamically added to the dictionary; if the concept ID = selt, it can have words with relational components such as "{0} or {1}", then the word "or" will be dynamically added to the dictionary; if the concept ID = eban, it can have the compound words "would rather {1} than {2}", then the words "would rather" and "would not" will be dynamically added to the dictionary.

[0487] 2) Segment the sentence using word-based sequence labeling models such as Maximum Entropy Hidden Markov Model, Conditional Random Field (CRF), and Bidirectional LSTM seq2seq. This segmentation result can be used as the final segmentation result.

[0488] √ Many word segmentation tools have been implemented, for example:

[0489]

[0490] 3) Sentence segmentation using a dictionary-based full segmentation method;

[0491] √For example:

[0492]

[0493] 4) Merge the words segmented by the two methods above, keeping only one of the words that are in the same position and are identical during the merging process;

[0494] 5) Then, algorithms such as Bigram, shortest distance (minimum number of words), reverse maximum matching, forward maximum matching, reverse minimum matching, and forward minimum matching are used to eliminate ambiguity and obtain the final word segmentation result.

[0495] 6) Different algorithms may produce different word segmentation results. Therefore, priority can be assigned to these algorithms, and then the algorithms can be sorted according to their priority.

[0496] Traversing from highest to lowest priority, the process is as follows:

[0497] i. First, use a high-priority algorithm to segment the data into words;

[0498] ii. Then, perform subsequent semantic understanding processing on the segmented result. If the processing is successful, the process ends; otherwise, select the algorithm with the highest priority from the algorithms that have not been traversed and segment the result again. If the segmented result has already been processed, continue to select the next algorithm with the highest priority; otherwise, repeat step ii.

[0499] iii. Until semantic understanding processing is successful, or the entire algorithm has been traversed;

[0500] 2.1.2.2. Part-of-speech tagging

[0501] Part-of-speech (POS) describes the function of a word in a context, and POS tagging is the process of identifying the POS of these words to determine their function in the context. Generally, POS tagging is based on word segmentation, assigning a correct POS to each word in the segmentation result, that is, determining whether each word is a noun, verb, adjective, or other part of speech.

[0502] In a concept network, words that directly or indirectly correspond to concepts can be assigned part-of-speech tags. However, if there are no words with specific part-of-speech tags, the part-of-speech tagging step can be skipped. Otherwise, part-of-speech tagging plays a crucial role in the subsequent concept recognition process.

[0503] There are many part-of-speech tagging methods, most of which are based on statistical models, such as Hidden Markov Models (HMMs).

[0504] √ Many part-of-speech taggers have been implemented, for example:

[0505]

[0506] 2.1.2.3. Concept Identification

[0507] The concept network identifies a concept for each word in the segmentation result. A word can correspond to one or more word concepts or no word concept. Words that are not identified with any concept are marked as unknown word concepts. Therefore, this segmentation result can be called a concept word sequence.

[0508] For word concepts, word matching is used for identification. If it is a word with a relational component or a compound word, the component is ignored and the word is extracted before matching. Usually, the positions of the associated words in the sentence are also marked for the identified compound word concepts.

[0509] √ For example, the table "news" generates a word concept ID = "news", which can include words such as "news", "news", and "information". The word "news" appears in the sentence "What news has been happening lately?".

[0510] namely corresponds to this concept; for example, for the word concept ID=selt, there may be a word with a relational component "{0} or {1}", and the word "or" in the sentence "apple or watermelon"

[0511] namely corresponds to this concept; for example, for the word concept ID=eban, there may be a compound word "prefer {1} rather than {2}", and the words "prefer" and "rather than" in the sentence "I would rather be exhausted than trouble you" namely correspond to this concept. Meanwhile, "prefer" marks that the position of its associated "rather than" in the sentence is 5, and "rather than" marks that the position of its associated "prefer" in the sentence is 1.

[0512] For non-word concepts, they are identified by their concept identifiers. The identified concepts usually also include a converter that implements the concept definition (DEF).

[0513] √ For example, the non-word concept ID=@time is used to refer to time and date, such as the words "20150712", "tomorrow", "a few days ago", and "a certain day". The ontology of this concept

[0514] The concept is the word concept ID=time. The corresponding words of the word concept ID=time may be "time" and "date". In the sentence "Tomorrow's date is 20150712", by means of the concept identifier of this

[0515] concept, the words "tomorrow" and "20150712" can be identified as corresponding to this concept. Certainly, the word "date" can also be identified as corresponding to the concept ID=time.

[0516] 2.1.3. Concept Definition (DEF) Dependency Parsing

[0517] The concept definition (DEF) dependency parsing described in this text is mainly implemented by the following methods:

[0518] (1) Dependency syntactic parsing based on Arc-Standard transition actions and a classifier, and concept definition (DEF) analysis is performed during action transitions in the parsing process;

[0519] (2) Directly train a dependency structure tree based on an existing pre-trained language representation model such as BERT, and then perform concept definition (DEF) analysis through this dependency structure tree.

[0520] 2.1.3.1. Dependency Syntactic Parsing Based on Arc-Standard Transition Actions and Classifier

[0521] Dependency syntactic parsing is to use the dependency relationship between words in a sentence to represent the syntactic structure relationships of words, such as subject-predicate, verb-object, attributive and other structural relationships, so as to provide a basis for achieving accurate understanding of natural language.

[0522] Mainstream dependency parsing methods fall into two categories: graph-based and transition-based. Graph-based methods treat dependency parsing as finding the maximum spanning tree in a fully directed graph, where edges represent the probability of a syntactic relationship between two words. Transition-based methods construct a dependency syntactic tree through a series of shifts and reductions, aiming to find the optimal action sequence. Compared to graph-based methods, transition-based methods have lower algorithmic complexity and thus higher parsing efficiency. Furthermore, due to the ability to utilize richer features, their parsing accuracy is comparable to graph-based methods. In recent years, many deep learning techniques have been increasingly applied to transition-based methods.

[0523] This article describes a dependency parsing method based on classifiers and Arc-Standard action transfer, but the difference is that concept definition (DEF) analysis is performed during action transfer in the analysis process.

[0524] 2.1.3.1.1. Arc-Standard based transfer action

[0525] Transfer-based dependency parsing uses a series of states from initial to final to represent the parsing process. A state consists of a stack, a buffer, and some parsed dependency arcs. The stack stores parsed words, and the buffer represents words to be parsed.

[0526] Initially, the stack contains only a root node, and the cache stores all the words in the sentence. A state transforms into a new state through a transition action. There are three types of transition actions: shift, left-reduce, and right-reduce. The shift action pushes the first word in the cache onto the stack; the left-reduce action creates a left-pointing dependency arc between the top two words of the stack and removes the second word from the stack; the right-reduce action creates a right-pointing dependency arc between the top two words of the stack and removes the top word from the stack.

[0527] After a series of transfer actions, the system eventually reaches a termination state, where the stack contains only one root node and the cache is empty. At this point, a complete dependency tree is formed, and the dependency parsing process for a sentence is completed.

[0528] Many open-source projects have implemented transfer-based dependency parsing, such as StandardNLP, SyntaxNet, and Harbin Institute of Technology LTP mentioned in the table above.

[0529] 2.1.3.1.2. Classifier-based

[0530] Transfer-based dependency parsing also requires a classifier, whose input is a state and output is the most likely action in that state. Traditional classifiers require manually defining a series of features and various combinations of feature templates, which is extremely tedious, requires extensive knowledge of syntactic parsing, and has low accuracy.

[0531] Neural network-based classifiers are completely different. They only require some scattered raw features to be directly fed into the neural network model. As for how the features are combined, it is no longer determined by manually written feature templates, but is automatically extracted by the hidden layers of the neural network model.

[0532] √ For example, Google's open-source neural network SyntaxNet. Google researchers randomly selected sentences from English news feeds (source: Penn Treebank) as a benchmark, and Parsey McParseface retried the dependencies between words in the sentences with an accuracy of 94%.

[0533] √ For example, Harbin Institute of Technology's LTP (Local Dependency Parsing Program). nndepparser is a training suite for the LTP neural network dependency parsing model. Users can use nndepparser to train and obtain the LTP dependency parsing model. nndepparser supports both training the dependency parsing model from manually annotated dependency parsing data and calling the dependency parsing model to perform dependency parsing on sentences.

[0534] 2.1.3.1.3. Conceptual Network Transfer Action Compensation

[0535] Despite the high accuracy achieved using neural networks, syntactic analysis remains extremely difficult, primarily due to the significant ambiguity of human language. It's not uncommon for a moderately long sentence of 20 to 30 words to have hundreds, thousands, or even tens of thousands of possible syntactic structures. A natural language parser must be able to search through all these structural choices and find the most reasonable one for a given context.

[0536] ■ Examples of dependency syntax are as follows (the following examples are from the project's own syntax analysis interface or platform):

[0537]

[0538]

[0539] *For Standard NLP and SyntaxNet dependency relationships, see: http: / / universaldependencies.org / docs / u / dep / index.html

[0540] *Standard NLP Chinese model can be found at: http: / / nl p .stanford.edu / software / stanford-chinese-corenl p -2016-10-31-models.jar

[0541] *The Chinese version of the SyntaxNet model can be found at: http: / / download.tensorflow.org / models / p arsey_universal / Chinese.zi p

[0542] *For Harbin Institute of Technology's LTP dependency relationships, please see: http: / / www.ltp-cloud.com / intro / #sdp_how

[0543] *See Harbin Institute of Technology's LTP Language Cloud at: http: / / www.ltp-cloud.com /

[0544] This paper also proposes a concept network transfer action compensation method to be introduced into dependency parsing. The idea behind this method is to incorporate common sense into transfer-based dependency parsing, enabling the identification of the most appropriate syntactic dependency within a given context. The process is as follows:

[0545] 1) Transform the conceptual connections in the conceptual network into possible inter-concept transfer actions;

[0546] √ The conversion method is shown below:

[0547]

[0548] ■VALUE Relationship. The left-hand concept of this relationship automatically forms a subject-verb relationship (SV) with the relational action concept, while the right-hand concept of the relation automatically forms a verb-object relationship (VO). Therefore, referring to the table above, the relationship between the left-hand concept and the relational action concept is converted into possible transition actions between the two concepts according to the subject-verb relationship (SV), while the relationship between the relational action concept and the right-hand concept of the relation is converted into possible transition actions between the two concepts according to the verb-object relationship (VO).

[0549] ■ Multi-layered conceptual connections, which generate possible transfer actions between concepts. For example, a two-layered conceptual connection: ATTRIBUTE-VALUE.

[0550]

[0551] ■SPECIES. The right-hand side of this relationship is a subordinate (or subclass) of the left-hand side concept, inheriting the characteristics of the left-hand side concept. Therefore, the right-hand side concept also inherits the transfer actions related to the left-hand side concept.

[0552] 2) Before the transition action, the concept word sequence (i.e. the word segmentation result after concept recognition) pre-determines the possible transition action that each word and the following words may form.

[0553] √For example:

[0554]

[0555]

[0556] 3) When transitioning to a new action, first use a classifier to determine the most likely action in that state. Then, based on that action, determine whether there are other possible new transition actions among the possible transition actions between concepts. If so, create a new sub-thread to handle the new action transition by copying the current state. The specific idea is:

[0557]

[0558] ■ After processing, mark the top term of the stack to avoid duplicate processing. If the top term has already been processed, it will not be checked again in possible transitions between concepts;

[0559] ■ New threads work independently from the original threads, meaning their states are independent. The purpose of using threads is to improve analysis performance through parallel processing.

[0560] ■ Set the score for the action in this state of the new thread to be equal to the score of the most likely action determined by the classifier.

[0561] 4) After a series of transfer actions, many threads will be generated, and each thread will also reach the termination state after a series of transfer actions. That is, the original thread and each new thread have only one root node in their stacks and the cache is empty.

[0562] ■ Each thread, including the original thread, can be prematurely determined to be invalid and forcibly terminated during the transfer process, which helps the results of syntactic analysis to converge;

[0563] 5) At this point, many syntactic analysis results, i.e. dependency trees, may be generated, from which the optimal result can be obtained through an algorithm;

[0564] ■ Algorithm Example: For each left-right reduction action transition, statistics are performed. These statistics include the action's score (i.e., the score of the most likely action determined by the classifier), the distance between dependency arcs, and whether a concept transfer action is hit. Assuming the optimal outcome is a maximum action score (the value after fitting with the Sigmoid function is in the range of 0-1, the closer to 1 the better), a minimum distance between dependency arcs (the value after dividing 1 by the distance is also in the range of 0-1, the closer to 1 the better), and a hit on a concept transfer action (a value of 1 if hit, 0 otherwise), then the cosine similarity is calculated between the vector formed by these scores and a vector of equal length with a value of 1. A cosine value closer to 1 indicates a better result.

[0565] The dependency parsing results of the Chinese sentences in the above example are as follows: Figure 13 .

[0566] 2.1.3.2. Training a Model from Concept Word Sequences to Dependency Structure Trees Based on Pre-trained Language Representation Models such as BERT Existing mainstream pre-trained language representation models, such as BERT, have achieved significant breakthroughs in multiple natural language understanding tasks. These pre-trained models can be used to train a model from concept word sequences to dependency structure trees. This model can output a dependency structure tree from concept word sequences, and then perform definition-of-concept (DEF) analysis using the output dependency structure tree.

[0567] A dependency structure tree expresses the interdependencies between words in a sentence. In a dependency structure tree, child nodes depend on parent nodes. For example, in the sentence "My cat likes to eat cat food," the corresponding dependency structure tree is: "my" depends on "cat," "cat food" depends on "eat," and both "cat" and "eat" depend on "like."

[0568] Some words or phrases in a sentence may have no dependency relationship with other words because there are often words or phrases in spoken language that have no semantic meaning. These words may be ignored in the DEF analysis process described below.

[0569] Multiple dependency tree structures can coexist within a sentence. When multiple dependency tree structures exist, the root of one dependency tree structure can be used as the center, and the roots of the other dependency tree structures depend on the root that serves as the center. For example, in the sentence "I miss you, I love you," "I miss you" and "I love you" are two dependency tree structures. "I miss you" is centered on "I miss you," and "I love you" depends on "I miss you." Therefore, the method of handling triples can also be fully and effectively utilized.

[0570] 2.1.3.3. Concept Definition (DEF) Analysis

[0571] 2.1.3.3.1. Definition of Concepts (DEF)

[0572] A concept definition (DEF) refers to the specific definition or implementation of a concept, and can also be called a concept instance.

[0573] Concept definitions (DEFs) are defined by DEF converters, which are configured and defined within the concept network. A DEF converter generates one DEF based on one concept, and multiple DEFs are generated for multiple concepts.

[0574] DEF can be divided into two categories: simple DEF and compound DEF. Simple DEF includes three types: general DEF, DEF with appended terms, and DEF with appended terms and limitations. Compound DEF mainly includes two types: conjunction and introduction DEF, and subject-verb-object DEF.

[0575] DEF is defined according to the following classification:

[0576] ■Simple DEF

[0577] A standard DEF is the most basic type, without any appendices or limitations. The resulting DEF may not support merging with other DEFs. A DEF with appendices refers to one with a series of left appendices, right appendices, and punctuation appendices. The resulting DEF should support merging with other DEFs, and the merged DEF should be marked as appended. A DEF with both appendices and limitations refers to one with a series of limitations in addition to the aforementioned appendices. The resulting DEF should also support merging with other DEFs, and the merged DEF should be marked as either appended or limited.

[0578] Since the language used is arbitrary, the generated DEF files can usually be merged with other DEF files. However, for general DEF files, the merging process can be ignored.

[0579] When generating a DEF, if it has additional DEFs, the additional DEFs will be merged into the DEF after the DEF is generated, and the merged DEF will be marked as additional; if it has both additional and limited DEFs, both additional and limited DEFs will be merged into the DEF after the DEF is generated, and the merged DEF will be marked as either additional or limited.

[0580] ■Subject-verb-object-DEF

[0581] A subject-verb-object (DEF) structure contains a subject, action, object, pivot or object complement, and a series of supplementary DEFs. The generated DEF typically expresses an action, behavior, or method. This DEF should support the merging of the subject DEF, object DEF, pivot or object complement DEF, and a series of supplementary DEFs.

[0582] ■Connection and referencing DEF

[0583] The connection and referencing DEFs include the start DEF of the connection or referencing, and a series of end DEFs of the connection or referencing, which need to be processed separately depending on their function.

[0584] ◆Table Joins

[0585] The expression connecting two DEFs typically generates a grouped DEF. This DEF should support merging DEFs that start with a series of ending DEFs, with a grouping type between the start and each ending. This grouping type depends on the semantics.

[0586] ◆Table Introduction

[0587] The expression introduces a preceding or following DEF. The starting DEF is often a preposition used for introduction, while the ending DEF is the headword of the introduced part. The generated DEF is the DEF generated from the starting DEF. This DEF should support merging a series of ending DEFs, and there should be a preposition type between it and each ending DEF. This preposition type also depends on the semantics.

[0588] The function of a DEF can usually be determined by the concepts used for connection and referencing. If the starting DEF is one of these concepts, it is considered a table referencing; otherwise, it is a table join. If it is a table referencing, the semantics of the concept is the referencing type. If it is a table join, it is further determined whether the concepts dependent on the starting or ending DEF exist; if so, the semantics of the concept is the composite type.

[0589] √ Commonly used concepts for connection and referencing include:

[0590]

[0591] In summary, there is a general approach to configuring and defining DEF converters in conceptual networks, which is as follows:

[0592] DEF converters typically generate DEFs that support merging appended and qualified DEFs;

[0593] For right-hand concepts in SV subject-verb relations and left-hand concepts in VO verb-object relations, their DEF converters should be able to generate DEFs expressing actions, behaviors, or methods;

[0594] For concepts that can be used for joins and references, their DEF converters should be able to generate DEFs that can be identified as joins and references, and also indicate the combination type of table joins and the reference type of table references. Table reference DEFs should also support merging a series of DEFs that export DEFs.

[0595] Definition of Concepts (DEF) Necessary and Optional Dependencies If the language expression is incomplete, its meaning cannot be understood. Similarly, some DEFs require the existence of other DEFs that depend on them; these DEFs are called necessary dependencies. Conversely, if the intention can be understood without these dependent DEFs, then these DEFs are called optional dependencies.

[0596] There are two main methods for defining the necessary and optional dependencies of a DEF:

[0597] ■ Words that correspond directly or indirectly to a concept and carry a relation DEF. The relation DEF specifies the necessary conditions for the definition of that concept (DEF). If this part of DEF is missing, the semantics will be incomplete;

[0598] √ For example, the concept ID = caru can have the word "because {1}" with DEF, where {1} is the necessary dependency DEF of the concept. In the statement "because he is sick," the right side of "because" and "he is sick" is the relation DEF of the concept, indicating cause. The statement "because" lacks the necessary relation DEF, resulting in an incomplete semantic expression.

[0599] ■ Generate DEF files with necessary and optional dependencies using a DEF converter;

[0600] The necessary and optional dependencies of the DEF mentioned above are defined when the DEF is generated, and are called... Basic necessities Dependencies and Optional Dependencies There is also a type of restricted necessary and optional dependency condition, which is related to the statement itself, also known as... Dynamic necessary and optional dependencies .

[0601] √ For example, the concept ID = var, which can contain the word "variable". It doesn't specify necessary or optional dependencies. ① The statement "create variable" is semantically incomplete; ② The statement "create a variable named c" is semantically complete; ③ The statement "create a variable named c with a value of 100" is semantically even more complete. "Create" generates a DEF expressing the action of creation, while the DEF generated by "variable" is merged into this DEF (i.e., the object DEF). Therefore, "name is c" is a necessary dependency DEF, while "value is 100" is an optional dependency DEF.

[0602] Of course, sometimes necessary and optional dependencies (DEF) have already been expressed in the preceding statements, satisfying the current necessary and optional dependency conditions. Therefore, in actual analysis, it is necessary to combine the context of the conversation for analysis.

[0603] There are two main methods for defining dynamic necessary and optional dependencies:

[0604] ■ A DEF converter can be used to generate DEF files that allow these conditions to be defined during the merge process. Alternatively, the definitions can be implemented during the merge process through configuration and other technical means.

[0605] √ In the example above, when merging the DEF of "Creation", the DEF of "Variable" should be qualified to include name←→be←→@var.name, while value←→be←→@var.value is an optional qualified DEF;

[0606] ■ Concept Definition (DEF) determines whether necessary dependency DEFs are missing during the runtime process.

[0607] The absence of necessary dependencies DEF during sentence comprehension does not mean that the syntactic analysis is invalid. The necessary dependencies DEF can be supplemented through the following text or multiple rounds of dialogue.

[0608] √ In the example above, statement ① "Create variable" may not be semantically clear in a single round, but the necessary dependencies DEF are supplemented by subsequent statements such as "The variable name is c", making the semantic understanding complete.

[0609] Required and optional dependency configuration and definition are typically used in the DEF merging process of subject-verb-object (DEF). This article uses an XML-formatted configuration file for configuration and definition.

[0610] For example Figure 14 The configuration file in the diagram defines multiple conditions. The condition element attribute `verb` represents the action, `object` represents the object, `subject` represents the subject, `double` represents the complement or object complement, and `if-constrained` indicates whether the condition applies when used as a conditional DEF. Additionally, the condition attribute or element `require-*` indicates a necessary DEF. The `spec` element indicates the conditional DEF, and the `item` element represents one of the items.

[0611] 2.1.3.3.2. DEF Analysis Procedure

[0612] The analysis process of concept definitions (DEF) is mainly the process of merging DEFs. The analysis process mainly includes concept connectivity analysis, dependency analysis, and context analysis.

[0613] In a dependency structure tree, the dependency relationships between child nodes and parent nodes can be handled using the same approach as transitions. A child node on the left depends on its parent node on the right, which can be considered a left-reduce; a child node on the right depends on its parent node on the left, which can be considered a right-reduce.

[0614] Concept Definition (DEF) analysis is performed concurrently with action transitions. A state contains a DEF stack (CompositionStack). The DEF stack stores the defined DEFs. After a series of transition actions, the final terminating state will have only one DEF in its DEF stack. Analysis process:

[0615] ■ The shift action is to push the first word in the cache onto the stack when shifting, and at the same time generate a general DEF for this word and push this DEF onto the DEF stack;

[0616] ■ When performing a left-reduce operation, the second DEF stack depends on the top DEF stack and is pushed off the stack. When performing a right-reduce operation, the top DEF stack depends on the second DEF stack and is pushed off the stack.

[0617]

[0618] The dependency between DEF depends on the dependency relationship. During the dependency process, DEF may be transformed into other types of DEF.

[0619]

[0620]

[0621] ■ During DEF parsing, it's possible to determine whether a DEF dependency is valid. If it's deemed invalid, the current transfer action is invalid, causing the current parsing thread (including the original thread) to be prematurely terminated. For example, according to the five axioms of dependency relations, a DEF can only depend on one other DEF. Therefore, if a DEF depends on multiple DEFs, the DEF dependency can be deemed invalid, and the current parsing thread (including the original thread) will be prematurely terminated.

[0622] √ In the 1970s, Robinson proposed four axioms about dependency relations in dependency grammar. In the study of processing Chinese information, Chinese scholars have proposed a fifth axiom of dependency relations: Only one component in a sentence is independent; other components are directly dependent on a certain component; no component can depend on two or more components; if component A is directly dependent on component B, and component C is located between A and B in the sentence, then C is either directly dependent on B or directly dependent on a component between A and B; the other components on the left and right sides of the central component are not related to each other.

[0623] ■DEF is generated based on the word when the transfer action is a shift, therefore:

[0624] ◆When a word corresponds to one or more word concepts, one or more DEFs are defined based on the DEF converter of the word concepts;

[0625] ◆When a word corresponds to one or more wordless concepts, the DEF converter contained in the concept identified by its concept recognizer defines one or more DEFs;

[0626] ◆When a word is tagged as an unknown concept, the DEF does not exist and will be ignored during the analysis.

[0627] It is evident that a DEF may not exist, there may be only one, or there may be multiple DEFs. Multiple DEFs express the ambiguity of the language, while the absence of a DEF means that the current statement cannot be understood.

[0628] During the analysis process, DEF is not static. It may change from one to zero (i.e., it does not exist), or it may change from multiple to one or even zero. This depends on the dependency analysis under the context of the session.

[0629] 2.1.3.3.2.1. Conceptual Connection Analysis

[0630] Based on whether the transfer action is a possible transfer action between concepts, the following two cases are analyzed.

[0631] ■ If the transfer action is a possible transfer action between concepts, then the headword and dependent words only need to select the concept to which they belong or are related from the concepts corresponding to the words.

[0632] This is equivalent to the concepts on both sides of the action.

[0633] Simultaneously, a dependency word is the headword of its dependent words. One scenario involves selecting a concept between a dependency word and its dependent words.

[0634] Another scenario involves selecting a concept between the dependency term and its headword. Therefore, the dependency term should only select concepts that overlap in both scenarios, such as... Figure 15 .

[0635] ◆If there is no overlap between dependency terms, then the DEF dependency can be considered invalid;

[0636] ◆If there are non-overlapping concepts among the dependency terms, remove these non-overlapping concepts from the selected concepts, and process their headwords upwards and their dependencies downwards. Remove concepts connected to these non-overlapping concepts from the selected concepts. Then process upwards and downwards using these words as the center. Similarly, if there are no overlapping concepts among these terms, then the DEF basis can be considered invalid. Figure 16 .

[0637] ■ If the transfer action is not a possible transfer action between concepts, this step can be skipped unless all concept connections in the concept network can be converted into possible transfer actions between concepts. Otherwise, it is necessary to determine whether there are reasonable concept connections between the dependency word and its head word, and between the dependency word and its dependency word, in order to select concepts for these words.

[0638] ◆If a word is labeled as an unknown concept, it should be considered reasonable;

[0639] ◆If the concept of a word can be connected with any other concept, but is not reflected in the concept network, it should be considered reasonable;

[0640] ◆If it is within a coherent multi-layered conceptual connection, it should be considered reasonable. This includes contextual (or parent-child) inheritance derivations containing genus-species relationships;

[0641] √ For example, the concept connection thing←SPECIES→object←SPECIES→var expresses the genus-species relationship between thing←→var. Therefore, it is reasonable to deduce the concept connection @quantity←→var from the concept connection thing←ATTRIBUTE→quantity←VALUE→@quantity.

[0642] √ This method can also be used to determine the reasonableness of the connection between more than two concepts.

[0643] ◆If we treat the concept network as a graph, then the concepts are the nodes of the graph, and the connections between concepts are the paths in the graph. Therefore, this problem can be viewed as a two-point pathfinding problem in a graph, and thus graph theory algorithms such as shortest path and depth-first traversal can be used to implement it.

[0644] ◆If there is no reasonable conceptual connection between the derived words, the actual application scenario should also be considered:

[0645] If applied to a specific domain and scenario, the DEF dependency should generally be considered invalid; if applied to a general domain such as chat, the arbitrariness of language and the randomness of expression need to be taken into account, so such a conceptual connection may be reasonable.

[0646] The above two cases analyze the reasonableness of the connection between two concepts. However, apart from general DEF, other DEFs involve the reasonableness of the connection between multiple concepts. We mainly consider DEFs with qualifiers and subject-verb-object DEFs.

[0647] ■ With limited DEF

[0648] ◆Prioritize determining the rationality of connections within DEF;

[0649] ◆If DEF is a subject-verb-object DEF, then determine whether the concept of the limiting DEF is a relative action verb concept. ①If it is, then further determine whether the object is missing. a. If it is, it can be determined to be unreasonable. b. Otherwise, determine the reasonableness of the connection between the subject or object DEF and the current DEF. ②If it is not, then it is necessary to further determine whether the limiting DEF is missing a subject or object DEF. a. If both are missing or neither is missing, then determine the reasonableness of the connection between the limiting DEF and the current DEF. b. If one is missing, then determine the reasonableness of the connection between the limiting DEF and the non-missing one.

[0650] ◆If DEF is defined as a link or a reference to DEF, then ① if the scope of the defined DEF is linked, then the validity of the connection between the start DEF and the series of end DEFs of the defined DEF and the current DEF is determined; ② if the scope of the defined DEF is referenced, then the validity of the connection between the start DEF and the series of end DEFs attached to the defined DEF and the current DEF is determined.

[0651] ◆If DEF is restricted to other DEFs, then determine the validity of the connection between the restricted DEF and the current DEF.

[0652] ■Subject-verb-object-DEF

[0653] ◆If there is a pivot or object complement in the subject-verb-object DEF, then in English, consider the rationality of the connection between subject-verb-concept ID = *action, and object-object complement; in Chinese, consider the rationality of the connection between subject-verb-concept ID = *action, and pivot-object.

[0654] ◆If there is no pivot or object complement in the subject-verb-object (DEF) pair, then consider the rationality of the subject-verb-object connection.

[0655] √ For example, the Chinese statement in the example above, "Create a name is..." a "Variables", see Figure 17 :

[0656]

[0657]

[0658] 2.1.3.5.2.2. Dependency Analysis

[0659] This paper analyzes the necessary and optional dependencies of the definition of concepts (DEF). These conditions are configured and defined in the XML configuration file described in this paper. Therefore, it is easy to determine whether a statement satisfies these conditions.

[0660] √ For example, the Chinese statement in the example above, "Create a name is..." a "Variables":

[0661]

[0662] If necessary and optional dependencies are not met, they are logged in the context analysis session so that natural language generation techniques can be used to inform the user of these missing conditions and enable the user to receive DEFs that match these conditions in the next round of statements.

[0663] 2.1.3.5.2.3. Context Analysis

[0664] The context session uses a "last-in, first-out" queue to store the valid concept definition DEF. The number of items in the queue can be capped; when the cap is exceeded, the first item to enter the queue is removed.

[0665] When the last DEF to be merged enters the queue, that DEF is removed from the queue and merged into the currently being analyzed DEF. The DEF to be merged is typically a table-referenced DEF, which is pushed into the queue during the DEF's execution.

[0666] When there are dependency conditions to be matched in the queue, the DEF currently being analyzed needs to determine whether these dependency conditions are met. If they are met, then ① the DEF is superimposed on the DEF to which these dependency conditions belong. When all the necessary dependency conditions to be matched of the DEF in the queue are met, the DEF can be run; ② the current DEF is no longer pushed into the queue, and the superimposed DEF is moved to the front; ③ if there are dependency conditions to be matched in the current DEF, the superimposed DEF will inherit these conditions.

[0667] The criteria for determining whether a condition is satisfied are as follows: First, treat the current DEF as the DEF referred to by the dependency condition to be matched, and then determine whether the condition is satisfied based on the dependency condition analysis in the previous section. The superposition refers to the DEF referred to by the dependency condition to be matched.

[0668] √For example:

[0669]

[0670] 2.1.4. Concept Definition (DEF) Operation

[0671] A concept definition (DEF) is a specific definition or implementation of a concept. It is an object generated during program execution and can therefore be directly processed.

[0672] Concept definitions (DEF) require different processing methods in different application scenarios, such as... Figure 18 .

[0673] This article mainly describes a processing method based on DEF execution, which can accurately generate and manipulate UI interfaces, data, programming language code, and generate DEF responses.

[0674] After concept definition (DEF) dependency parsing, multiple valid concept definitions (DEFs) may be obtained, but not all DEFs will succeed. These DEFs run independently in their runtime contexts and sessions, without interfering with each other. The results of multiple DEFs may be consistent or different, which precisely illustrates the ambiguity of language. If all DEFs fail, it means that the statement is unintelligible in the current session, so further comprehension through contextualization or multi-turn dialogue is needed.

[0675] √For example Figure 19 The two statements, "create a variable named 'a'" and "create two variables named 'a'", although their analytical conclusions are consistent,

[0676] The results of the DEF analysis are quite different. The DEF analysis result in the right box of the diagram is "-", meaning that the connection between the concepts @quantity and name is assumed to be valid. The prerequisites for running DEF are:

[0677] ■ It is valid, and all its necessary dependencies are met;

[0678] ■ The method for running within a context-based running session has been implemented;

[0679] 2.1.4.1.GScript GTL

[0680] This article describes a novel processing method based on DEF execution, which can accurately generate and manipulate UI interfaces, data, programming language code, or generate DEF responses. This method is based on the GTL template engine technology of the GScript language. This technology can parse or compile GTL text files to generate GScript language code, and then the GScript engine calls different instruction function libraries according to the GTL text file type to parse or compile and execute the code to generate other programming languages. These generated programming languages ​​can then be executed by their corresponding executors or tools; for example, HTML can be executed by a browser.

[0681] DEF execution is implemented using GTL template engine technology based on the GScript language, such as... Figure 20 .

[0682] The running mode is typically set within the context of the running session. These running modes include Human-Computer Interaction (HCI), Development (dev), and Hybrid (dev+hCI), etc.

[0683] This article primarily discusses two modes: Human-Computer Interaction (HCI) mode and Development mode. HCI mode is further divided into UI and NoUI sub-modes based on the presence or absence of a UI interface. The UI sub-mode is commonly used for devices with screens, such as computers and mobile phones, while the NoUI sub-mode is commonly used for screenless devices, such as smart speakers. Development mode is further divided based on the computer languages ​​supported by the GScript language. The current version of GScript supports: Java, JavaScript, HTML, CSS, XML, JSON, and Text. The GTL template engine calls different formats of GTL text files for execution in different runtime modes.

[0684] √The human-computer interaction mode, development mode, and GTL text file format correspond as follows:

[0685]

[0686] √ The GTL template engine supports the <%! %> tag syntax. Using this tag syntax, you can import other GTL text files, even nested imports, thereby solving a key real-world problem: "The existence of multiple run modes and sub-modes significantly increases the workload of developing GTL text files, much of which is repetitive," thus greatly reducing the development workload.

[0687] The GTL template engine can be used to select and execute GTL text files using the following method.

[0688] ■If a GTL text file has already been specified for DEF, then that file will be selected for execution;

[0689] ■Otherwise, proceed as follows:

[0690] ◆ DEF expressing actions, behaviors, or methods

[0691] Select the GTL text file to execute based on the concept ID of the action.

[0692] √ For example, if the concept ID = create, it indicates a creation action. In the human-computer interaction mode, hci_json / create.gtl_json is automatically selected, while in the development sub-mode json, dev_json / create.gtl_json is automatically selected.

[0693] ◆Grouping (DEF)

[0694] The members of the combination are iterated and processed, and then the processing results are merged according to the current running mode and combination type.

[0695] √ For example, the statement "create a variable named a and then create a variable named b". "Create a variable named a" and "create a variable named b" are combined DEFs. The combined DEFs are processed sequentially, and the resulting GScript code is merged.

[0696] ◆Table-introduced DEF

[0697] This DEF usually depends on other DEFs, so it is ignored and not processed. However, it needs to be pushed into the context analysis session queue and marked as a DEF to be merged.

[0698] ◆Other DEF

[0699] If the current DEF belongs to the concept ID=object, it defaults to the action of a table query (concept ID=query), that is, it is converted into a DEF that expresses an action, behavior or method before processing.

[0700] √ For example, the statement "news" will be converted into the statement "query news" and processed accordingly;

[0701] ■ If the corresponding GTL text file cannot be found for execution, it means that the process cannot be completed, indicating that the statement cannot be understood.

[0702] The GTL template engine allows externally passed cached data, enabling DEF files to be passed as cached data during execution. This allows for the processing of dependent (i.e. merged) DEF files during execution.

[0703] √For example

[0704]

[0705]

[0706] 2.1.4.2. Context execution

[0707] If a necessary dependency is not met during DEF execution, it is recorded in the context execution session so that natural language generation technology can be used to inform the user of these missing conditions and enable the user to receive components that match these conditions in the next round of statements.

[0708] If DEF runs successfully, the following will happen at the end of the session:

[0709] ■ Push the DEF into the DEF queue of the context session;

[0710] ■ If the current DEF is an expression of an action, behavior, or method, then an event is formed and stored in the event queue of the context session. Simultaneously, the concept ID = event and the wordless concept generated from this object form a SPECIES relationship.

[0711] ■ Newly created objects and their relationships during DEF execution are stored in the context session's object queue and object relationship queue, respectively. Object collections are also considered objects.

[0712] ■ Based on changes in object attributes (including value changes) and changes in relationships between objects that occur during DEF execution, synchronously modify the object queue and object relationship queue of the context session;

[0713] The queues of events, objects, and object relationships in the context session will play a crucial role in the internal implementation of methods running in DEF (such as pronoun resolution) and subsequent natural language generation.

[0714] 2.1.5. Context Session

[0715] The context session is present throughout the entire analysis and execution process. Both the analysis session and the execution session are generated from the context session.

[0716] ■Analysis Session

[0717] The analysis of the conversation takes place during the analysis phase. Its lifecycle begins with sentence analysis and ends when: ① no valid DEF is found; ② one DEF is successfully analyzed; or ③ all DEFs have finished analyzing.

[0718] ■Running Session

[0719] The runtime session depends on the analysis session and operates during the runtime phase. Its lifecycle begins when the DEF runs and ends when the DEF runs. When the DEF runs successfully, before the analysis session and runtime session end, the data contained therein (such as events, objects, and relationships between objects in the runtime session) will be merged into the context session to facilitate analysis and runtime in the following text or the next round of dialogue.

Claims

1. A natural language understanding method based on concept networks includes the following steps: performing the following operations on the natural language in sequence: segmenting concept words, concept definition dependency analysis, and concept definition execution; in, The segmentation of concept words mainly consists of three stages: segmentation words, part-of-speech tagging, and concept recognition. The approach to word segmentation selection can be based on one or a combination of methods, such as character-based sequence labeling models, word-based n-gram models, or lexicon-based models. Part-of-speech tagging is based on a statistical model; words in the concept network that directly or indirectly correspond to concepts can be assigned a part of speech, but if there are no words with a specific part of speech, the part-of-speech tagging step is skipped. Concept recognition: Based on the concept network, a concept is identified for each word in the word segmentation result. A word can correspond to one or more word concepts or no word concept. Words that are not identified as having any concept are marked as unknown word concepts. Therefore, this word segmentation result can be called a concept word sequence. Concept definition dependency parsing is mainly implemented through the following methods: Dependency parsing based on Arc-Standard transfer actions and classifiers, while performing concept definition analysis during action transfer in the analysis process; a concept network transfer action compensation method is introduced in the dependency parsing process. Model training from concept word sequences to dependency structure trees is performed based on pre-trained language representation models such as BERT. Concept definition execution: Concept definition is the specific definition or implementation of a concept, and it is an object generated during program execution; The word segmentation process combining the various methods is as follows: 1) Dynamically add words that directly or indirectly correspond to concepts in the concept network to the dictionary; if the word has a relational component or is a compound word, ignore the relational component, extract the word, and then add it to the dictionary; 2) Segment the sentence using methods such as maximum entropy hidden Markov model, conditional random field (CRF), bidirectional LSTM seq2seq, or other character-based sequence labeling models; this segmentation result can be used as the final segmentation result. 3) Sentence segmentation using a dictionary-based full segmentation method; 4) Merge the words segmented by the two methods in 1)-3) above. When merging, only keep one of the words that are in the same position and are identical. 5) Then use binary model, shortest distance, reverse maximum matching, forward maximum matching, reverse minimum matching, forward minimum matching or other algorithms to eliminate ambiguity and obtain the final word segmentation result.

2. The natural language understanding method based on concept networks according to claim 1, characterized in that: Before segmenting conceptual terms, it also includes segmenting sentences. There are two main methods for segmenting sentences: one is based on sentence segmentation rules; the other is based on training / recognizing sentence segmentation symbols.

3. The natural language understanding method based on concept networks according to claim 1, characterized in that: The word segmentation process involves a combination of methods. Different algorithms may produce different segmentation results. By assigning priorities to these algorithms and then iterating through them in descending order of priority, the process is as follows: i. First, use a high-priority algorithm to segment the data into words; ii. Then, perform subsequent semantic understanding processing on the segmented result. If the processing is successful, the process ends; otherwise, select the algorithm with higher priority from the algorithms that have not been traversed and segment the result again. If the segmented result has already been processed, select the next algorithm with higher priority; otherwise, repeat step ii. iii. Until semantic understanding processing is successful, or the entire algorithm has been traversed.

4. The natural language understanding method based on concept networks according to claim 1, characterized in that: The statistical model for part-of-speech tagging is a Hidden Markov Model (HMM).

5. The natural language understanding method based on concept networks according to claim 1, characterized in that: Concept definitions are defined by DEF converters, which are configured and defined in the concept network. A DEF converter generates a DEF based on a concept, and multiple DEFs are generated for multiple concepts. Concept definitions have basic and dynamic necessary and optional dependencies.

6. The natural language understanding method based on concept networks according to claim 1, characterized in that: It also includes DEF responses, generated based on the intended message, using natural language generation techniques described in this paper to generate sentences; contextual conversations are present throughout the entire analysis and execution process.

7. The method of claim 1 is used for understanding chapters / paragraphs and single / multi-turn dialogues.

8. The application according to claim 7, characterized in that: Based on understanding chapters / paragraphs and single / multi-turn dialogues, it can generate and manipulate UI interfaces, data, programming language code, or generate DEF responses.

9. The application according to claim 8, characterized in that: The GTL template engine technology based on the GScript language can generate and manipulate UI interfaces, data, programming language code, or generate DEF responses.

Citation Information

Patent Citations

  • Chinese word segmentation method and device of webpage text

    CN105975454A

  • Natural language understanding system and working method thereof

    CN108959239A