A concept network-based natural language generation method
Patent Information
- Application Number
- CN202210477540.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-04
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2042-05-04
Smart Images

Figure CN115345153B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, and specifically provides a natural language generation 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 generation method based on concept networks.
[0005] The natural language generation method described in this invention includes the following steps: based on a concept network, the intended meaning is sequentially expressed as follows: DEF generation and syntactic analysis;
[0006] Characteristics of the natural language generation process:
[0007] (1) Based on conceptual networks;
[0008] (2) The process is as follows: DEF generation and syntactic analysis. The purpose is to generate natural language statements that match the intent, so as to meet the needs of generating chapters / paragraphs and realizing single-turn / multi-turn dialogues.
[0009] (3) Contextual sessions are used throughout the entire generation process.
[0010] This invention provides a conceptual network for artificial intelligence.
[0011] 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.
[0012] (1) Definition of concept network: concepts and concept connections.
[0013] 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).
[0014] 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).
[0015] 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.
[0016] 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.
[0017] Conceptual connections, or semantic relationship chains between concepts, are used to describe multi-level semantic relationships between concepts. Their characteristics are:
[0018] 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.
[0019] 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.
[0020] c / Existence characteristics. These characteristics represent the affirmation, negation, possibility, scope, probability, degree, frequency, time, tone, etc., reflecting the relationship in conceptual connections.
[0021] In addition, the present invention also provides a method for generating conceptual networks.
[0022] Methods for generating conceptual networks include: basic definition, generation, extended definition, and dynamic formation.
[0023] 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.
[0024] 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.
[0025] Data Structures
[0026] 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.
[0027] B. Generation method process:
[0028] ① 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.
[0029] ② 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.
[0030] ③ 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.
[0031] ④ 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.
[0032] ⑤ 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.
[0033] 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 connections based on the object template XML. Generation process:
[0034] ① 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.
[0035] ② 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.
[0036] ③ 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.
[0037] Programming Languages
[0038] 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.
[0039] 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 to generate other programming languages. Current versions of GScript support generating the following programming languages: Java, JavaScript, HTML, CSS, XML, JSON, and Text. 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. Generation process:
[0040] ① 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 their connections using the instruction functions, operators, and operation functions of the GScript language syntax. The configuration method can use techniques consistent with the basic definitions.
[0041] ② 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.
[0042] 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 concept's name. Multiple classes can point to the same concept; for example, an interface and its implementing classes typically represent the same concept. Furthermore, the underlying concept ID = object and the concepts generated from these classes form a SPECIES relationship.
[0043] 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.
[0044] Engine III handles each field of a class differently depending on its reference status:
[0045] If a field is configured or annotated to define a concept, then the concept of this class and the concept of that field form an ATTRIBUTE attribute relationship.
[0046] ii. 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 field's data type form an ATTRIBUTE attribute relationship.
[0047] iii Otherwise, the engine defines a concept for the field, using the field name or a word that refers to the field as the word for the concept, and then this concept and the concept generated by the field form an ATTRIBUTE attribute relationship.
[0048] The IV engine also needs to handle different data types separately:
[0049] ①Class: Basic data types and their corresponding object types.
[0050] ②Classes: Collection types, mainly including arrays and classes that implement java.lang.Collection.
[0051] ③ Classes: Other types, including java.lang.Object, java.lang.Class, enumerations, etc.
[0052] V-engine defines class fields: If a field is not configured or has no conceptual connection defined by annotations, then:
[0053] 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.
[0054] 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.
[0055] The VI engine defines class methods: If a method is not configured or annotated with concepts and concept connections, then:
[0056] 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.
[0057] 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.
[0058] 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.
[0059] ③ 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".
[0060] Semantic networks / dictionaries / knowledge bases
[0061] 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.
[0062] The extended definition further expands the defined concepts and conceptual connections. The same technical means as the basic definition can be used for implementation.
[0063] 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.
[0064] 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.
[0065] Finally, this invention provides the application of concept networks in artificial intelligence language understanding and generation.
[0066] Natural language generation process:
[0067] (1) DEF generation
[0068] The DEF generation engine generates DEFs based on the intended meaning, primarily using rules. These rules can be defined through configuration and other technical means.
[0069] ①Programming Language
[0070] The essence of a programming language is its syntax rules, and programming languages can generally convert code into a syntax tree through a parser.
[0071] The code can then be converted into a syntax tree using a parser, and then the syntax tree can be converted into a DEF using a DEF generation engine.
[0072] A.GScript also has a parser that can convert code into a syntax tree. Furthermore, current versions of GScript support other computer languages that, with their corresponding parsers, can be directly converted into GScript. This allows them to be indirectly converted into DEF files via a DEF generation engine based on a GScript parser.
[0073] I GScript Language Syntax It consists of three parts: instruction functions, operators, and arithmetic functions. The preferred configuration for the DEF generation engine is GScript.
[0074] The language syntax defines a series of DEFs, including instruction functions, operators, and operation functions.
[0075] II Java Language Syntax It includes classes, attributes, methods, data types, enumerations, annotations, etc. The DEF generation engine is also optimally configured with Java.
[0076] Annotations are used to configure and define DEF generation. Java annotations, in particular, allow DEF generation definitions to be defined during code development.
[0077] III Target programming language The DEF generation is consistent with the corresponding chapter of GScript "Instruction Functions - Extended Instructions".
[0078] ②DEF connection
[0079] There may be multiple generated DEFs. To ensure semantic coherence and logical expression, the DEFs are logically linked together using cohesive techniques.
[0080] The main means of connection include: merging, reference, omission, clause segmentation, appending, linking, and referencing.
[0081] i. Merging: Merging locally identical parts in DEF together, expressing the compactness of the language;
[0082] ii. Reference: In context, pronouns and other means are used to transform DEF, serving to substitute for or indicate people or things. The pronouns are mainly personal pronouns and demonstrative pronouns;
[0083] iii. Omission: In conjunction with the context of the conversation, omit DEF, which have already been stated in the preceding text, to avoid semantic repetition and highlight the key points. This is usually used in conjunction with referential devices.
[0084] iv. Clause: Separate the overly long parts of DEF and use them as supplementary clauses. They are usually used in conjunction with pronouns and conjunctions.
[0085] v. Addition: By adding particles, interjections, etc. to DEF, sentences can be made unambiguous, more fluent, and more expressive of emotions;
[0086] vi join: Joins DEF with a reference. This is frequently used in merge techniques;
[0087] vii Reference: Combining the context of the conversation, using some DEFs above as reference points, and using comparison, analogy, exclusion and other means to transform DEFs.
[0088] (2) Syntactic Analysis
[0089] A. Generation Principles
[0090] Depending on the DEF type, the principles for generating sentences also differ, as described below:
[0091] 1. If DEF has already been assigned to a generation template or rule, then generate a word sequence according to that template or rule;
[0092] 2. Otherwise, proceed as follows:
[0093] I generally use DEF, choose words
[0094] II with additional DEF scores
[0095] i. Select words; the following are called the central words.
[0096] ii. The words selected by adding DEF to the left are placed to the left of the head word in sequence.
[0097] iii. The words selected by adding DEF to the right are placed to the right of the head word in sequence.
[0098] The words selected by punctuation marks DEF are on the far right.
[0099] III. DEF with bonus points and limitations
[0100] i. Select words; the following are called the central words.
[0101] The words selected by DEF on the left side are arranged in order on the far left.
[0102] iii. The words selected by DEF are arranged to the left of the headword in sequence.
[0103] iv. The words selected by adding DEF to the right are placed sequentially to the right of the head word.
[0104] The words selected by the punctuation marks DEF are on the far right.
[0105] IV Connection and Introduction DEF
[0106] The words selected by DEF starting with i are on the left; these are referred to as the head words.
[0107] The words selected by DEF at the end of ii are listed on the right in order.
[0108] iii. If DEF is a table join, and the combined concept is a word concept with DEF, then the head word is joined to the word selected by the ending DEF according to the position of DEF; otherwise, it is placed to the right of the head word by default.
[0109] V Subject Verb Object DEF
[0110] i. Select words; the following are called the central words.
[0111] ii. The word selected by subject DEF is placed to the left of the headword; these are referred to as subject DEF words.
[0112] iii. The word selected by the object DEF is to the right of the headword; these are referred to as the object DEF word.
[0113] iv. The word selected by the pivot or object complement (DEF) is located between the subject (DEF) and object (DEF) in Chinese, and to the right of the object (DEF) in English.
[0114] The words selected by DEF for the complement are listed on the far right.
[0115] B. Generation Method
[0116] The purpose of syntactic analysis is to transform DEF (descriptive, non-descriptive) data into sentences that conform to human language habits. Common methods include those based on generative templates and rules.
[0117] There are also statistical models based on N-gram language models, neural networks, etc.
[0118] I. Word segmentation method
[0119] DEF generation may involve multiple rules, as in example sentence ③ above, where sentence generation offers various options. Furthermore, a single concept can directly or indirectly correspond to multiple words.
[0120] Sentence generation involves selecting the best word sequence from an ordered set of words. Word segmentation algorithms find the best segmentation result among the resulting words; this result is the word sequence. Common algorithms used include bigram models and shortest distance algorithms.
[0121] II. Dependency Parsing Methods
[0122] The dependency between DEF depends on the dependency relationship; therefore, the dependent words of DEF have a dependency relationship with the head word. The purpose of dependency parsing is to find the best dependency tree for the segmentation results. Here, we still use the transition-based dependency parsing method, and a classifier is also required.
[0123] Unlike dependency parsing in natural language understanding, the classifier takes a state as input and sets the most probable action to be the action corresponding to the dependency relation, then records the score of each word. After a series of transition actions, a final state is reached, resulting in a word sequence. This process may generate many dependency trees, from which the optimal result can be obtained through algorithms.
[0124] The key idea is that, under the premise that the input state and output action are the same, the feature information input into the neural network model is different due to the different word features, so each word will receive a different transition action score.
[0125] Context Session
[0126] The context session is present throughout the entire generation process. The same context session exists throughout both the understanding and generation processes. The generation session is generated from the context session. In single-turn / multi-turn dialogues, the generation session also depends on the currently running session. The generation session operates within the generation phase. Before the generation session ends, the included data (such as DEF queues) is merged into the context session to facilitate subsequent generation or analysis and execution in the next round of dialogue.
[0127] This invention proposes a novel natural language generation method based on conceptual networks. Its greater significance lies in comprehensively explaining how to generate natural language statements from intended meanings using programming languages. This paper also describes methods for conversion between various languages. The methods and systems described in this paper provide a methodology for machine-generated natural language and, more importantly, a completely new solution. Attached Figure Description
[0128] Figure 1 A graph illustrating the process of generating natural language from the intended meaning.
[0129] Figure 2 The program code is processed by a parser and a DEF generation engine to generate a DEF file.
[0130] Figure 3 The GScript code is processed by the GScript parser and the DEF generation engine to generate a DEF file.
[0131] Figure 4 "create(null,(be(name,@var.name="a",ude1)var))"DEF generates a word sequence according to the generation principle.
[0132] Figure 5 Methods and processes for converting between multiple languages (with diagrams) Detailed Implementation
[0133] The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings:
[0134] Expressing a given intention or idea using natural language text is called natural language generation. This article describes the natural language generation process, such as... Figure 1 In general, it has the following characteristics:
[0135] ■ Based on conceptual networks;
[0136] ■ It goes through multiple stages such as DEF generation and syntactic analysis, which enables the generation of natural language sentences that match the intent, meeting the needs of generating chapters / paragraphs and realizing single-turn / multi-turn dialogues;
[0137] ■Contextual sessions are used throughout the entire generation process;
[0138] 1.1. Implementation Process
[0139] 1.1.1.DEF Generation
[0140] A Concept Definition (DEF) is a concrete definition or implementation of a concept; it is an object generated during program execution. The DEF generation engine primarily uses rules to generate DEFs based on the intended meaning. These rules can be defined through configuration and other technical means. Technically, DEF representations can be used to quickly configure and define DEF generation. Combined with a DEF representation converter, these representations can be converted into DEFs.
[0141] To facilitate the description of the definitions of various DEF types, DEF can be expressed in the following form:
[0142] ■General DEF
[0143] Composition can be represented directly using a concept ID.
[0144] ■ With additional DEF
[0145] Ad(Composition,[Lad,...,...],[Rad,...,...],[Wp,...,...])
[0146] Where [Lad,...,...] is a series of left-appended DEFs, [Rad,...,...] is a series of right-appended DEFs, and [Wp,...,...] is a series of punctuation mark-appended DEFs.
[0147] ■ DEF with additional and limited features
[0148] Spec(Composition,[Spec,...,...],[Lad,...,...],[Rad,...,...],[Wp,...,...])
[0149] Where [Spec,...,...] is a series of qualifying DEFs, [Lad,...,...] is a series of left-adding DEFs, [Rad,...,...] is a series of right-adding DEFs, and [Wp,...,...] is a series of punctuation mark-adding DEFs.
[0150] ■Connection and referencing DEF
[0151] Conj-Kind(Begin,[End,...,...])
[0152] Where Begin is the start DEF, [End,...,...] is a series of end DEFs, and Kind is the join or referencing type.
[0153] ■Subject-verb-object-DEF
[0154] Action(Subject,Verb,Object,DoubleObject,[Compl,..,...])
[0155] In this context, Subject is the subject (DEF), Verb is the action (DEF), Object is the object (DEF), DoubleObject is the complement or object complement (DEF), and [Compl,..,...] is a series of complements (DEF).
[0156] The DEF representation converter can convert the above representations into DEF, and also convert DEF into representations.
[0157] √ For example, in the process of defining a concept, DEF analysis, and execution, the intention is to express the necessary and optional dependencies:
[0158]
[0159] √For example, the result of running DEF needs further prompting or dialogue with the user:
[0160]
[0161]
[0162] 1.1.1.1. Programming Languages
[0163] As discussed in previous chapters, the essence of a programming language is its syntax rules, and programming languages generally allow code to be converted into a syntax tree using a parser. Therefore, a parser can convert code into a syntax tree, and then a DEF generation engine can convert the syntax tree into a DEF file, such as... Figure 2 .
[0164] The GScript language also has a parser that can convert code into a syntax tree. Furthermore, current versions of GScript support various computer languages that, with their corresponding parsers, can be directly converted into GScript using the GScript parser. They can also be indirectly converted into DEF files using a DEF generation engine based on a GScript parser.
[0165] The next section of this article will mainly discuss the generation method of the GScript language. The methods for most other programming languages, such as JAVA, HTML, JS, CSS, JSON, and XML, are basically the same and will not be described in detail here.
[0166] 1.1.1.1.1.GScript Language
[0167] 1.1.1.1.1.1.GScript / Java Syntax Rules
[0168] For details, please refer to the previous chapters "GScript Syntax Rules" and "Java Syntax Rules".
[0169] 1.1.1.1.1.2.DEF Generation Engine
[0170] The DEF generation engine generates DEF files based on GScript syntax rules, Java syntax rules, and the syntax rules of the target programming language. Figure 3 .
[0171] 1.1.1.1.1.2.1.GScript
[0172] The preferred configuration for the DEF generation engine is to define a series of DEFs using the instruction functions, operators, and operation functions of the GScript language syntax.
[0173] ■Instruction Functions
[0174] ◆Basic Instructions
[0175]
[0176]
[0177]
[0178] ◆Extended Instructions
[0179] ●TEXT
[0180]
[0181] ●JSON
[0182]
[0183] ●XML
[0184]
[0185]
[0186] ●HTML
[0187]
[0188] ●CSS
[0189]
[0190] ●JS (JavaScript)
[0191]
[0192] ■ Operators
[0193]
[0194]
[0195] ■ Operational Functions
[0196]
[0197]
[0198] 1.1.1.1.1.2.2.Java
[0199] The Java syntax has been covered in previous chapters.
[0200] It is also preferable to configure and define DEF generation using Java annotations. Java annotations allow the definition of DEF generation to be performed during code development.
[0201] √For example, see the Java annotation com.onegrid.grid.platform.nlp4.impl.generation.annotation.MethodGeneration. Figure 4 The DEF generated statement in the annotation shown in the figure can be converted into the corresponding DEF using a DEF statement converter.
[0202] √For example
[0203]
[0204] 1.1.1.1.1.2.3.Html
[0205] HTML syntax has been covered in previous chapters. The generation method can be found in the previous section, "GScript Instruction Functions - Extended Instructions - HTML".
[0206] 1.1.1.1.1.2.4.Css
[0207] The CSS syntax has been covered in previous chapters. For generation methods, see the previous section, "GScript Directives and Functions - Extended Directives - CSS".
[0208] 1.1.1.1.1.2.5.Xml
[0209] XML syntax has been discussed in previous chapters. The generation method can be found in the previous section, "GScript Instruction Functions - Extended Instructions - XML".
[0210] 1.1.1.1.1.2.6.Json
[0211] JSON syntax has been covered in previous chapters. For generation methods, see the previous section, "GScript Instruction Functions - Extended Instructions - JSON".
[0212] 1.1.1.1.1.2.7.Js (Javascript)
[0213] JavaScript syntax has been covered in previous chapters.
[0214] √For example
[0215]
[0216] For some of the generation methods, please refer to the previous section GScript "Instruction Functions - Extended Instructions - JS (JAVASCRIPT)" and "Operation Functions - Extended Operation Functions - JS (JAVASCRIPT)".
[0217] 1.1.1.2.DEF Connection
[0218] There may be multiple DEFs generated. To ensure semantic coherence and logical flow, these DEFs are logically linked together using cohesive devices. These cohesive devices mainly include: merging, reference, ellipsis, clause segmentation, appending, linking, and referencing.
[0219] ■Merger
[0220] This refers to merging locally identical parts in DEF, expressing the conciseness of the language.
[0221] √For example, the rules for merging multiple subject-verb-object-DEF pairs without a pivot or object complement:
[0222] a. Only the concepts of the subjects DEF are the same;
[0223]
[0224] b. Only the subject and predicate DEF have the same concept;
[0225]
[0226] c. Only the concepts of subject, predicate, and complement (DEF) are the same;
[0227]
[0228] d differs only in the concepts of complements DEF;
[0229]
[0230] e has the same concept for both the predicate and the complement DEF;
[0231]
[0232] f Only the predicate, object, and complement have the same concept as DEF;
[0233]
[0234] g. Only the subject and object have the same concept of DEF;
[0235]
[0236] h Only the concepts of subject, object, and complement DEF are the same;
[0237]
[0238] √The above example statement ② "Create User"
[0239]
[0240] ■Referring to
[0241] In context, pronouns and other means are used to transform DEF, serving to replace or indicate people or things. The pronouns are mainly personal pronouns and demonstrative pronouns.
[0242] √For example
[0243]
[0244] ■Omit
[0245] In the context of the conversation, DEF, which have already been stated above, are omitted to avoid semantic repetition and highlight the key points. This is usually used in conjunction with referential devices.
[0246] √ In the example above, Spec(varAction(namebe@varname="a"))→Spec(varthis) means that the restatement description "the noun is a" is omitted.
[0247]
[0248] ■Sentence segmentation
[0249] This refers to separating out excessively long sections from DEF and using them as supplementary clauses. It is usually used in conjunction with pronouns and conjunctions.
[0250] √For example:
[0251]
[0252] ■Additional
[0253] By adding particles, interjections, etc. to DEF, sentences can be made unambiguous, more fluent, and more expressive of emotions.
[0254] √For example:
[0255]
[0256] ■Connection
[0257] Connecting DEFs by linking and referencing them is a common technique used in merging.
[0258] √For example:
[0259]
[0260]
[0261] ■Reference
[0262] Based on the context of the conversation, and using some DEFs mentioned above as reference points, we transform DEFs using methods such as comparison, analogy, and exclusion.
[0263] 1.1.1.3. Context Generation
[0264] Context generation sessions use a "last-in, first-out" queue to store valid DEFs generated from the context. This primarily occurs in single-turn / multi-turn dialogues and in programming language code generation statements. Typically, in single-turn / multi-turn dialogues, these DEFs also carry dependency conditions to be matched, used to determine whether the user's response satisfies these dependency conditions and to generate an appropriate response.
[0265] √For example, the statement ① "Create variable":
[0266] Generate DEF Action(name, be|equal, what) Necessary Dependencies name←→be←→@var.name
[0267] During the understanding process, the context session merges and stores data contained in the analysis and running sessions; during the generation process, the context session merges and stores data contained in the generation session. This data provides crucial information for DEF (Derivative-Executable) connections, such as referencing, omission, and reference.
[0268] 1.1.2. Syntactic Analysis
[0269] 1.1.2.1. Generation Principles
[0270] Depending on the DEF type, the principles for generating sentences also differ, as described below:
[0271] ■If DEF has already been assigned to a generation template or rule, then generate a word sequence according to that template or rule;
[0272] ■Otherwise, proceed as follows:
[0273] ◆Generally DEF, choose words based on concepts.
[0274] DEF Composition word order WordComposition
[0275] ◆With additional DEF
[0276] ● Select words based on concepts; the following are called central words.
[0277] ● The words selected by adding DEF on the left are arranged to the left of the head word.
[0278] ● The words selected by adding DEF on the right will appear to the right of the head word in sequence.
[0279] ● The words selected by punctuation marks DEF are on the far right.
[0280] DEF Ad(Composition,[Lad,...,...],[Rad,...,...],[Wp,...,...]) word order WordLad…WordCompositionWordRad…WordWp…
[0281] ◆DEF with additional and limited features
[0282] ● Select words based on concepts; the following are called central words.
[0283] ● The words selected by the left-hand appendix DEF are listed in order on the far left.
[0284] ● The words selected by DEF are arranged to the left of the headword.
[0285] ● The words selected by adding DEF on the right will appear to the right of the head word in sequence.
[0286] ● The words selected by punctuation marks DEF are on the far right.
[0287] DEF Spec(Composition,[Spec,...,...],[Lad,...,...],[Rad,...,...],[Wp,...,...]) word order WordLad…WordSpec…WordCompositionWordRad…WordWp…
[0288] ◆Connection and referencing DEF
[0289] ●The words selected by DEF at the beginning are on the left; these are called the headwords.
[0290] ●The words selected at the end of DEF are listed on the right in order.
[0291] ● If DEF is a table join, and the combined concept is a word concept with DEF, then the head word and the word selected by the ending DEF are joined according to the position of DEF; otherwise, it is placed to the right of the head word by default.
[0292] DEF Conj-Kind(Begin,[End,...,...]) word order WordBeginWordKindWordEnd…
[0293] ◆Subject-Verb-Object-DEF
[0294] ● Select words based on concepts; the following are called central words.
[0295] ●The word selected by subject DEF is placed to the left of the headword; these are referred to as subject DEF words.
[0296] ●The word selected by the object DEF is to the right of the headword; these are referred to as the object DEF word.
[0297] ●The word selected by the pivot or object complement DEF is located between the head noun and the object DEF word in Chinese, and to the right of the object DEF word in English.
[0298] ●The words selected by complements DEF are listed in order on the far right.
[0299]
[0300] 1.1.2.2. Generation Method
[0301] The purpose of syntactic analysis is to transform DEF (descriptive, non-descriptive) data into sentences that conform to human language habits. Common methods include those based on generative templates and rules, as well as those based on statistical models such as N-gram language models and neural networks.
[0302] 1.1.2.2.1. Word Segmentation Methods
[0303] DEF generation may involve multiple rules, as in example sentence ③ above, where sentence generation offers various options. Furthermore, a single concept can directly or indirectly correspond to multiple words.
[0304] Sentence generation involves selecting the best word sequence from an ordered set of words. Word segmentation algorithms find the best segmentation result among the resulting words; this result is the word sequence. Common algorithms used include bigram models and shortest distance algorithms.
[0305] √For example
[0306]
[0307] 1.1.2.2.2. Dependency parsing method
[0308] The dependency between DEF depends on the dependency relationship; therefore, the dependent words of DEF have a dependency relationship with the head word. The purpose of dependency parsing is to find the best dependency tree for the segmentation results. Here, we still use the transition-based dependency parsing method, and a classifier is also required.
[0309] Unlike dependency parsing in natural language understanding, the classifier takes a state as input and sets the most probable action to be the action corresponding to the dependency relation. It then records the score of each word. After a series of transition actions, it eventually reaches a terminating state, thus obtaining the word sequence.
[0310] This may generate many dependency trees, from which the optimal result can be obtained through an algorithm. The algorithm can be the same as the one mentioned in the previous chapter on concept network transfer action compensation, except that the "distance between dependency arcs" mentioned in the algorithm is the same in these dependency trees, and all of them are set to "hit concept transfer action" (i.e., the hit value is 1).
[0311] The key idea is that, under the premise that the input state and output action are the same, the feature information input into the neural network model is different due to the different word features, so each word will receive a different transition action score.
[0312] √ For example, generating DEF in the example above
[0313]
[0314] 1.1.3. Contextual Session
[0315] The contextual session is present throughout the entire generation process. The same contextual session exists throughout the same understanding and generation process.
[0316] ■ Generate Session
[0317] The generation session is generated from the context session. In single-turn / multi-turn dialogues, the generation session also depends on the currently running session. The generation session operates during the generation phase, and its lifecycle begins with DEF generation and continues until the syntactic analysis ends.
[0318] Before the generation session ends, the included data (such as DEF queues) will be merged into the context session to facilitate the generation of the following text or the analysis and execution of the next round of dialogue.
[0319] IV. Natural Language Generation
[0320] like Figure 1 Expressing a given intention or idea using natural language text is what we call natural language generation. The natural language generation process described in this article generally has the following characteristics:
[0321] ■ Based on conceptual networks;
[0322] ■ It goes through multiple stages, including DEF generation and syntactic analysis, to generate natural language sentences that match the intent, meeting the needs of generating chapters / paragraphs and realizing single-turn / multi-turn dialogues;
[0323] ■Contextual sessions are used throughout the entire generation process;
[0324] 4.1. Implementation Process
[0325] 4.1.1. DEF Generation
[0326] The primary method for generating DEF (Descriptive Expression File) based on the intended meaning is through rules. These rules can be defined using techniques such as configuration.
[0327] √ For example, in the process of defining a concept, DEF analysis, and execution, the intention is to express the necessary and optional dependencies:
[0328]
[0329] √For example, the result of running DEF needs further prompting or dialogue with the user:
[0330]
[0331]
[0332] 4.1.1.1. Programming Languages
[0333] As discussed in previous chapters, the essence of a programming language is its syntax rules, and programming languages generally allow code to be converted into a syntax tree using a parser. Therefore, a parser can convert code into a syntax tree, and then a DEF generation engine can convert the syntax tree into a DEF file, such as... Figure 2 .
[0334] The GScript language also has a parser that can convert code into a syntax tree. Furthermore, current versions of GScript support many computer languages that, when used with their corresponding parsers, can be directly converted into GScript. Figure 3 .
[0335] The next section of this article will mainly discuss the generation strategy of the GScript language. The strategies for most other programming languages, such as Java, HTML, JS, CSS, JSON, and XML, are basically the same, so they will not be detailed here.
[0336] 4.1.1.1.1. GScript Language
[0337] 4.1.1.1.1.1.GScript / Java Syntax Rules
[0338] For details, please refer to the previous chapters "GScript Syntax Rules" and "Java Syntax Rules".
[0339] 4.1.1.1.1.2.DEF Generation Engine
[0340] 4.1.1.1.1.2.1.GScript
[0341] 4.1.1.1.1.2.2.Java
[0342] The Java syntax has been covered in previous chapters.
[0343] 4.1.1.1.1.2.3.Html
[0344] HTML syntax has been covered in previous chapters. The generation method can be found in the previous section, "GScript Instruction Functions - Extended Instructions - HTML".
[0345] 4.1.1.1.1.2.4.Css
[0346] The CSS syntax has been covered in previous chapters. For generation methods, see the previous section, "GScript Directives and Functions - Extended Directives - CSS".
[0347] 4.1.1.1.1.2.5.Xml
[0348] XML syntax has been discussed in previous chapters. The generation method can be found in the previous section, "GScript Instruction Functions - Extended Instructions - XML".
[0349] 4.1.1.1.1.2.6.Json
[0350] JSON syntax has been covered in previous chapters. For generation methods, see the previous section, "GScript Instruction Functions - Extended Instructions - JSON".
[0351] 4.1.1.1.1.2.7.Js (Javascript)
[0352] JavaScript syntax has been covered in previous chapters.
[0353] For some of the generation methods, please refer to the previous section GScript "Instruction Functions - Extended Instructions - JS (JAVASCRIPT)" and "Operation Functions - Extended Operation Functions - JS (JAVASCRIPT)".
[0354] 4.1.1.2. DEF Connection
[0355] There may be multiple DEFs generated. To ensure semantic coherence and logical flow, these DEFs are logically linked together using cohesive devices. These cohesive devices mainly include: merging, reference, ellipsis, clause segmentation, appending, linking, and referencing.
[0356] ■Merger
[0357] This refers to merging locally identical parts in DEF, expressing the conciseness of the language.
[0358] √For example, the rules for merging multiple subject-verb-object-DEF pairs without a pivot or object complement:
[0359] a. Only the concepts of the subjects DEF are the same;
[0360]
[0361]
[0362] b. Only the subject and predicate DEF have the same concept;
[0363]
[0364] c. Only the concepts of subject, predicate, and complement (DEF) are the same;
[0365]
[0366] d differs only in the concepts of complements DEF;
[0367]
[0368] e has the same concept for both the predicate and the complement DEF;
[0369]
[0370] f Only the predicate, object, and complement have the same concept as DEF;
[0371]
[0372] g. Only the subject and object have the same concept of DEF;
[0373]
[0374] h Only the concepts of subject, object, and complement DEF are the same;
[0375]
[0376] √The above example statement ② "Create User"
[0377]
[0378] ■Referring to
[0379] In context, pronouns and other means are used to transform DEF, serving to replace or indicate people or things. The pronouns are mainly personal pronouns and demonstrative pronouns.
[0380] √For example
[0381]
[0382] ■Omit
[0383] In the context of the conversation, DEF, which have already been stated above, are omitted to avoid semantic repetition and highlight the key points. This is usually used in conjunction with referential devices.
[0384] √In the example above, (be(name,@var.name="a",ude1))var→(this)var means that the restatement description "the noun is a" is omitted.
[0385]
[0386] ■Sentence segmentation
[0387] This refers to separating out excessively long sections from DEF and using them as supplementary clauses. It is usually used in conjunction with pronouns and conjunctions.
[0388] √For example:
[0389]
[0390] ■Additional
[0391] By adding words, interjections, etc. to DEF, the sentences can be made unambiguous, more fluent, and more expressive of emotions.
[0392] √For example:
[0393]
[0394] ■Connection
[0395] Connecting DEFs by linking and referencing them is a common technique used in merging.
[0396] √For example:
[0397]
[0398] ■Reference
[0399] Based on the context of the conversation, and using some DEFs mentioned above as reference points, we transform DEFs using methods such as comparison, analogy, and exclusion.
[0400] In addition to rule-based implementation, DEF concatenation can also be achieved through neural networks, such as keyword-based seq2seq methods.
[0401] 4.1.1.3. Context Generation
[0402] Context generation sessions use a "last-in, first-out" queue to store valid DEFs generated from the context. This primarily occurs in single-turn / multi-turn dialogues and in programming language code generation statements. Typically, in single-turn / multi-turn dialogues, these DEFs also carry dependency conditions to be matched, used to determine whether the user's response satisfies these dependency conditions and to generate an appropriate response.
[0403] √For example, the statement ① "Create variable":
[0404]
[0405] During the understanding process, the context session merges and stores data contained in the analysis and running sessions; during the generation process, the context session merges and stores data contained in the generation session. This data provides crucial information for DEF (Derivative-Executable) connections, such as referencing, omission, and reference.
[0406] 4.1.2. Syntactic Analysis
[0407] 4.1.2.1. Generation Principles
[0408] Depending on the DEF type, the principles for generating sentences also differ, as described below:
[0409] ■If DEF has already been assigned to a generation template or rule, then generate a word sequence according to that template or rule;
[0410] ■Otherwise, proceed as follows:
[0411] ◆General DEF, word selection
[0412] ◆With additional DEF
[0413] ●Select words; the following are referred to as the central words.
[0414] ● The words selected by adding DEF on the left are arranged to the left of the head word.
[0415] ● The words selected by adding DEF on the right will appear to the right of the head word in sequence.
[0416] ● The words selected by punctuation marks DEF are on the far right.
[0417] ◆DEF with additional and limited features
[0418] ●Select words; the following are referred to as the central words.
[0419] ● The words selected by the left-hand appendix DEF are listed in order on the far left.
[0420] ● The words selected by DEF are arranged to the left of the headword.
[0421] ● The words selected by adding DEF on the right will appear to the right of the head word in sequence.
[0422] ● The words selected by punctuation marks DEF are on the far right.
[0423] ◆Connection and referencing DEF
[0424] ●The words selected by DEF at the beginning are on the left; these are called the headwords.
[0425] ●The words selected at the end of DEF are listed on the right in order.
[0426] ◆Subject-Verb-Object-DEF
[0427] ●Select words; the following are referred to as the central words.
[0428] ●The word selected by subject DEF is placed to the left of the headword; these are referred to as subject DEF words.
[0429] ●The word selected by the object DEF is to the right of the headword; these are referred to as the object DEF word.
[0430] ●The word selected by the pivot or object complement (DEF) is located between the subject (DEF) and object (DEF) in Chinese, and to the right of the object (DEF) in English.
[0431] ●The words selected by complements DEF are listed in order on the far right.
[0432] 4.1.2.2. Generation Method
[0433] The purpose of syntactic analysis is to transform DEF (descriptive, non-descriptive) data into sentences that conform to human language habits. Common methods include those based on generative templates and rules, as well as those based on statistical models such as N-gram language models and neural networks.
[0434] 4.1.2.2.1. Word segmentation methods
[0435] DEF generation may involve multiple rules, as in example sentence ③ above, where sentence generation offers various options. Furthermore, a single concept can directly or indirectly correspond to multiple words.
[0436] Sentence generation involves selecting the best word sequence from an ordered set of words. Word segmentation algorithms find the best segmentation result among the resulting words; this result is the word sequence. Common algorithms used include bigram models and shortest distance algorithms.
[0437] √For example
[0438]
[0439] 4.1.2.2.2. Dependency parsing method
[0440] Dependencies between DEFs depend on dependency relations; therefore, the dependent words of DEFs are dependent on their head words. The purpose of dependency parsing is to find the best dependency tree for the segmentation results. Here, we still use transition-based dependency parsing, and a neural network classifier is also required.
[0441] Unlike dependency parsing, the classifier takes a state as input and sets the most probable action to be the action corresponding to the dependency relation, then records the score of each word. After a series of transition actions, a final state is reached, yielding the word sequence. This may generate many dependency trees, from which the optimal result can be obtained through an algorithm. The algorithm can be the same as the one mentioned in the previous chapter on concept network transition action compensation, except that the "distance between dependency arcs" mentioned in the previous algorithm is the same in all these dependency trees, and all are set to "hit the concept-to-concept transition action" (i.e., the hit value is 1).
[0442] The key idea is that, under the premise that the input state and output action are the same, the feature information input into the neural network model is different due to the different word features, so each word will receive a different transition action score.
[0443] √ For example, generating DEF in the example above
[0444]
[0445] 4.1.2.2.3. Other methods
[0446] For example, machine translation methods can be used to translate the input source (DEF) into the output target (sentence).
[0447] 4.1.3. Contextual Session
[0448] The contextual session is present throughout the entire generation process. The same contextual session exists throughout the same understanding and generation process.
[0449] ■ Generate Session
[0450] The generation session is generated from the context session. In single-turn / multi-turn dialogues, the generation session depends on the currently running session. The generation session operates during the generation phase, and its lifecycle begins with DEF generation and continues until the syntactic analysis ends.
[0451] Before the generation session ends, the included data (such as DEF queues) will be merged into the context session to facilitate the generation of the following text or the analysis and execution of the next round of dialogue.
[0452] V. Language Conversion
[0453] The method for multilingual conversion combines the above-mentioned natural language understanding and generation methods, as follows: Figure 5 As shown.
[0454] In Language 1, passages / paragraphs and monologues / multi-turn dialogues are segmented into sentences using the concept network of Language 1. Each sentence is then analyzed into a DEF by a series of steps, including segmentation of concept words, DEF analysis, and dependency parsing of concept definition DEF analysis. Based on the concept network of Language 2, the DEFs are then generated into sentences through DEF generation and syntactic analysis. Finally, these sentences constitute passages / paragraphs and monologues / multi-turn dialogues of Language 2.
[0455] The DEF generation here includes DEF transformation functionality. The purpose of DEF transformation is to convert the DEF generated under the conceptual network of Language 1 into the DEF under the conceptual network of Language 2. The transformation method can be implemented through rules (such as rule mapping between two conceptual networks) and statistics (such as sequence-to-sequence between DEFs). The transformed DEF is then processed through DEF concatenation and other means, and then subjected to syntactic analysis to generate sentences in Language 2.
[0456] VI. Conclusion
[0457] Later in this paper, we will further elaborate on the use of neural networks and deep learning algorithms to achieve: constructing a general concept network; directly moving from word segmentation to DEF analysis, or even directly to concept definition DEF analysis, without syntactic analysis; improving the fluency of generated sentences by optimizing DEF cohesion and syntactic analysis; achieving sequence-to-sequence between DEFs and between DEFs and language; and so on.
[0458] This application is based on a conceptual network and is implemented as follows:
[0459] 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.
[0460] 1.1. Definition
[0461] A concept network consists of two parts: the concepts themselves and the connections between them.
[0462] 1.1.1. Concept
[0463] 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).
[0464] 1.1.1.1. Word Concept
[0465] 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.
[0466] A concept definition (DEF) refers to the specific definition or implementation of a concept, also known as a concept instance. It differs from the DEF in the knowledge dictionary described by HowNet, and the two should not be confused. A natural language word can correspond to one or more concepts. Some words have multiple parts of speech, therefore, words with specific parts of speech can also be assigned to one or more concepts.
[0467] √ 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.
[0468] The word concepts in the above examples do not contain any relational components and are called general word concepts.
[0469] The concept of words also includes:
[0470] ◆Word concepts containing relational elements
[0471] 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.
[0472] √ 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.
[0473] Furthermore, semantic relationships expressed in natural language can be indirectly achieved through relational components. Examples are as follows:
[0474]
[0475]
[0476] ◆ Concept of compound words
[0477] Such concepts are composed of multiple words, or at least the words are related to the concept.
[0478] √ 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.
[0479] ◆ Concept of word set
[0480] This type of concept indicates that there are multiple words, words with components, or compound words that correspond to the concept.
[0481] √ For example, the concept ID = caru can be associated with words such as "because {1} therefore {2}", "the reason {2} is because {1}", "since {1} then {2}", "because {1}", "due to {1}", "for {1}", "in order to {1}", "for the sake of {1}", "therefore {2}", "so {2}", "the reason {2}", "for the sake of {1}", "so that {1}", etc., indicating cause and effect, with the cause or purpose stated first and the result explained later; for example, the concept ID = create can be associated with words such as "definition", "create", "new", "establish", "build", "build", "construct", "initial", "build", "build", "create", etc., indicating the action of creation.
[0482] 1.1.1.2. Concept of No Word
[0483] 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.
[0484] √ For example, the concept ID = @time is used to refer to time or date, such as the words "20150712", "tomorrow", "a few days ago", or "a certain day". A concept recognizer is needed to identify whether a word is a time concept.
[0485] 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:
[0486] ◆Wordless concepts with ontological connotations
[0487] These types of concepts are usually used to describe a class of concepts, and they have specific word concepts that correspond to them.
[0488] √ 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 = *valu `e` is used to describe the role of a concept relationship—value. 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 a word like string, 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 a word like number, 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 a word 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".
[0489] 1.1.1.3. Unknown Concept
[0490] This indicates that a concept definition (DEF) cannot be generated for this concept and will be ignored during natural language processing.
[0491] These types of unknown concepts also include:
[0492] ◆Unknown word concept
[0493] These types of concepts have a single natural language word corresponding to them.
[0494] ◆ Concept of Unknown Word Set
[0495] There are multiple natural language terms that correspond to this type of concept.
[0496] 1.1.2. Conceptual Connections
[0497] 1.1.2.1. Basic
[0498] This refers to the semantic relationship chain between concepts, used to describe multi-level semantic relationships between concepts. Examples of such semantic relationships include:
[0499] ■Species
[0500] 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.
[0501] √ For example, thing – event | object; object – news | user | department; red – vermilion | carmine | crimson.
[0502] ■ Parts
[0503] The relationship between the whole and its components.
[0504] √ For example, quantity—number | unit; time—year | month | day | hour | minute | second | millisecond; human—head | body.
[0505] ■Attribute
[0506] Relationships such as host-attribute, host-possession, host-characteristic, material-finished product, etc. The host also includes actions.
[0507] √ For example, variable var - name | value; news - title | content | attachments | author; personality - good or bad; format - pattern.
[0508] ■Value
[0509] The relationship between attribute-value and entity-value.
[0510] √ For example, quantity — @quantity; title — @string; color — @color.
[0511] ■Subject-Verb (SV)
[0512] Source of action - Relationship of actions.
[0513] √ For example, "me" means create, modify, delete, query, or publish; for example, "@number" means add or subtract.
[0514] ■ Verb-Object (VO)
[0515] The relationship between action and action target.
[0516] √ For example, create—var; publish—news.
[0517] ■Related(R)
[0518] 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.
[0519] √ For example, cold — hot; good — bad.
[0520] A concept can form one or more inherent semantic relationships with multiple concepts, and the semantic relationships between concepts can be multi-layered.
[0521] 1.1.2.2. Dynamic Formation
[0522] A concept can gradually form new conceptual connections with multiple concepts during the natural language understanding process.
[0523] √ 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.
[0524] 1.1.2.3. Features
[0525] This indicates that the connection between concepts reflects the relationship. affim , negative , possible , scope , probability , degree , frequency , time , tone wait.
[0526] √ 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 .
[0527] 1.2. Construction Methods
[0528] The construction of conceptual networks can be achieved through several aspects, including basic definition, generation, extended definition, and dynamic formation.
[0529] 1.2.1. Basic Definitions
[0530] 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.
[0531] √ For example, concept configuration files concepts / base1.json and concepts / action1.json, and concept connection configuration files connectivities / base1.json and connectivities / action1.json.
[0532] 1.2.2. Generation
[0533] 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.
[0534] 1.2.2.1. Data Structure
[0535] ■ Structured Data
[0536] 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.
[0537] √ For example, Excel field types (defined in cell format) include: numeric, 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.
[0538] 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.
[0539] ● 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.
[0540] ■Non-relational databases
[0541] 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:
[0542] √BigTable—BigTable is a key-value mapping, but it uses many relational database terms, such as table, row, column, etc.
[0543] √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.
[0544] √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.
[0545] 1.2.2.1.1. Generation Method
[0546] 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.
[0547] √ 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".
[0548] 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.
[0549] √ For example, the concept ID = object and the concepts ID = user and ID = news in the above example constitute a genus-species relationship.
[0550] 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.
[0551] √ For example, the field name in the user table can generate the concept ID = user.name, which can include words such as "name", "name", "first name", "first name", "first name", etc.; the field sex in the user table can generate the concept ID = user.sex, which can include words such as "sex" and "gender"; the field title in the news table can generate the concept ID = news.title, which can include words such as "title", "headline", "main title", etc.; the field creator in the news table can generate the concept ID = news.creator, which can include words such as "creator" and "creator".
[0552] At the same time, the concepts generated by the table and the concepts generated by these fields form an ATTRIBUTE attribute relationship.
[0553] √ 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.
[0554] 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.
[0555] √ 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.
[0556] 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.
[0557] √ 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.
[0558] 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.
[0559] √ 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.
[0560] 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.
[0561] √ For example, if the field "creator" in the "news" table has a foreign key relationship with the "user" table, then the concept ID = "news.creator" and the concept ID = "user" have a VALUE relationship.
[0562] 1.2.2.1.2. Object Data Management Technology
[0563] 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.
[0564] 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.
[0565] √ 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;
[0566] The object template file supports multiple languages, including Chinese and English. It defines the terms referring to the table, the attribute field names, the 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.
[0567] √ For example, the object template file department.xml.
[0568] In object data management technology, data types are defined into three types: simple type SIMPLE, composite type COMPLEX, and structured type STRUCTURE.
[0569] ■Simple Type SIMPLE
[0570] 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.
[0571] √ For example, in the above object template file department.xml, the parent attribute is of object type and points to the current object table.
[0572] ■Composite Type COMPLEX
[0573] 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.
[0574] √MongoDB can use embedded document types;
[0575] √ For example, the attribute (field) price definition indicates that the price consists of a numerical value and a unit;
[0576] ■Structure Type
[0577] 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 this authorized function `functions` is an attribute of the role, and it is a structure type. This type of attribute also consists of multiple sub-attributes, and the attributes and sub-attributes also form an ATTRIBUTE attribute relationship.
[0578] √MongoDB can use array types with their elements being embedded document types, representing a document-embedded document relationship;
[0579] √ For example, the definition of attribute (field) authorization functions.
[0580] 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.
[0581] The concept generation engine can generate concepts and concept connections based on object template XML.
[0582] 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.
[0583] 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.
[0584] 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.
[0585] √For example, data types and concepts.
[0586]
[0587]
[0588] ◇The above example object template file department.xml generates concepts and concept connections. Concepts ID=@phone and ID=@fax are custom wordless concepts, used to identify telephone numbers and fax numbers, respectively.
[0589] 1.2.2.2. Programming Languages
[0590] 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.
[0591] Programming languages generally have a parser that can convert code into a syntax tree and vice versa, as shown in the table below:
[0592]
[0593] 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.
[0594] 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.
[0595] 1.2.2.2.1. Generation Method
[0596] 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.
[0597] 1.2.2.2.2.GScript Language
[0598] 1.2.2.2.2.1. GScript Syntax Rules
[0599] The GScript language syntax consists of three parts: instruction functions, operators, and operation functions.
[0600] ■Instruction Functions
[0601] The instruction function takes the form of:
[0602] <function name>(<function parameter 1>, <function parameter 2>, ...){
[0603] <function body>
[0604] };
[0605] 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.
[0606] 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, on the other hand, are related to the target generated programming language and can be dynamically expanded during use.
[0607] ■ Operators
[0608] GScript supports the following characters, and their priority order is shown in the table below:
[0609]
[0610]
[0611] 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.
[0612] ■ Operational Functions
[0613] The main operational functions include mathematical, string, HTML, date, array, object, value retrieval, JSON, debugging, and other extended operational functions.
[0614] 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 with Java seamlessly. Java constants, classes, properties, and methods can be accessed and invoked using getter operators and getter functions.
[0615] The current version of GScript supports the following computer languages, as shown in the table below:
[0616] Supported computer languages Instruction library 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
[0617] 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.
[0618]
[0619] 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.
[0620] 1.2.2.2.2.2. Java Syntax Rules
[0621] 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.
[0622] 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.
[0623] 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.
[0624] 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.
[0625] 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.
[0626] 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.
[0627] 1.2.2.2.2.3. Concept Generation Engine
[0628] 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.
[0629] 1.2.2.2.2.3.1.GScript
[0630] 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.
[0631] ■Instruction Functions
[0632] ◆Basic Instructions
[0633]
[0634]
[0635] ◆Extended Instructions
[0636] ●TEXT
[0637]
[0638] ●JSON
[0639]
[0640] ●XML
[0641]
[0642] ●HTML
[0643]
[0644]
[0645] ●CSS
[0646]
[0647] ●JS (JavaScript)
[0648]
[0649] ■ Operators
[0650]
[0651]
[0652] ■ Operational Functions
[0653]
[0654]
[0655]
[0656] 1.2.2.2.2.3.2.Java
[0657] 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.
[0658] 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.
[0659] √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.
[0660] √ 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.
[0661] 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.
[0662] 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.
[0663] At the same time, the basic definition of the concept ID=object and the concepts generated from these classes constitute a SPECIES relationship.
[0664] √ For example, the concept ID = object and the concepts ID = cogpciActionContext and ID = cogpciApplicationContext in the above example constitute a SPECIES relationship;
[0665] 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.
[0666] The engine handles each field of a class differently depending on how it is referenced:
[0667] ① 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;
[0668] ② 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.
[0669] √ For example, class com.onegrid.grid.platform.context4.impl.ActionContext(conceptID = cogpciActionContext).
[0670] ③ 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.
[0671] √ For example, class com.onegrid.grid.platform.core4.impl.bean.RequestPage(concept ID = cogpcibRequestPage).
[0672] The engine also needs to handle different data types separately:
[0673] ①Class: Basic data types and their corresponding object types.
[0674] ②Classes: Collection types, mainly including arrays and classes that implement java.lang.Collection.
[0675] ③ Classes: Other types, including java.lang.Object, java.lang.Class, enumerations, etc.
[0676] Engine-defined class fields: If a field is not configured or has no conceptual connection defined by annotations, then:
[0677] ◆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.
[0678] ◆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.
[0679] √ 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.
[0680] Engine-defined class methods: If a method is not configured or annotated with concepts and concept connections, then:
[0681] ◆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.
[0682] ◆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.
[0683] Engine-defined 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.
[0684] 1.2.2.2.2.3.3.Html
[0685] 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 the generation of concepts and conceptual connections, see the previous section, GScript "Instructions and Functions - Extended Instructions - HTML".
[0686] 1.2.2.2.2.3.4.Css
[0687] 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".
[0688] 1.2.2.2.2.3.5.Xml
[0689] 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 the generation of conceptual connections, see the previous section, GScript "Instructions and Functions - Extended Instructions - XML".
[0690] 1.2.2.2.2.3.6.Json
[0691] 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 Instruction Functions - Extended Instructions - JSON".
[0692] 1.2.2.2.2.3.7.Js (Javascript)
[0693] 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.
[0694] √ For example, executing GScript Js (Javascript) code generates Javascript code.
[0695] 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.
[0696] √ For example, the default GScript configuration.
[0697] 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, catch, etc. 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.
[0698] For some concepts and the generation of concept connections, please refer to the previous section GScript "Instruction Functions - Extended Instructions - JS (JAVASCRIPT)" and "Operation Functions - Extended Operation Functions - JS (JAVASCRIPT)".
[0699] 1.2.2.3. Semantic Networks / Dictionaries / Knowledge Bases
[0700] Currently, the mainstream semantic networks / dictionaries / knowledge bases include ConceptNet, FrameNet, WordNet, and HowNet. 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.
[0701] 1.2.3. Extended Definition
[0702] 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.
[0703] 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.
[0704] √ 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.
[0705] √Word2Vec is a tool that converts words into vector form. It simplifies the processing of text content into vector operations in a vector space, calculating the similarity in the vector space to represent the semantic similarity of the text.
[0706] 1.2.4. Dynamic Formation
[0707] 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.
[0708] √ For example, the statement "I don't have a bag" expresses an ATTRIBUTE connection between "me" and "bag," but this connection is characterized as follows in the current context: negative However, the characteristics of the connections added to the conceptual network are... Ken Certainly .
[0709] For example, human intervention in the natural language understanding process, such as adding words to concepts or adding connections between concepts.
[0710] This depends on the specific application.
[0711] 1.2.5. Word Vectors
[0712] 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:
[0713] √One-hot Representation. A vocabulary is created and each word is sequentially numbered. In practice, sparse encoding is generally used for storage, primarily relying on word numbers. A major problem with this representation method is its inability to capture the similarity between words; even synonyms show no relationship in their word vectors. Furthermore, this method is prone to the curse of dimensionality, especially in some Deep Learning applications.
[0714] √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.
[0715] 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.
[0716] There are two main ways to combine it with word vectors.
[0717] ■ 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.
[0718] ■ Concept IDs are directly derived from word vectors.
Claims
1. A method for natural language generation based on a conceptual network, characterized in that: Based on the concept network, the intended message is sequentially processed through DEF generation and syntactic analysis to generate a natural language statement that matches the intended message. The concept network is a system that defines the concepts of things and the semantic relationships between concepts, including concepts and concept connections. The concept connections are semantic relationship chains between concepts, used to describe one or more layers of semantic relationships between concepts. DEF is a specific definition or implementation of a concept. The DEF generation method converts a programming language into a DEF using a DEF generation engine. The DEF generation engine expresses the syntax rules of the programming language into a DEF representation, which is then converted into a DEF using a DEF representation converter. The DEF generation method uses the DEF representation to configure and define the language. The DEF representation is converted into a DEF using a DEF representation converter. DEFs are categorized into general DEFs, DEFs with additional parameters, DEFs with additional parameters and limitations, conjunctions and prepositions, and subject-verb-object DEFs. General DEFs are directly represented using concept numbers. The DEF generation engine uses the formatting scripting language GScript to generate DEF files from Java, JavaScript, HTML, CSS, XML, JSON, text, or other programming languages.
2. The natural language generation method based on concept networks according to claim 1, characterized in that: The concept network described is a system that defines the concepts of things and the semantic relationships between concepts, including concepts and concept connections. Each concept has a unique number, and concepts are divided into three categories: word concepts, wordless concepts, and unknown concepts; among them... The concept of a word includes general word concepts, word concepts with relational components, compound word concepts, and word set concepts. The characteristic of a word concept is that there are natural language words that directly correspond to this concept, and there are also converters that realize the definition of the concept. 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 a concept recognizer that allows natural language words to indirectly correspond to the concept. Unknown concepts include unknown word concepts and unknown word set concepts. The characteristic of unknown concepts is that it is impossible to generate a concept definition for them, and they will be ignored in the natural language processing process. The concept connection is a semantic relationship chain between concepts, used to describe one or more layers of semantic relationships between concepts.
3. The natural language generation method based on concept networks according to claim 1, characterized in that: The syntactic analysis methods mentioned include those based on generated templates and rules, those based on N-gram language models, or those based on neural network statistical models.
4. The natural language generation method based on concept networks according to claim 3, characterized in that: The syntactic analysis method described uses a word segmentation method based on an N-gram language model.
5. The natural language generation method based on concept networks according to claim 3, characterized in that: The neural network statistical model of the syntactic analysis method uses dependency parsing.
6. The natural language generation method based on concept networks according to claim 5, characterized in that: The dependency parsing method is as follows: the classifier takes a state as input and sets the most likely action to be the action corresponding to the dependency relation. Then, it records the score obtained for each word. After a series of transition actions, it finally reaches the termination state and obtains the word sequence.
7. The natural language generation method based on concept networks according to claim 1, characterized in that: The DEF generation also includes a DEF conversion function to enable conversion between different languages.
Citation Information
Patent Citations
Natural language generating apparatus, vehicle having the same and natural language generating method
US20200342060A1