A method for encoding semantics and semantic sequences across symbol systems
By adopting the combination method of absolute semantic code and symbolic system code in the field of signal processing, language processing, and artificial intelligence, the use of graph structure to implement the semantic and sequential coding of cross -symbolic systems. Dynamic learning and building a strong artificial intelligence system.
Patent Information
- Application Number
- CN202110432590.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-21
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-04-21
AI Technical Summary
The prior art is difficult to unify the coding of semantic and semantic sequences across symbolic systems, limiting the development of advanced functions of signal processing, language processing and artificial intelligence systems.
The combination method of absolute semantic code and symbolic system code is adopted to implement the semantic and sequential coding of cross -symbolic systems through the graph structure, dynamically learn new symbolic systems and define semantics.
The semantic and sequential coding of cross -symbolic systems is implemented, supporting new symbols and systems on online learning, and building a strong artificial intelligence system enable technology.
Smart Images

Figure CN113158625B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of signal processing, natural language processing and artificial intelligence, and in particular to a method for encoding semantics and semantic sequences across symbol systems. Background Art
[0002] A discrete signal can be abstracted as a sequence. For a discrete signal with only a finite number of possible signal values, the signal value at each position in the sequence can be abstracted as a "character". All possible signal values (i.e., all possible characters) can form a "symbol system". Therefore, a discrete signal with a finite number of possible signal values can be abstracted as a sequence represented by characters in a specific symbol system. Characters have specific "semantics"; the sequence pattern composed of characters also has specific "semantics".
[0003] Similar to signal processing, a commonly used technique in natural language processing and artificial intelligence systems is to use character sequences to represent specific semantics. Such character sequences can be called "semantic sequences". For example, in telecommunications and computer science, serial communication technology transmits one bit of data at a time through a data channel and performs this single process continuously. The receiver of the communication signal receives a sequence of characters in a bit symbol system ("0" and "1"). This sequence represents a specific data (i.e., semantics), so it is a ideographic sequence. However, the ideographic sequence must correspond to a symbol system in order to be truly understood.
[0004] For example, if based on Figure 2 The Braille character table adopts the writing rule of "from left to right, from top to bottom, black circle is 1, white circle is 0", and can write a semantic sequence composed of characters in the bit symbol system of Braille (denoted as X symbol system), "011000000000100000110010000000011010100000110010" (denoted as Y sequence). In the X symbol system, the real meaning represented by the Y sequence corresponds to the string "I am Sam". However, there is another symbol system that can interpret the Y sequence, for example, there is a "binary digital symbol system" (denoted as Z symbol system). In the Z symbol system, the real meaning represented by the sequence Y corresponds to the value 105588314974258. Therefore, the real meaning of the Y sequence can only be clarified when its symbol system is also clear.
[0005] In addition, within the same symbol system, the meanings represented by the ideographic sequence also have a hierarchical structure. The source of this hierarchical structure is that there are repeated segments in the sequence (or called sequence patterns, such as Figure 2The Braille code table defines 40 sequence patterns of "0" and "1". In the same symbol system, a sequence pattern represents a (more complex) meaning, and a more complex meaning can be composed of simpler meanings. And a more complex meaning can also be combined with a simpler meaning to form a more complex meaning.
[0006] For example, in the previous example, if the Y sequence representing "I am Sam" is defined as a (more complex) semantics (sequence pattern), then Y can be combined with the (simpler) sequence pattern representing the semantics of English letters (recorded as 'i', 's', 'a', 'e', 'n', 't', 'c', '') to form a new sequence to represent a more complex semantics "Y is an entity" or "'I am Sam' is a sentence".
[0007] At present, in the fields of signal processing, language processing, and artificial intelligence, widely used sequence coding technologies are generally used for the purpose of compression or error correction. These technologies are based on a fixed symbol system, that is, the original sequence and the encoded sequence use characters from the same symbol system. The encoding goal of compression technology is to represent the original sequence with a shorter sequence. The encoding goal of error correction technology is to map the original sequence to a longer encoded sequence, so that there are differences in multiple positions between the encoded sequences of any possible original sequence. Therefore, in the process of transmitting the encoded sequence, if only a small number of transmission errors occur, the system can detect or correct these errors.
[0008] Due to the lack of a universal technology for uniformly encoding semantics and semantic sequences in multiple different symbol systems, it is difficult to efficiently establish signal processing, language processing, and artificial intelligence systems with advanced functions across symbol systems. At the same time, since various existing software and hardware tools often use different symbol systems to implement their internal logic, the lack of semantics and semantic sequence encoding technology across symbol systems also limits the feasibility of constructing more complex and more comprehensive advanced systems based on existing tools through continuous integration.
[0009] When designing a method for encoding semantics and semantic sequences across symbol systems, an important difficulty is that it is impossible to know all symbol systems when designing the method. Therefore, the method needs to be able to dynamically learn new symbol systems and use them to express semantics. In particular, if engineers need to design a strong artificial intelligence system with learning and reasoning capabilities similar to humans, the system needs to have the ability to learn various symbol systems from scratch and use them to express semantics, similar to a newborn baby. Therefore, this method for encoding semantics and semantic sequences across symbol systems is an enabling technology for building a strong artificial intelligence system. Summary of the invention
[0010] In order to solve the deficiencies in the existing technical solutions, the present invention provides a method for encoding semantics and semantic sequences across symbol systems. The specific technical solution is as follows:
[0011] A method for encoding meanings and semantic sequences across symbol systems, consisting of two types of codes and a set of encoding methods.
[0012] The two types of codes are:
[0013] 1) Absolute semantic code: Absolute semantic code is expressed in the form of Ax, where x is an integer, such as A-35;
[0014] 2) Symbol system code: The symbol system code is expressed in the form of Sx, where x is an integer, such as S-35.
[0015] The encoding method is characterized by:
[0016] 1) It includes absolute semantic code, symbol system code, and the relationship between the two codes; the absolute semantic code represents an absolute semantic, and the symbol system code represents a symbol system; there is a relationship or constraint between the absolute semantic and the symbol system as shown in points 2)-4);
[0017] 2) An absolute semantics belongs to one or more symbol systems; an absolute semantics corresponds to a sequence of absolute semantics under a symbol system;
[0018] 3) Sequences are composed of absolute semantics; each position in a sequence is an absolute semantics; a sequence itself is also an absolute semantics;
[0019] 4) Based on an absolute semantics, a symbol system can be defined; that is, a symbol system must have an absolute semantics that defines it, but not every absolute semantics defines a symbol system.
[0020] As a further improvement, the "absolute semantics is subordinate to one or more symbol systems" described in the present invention can be specially processed as follows: there are "physical" symbol systems that can exist naturally and their symbol system codes can be compiled; accordingly, there are "physical" absolute semantics that can exist naturally, they have absolute semantic codes, but they can be subordinate to any symbol system. The understanding of the "physical" symbol system and the "physical" absolute semantics is:
[0021] 1) The encoding method of the present invention encodes a semantic sequence, and the source of the semantic sequence is some physical systems that can perceive the state of the physical world. For example, a "camera system" can perceive the state of the physical world in front of it (an image) and generate a semantic sequence to represent this physical world state (a character sequence in the BMP format file of the image). When a physical system that can perceive the state of the physical world (such as a camera system) generates a semantic sequence, the symbol system it uses is a "physical" symbol system, and the basic component units of the semantic sequence it generates (such as all possible characters in the BMP format file of the image) are the "physical" absolute semantics that are subordinate to the physical symbol system.
[0022] 2) In the encoding method of the present invention, a "physical" symbol system may not compile a symbol system code. The reason for this is that each character under a different "physical" symbol system has different absolute semantics. In other words, even if the representation forms of these absolute semantics are the same (such as the "0" character and the digital "0" character in the BMP format file of an image), they have different actual meanings; therefore, characters from different "physical" symbol systems, regardless of their form, should be directly given different absolute semantic codes. At the same time, these "physical" absolute semantic codes can also be understood as not belonging to any symbol system, that is, they all represent different absolute semantics that exist naturally.
[0023] 3) Based on the above understanding, the encoder implementing the encoding method of the present invention should provide a function of "learning characters of the physical symbol system". This function directly creates absolute semantic codes representing characters of the physical symbol system. For example, if the encoder is operated by a program written in Java language, for the encoder, all object instances in the Java program are characters under the "physical" symbol system of the "Java program environment", and each Java object instance can correspond to an absolute semantic code.
[0024] As a further improvement, the "sequence is composed of absolute semantics; each position in a sequence is an absolute semantics; a sequence itself is also an absolute semantics" described in the present invention is implemented by the following method:
[0025] 1) Define a special absolute semantics to represent "empty sequence";
[0026] 2) Using the suffix (or prefix) coding method, the absolute semantic code of each suffix (or prefix) sequence of the sequence is encoded in order from short to long, and finally the absolute semantic code of the entire sequence is obtained.
[0027] As a further improvement, the encoding process of the present invention can be implemented using a graph structure, which has the following characteristics:
[0028] 1) The nodes in the graph can be labeled by absolute semantic codes or by symbolic system codes;
[0029] 2) The edges in the graph can be marked by absolute semantic codes or by symbolic system codes;
[0030] 3) There is at most one edge in the same direction between any pair of nodes marked with absolute semantic codes in the graph.
[0031] As a further improvement, a method based on a graph structure of the present invention has the following characteristics:
[0032] 1) Define a special absolute semantic code (denoted as A-0) to represent "empty sequence" and create a node marked by A-0 in the initial graph;
[0033] 2) Starting from the "empty sequence" node, through the edge marked with the absolute semantic code, arrive at a node marked with the absolute semantic code that represents the sequence with a length of one obtained by adding the absolute semantics on the edge to the front of the sequence of the starting node. According to this method, starting from the absolute semantics at the last position of the sequence to be encoded, the absolute semantics are added in reverse order, and finally the absolute semantics of the entire sequence is obtained.
[0034] As a further improvement, a specific implementation method of a graph-structured suffix encoding method of the present invention (the sequence to be encoded is [A-p1, A-p2, ..., A-pm, A-pn]) adopts the following steps:
[0035] 1) Check whether there is an edge marked as A-pn from the node marked by A-0 to another node; if there is such an edge, the mark of the node (denoted as A-t1) represents the shortest suffix sequence of the sequence to be encoded, that is, [A-pn]; if there is no such edge, create a new absolute semantic code, denoted as A-t1, create a node marked by A-t1, create an edge from the node marked by A-0 to the node marked by A-t1, mark the edge as A-pn, and create an edge from the node marked by A-t1 to the node marked by A-0, mark the edge as A-0 (used to index the source node of the node marked by A-t1). At this time, A-t1 represents the shortest suffix sequence of the sequence to be encoded, that is, [A-pn];
[0036] 2) Starting from node A-t1, check whether there is an edge marked as A-pm connecting to another node; if there is such an edge, the label of the node (denoted as A-t2) represents the sequence obtained by adding A-pm to the front of the suffix sequence represented by A-t1 (i.e. [A-pm, A-pn]), that is, A-t2 represents a suffix sequence of the sequence to be encoded that is slightly longer than A-t1; if there is no such edge, create a new absolute semantic code, denoted as A-t2, create a node marked by A-t2, and then create a Create an edge from the node marked by A-t1 to the node marked by A-t2, and set the label of this edge to A-pm. Create another edge from the node marked by A-t2 to the node marked by A-t1, and mark this edge as A-0 (used to index the source node of the node marked by A-t2; here, all the labels of the edges used to index the source nodes are A-0). At this time, A-t2 represents a slightly longer suffix sequence obtained by adding A-pm to the front of the suffix sequence represented by A-t1 (i.e., [A-pm, A-pn]);
[0037] 3) The suffix sequence is gradually extended according to the above method, and an already defined absolute semantic code is found for each suffix sequence or a new absolute semantic code is defined, and finally an absolute semantic code defined by the complete sequence to be encoded can be obtained; from the operation mode of the above process, it can be known that when the same sequence is encoded again, the encoding result will be the same as the result of the previous encoding;
[0038] 4) If you need to obtain a sequence represented by an absolute semantic code (denoted as Ax), you can do so by following the steps below: First, starting from the node marked by Ax, through the edge marked as "A-0", you can obtain the absolute semantic code (denoted as Ay) of the suffix sequence obtained by removing the first position of the sequence represented by Ax; then, since "there is at most one edge marked with the absolute semantic code in the same direction between any pair of nodes marked with the absolute semantic code in the graph", you can query and obtain an edge from the node marked by Ay to the node marked by Ax, and the label of this edge ( Then, taking Ay as Ax, repeat the above process to obtain the code of the suffix sequence whose length is Ax minus one and the absolute semantic code of the first position of the sequence represented by Ax (respectively denoted as A-p1, A-p2, ..., A-pn), until the obtained suffix sequence code is A-0. At this time, the sequence of absolute semantic codes of the first position of each suffix sequence obtained [A-p1, A-p2, ..., A-pn] is the sequence represented by Ax.
[0039] As a further improvement, the present invention states that “based on an absolute semantics, a symbol system can be defined; that is, a symbol system must have an absolute semantics that defines it, but not every absolute semantics defines a symbol system”, which is implemented by the following method:
[0040] 1) Define a special absolute semantics, denoted as "-1", which means "define symbol system". The code of this special absolute semantics is denoted as "A-'-1'".
[0041] 2) When a symbol system is defined by an absolute semantics (denoted as Ax), first find the node marked by Ax in the graph, and check whether there is an edge marked as "A-'-1'" from the node to another node; if such an edge exists, the mark of the reaching node (denoted as Sx) is the code of the symbol system defined by Ax; if such an edge does not exist, create a new symbol system code, denoted as Sx, and then create a node marked by Sx, and then create an edge marked as "A-'-1'" from the node marked by Ax to the node marked by Sx, and then create an edge marked as "A-'-1'" from the node marked by Sx to the node marked by Ax; at this time, Sx is the code of the symbol system defined by Ax.
[0042] 3) When a symbol system (denoted as Sx) is used to search for the absolute semantics that defines it, the node marked with Sx is found in the graph; there must be an edge marked as "A-'-1'" reaching another node from this node, and the mark of the node (denoted as Ax) is the absolute semantic code that defines Sx.
[0043] As a further improvement, the present invention's "an absolute semantics belongs to one or more symbol systems; an absolute semantics corresponds to a sequence of absolute semantics under a symbol system" is implemented by the following method: starting from the node marked with the absolute semantic code representing the sequence in the graph, an edge is connected to the node marked with the absolute semantic code inside the symbol system, and the edge is marked with the symbol system code; at the same time, starting from the node marked with the symbol system code, an edge is connected to the node marked with the absolute semantic code of the sequence, and the edge is marked with the absolute semantic code inside the symbol system.
[0044] 1) When an absolute semantics (denoted as Ax) corresponds to a sequence (denoted as Az) in a symbol system (denoted as Sy), an edge marked as Sy is established, starting from the node marked by Az and connected to the node marked by Ax. This edge indicates that the absolute semantics Ax in the symbol system Sy corresponds to the sequence represented by Az. At the same time, an edge marked as Ax is established, starting from the node marked by Sy and connected to the node marked by Az. This edge is used to trace back from Ax to define its sequence in Sy. According to the above method, the codes of the terminal nodes of all edges marked as Sy are absolute semantic codes belonging to the symbol system Sy.
[0045] 2) When it is known that a sequence (the absolute semantic code of the sequence is Az) corresponds to an absolute semantic under a symbol system (denoted as Sy), but the specific code of the absolute semantic is unknown, we can create a new absolute semantic code (denoted as Ax), create a node marked by the code, create an edge marked as Sy, connect the node marked by Az to the node marked by Ax, and then create an edge marked as Ax, connect the node marked by Sy to the node marked by Az;
[0046] 3) After the operation in point 2) above, if the coding system learns that the absolute semantics (denoted as Ax) under a certain symbol system (denoted as Sy) previously created by a certain sequence (denoted by the absolute semantic code of this sequence as Az) should be another existing absolute semantics (denoted as Ac), then the operation of merging Ac and Ax is performed, that is, one of the codes is retained (for example, retain Ac), all edges starting from the nodes marked by Ax are updated, and their starting points are set to the nodes marked by Ac, all edges reaching the nodes marked by Ax are updated, and their end points are set to the nodes marked by Ac, and all edges marked by Ax are updated, and their end points are set to the nodes marked by Ac. Ac marks, and then deletes the nodes marked by Ax; if Ax and Ac define symbol systems at the same time (respectively denoted as Sx and Sc), then further merge Sx and Sc, that is, keep one of the codes (for example, keep Sc), update all edges starting from the nodes marked by Sx, set their starting points to the nodes marked by Sc, update all edges reaching the nodes marked by Sx, set their end points to the nodes marked by Sc, update all edges marked by Sx, set them to be marked by Sc, and then delete the nodes marked by Sx; finally, remove redundant edges (only one edge with the same mark and direction is retained between two nodes).
[0047] 4) When an absolute semantics (denoted as Ax) is used to search for a sequence that is defined under a symbol system (denoted as Sy), a node marked with Sy is found in the graph. There must be an edge marked with Ax at this node. The label of the node reached by this edge (denoted as Az) is the absolute semantic code of the sequence that defines Ax under Sy.
[0048] As a further improvement, the specific implementation of the method for encoding semantics and semantic sequences across symbol systems of the present invention can adopt neural network computing hardware; the design and operation of the dedicated computing hardware corresponds to the structure and operation of the graph, and the corresponding relationship is as follows:
[0049] 1) Since the same code can mark a node or an edge in the graph, when designing hardware, nodes and edges correspond to different computing units; in other words, each computing hardware unit can be addressed by a code and a bit representing an edge or node; the addressing method can activate a specific computing unit representing a node or edge marked by a certain code;
[0050] 2) The computational unit is a hardware neuron; a hardware neuron can be activated by other activated hardware neurons; a neuron requires two input neurons to be activated in order to be activated;
[0051] 3) The basic unit of the aforementioned graph operation is to find a node from a node and an edge, or to find an edge from two nodes, and (sometimes) when the corresponding node or edge cannot be found, generate new code and the node and edge corresponding to the code, and connect them; this operation corresponds to the computing hardware finding the third hardware neuron through two activated hardware neurons. These basic units of graph operations can be mapped to the design and operation of computing hardware: the computing hardware contains a large number of unused hardware neurons, which are enabled on demand; the hardware neurons are set in pairs, and a pair of neurons is addressed by the same code and a bit representing "edge or node", and they They respectively represent nodes and edges marked by the same code; if the graph needs to find another node (denoted as Ne) through a node (denoted as Ns) and an edge (denoted as E), then the input of the hardware neuron corresponding to Ne is set to include the hardware neurons corresponding to Ns and E; similarly, if the graph needs to find an edge (denoted as E) through two nodes (denoted as Ns and Ne), then the input of the hardware neuron corresponding to E is set to include the hardware neurons corresponding to Ns and Ne; when the graph operation needs to create new nodes and edges, the unused hardware neurons are enabled in the hardware and connected accordingly; the functions of the remaining computing hardware are designed accordingly under the above framework.
[0052] The beneficial effects of the present invention are:
[0053] 1) It can realize the encoding of semantics and semantic sequences across symbol systems, realize the correspondence between a single semantic and a sequence of semantics, and realize the correspondence between semantics and sequences of semantics determined by symbol systems. It is an enabling technology for building a strong artificial intelligence system;
[0054] 2) New symbols, semantics and symbol systems can be learned online, which specifically includes three aspects: first, new physical absolute semantics can be learned (generated) at any time through the physical symbol system; second, new absolute semantics can be learned through the absolute semantics that have been learned; third, new symbol systems can be defined (generated) through the absolute semantics that have been learned.
[0055] 3) All absolute semantics and symbol systems encoded by the method of the present invention have mutually indexable connections, that is, starting from any code, one can index to the related code. This coordinate system reflecting the semantic structure makes it possible to calculate and generate new related semantics.
[0056] 4) The encoding method disclosed in the present invention can be implemented using software or a dedicated hardware system. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a schematic diagram of the graph structure-based encoding method of the present invention.
[0058] Figure 2 It is a schematic diagram of a partial Braille character table in the background technology of the present invention. DETAILED DESCRIPTION
[0059] The following embodiments of the present invention are described in detail. The following embodiments are exemplary and intended to be used to explain the present invention, but should not be construed as limiting the present invention.
[0060] An encoder implementing a method for encoding semantics and semantic sequences across symbol systems provides the following functionality (functional approach):
[0061] 1) learnPhysical(obj): obj is a Java non-sequence object. This method returns an "absolute semantic" code representing obj.
[0062] 2) getPhysical(Acode): Acode is an "absolute semantic" code. This method returns a Java non-sequential object.
[0063] 3) defineSystem (Acode): Acode is an "absolute semantic" code. This method returns a code of the "symbol system" defined by Acode;
[0064] 4)mapSeqToAinS(Acode, Scode): Acode is an absolute semantic code representing a sequence, Scode is a symbolic code, this method returns an absolute semantic code under the symbolic system Scode, which corresponds to the sequence represented by Acode;
[0065] 5) getSeqForAinS(Acode, Scode): Acode is an "absolute semantic" code, Scode is a "symbol system" code, "absolute semantic" Acode is subordinate to the "symbol system" Scode, this method returns an "absolute semantic" code, the "sequence" represented by this code corresponds to Acode under the "symbol system" of Scode; it can be understood that getSeqForAinS and mapSeqToAinS are inverse operations, they realize the mutual conversion of two Acodes under the same Scode parameter.
[0066] 6) prefixTo(Acode1, Acode2): Acode1 and Acode2 are two "absolute semantic" codes. Acode1 is understood as an "absolute semantic" and Acode2 is understood as a "sequence". The return value of this method is an "absolute semantic" code, which represents the "sequence" obtained by adding Acode1 to the front of the "sequence" Acode2.
[0067] 7)getSeqForA(Acode): Acode is an "absolute semantic" code. The return value of this method is a sequence composed of "absolute semantic" codes, which is the "sequence" represented by Acode.
[0068] 8)setEqualA(Acode1,Acode2): Acode1 and Acode2 are two "absolute semantic" codes. This method sets these two "absolute semantic" codes to be equivalent, retains Acode2, deletes Acode1, and this method has no return value.
[0069] A specific example is described as follows:
[0070] There are a "symbol system" called "binary" and a "symbol system" called "decimal"; in the "symbol system" of "binary", the sequence "1010" means the numerical value 10; in the "symbol system" of "decimal", the sequence "10" also means the numerical value 10; to express the above meanings, a group of characters are needed: "two", "bin", "decimal", "ten", "1", "0".
[0071] Specific implementation task 1: Create a graph structure corresponding to the above embodiment case description (attached Figure 1), the steps are as follows:
[0072] 1) learnPhysical(“two”): Find or define the “absolute semantic” code for the Java character “two”. The return value of the method is A-1. This step first checks if there is a node with the “javaObj” attribute being the Java character “two”. If so, it returns the label of that node. At this time, there is no node with the “javaObj” attribute being the Java character “two” in the graph. Therefore, create the “absolute semantic” code A-1, create a node labeled with A-1 in the graph, create an attribute “javaObj” for this node, and set its value to the Java character “two”. At this time, the code A-1 represents a “physical” “absolute semantic”: “two”.
[0073] 2) learnPhysical(“enter”): Find or define the “absolute semantic” code for the Java character “enter”. The return value of the method is A-2. This step first checks if there is a node with the “javaObj” attribute being the Java character “enter”. If so, it returns the label of that node. At this time, there is no node with the “javaObj” attribute being the Java character “enter” in the graph. Therefore, create the “absolute semantic” code A-2, create a node labeled with A-2 in the graph, create an attribute “javaObj” for this node, and set its value to the Java character “enter”. At this time, the code A-2 represents a “physical” “absolute semantic”: “enter”.
[0074] 3) learnPhysical(“system”): Find or define the “absolute semantic” code for the Java character “system”. The return value of the method is A-3. This step first checks if there is a node with the “javaObj” attribute being the Java character “system”. If so, it returns the label of that node. At this time, there is no node with the “javaObj” attribute being the Java character “system” in the graph. Therefore, create the “absolute semantic” code A-3, create a node labeled with A-3 in the graph, create an attribute “javaObj” for this node, and set its value to the Java character “system”. At this time, the code A-3 represents a “physical” “absolute semantic”: “system”.
[0075] 4) learnPhysical(“十”): Find or define the “absolute semantic” code for the Java character “十”. The return value of the method is A-4. This step first checks if there is a node with the “javaObj” attribute being the Java character “十”. If so, return the label of that node. At this time, there is no node in the graph with the “javaObj” attribute being the Java character “十”. Therefore, create the “absolute semantic” code A-4, create a node labeled A-4 in the graph, create an attribute “javaObj” for this node, and set its value to the Java character “十”. At this time, the code A-4 represents a “physical” “absolute semantic”: “十”.
[0076] 5) learnPhysical(“1”): Find or define the “absolute semantic” code for the Java character “1”. The return value of the method is A-5. This step first checks if there is a node with the “javaObj” attribute being the Java character “1”. If so, return the label of that node. At this time, no node with the “javaObj” attribute being the Java character “1” is found in the graph. Therefore, create the “absolute semantic” code A-5, create a node labeled A-5 in the graph, create an attribute “javaObj” for this node, and set its value to the Java character “1”. At this time, the code A-5 represents a “physical” “absolute semantic”: “1”.
[0077] 6) learnPhysical(“0”): Find or define the “absolute semantic” code for the Java character “0”. The return value of the method is A-6. This step first checks if there is a node with the “javaObj” attribute being the Java character “0”. If so, return the label of that node. At this time, no node with the “javaObj” attribute being the Java character “0” is found in the graph. Therefore, create the “absolute semantic” code A-6, create a node labeled A-6 in the graph, create an attribute “javaObj” for this node, and set its value to the Java character “0”. At this time, the code A-6 represents a “physical” “absolute semantic”: “0”.
[0078] 7) prefixTo(A-3, A-0): Find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-3 to the front of "sequence" A-0. The return value of the method is code A-7. This step queries whether there is an edge marked with A-3 from the node marked with A-0 to another node; since such an edge does not exist in the graph, a new "absolute semantic" code (denoted as A-7) is created, and a node marked with A-7 is created in the graph. Then, an edge is created starting from the node marked with A-0 and connecting to the node marked with A-7, and this edge is marked as A-3. Another edge is created starting from the node marked with A-7 and connecting to the node marked with A-0, and this edge is marked as A-0 (used to index the source node of the node marked with A-7). At this time, A-7 represents the sequence [A-3], which can be understood as ["system"].
[0079] 8) prefixTo(A-2, A-7): Find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-2 to the front of "sequence" A-7. The return value of the method is code A-8. This step queries whether there is an edge marked with A-2 from the node marked with A-7 to another node; since such an edge does not exist in the graph, a new "absolute semantic" code (denoted as A-8) is created, and a node marked with A-8 is created in the graph. Then, an edge is created starting from the node marked with A-7 and connecting to the node marked with A-8, and this edge is marked as A-2. Another edge is created starting from the node marked with A-8 and connecting to the node marked with A-7, and this edge is marked as A-0 (used to index the source node of the node marked with A-8). At this time, A-8 represents the sequence [A-2, A-3], which can be understood as ["enter" "system"].
[0080] 9) prefixTo(A-1, A-8): Find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-1 to the front of "sequence" A-8. The return value of the method is code A-9. This step queries whether there is an edge marked with A-1 from the node marked with A-8 to another node; since such an edge does not exist in the graph, a new "absolute semantic" code (denoted as A-9) is created, and a node marked with A-9 is created in the graph. Then, an edge is created starting from the node marked with A-8 and connecting to the node marked with A-9, and this edge is marked as A-1. Another edge is created starting from the node marked with A-9 and connecting to the node marked with A-8, and this edge is marked as A-0 (used to index the source node of the node marked with A-9). At this time, A-9 represents the sequence [A-1, A-2, A-3], which can be understood as ["binary" "enter" "system"].
[0081] 10) prefixTo (A-4, A-8): find or define the "absolute semantics" code of the "sequence" obtained by adding "absolute semantics" A-4 to the front of the "sequence" A-8. The method returns code A-10. This step queries whether there is an edge marked as A-4 from the node marked by A-8 to another node; since this edge does not exist in the graph, a new "absolute semantics" code (denoted as A-10) is created, and a node marked by A-10 is created in the graph. Then, an edge is created from the node marked by A-8 to the node marked by A-10, and the edge is marked as A-4. Then, an edge is created from the node marked by A-10 to the node marked by A-8, and the edge is marked as A-0 (used to index the source node of the node marked by A-10). At this time, A-10 represents the sequence [A-4, A-2, A-3], which can be understood as ["ten", "increment", "system"].
[0082] 11) defineSystem (A-9): find or define a "symbol system" defined by "absolute semantics" A-9, and the method return value is S-1. This step finds the node marked by A-9 in the graph, and checks whether there is an edge marked by "A-'-1'" from the node to another node; since this edge does not exist in the graph, create a "symbol system" code (denoted as S-1), and create a node marked by S-1 in the graph, then create an edge marked by "A-'-1'" from the node marked by A-9 to the node marked by S-1, and then create an edge marked by "A-'-1'" from the node marked by S-1 to the node marked by A-9; at this time, based on an "absolute semantics" A-9 (["binary" "binary" "system"]), a new "symbol system" S-1 is defined.
[0083] 12) defineSystem (A-10): find or define a "symbol system" defined by "absolute semantics" A-10, and the method return value is S-2. This step finds the node marked by A-10 in the graph, and checks whether there is an edge marked by "A-'-1'" from the node to another node; since this edge does not exist in the graph, create a "symbol system" code (denoted as S-2), and create a node marked by S-2 in the graph, then create an edge marked by "A-'-1'" from the node marked by A-10 to the node marked by S-2, and then create an edge marked by "A-'-1'" from the node marked by S-2 to the node marked by A-10; at this time, based on an "absolute semantics" A-10 (["decimal" "radix" "system"]), a new "symbol system" S-2 is defined.
[0084] 13) prefixTo (A-6, A-0): find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-6 to the front of the "sequence" A-0. The method returns the code A-11. This step queries whether there is an edge marked as A-6 from the node marked by A-0 to another node; since this edge does not exist in the graph, a new "absolute semantic" code (denoted as A-11) is created, and a node marked by A-11 is created in the graph. Then, an edge is created from the node marked by A-0 to the node marked by A-11, and the edge is marked as A-6. Then, an edge is created from the node marked by A-11 to the node marked by A-0, and the edge is marked as A-0 (used to index the source node of the node marked by A-11). At this time, A-11 represents the sequence [A-6], which can be understood as ["0"].
[0085] 14) prefixTo (A-5, A-11): find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-5 to the front of the "sequence" A-11. The method returns code A-12. This step queries whether there is an edge marked as A-5 from the node marked by A-11 to another node; since this edge does not exist in the graph, a new "absolute semantic" code (denoted as A-12) is created, and a node marked by A-12 is created in the graph, and then an edge is created from the node marked by A-11 to the node marked by A-12, and the edge is marked as A-5, and then an edge is created from the node marked by A-12 to the node marked by A-11, and the edge is marked as A-0 (used to index the source node of the node marked by A-12). At this time, A-12 represents the sequence [A-5, A-6], which can be understood as ["1" "0"].
[0086] 15) prefixTo (A-6, A-12): find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-6 to the front of the "sequence" A-12. The method returns code A-13. This step queries whether there is an edge marked as A-6 from the node marked by A-12 to another node; since this edge does not exist in the graph, a new "absolute semantic" code (denoted as A-13) is created, and a node marked by A-13 is created in the graph, and then an edge is created from the node marked by A-12 to the node marked by A-13, and the edge is marked as A-6. Then an edge is created from the node marked by A-13 to the node marked by A-12, and the edge is marked as A-0 (used to index the source node of the node marked by A-13). At this time, A-13 represents the sequence [A-6, A-5, A-6], which can be understood as ["0" "1" "0"].
[0087] 16) prefixTo (A-5, A-13): find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-5 to the front of the "sequence" A-13. The method returns code A-14. This step queries whether there is an edge marked as A-5 from the node marked by A-13 to another node; since this edge does not exist in the graph, a new "absolute semantic" code (denoted as A-14) is created, and a node marked by A-14 is created in the graph, and then an edge is created from the node marked by A-13 to the node marked by A-14, and the edge is marked as A-5, and then an edge is created from the node marked by A-14 to the node marked by A-13, and the edge is marked as A-0 (used to index the source node of the node marked by A-14). At this time, A-14 represents the sequence [A-5, A-6, A-5, A-6], which can be understood as ["1" "0" "1" "0"].
[0088] 17)mapSeqToAinS(A-14,S-1): Find or define the "absolute semantic" code corresponding to the "sequence" represented by A-14 under the "symbol system" of S-1, and the method returns A-15. This step queries whether there is an edge marked by S-1 from the node marked by A-14 to another node; since this edge does not exist in the graph, a new "absolute semantic" code (denoted as A-15) is created, and a node marked by A-15 is created in the graph, and then an edge marked by S-1 is created, starting from the node marked by A-14 and connected to the node marked by A-15, and then an edge marked by A-15 is created, starting from the node marked by S-1 and connected to the node marked by A-14. At this time, the "absolute semantic" A-15 is the "absolute semantic" corresponding to the sequence represented by A-14 (which can be understood as ["1" "0" "1" "0"]) under the S-1 symbol system, which can be understood as "the value 10".
[0089] 18)mapSeqToAinS(A-12,S-2): Find or define the "absolute semantic" code corresponding to the "sequence" represented by A-12 under the S-2 "symbol system", and the method returns A-16. This step queries whether there is an edge marked as S-2 from the node marked by A-12 to another node; since this edge does not exist in the graph, a new "absolute semantic" code (denoted as A-16) is created, and a node marked by A-16 is created in the graph, and then an edge marked as S-2 is created, starting from the node marked by A-12 and connecting to the node marked by A-16, and then an edge marked as A-16 is created, starting from the node marked by S-2 and connecting to the node marked by A-12. At this time, the "absolute semantics" A-16 is the "absolute semantics" corresponding to the sequence represented by A-12 (which can be understood as ["1" "0"]) under the S-2 symbol system, which can be understood as "the value 10".
[0090] 19) setEqualA(A - 16, A - 15): Set the "absolute semantics" represented by A - 15 and A - 16 (which can be understood as "numerical value 10") to be equivalent. In this step, the code A - 15 is retained, the code A - 16 is deleted, and there is no return value. This step updates all the edges starting from the nodes marked with A - 16, sets their starting points to the nodes marked with A - 15, updates all the edges reaching the nodes marked with A - 16, sets their end points to the nodes marked with A - 15, and updates all the edges marked with A - 16, sets them to be marked with A - 15. Since A - 16 does not define a "symbol system" (there is no edge marked with A - '-1' starting from the node marked with A - 16), no further processing is done. Finally, the node marked with A - 16 is deleted.
[0091] Specific implementation task 2: Obtain which sequence defines the absolute semantics of the sequence "1010" in decimal when it is in binary. The steps are as follows:
[0092] 1) learnPhysical("二"): Find or define the "absolute semantics" code of the Java character "二". The method return value is A - 1. This step first checks if there is a node with the "javaObj" attribute being the Java character "二". At this time, there is a node with the "javaObj" attribute being the Java character "二" in the graph, and the method returns the marking code A - 1 of this node.
[0093] 2) learnPhysical("进"): Find or define the "absolute semantics" code of the Java character "进". The method return value is A - 2. This step first checks if there is a node with the "javaObj" attribute being the Java character "进". At this time, there is a node with the "javaObj" attribute being the Java character "进" in the graph, and the method returns the marking code A - 2 of this node.
[0094] 3) learnPhysical("制"): Find or define the "absolute semantics" code of the Java character "制". The method return value is A - 3. This step first checks if there is a node with the "javaObj" attribute being the Java character "制". At this time, there is a node with the "javaObj" attribute being the Java character "制" in the graph, and the method returns the marking code A - 3 of this node.
[0095] 4) learnPhysical(“十”): Find or define the "absolute semantic" code of the Java character "十". The return value of the method is A-4. This step first checks if there is a node with the "javaObj" attribute being the Java character "十". At this time, there is such a node in the graph, and the method returns the label code A-4 of this node.
[0096] 5) learnPhysical(“1”): Find or define the "absolute semantic" code of the Java character "1". The return value of the method is A-5. This step first checks if there is a node with the "javaObj" attribute being the Java character "1". At this time, there is such a node in the graph, and the method returns the label code A-5 of this node.
[0097] 6) learnPhysical(“0”): Find or define the "absolute semantic" code of the Java character "0". The return value of the method is A-6. This step first checks if there is a node with the "javaObj" attribute being the Java character "0". At this time, there is such a node in the graph, and the method returns the label code A-6 of this node.
[0098] 7) prefixTo(A-6, A-0): Find or define the "absolute semantic" code of the "sequence" obtained by adding the "absolute semantic" A-6 to the front of the "sequence" A-0. The return value of the method is the code A-11. This step queries if there is an edge labeled A-6 from the node labeled A-0 to another node; since there is such an edge in the graph, it reaches the node labeled A-11, and the method returns the label code A-11 of this node. At this time, A-11 represents the sequence [A-6], which can be understood as ["0"].
[0099] 8) prefixTo(A-5, A-11): Find or define the "absolute semantic" code of the "sequence" obtained by adding the "absolute semantic" A-5 to the front of the "sequence" A-11. The return value of the method is the code A-12. This step queries if there is an edge labeled A-5 from the node labeled A-11 to another node; since there is such an edge in the graph, it reaches the node labeled A-12, and the method returns the label code A-12 of this node. At this time, A-12 represents a sequence [A-5, A-6], which can be understood as ["1", "0"].
[0100] 9) prefixTo(A-6, A-12): Find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-6 to the front of "sequence" A-12. The return value of the method is code A-13. This step queries whether there is an edge marked with A-6 from the node marked with A-12 to another node; since there is such an edge in the graph, it reaches the node marked with A-13, and the method returns the marked code A-13 of this node. At this time, A-13 represents a sequence [A-6, A-5, A-6], which can be understood as ["0", "1", "0"].
[0101] 10) prefixTo(A-5, A-13): Find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-5 to the front of "sequence" A-13. The return value of the method is code A-14. This step queries whether there is an edge marked with A-5 from the node marked with A-13 to another node; since there is such an edge in the graph, it reaches the node marked with A-14, and the method returns the marked code A-14 of this node. At this time, A-14 represents a sequence [A-5, A-6, A-5, A-6], which can be understood as ["1", "0", "1", "0"].
[0102] 11) prefixTo(A-3, A-0): Find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-3 to the front of "sequence" A-0. The return value of the method is code A-7. This step queries whether there is an edge marked with A-3 from the node marked with A-0 to another node; since there is such an edge in the graph, it reaches the node marked with A-7, and the method returns the marked code A-7 of this node. At this time, A-7 represents the sequence [A-3], which can be understood as ["system"].
[0103] 12) prefixTo(A-2, A-7): Find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-2 to the front of "sequence" A-7. The return value of the method is code A-8. This step queries whether there is an edge marked with A-2 from the node marked with A-7 to another node; since there is such an edge in the graph, it reaches the node marked with A-8, and the method returns the marked code A-8 of this node. At this time, A-8 represents the sequence [A-2, A-3], which can be understood as ["enter", "system"].
[0104] 13) prefixTo (A-1, A-8): find or define the "absolute semantic" code of the "sequence" obtained by adding "absolute semantic" A-1 to the front of the "sequence" A-8. The method returns the code A-9. This step checks whether there is an edge marked A-1 from the node marked by A-8 to another node; since this edge exists in the graph, the node marked A-9 is reached, and the method returns the marking code A-9 of the node. At this time, A-9 represents the sequence [A-1, A-2, A-3], which can be understood as ["binary", "incremental", "system"].
[0105] 14) prefixTo (A-4, A-8): find or define the "absolute semantics" code of the "sequence" obtained by adding "absolute semantics" A-4 to the front of the "sequence" A-8, and the method returns the code A-10. This step checks whether there is an edge marked A-4 from the node marked by A-8 to another node; since this edge exists in the graph, the node marked A-10 is reached, and the method returns the marking code A-10 of the node. At this time, A-10 represents the sequence [A-4, A-2, A-3], which can be understood as ["ten", "increment", "system"].
[0106] 15) defineSystem (A-9): find or define a "symbol system" defined by "absolute semantics" A-9, and the method returns S-1. This step finds the node marked by A-9 in the graph, and checks whether there is an edge marked "A-'-1'" from the node to another node; since this edge exists in the graph, the node it reaches is marked S-1, and the method returns S-1, that is, the "symbol system" code defined by "absolute semantics" A-9 (["binary" "binary" "system"]) is S-1.
[0107] 16) defineSystem (A-10): find or define a "symbol system" defined by "absolute semantics" A-10, and the method returns S-2. This step finds the node marked by A-10 in the graph, and checks whether there is an edge marked "A-'-1'" from the node to another node; since this edge exists in the graph, the node it reaches is marked S-2, and the method returns S-2, that is, the "symbol system" code defined by "absolute semantics" A-10 (["decimal" "radix" "system"]) is S-2.
[0108] 17)mapSeqToAinS(A-14,S-1): Find or define the "absolute semantics" code corresponding to the "sequence" represented by A-14 under the "symbol system" of S-1, and the method returns A-15. This step queries whether there is an edge marked as S-1 from the node marked by A-14 to another node; since this edge exists in the graph, the node it reaches is marked as A-15, and the method returns A-15, that is, the "absolute semantics" A-15 is the "absolute semantics" corresponding to the sequence represented by A-14 (["1" "0" "1" "0"]) under the "symbol system" of S-1, which can be understood as "the value 10".
[0109] 18) getSeqForAinS(A-15, S-2): find the "absolute semantic" code of a "sequence" that defines A-15 under the "symbol system" of S-2. The method returns A-12. This step finds the node marked by S-2 in the graph. There must be an edge marked by A-15 that reaches another node, and the node it reaches is marked by A-12. The method returns A-12, that is, the "sequence" represented by A-12 defines the "absolute semantics" A-15 under the "symbol system" of S-2 (["decimal", "radix"]).
[0110] 19)getSeqForA(A-12): Find the "sequence" represented by the "absolute semantics" code A-12. The return value of the method is [A-5, A-6]. This step starts from the node marked by A-12 and reaches a node through the edge marked by "A-0". The label (A-11) of this node represents a suffix sequence obtained by removing the first position of the "sequence" represented by A-12. Then, query the edge marked with the "absolute semantics" code from the node marked by A-11 to the node marked by A-12 (there must be only one edge). The label (A-5) of this edge is the "absolute semantics" code at the first position in the "sequence" represented by A-12; then, starting from the node marked by A-11, reach a node through the edge marked by "A-0". This node The label (A-0) represents a suffix sequence obtained by removing the first position from the "sequence" represented by A-11, and then query the edge marked with the "absolute semantic" code from the node marked by A-0 to the node marked by A-11 (there must be only one edge). The label (A-6) of this edge is the "absolute semantic" code at the first position in the "sequence" represented by A-11, which is also the "absolute semantic" code at the second position in the "sequence" represented by A-12. At this time, the code of the suffix sequence obtained is A-0, so the loop ends and the method returns the "sequence" corresponding to A-12 [A-5, A-6].
[0111] 20) getPhysical(A-5): Find the Java non-sequence object corresponding to the "absolute semantic" code A-5, and the method return value is "1". This step finds the node marked A-5 and returns the value of its "javaObj" attribute. The method returns the java character "1".
[0112] 21) getPhysical(A-6): Find the Java non-sequence object corresponding to the "absolute semantics" code A-6, and the method return value is "0". This step finds the node marked A-6 and returns the value of its "javaObj" attribute. The method returns the Java character "0".
[0113] 22) From the results of steps 19)-21) above, it can be seen that the absolute meaning of "1010" in binary is defined by the sequence ["1""0"]([A-5,A-6]) in decimal.
[0114] The above is not a limitation on the specific implementation methods of this patent. It should be pointed out that for ordinary technicians in this technical field, several changes, modifications, additions or substitutions can be made without departing from the essential scope of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims
1. A method for encoding semantics and semantic sequences across symbol systems, characterized in that : 1) Includes absolute semantic codes, symbol system codes, and the relationship between the two codes; The absolute semantic code represents an absolute semantics, and the symbol system code represents a symbol system; There are the following relationships or constraints between absolute semantics and the symbol system: 2)-4) 2) An absolute semantics belongs to one or more symbol systems; an absolute semantics corresponds to a sequence of absolute semantics under a symbol system; 3) A sequence consists of absolute semantics; each position in a sequence is an absolute semantics; a sequence itself is also an absolute semantics; 4) Based on an absolute semantics, a symbol system can be defined; that is, a symbol system must have an absolute semantics that defines it, but not every absolute semantics defines a symbol system; A specific method for implementing the above method is: using a graph structure to implement suffix or prefix encoding; When implementing the graph-based suffix encoding method, define a special absolute semantics to represent the "empty sequence". Starting from the "empty sequence" node, through the edge marked by the absolute semantics, get a node representing the sequence with the length plus one obtained by adding the absolute semantics on the edge to the front of the sequence of the starting node. According to this method, starting from the absolute semantics at the last position of the sequence to be encoded, add the absolute semantics in reverse order, and finally get a node representing the entire sequence; To implement point 4), define a special absolute semantics to represent "defining a symbol system", and use the edge marked with the special absolute semantics in the graph to connect a node marked with the absolute semantics and a node marked with the symbol system defined by the absolute semantics; To achieve point 2), in the graph, starting from the node marked with the absolute semantic code representing the sequence, connect an edge to the node marked with the absolute semantic code inside the symbol system, and mark this edge with the symbol system code; at the same time, starting from the node marked with the symbol system code, connect an edge to the node marked with the absolute semantic code of the sequence, and mark this edge with the absolute semantic code inside the symbol system; It is implemented using neural network computing hardware. The design and operation of the computing hardware correspond to the structure and operation of the graph. The characteristics of the correspondence are: the nodes and edges in the graph correspond to different hardware computing units. Each hardware computing unit is addressed by a code and a bit representing an edge or node, and is activated based on the addressing. The basic unit of graph operation is to find a node from a node and an edge, or to find an edge from two nodes. This operation corresponds to the computing hardware finding a third hardware computing unit through two activated hardware computing units.
2. The method for encoding semantics and semantic sequences across symbol systems according to claim 1, characterized in that: When realizing the "one absolute semantics belongs to one or more symbol systems", the following special processing is performed: there are "physical" symbol systems that can exist naturally and do not need to compile their symbol system codes; correspondingly, there are "physical" absolute semantics that can exist naturally, they have absolute semantic codes, but do not need to belong to any symbol system.
Citation Information
Patent Citations
Method for automatically generating Java code annotations based on Graph2Seq of deep reinforcement learning
CN110018820A
Mongolian-Chinese neural machine translation method fusing semantic knowledge
CN112580370A