WO2021135103A1 - 一种语义分析方法、装置、计算机设备及存储介质 - Google Patents

一种语义分析方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2021135103A1
WO2021135103A1 PCT/CN2020/098939 CN2020098939W WO2021135103A1 WO 2021135103 A1 WO2021135103 A1 WO 2021135103A1 CN 2020098939 W CN2020098939 W CN 2020098939W WO 2021135103 A1 WO2021135103 A1 WO 2021135103A1
Authority
WO
WIPO (PCT)
Prior art keywords
semantic
entity
text information
node
logical
Prior art date
Application number
PCT/CN2020/098939
Other languages
English (en)
French (fr)
Inventor
胡逸天
王雪
孙银波
娄静怡
黄珊珊
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021135103A1 publication Critical patent/WO2021135103A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to a semantic analysis method, device, computer equipment, and storage medium.
  • the intelligent question answering system is an important position for artificial intelligence to land in the industry. With the advent of the era of big data and the era of AI, more and more traditional BI systems are facing the pressure and challenge of the integration and integration of data dimensions and business function dimensions.
  • An existing question and answer method for a customer service robot is to communicate with a user through a preset customer service robot, and extract corresponding reply content from a database based on the keywords asked in the user communication process to answer, thereby realizing an intelligent question and answer process.
  • the customer service robot can only return fixed text to answer questions by configuring keywords, without considering the combination of context and Recognizing the user’s true emotions, but only mechanical answers, the user experience is poor.
  • the purpose of the embodiments of this application is to solve the problem that traditional customer service robot question answering methods generally can only return fixed text to answer questions by configuring keywords. It does not consider the combination of context and does not recognize the user’s true emotions, but only mechanically. The answer to the question of poor user experience.
  • an embodiment of the present application provides a semantic analysis method, which adopts the following technical solutions:
  • the target semantic tree is used as the input content of the intelligent question answering system to perform intelligent question answering operations.
  • an embodiment of the present application also provides a semantic analysis device, which adopts the following technical solutions:
  • the request receiving module is configured to receive a query request sent by the user terminal for the intelligent question answering system, the query request carrying at least query text information;
  • a text acquisition module configured to read a local entity library, perform a translation operation on the query text information based on the local entity library and preset logic rules, and obtain logical text information;
  • a semantic conversion module for converting the logical text information into a target semantic tree based on semantic tree conversion rules
  • the semantic input module is configured to use the target semantic tree as the input content of the intelligent question answering system to perform intelligent question answering operations.
  • the embodiments of the present application also provide a computer device, which adopts the following technical solutions:
  • the computer-readable storage medium stores a computer process, and when the computer process is executed by the processor, the following steps of the semantic analysis method are implemented:
  • the target semantic tree is used as the input content of the intelligent question answering system to perform intelligent question answering operations.
  • the embodiments of the present application also provide a computer-readable storage medium, which adopts the following technical solutions:
  • the computer-readable storage medium stores a computer process, and when the computer process is executed by a processor, the following steps of the semantic analysis method are implemented:
  • the target semantic tree is used as the input content of the intelligent question answering system to perform intelligent question answering operations.
  • FIG. 1 is an implementation flowchart of the semantic analysis method provided by Embodiment 1 of the present application.
  • FIG. 2 is a schematic diagram of a target semantic tree provided in Embodiment 1 of the present application.
  • Fig. 3 is a flowchart of the realization of step S102 in Fig. 1;
  • Fig. 4 is a flowchart of the realization of step S103 in Fig. 1;
  • FIG. 5 is an implementation flowchart of the logic verification method provided by Embodiment 1 of the present application.
  • FIG. 6 is a schematic structural diagram of a semantic analysis device provided in Embodiment 2 of the present application.
  • FIG. 7 is a schematic diagram of the structure of the text acquisition module in FIG. 6;
  • FIG. 8 is a schematic diagram of the structure of the semantic conversion module in FIG. 6;
  • Fig. 9 is a schematic structural diagram of an embodiment of a computer device according to the present application.
  • FIG. 1 there is shown a flow chart of the implementation of the semantic analysis method provided in Embodiment 1 of the present application. For ease of description, only the parts related to the present application are shown.
  • step S101 a query request sent by a user terminal for the intelligent question answering system is received, and the query request carries at least query text information.
  • the user terminal may be, for example, a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc. It should be understood that the examples of user terminals here are only for ease of understanding, and are not used to limit this application.
  • the intelligent question answering system is mainly used to accurately locate the question knowledge required by website users, and provide personalized information services for website users by interacting with website users.
  • the query request refers to the data stream information that the user sends to the system through the user terminal and contains the content that the user needs to ask questions.
  • the query request can be text inputted text data or voice inputted audio data.
  • the query request is audio data, it is necessary to perform voice recognition operations on the audio data and convert it into text data that the system can perform semantic analysis. It should be understood that the query request examples here are only for ease of understanding and are not used to limit the text. Application.
  • the query text information refers to text data input by the user, or text data converted from audio data input by the user, and the query text information is the most original semantic content of the user.
  • step S102 the local entity library is read, and the query text information is translated based on the local entity library and preset logic rules to obtain logical text information.
  • the local entity library is mainly used for a knowledge base that stores entity content in advance.
  • the preset logic rules are mainly used to accurately express natural language information and facilitate machine recognition, and the preset logic rules can be correspondingly designed according to actual needs.
  • the translation operation refers to after identifying the query text information, comparing the query text information with the entity content in the knowledge base by means of entity connection, obtaining texts with consistent entity content, and obtaining texts based on the entity content.
  • the semantically represented logical rule symbol set translates the text to obtain the above-mentioned logical text information.
  • the largest ranking entity appearing in the question sentence is taken as the subject entity word of the question sentence, and the entity finally asked by the user is taken as the end of the query graph link.
  • the core reasoning link from the subject entity word to the ending entity word is obtained.
  • the core derivation link For each core derivation link, it is converted into a tree structure for storage.
  • the core derivation link most similar to the question is obtained.
  • the link information of the core derivation link is parsed into query parameters and query procedures.
  • step S103 the logical text information is converted into a target semantic tree based on the semantic tree conversion rule.
  • the semantic tree conversion rule refers to the logic rule expressing the minimum semantics with " ⁇ >".
  • This reference relationship represents The sequence of queries and the way of association between entities in the knowledge graph.
  • the leaf node corresponds to the entity of the triplet
  • the non-leaf node corresponds to the relationship between the entity of the triplet or the attribute of the entity
  • the answer node is located at the root node.
  • step S104 the target semantic tree is used as the input content of the intelligent question answering system to perform the intelligent question answering operation.
  • the preset logic rules specifically include Unary unary rules, Binary binary rules, and Aggregation rules.
  • Binary is mainly used to describe the relationship of triples. Triples can be understood as (head entity, relationship, tail entity), (head entity, attribute, attribute value) or (relationship, relationship attribute, relationship attribute value).
  • the Binary rule is to know two of the elements, find the third element, use ‘? ’To mark the element to be queried.
  • Entity attribute problems S means entity, PRO means attribute, value means attribute value
  • R represents the relationship
  • RPRO represents the attribute of the relationship
  • value represents the attribute value
  • Sorting used to answer questions such as ‘Top N’, ‘Nth’, etc.
  • Parameter setting obj—counting object; con—filtering condition when counting
  • the entire logic rule is composed of multiple semantic units.
  • the grammatical specification of a single semantic unit is as follows:
  • unit_code represents the coding of the semantic unit, and there should be only one main unit in the logic rule.
  • the main unit represents the final answer content to be returned by the question, and A is used to indicate that the main unit must be executed last.
  • the principle of semantic unit coding is to name and expand from A forwards and then backwards, for example: V5 V4 V3 V2 V1 A V6 V7 V8.
  • semantic_unit is the triple representation mentioned in the previous unit and will not be repeated.
  • step S102 in FIG. 1 a flowchart of the implementation of step S102 in FIG. 1 is shown. For ease of description, only the parts related to the present application are shown.
  • step S102 specifically includes: step S201, step S202, step S203, step S204, step S205, and step S206.
  • step S201 the entity data corresponding to the query text information is obtained in the local entity database.
  • keywords can be obtained by identifying the content of the question, and compared with the entity stored in the local entity, and finally obtaining the data consistent with the keyword and the entity as the entity data.
  • step S202 the subject entity word corresponding to the entity data is determined based on the preset weight value.
  • each entity is selected as the subject entity word.
  • the weight value of each entity is preset through the pointing relationship between the entities in the local entity. Take entities with a weight greater than 0 as the candidate set of topic entity words, and try subsequent operations on each candidate topic word in order.
  • step S203 the end entity data of the query text information is used as the end entity word.
  • the entity to be asked at the end of the question sentence is used as the ending entity word.
  • the ending entity word is a relationship, try to correct it.
  • step S204 the subject entity word and the ending entity word are respectively used as the first entity word of the initial logical text to obtain the intermediate logical text.
  • the subject entity word obtained in step S202 and the ending entity word obtained in step S203 are used as the beginning and end of the link, and traversed in the graph. Get the set of candidate subgraphs.
  • step S205 the optimal intent with the highest similarity to the intermediate logical text is obtained in the intent database.
  • the similarity judgment between the candidate sub-image and the existing intention in the image library is performed. Similarity is judged by whether the entities, relationships, locations, etc. are consistent. Get the most similar intent to return.
  • step S206 logical text information is generated based on the optimal intention.
  • a logical form is generated according to the graph structure of the intention subgraph.
  • the node corresponds to the uniary representation rule
  • the class corresponds to the entity type
  • the value corresponds to the specific instance value, such as Ping An Life. If there is no specific entity value, uniary indicates that the value can be increased.
  • Edges correspond to binary representation rules. The first position of Binary is the node information corresponding to the edge, and the second position is the information of the edge, such as the risk rate of the attribute entity. The third position fills in the corresponding node information according to whether the edge is a relationship or an attribute entity. For example: There is only one Binary in this question, and the second position is the risk rate, that is, the attribute entity.
  • the attribute value of the risk rate is greater than 20%. Then the third position is filled> 20%. If there is no corresponding attribute value, the filling refers to entity A according to the definition of logical form.
  • step S103 in FIG. 1 a flowchart of the implementation of step S103 in FIG. 1 is shown. For ease of description, only the parts related to the present application are shown.
  • step S103 specifically includes: step S301, step S302, and step S303.
  • step S301 a semantic segmentation operation is performed on the logical text information to obtain a semantic unit.
  • step S302 a node conversion operation is performed on the semantic unit to obtain a semantic node.
  • step S303 a semantic tree is constructed based on the semantic node to obtain the target semantic tree.
  • each node establishes a tree node object (each tree node object has the following attributes: name, type, value, left child node, right child node, parent node, etc.), for example, with ⁇ V3:Binary(V2?, transaction relationship, V1)> node as an example, the name of the tree node object is V3, the type is Binary, the value is (V2?, transaction relationship, V1), and the left child node, right child node, and parent node are initialized to empty.
  • V3 node update the following values: the left child node of V3 is V2, the right child node is V1, the parent node of V2 is V3, and the parent node of V1 is V3.
  • V4 node For the V4 node, update the following values: the left child node of V4 is V3, the right child node is empty, and the parent node of V3 is V4.
  • FIG. 5 there is shown an implementation flowchart of the logic check method provided in Embodiment 1 of the present application. For ease of description, only the parts related to the present application are shown.
  • step S103 after the above step S103, it further includes: step S401, step S402, step S403, and step S404.
  • step S401 the node type of the target semantic tree is obtained.
  • step S402 it is determined whether there is an entity triple corresponding to the node type in the local entity library.
  • step S403 if there is an entity triplet corresponding to the node type in the local entity library, execute the intelligent question answering operation using the target semantic tree as the input content of the intelligent question answering system step.
  • step S404 if there is no entity triple corresponding to the node type in the local entity library, a node error signal is output.
  • the process of judging whether there are entity triples is to use the subsequent traversal tree search algorithm to search the entire tree from the bottom to the top, and at the same time fetch the pre-defined concept map triples from the database, and compare the types of nodes. Yes, make sure that each node meets the defined triplet, if it does, it will continue to search upwards, and if it does not, it will return the error node.
  • the purpose of logical verification is to not only discover the lack of semantics, redundancy, and dislocation (to provide a basis for the correction of the semantic tree), but also to provide error information for the semantic analysis module and make corrections.
  • the semantic analysis method provided in the embodiments of the present application has at least the following beneficial effects:
  • the computer process can be stored in a computer readable storage medium. When executed, it may include the procedures of the above-mentioned method embodiments.
  • the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disc, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.
  • this application provides an embodiment of a semantic recognition device.
  • the device embodiment corresponds to the method embodiment shown in FIG. Used in various electronic equipment.
  • the semantic recognition device 100 provided in the second embodiment of the present application includes: a request receiving module 110, a text acquisition module 120, a semantic conversion module 130, and a semantic input module 140. among them:
  • the request receiving module 110 is configured to receive a query request sent by a user terminal for the intelligent question answering system, the query request carrying at least query text information;
  • the text acquisition module 120 is configured to read a local entity library, perform a translation operation on the query text information based on the local entity library and preset logic rules, and obtain logical text information;
  • the semantic conversion module 130 is configured to convert the logical text information into a target semantic tree based on semantic tree conversion rules
  • the semantic input module 140 is configured to use the target semantic tree as the input content of the intelligent question answering system to perform intelligent question answering operations.
  • the user terminal may be, for example, a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc. It should be understood that the examples of user terminals here are only for ease of understanding, and are not used to limit this application.
  • the intelligent question answering system is mainly used to accurately locate the question knowledge required by website users, and provide personalized information services for website users by interacting with website users.
  • the query request refers to the data stream information that the user sends to the system through the user terminal and contains the content that the user needs to ask questions.
  • the query request can be text inputted text data or voice inputted audio data.
  • the query request is audio data, it is necessary to perform voice recognition operations on the audio data and convert it into text data that the system can perform semantic analysis. It should be understood that the query request examples here are only for ease of understanding and are not used to limit the text. Application.
  • the query text information refers to text data input by the user, or text data converted from audio data input by the user, and the query text information is the most original semantic content of the user.
  • the local entity library is mainly used for a knowledge base that stores entity content in advance.
  • the preset logic rules are mainly used to accurately express natural language information and facilitate machine recognition, and the preset logic rules can be correspondingly designed according to actual needs.
  • the translation operation refers to after identifying the query text information, comparing the query text information with the entity content in the knowledge base by means of entity connection, obtaining texts with consistent entity content, and obtaining texts based on the entity content.
  • the semantically represented logical rule symbol set translates the text to obtain the above-mentioned logical text information.
  • the largest ranking entity appearing in the question sentence is taken as the subject entity word of the question sentence, and the entity finally asked by the user is taken as the end of the query graph link.
  • the core reasoning link from the subject entity word to the ending entity word is obtained.
  • the core derivation link For each core derivation link, it is converted into a tree structure for storage.
  • the core derivation link most similar to the question is obtained.
  • the link information of the core derivation link is parsed into query parameters and query procedures.
  • the semantic tree conversion rule refers to the logic rule expressing the minimum semantics with " ⁇ >".
  • This reference relationship represents The sequence of queries and the way of association between entities in the knowledge graph.
  • the leaf node corresponds to the entity of the triplet
  • the non-leaf node corresponds to the relationship between the entity of the triplet or the attribute of the entity
  • the answer node is located at the root node.
  • the preset logic rules specifically include Unary unary rules, Binary binary rules, and Aggregation rules.
  • Binary is mainly used to describe the relationship of triples. Triples can be understood as (head entity, relationship, tail entity), (head entity, attribute, attribute value) or (relationship, relationship attribute, relationship attribute value).
  • the Binary rule is to know two of the elements, find the third element, use ‘? ’To mark the element to be queried.
  • Entity attribute problems S means entity, PRO means attribute, value means attribute value
  • R represents the relationship
  • RPRO represents the attribute of the relationship
  • value represents the attribute value
  • Sorting used to answer questions such as ‘Top N’, ‘Nth’, etc.
  • Parameter setting obj—counting object; con—filtering condition when counting
  • the entire logic rule is composed of multiple semantic units.
  • the grammatical specification of a single semantic unit is as follows:
  • unit_code represents the coding of the semantic unit, and there should be only one main unit in the logic rule.
  • the main unit represents the final answer content to be returned by the question, and A is used to indicate that the main unit must be executed last.
  • the principle of semantic unit coding is to name and expand from A forwards and then backwards, for example: V5 V4 V3 V2 V1 A V6 V7 V8.
  • semantic_unit is the triple representation mentioned in the previous unit and will not be repeated.
  • FIG. 7 a schematic structural diagram of the text acquisition module 120 in FIG. 6 is shown. For ease of description, only the parts related to the present application are shown.
  • the text acquisition module 120 includes: a data acquisition submodule 121, a theme determination submodule 122, an ending determination submodule 123, an intermediate text acquisition submodule 124, and an optimal intent submodule Module 125 and text generation sub-module 126. among them:
  • the data acquisition sub-module 121 is configured to acquire entity data corresponding to the query text information in the local entity database
  • the subject determination sub-module 122 is configured to determine subject entity words corresponding to the entity data based on a preset weight value
  • the end determination sub-module 123 is used to use the end entity data of the query text information as the end entity word;
  • the intermediate text acquisition sub-module 124 is configured to use the subject entity word and the ending entity word as the first entity word of the initial logical text, respectively, to obtain the intermediate logical text;
  • the optimal intent submodule 125 is used to obtain the optimal intent with the highest similarity to the intermediate logical text in the intent database;
  • the text generation sub-module 126 is configured to generate the logical text information based on the optimal intention.
  • keywords can be obtained by identifying the content of the question, and compared with the entity stored in the local entity, and finally obtaining the data consistent with the keyword and the entity as the entity data.
  • the topic entity word In the embodiment of the present application, of the multiple entities found in the topic determining submodule 122, one is selected as the topic entity word.
  • the weight value of each entity is preset through the pointing relationship between the entities in the local entity. Take entities with a weight greater than 0 as the candidate set of topic entity words, and try subsequent operations on each candidate topic word in order.
  • the entity to be asked at the end of the question sentence is used as the ending entity word.
  • the ending entity word is a relationship, try to correct it.
  • the subject entity words obtained in the subject determination sub-module 122 and the ending entity words obtained in the ending determination sub-module 123 are used as the beginning and the end of the link to be traversed in the graph. Get the set of candidate subgraphs.
  • the similarity judgment between the candidate sub-image and the existing intention in the image library is performed. Similarity is judged by whether the entities, relationships, locations, etc. are consistent. Get the most similar intent to return.
  • a logical form is generated according to the graph structure of the intention subgraph.
  • the node corresponds to the uniary representation rule
  • the class corresponds to the entity type
  • the value corresponds to the specific instance value, such as Ping An Life. If there is no specific entity value, uniary indicates that the value can be increased.
  • Edges correspond to binary representation rules. The first position of Binary is the node information corresponding to the edge, and the second position is the information of the edge, such as the risk rate of the attribute entity. The third position fills in the corresponding node information according to whether the edge is a relationship or an attribute entity. For example: There is only one Binary in this question, and the second position is the risk rate, that is, the attribute entity.
  • the attribute value of the risk rate is greater than 20%. Then the third position is filled> 20%. If there is no corresponding attribute value, the filling refers to entity A according to the definition of logical form.
  • FIG. 8 a schematic structural diagram of the semantic conversion module 130 in FIG. 6 is shown. For ease of description, only the parts related to the present application are shown.
  • the above-mentioned semantic conversion module 130 includes: a semantic segmentation module 131, a node conversion sub-module 132, and a semantic tree construction sub-module 133. among them:
  • the semantic segmentation module 131 is used to perform semantic segmentation operations on the logical text information to obtain semantic units;
  • the node conversion sub-module 132 is configured to perform a node conversion operation on the semantic unit to obtain a semantic node;
  • the semantic tree construction sub-module 133 is configured to construct a semantic tree based on the semantic node to obtain the target semantic tree.
  • each node establishes a tree node object (each tree node object has the following attributes: name, type, value, left child node, right child node, parent node, etc.), for example, with ⁇ V3:Binary(V2?, transaction relationship, V1)> node as an example, the name of the tree node object is V3, the type is Binary, the value is (V2?, transaction relationship, V1), and the left child node, right child node, and parent node are initialized to empty.
  • V3 node update the following values: the left child node of V3 is V2, the right child node is V1, the parent node of V2 is V3, and the parent node of V1 is V3.
  • V4 node For the V4 node, update the following values: the left child node of V4 is V3, the right child node is empty, and the parent node of V3 is V4.
  • the above-mentioned semantic analysis device 100 further includes: a type acquisition sub-module, an entity judgment sub-module, a semantic input sub-module, and an error signal output sub-module. among them:
  • the type obtaining sub-module is used to obtain the node type of the target semantic tree
  • the entity judgment sub-module is used to judge whether there is an entity triplet corresponding to the node type in the local entity library
  • the semantic input sub-module is used to execute the intelligent question answering by using the target semantic tree as the input content of the intelligent question answering system if there is an entity triplet corresponding to the node type in the local entity library Steps of operation;
  • the error signal output sub-module is configured to output a node error signal if the entity triple corresponding to the node type does not exist in the local entity library.
  • FIG. 9 is a block diagram of the basic structure of the computer device in this embodiment.
  • the computer device 9 includes a memory 91, a processor 92, and a network interface 93 that communicate with each other through a system bus. It should be pointed out that the figure only shows the computer device 9 with components 91-93, but it should be understood that it is not required to implement all the illustrated components, and more or fewer components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions.
  • Its hardware includes, but is not limited to, a microprocessor, a dedicated Integrated Circuit (Application Specific Integrated Circuit, ASIC), Programmable Gate Array (Field-Programmable Gate Array, FPGA), Digital Processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • ASIC Application Specific Integrated Circuit
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Processor
  • the computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the computer device can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device.
  • the memory 91 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static memory Random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disks, optical disks, etc., the computer readable storage The medium can be non-volatile or volatile.
  • the memory 91 may be an internal storage unit of the computer device 9, for example, a hard disk or a memory of the computer device 9.
  • the memory 91 may also be an external storage device of the computer device 9, such as a plug-in hard disk equipped on the computer device 9, a smart media card (SMC), a secure digital (Secure Digital, SD) card, Flash Card, etc.
  • the memory 91 may also include both the internal storage unit of the computer device 9 and its external storage device.
  • the memory 91 is generally used to store an operating system and various application software installed on the computer device 9, such as computer-readable instructions of a semantic analysis method.
  • the memory 91 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 92 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
  • the processor 92 is generally used to control the overall operation of the computer device 9.
  • the processor 92 is configured to run computer-readable instructions or process data stored in the memory 91, for example, computer-readable instructions for running the semantic analysis method.
  • the network interface 93 may include a wireless network interface or a wired network interface, and the network interface 93 is generally used to establish a communication connection between the computer device 9 and other electronic devices.
  • This application also provides another implementation manner, that is, a computer-readable storage medium storing a semantic analysis process, and the semantic analysis process can be executed by at least one processor to enable all The at least one processor executes the steps of the semantic analysis method as described above.
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, The optical disc) includes several instructions to make a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present application.
  • a terminal device which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种语义分析方法、语义分析装置、计算机设备及存储介质,涉及人工智能领域。该方法包括:接收用户终端针对智能问答系统发送的查询请求,查询请求至少携带有查询文本信息(S101);读取本地实体库,基于本地实体库以及预设逻辑规则对查询文本信息进行翻译操作,获取逻辑文本信息(S102);基于语义树转换规则将逻辑文本信息转换成目标语义树(S103);将目标语义树作为智能问答系统的输入内容进行智能问答操作(S104)。上述方法可以结合用户输入的文本的上下文逻辑关系,识别到用户的真实意图,能够向用户提供更加符合用户需求的回答内容。

Description

一种语义分析方法、装置、计算机设备及存储介质
本申请以2020年05月29日提交的申请号为202010477643.0,名称为“一种语义分析方法、装置、计算机设备及存储介质”的中国发明专利申请为基础,并要求其优先权。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种语义分析方法、装置、计算机设备及存储介质。
背景技术
智能问答系统是人工智能在产业界落地的重要阵地。随着大数据时代,AI时代的到来,越来越多的传统BI系统面临数据维度和业务功能维度集成整合的压力和挑战。
现有一种客服机器人问答方法,是通过预设的客服机器人与用户进行交流,并基于用户交流的过程中提问的关键字在数据库中提取对应的答复内容进行回答,从而实现智能问答的过程。
然而,在实现本申请的过程中,发明人意识到传统的客服机器人问答方法普遍不智能,该客服机器人只能通过配置关键字来返回固定的文字回答提问,没有考虑到上下文的结合,也没有识别到用户的真实情绪,而只是机械式的回答,用户体验较差。
发明内容
本申请实施例的目的旨在解决传统的客服机器人问答方法普遍只能通过配置关键字来返回固定的文字回答提问,没有考虑到上下文的结合,也没有识别到用户的真实情绪,而只是机械式的回答,用户体验较差的问题。
为了解决上述技术问题,本申请实施例提供一种语义分析方法,采用了如下所述的技术方案:
接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;
读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;
基于语义树转换规则将所述逻辑文本信息转换成目标语义树;
将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。
为了解决上述技术问题,本申请实施例还提供一种语义分析装置,采用了如下所述的技术方案:
请求接收模块,用于接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;
文本获取模块,用于读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;
语义转换模块,用于基于语义树转换规则将所述逻辑文本信息转换成目标语义树;
语义输入模块,用于将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。
为了解决上述技术问题,本申请实施例还提供一种计算机设备,采用了如下所述的技术方案:
包括存储器和处理器,所述计算机可读存储介质上存储有计算机流程,所述计算机流程被处理器执行时实现如下所述语义分析方法的步骤:
接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;
读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;
基于语义树转换规则将所述逻辑文本信息转换成目标语义树;
将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。
为了解决上述技术问题,本申请实施例还提供一种计算机可读存储介质,采用了如下所述的技术方案:
所述计算机可读存储介质上存储有计算机流程,所述计算机流程被处理器执行时实现如下所述语义分析方法的步骤:
接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;
读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;
基于语义树转换规则将所述逻辑文本信息转换成目标语义树;
将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。
通过将用户输入的查询文本翻译成逻辑文本,有效帮助我们将自然语言问句转化为机器可识别的表达,澄清了问句中模糊的表述,将问句以更规范、更清晰的规则展现,为后续基于自然语言的功能实现奠定了坚实的基础;并将所述逻辑文本转换成语义树,可以以严谨的逻辑顺序组织语义,逻辑规则与语义树的转换可以使人理解的语言信息转化为计算机可识别的数据结构,为后续执行查询操作提供基础,逻辑规则的校验为语义的检查以及修复提供基础,将语义树作为输入内容进行问答操作,可以结合用户输入的文本的上下文逻辑关系,识别到用户的真实情绪,能够向用户提供更加契合用户需求的回答内容。
附图说明
为了更清楚地说明本申请中的方案,下面将对本申请实施例描述中所需要使用的附图作一个简单介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例一提供的语义分析方法的实现流程图;
图2是本申请实施例一提供的目标语义树的示意图;
图3是图1中步骤S102的实现流程图;
图4是图1中步骤S103的实现流程图;
图5是本申请实施例一提供的逻辑校验方法的实现流程图;
图6是本申请实施例二提供的语义分析装置的结构示意图;
图7是图6中文本获取模块的结构示意图;
图8是图6中语义转换模块的结构示意图;
图9是根据本申请的计算机设备的一个实施例的结构示意图。
具体实施方式
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同;本文中在申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请;本申请的说明书和权利要求书及上述附图说明中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。本申请的说明书和权利要求书或上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含 在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
为了使本技术领域的人员更好地理解本申请方案,下面将结合附图,对本申请实施例中的技术方案进行清楚、完整地描述。
实施例一
参考图1,示出了本申请实施例一提供的语义分析方法的实现流程图,为了便于说明,仅示出与本申请相关的部分。
在步骤S101中,接收用户终端针对智能问答系统发送的查询请求,查询请求至少携带有查询文本信息。
在本申请实施例中,用户终端可以是诸如移动电话、智能电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端,应当理解,此处对用户终端的举例仅为方便理解,不用于限定本申请。
在本申请实施例中,智能问答系统主要用于精确的定位网站用户所需要的提问知识,通过与网站用户进行交互,为网站用户提供个性化的信息服务。
在本申请实施例中,查询请求指的是用户通过该用户终端向系统发送的包含用户需要提问的内容的数据流信息,该查询请求可以是文本输入的文本数据,也可以是语音输入的音频数据。当该查询请求为音频数据的时候,需要对该音频数据进行语音识别操作,转换成系统可进行语义分析的文本数据,应当理解,此处对查询请求的举例仅为方便理解,不用于限定本申请。
在本申请实施例中,查询文本信息指的是用户输入的文本数据,或者是用户输入的音频数据转换成的文本数据,该查询文本信息为用户最原始的语义内容。
在步骤S102中,读取本地实体库,基于本地实体库以及预设逻辑规则对查询文本信息进行翻译操作,获取逻辑文本信息。
在本申请实施例中,本地实体库主要用于预先存储实体内容的知识库。
在本申请实施例中,预设逻辑规则主要用于精确表达自然语言信息,并便于机器进行识别,该预设逻辑规则可根据实际需要进行对应设计。
在本申请实施例中,翻译操作指的是识别上述查询文本信息后,通过实体连接的方式,将查询文本信息与上述知识库中的实体内容进行对照,获取实体内容一致的文本,并通过基于语义表示的逻辑规则符号集对该文本进行翻译,从而获得上述逻辑文本信息。
在本申请实施例中,将问句中出现的最大的排序实体作为该问句的主题实体词,将用户最终询问的实体作为查询图链路的结尾。通过遍历问句中出现的实体、关系、属性,得到从主题实体词到结尾实体词的核心推理链路。针对每一条核心推导链路,将其转化为树结构进行存储,通过比较该树结构与已知意图的相似性,得到与该问句最相似的核心推导链路。最终将该核心推导链路的链接信息解析为查询参数和查询流程。
在步骤S103中,基于语义树转换规则将逻辑文本信息转换成目标语义树。
在本申请实施例中,语义树转换规则指的是逻辑规则以“<>”表达最小语义。我们首先将逻辑规则切分为一系列最小语义单元,然后将最小语义单元转换为语义树的节点(语义组合与拼装),根据语义单元之间的引用关系建立语义树,这种引用关系代表了查询的先后关系以及知识图谱实体之间的关联方式。
在实际应用中,叶子节点对应三元组的实体,非叶子节点对应三元组的实体间的关系或者实体的属性,答案节点位于根节点处。以XX公司的交易对手的敞口信息为例,XX公司和交易对手为实体,交易关系为实体间关系,敞口信息为属性,最后的答案节点询问的是属性值,如图2所示。
在步骤S104中,将目标语义树作为智能问答系统的输入内容进行智能问答操作。
通过将用户输入的查询文本翻译成逻辑文本,有效帮助我们将自然语言问句转化为机器可识别的表达,澄清了问句中模糊的表述,将问句以更规范、更清晰的规则展现,为后续基于自然语言的功能实现奠定了坚实的基础;并将所述逻辑文本转换成语义树,可以以严谨的逻辑顺序组织语义,逻辑规则与语义树的转换可以使人理解的语言信息转化为计算机可识别的数据结构,为后续执行查询操作提供基础,逻辑规则的校验为语义的检查以及修复提供基础,将语义树作为输入内容进行问答操作,可以结合用户输入的文本的上下文逻辑关系,识别到用户的真实情绪,能够向用户提供更加契合用户需求的回答内容。
作为实施例一的一些可选实现方式中,该预设逻辑规则具体包括Unary一元规则、Binary二元规则以及Aggregation聚合规则。
在本申请实施例中,为精确表达自然语言信息,并以机器可识别的逻辑规则展现,设计了三种语义单元模板,分别是Unary一元规则、Binary二元规则以及Aggregation聚合规则,具体规则如下:
(1)Unary一元规则
对于问句中的实体e,需要明确实体e表示的是一类实体还是一个实例Instance。若问句中仅出现了实体的类别,表示成<Unary(class=’E’)>;若问句中出现的是实体的实例值,则需找到其对应的实体类别,表示成<Unary(class=’E’,value=’Instance’)>。例如,定义‘机构’为一种实体类型。当问句中出现‘公司’时,表示成<Unary(class=’机构’)>,若问句中出现‘XXX公司’时,则表示成<Unary(class=’机构’,value=’XXX公司’)>。
(2)Binary二元规则
Binary主要用于描述三元组的关系,三元组可以理解为(头实体、关系、尾实体),(头实体、属性、属性值)或(关系,关系属性,关系属性值)。Binary规则是已知其中两个元素,求第三个元素,使用‘?’来标记要查询的元素。
关系类问题,S和E表示的是实体,rel表示的是关系
Binary(S,rel?,E)返回的是S和E之间的关系;
Binary(S,rel,E?)返回的是S的rel是什么;
Binary(S?,rel,E)回答的是有哪些实体和E有rel关系;
b)实体属性类问题,S表示实体,PRO表示属性,value表示属性值
Binary(S,PRO,value?)返回的是S的属性PRO是多少;
Binary(S?,PRO,value)求的是属性PRO是value的实体S;
Binary(S,PRO?,value)求的是value是S的什么属性;
c)关系属性类问题,R表示关系,RPRO表示关系的属性,value表示属性值
Binary(R,RPRO,value?)求的是关系的属性RPRO是多少;
(3)Aggregation聚合规则
此处引用了一系列聚合操作符,来表达问句中的运算逻辑和限定逻辑,主要有如下七种:
Rank操作
参数设置:by—排序的属性;obj—操作的对象;range—排序的返回范围
用途:排序,用于回答‘前N个’,‘第N个’等问题
Count操作
参数设置:obj—计数的对象;con—计数时过滤条件
用途:统计,用于回答‘有多少个’类似问题
Sum操作
参数设置:obj—求和的对象;con—加总时过滤条件
用途:对数值类属性做加总计算
Opr操作
参数设置:‘=’--计算方法(+-*/and or);
S—数值1;E—数值2;con—计算时的过滤条件
用途:二元计算,用于回答各类计算问题
Filter操作
参数设置:obj--过滤的对象;con—过滤条件
用途:对于关系的属性进行筛选操作
Time操作
参数设置:con—时间限定范围
用途:用于表示问句的时间跨度
Trend&Distribution操作
参数设置:无
用途:分布与变化趋势计算
整个逻辑规则由多个语义单元组成,单个语义单元的语法规范如下:
<unit_code:semantic_unit>
逻辑规则构建应遵循了原问句的语序,语义单元的排列顺序应与原问句中该语义所在位置一致。
unit_code代表语义单元的编码,逻辑规则应有且只有一个主单元。主单元表示问句最终要返回的答案内容,用A表示,主单元一定是最后执行的。语义单元编码的原则是从A先向前再向后命名扩展,比如:V5 V4 V3 V2 V1 A V6 V7 V8。
semantic_unit即为上单元提到的三元组表示,不再复述。
继续参考图3,示出了图1中步骤S102的实现流程图,为了便于说明,仅示出与本申请相关的部分。
作为实施例一的一些可选实现方式中,上述步骤S102具体包括:步骤S201、步骤S202、步骤S203、步骤S204、步骤S205以及步骤S206。
在步骤S201中,在本地实体库中获取与查询文本信息相对应的实体数据。
在本申请实施例中,可通过识别问句中出现内容,获得关键词,并与本地实体库存在的实体进行比较,最终获取关键词与实体相一致的数据,作为该实体数据。
在步骤S202中,基于预设权重值确定与实体数据相对应的主题实体词。
在本申请实施例中,对步骤S201中找出来的多个实体,选择一个作为主题实体词。通过本地实体中实体间的指向关系,预设每种实体的权重值。将权重大于0的实体作为主题实体词的候选集,按照顺序对每个候选主题词尝试后续操作。
在步骤S203中,将查询文本信息的末端实体数据作为结尾实体词。
在本申请实施例中,将问句结束时要询问的实体作为结尾实体词。当结尾实体词为关系时,尝试进行修正。
在步骤S204中,分别将主题实体词以及结尾实体词作为初始逻辑文本的首位实体词,获得中间逻辑文本。
在本申请实施例中,将步骤S202中得到的主题实体词和步骤S203中得到的结尾实体词作为链路的首尾两端,在图谱中进行遍历。得到候选的子图集合。
在步骤S205中,在意图数据库中获取与中间逻辑文本相似度最高的最优意图。
在本申请实施例中,将候选子图与意图库中已有的意图进行相似性判断。相似性通过实体、关系、位置等是否一致来判断。得到最相似的一个意图返回。
在步骤S206中,基于最优意图生成逻辑文本信息。
在本申请实施例中,根据意图子图的图结构,生成逻辑形式。
在实际应用中,将节点(实体类型)对应到uniary表示规则,class对应实体类型,value对应具体实例值,例如:平安人寿。若没有具体的实体值,uniary表示可以增加value的信息。边(关系、属性实体)对应到binary表示规则。Binary的第一个位置为该边对应 的节点信息,第二个位置为边的表示信息,例如:属性实体出险率。第三个位置根据该边为关系还是属性实体分别填充对应的节点信息。例如:该问题中只有一个Binary表示,第二个位置为出险率,即属性实体。此时若存在出险率的属性值,例如出险率的值是否大于20%,大于20%为出险率的属性值。则第三个位置填充>20%,若不存在对应的属性值,则根据逻辑形式的定义,填充指代实体A。
最后得到如下逻辑形式:
<V1:Uniary(class=专业公司,value=平安人寿)>
<A:Binary(V1,出险率,A?)>
继续参考图4,示出了图1中步骤S103的实现流程图,为了便于说明,仅示出与本申请相关的部分。
作为实施例一的一些可选实现方式中,上述步骤S103具体包括:步骤S301、步骤S302以及步骤S303。
在步骤S301中,对逻辑文本信息进行语义切分操作,获得语义单元。
在步骤S302中,对语义单元进行节点转换操作,获得语义节点。
在步骤S303中,基于语义节点构建语义树,获得目标语义树。
在实际应用中,流程会以<>为节点单元将如上述逻辑规则分拆成五个节点。每个节点建立一个树节点对象(每个树节点对象有如下属性:名字,类型,值,左子节点,右子节点,父节点等),例如以<V3:Binary(V2?,交易关系,V1)>节点为例,树节点对象的名字为V3,类型为Binary,值为(V2?,交易关系,V1),左子节点、右子节点、父节点初始化为空。后续描述中,我们以节点对象的名字表示节点名称,如<V1:Uniary(class='机构',value=’XX公司’)>描述为V1节点。
根据五个树节点对象建立树,主要更新每个树节点的左子节点,右子节点,父节点,例如:
1)针对V3节点,更新如下数值:V3的左子节点为V2,右子节点为V1,V2的父节点为V3,V1的父节点为V3。
2)针对V1节点,更新如下数值:V1的左子节点为空,右子节点为空。
3)针对V4节点,更新如下数值:V4的左子节点为V3,右子节点为空,V3的父节点为V4。
4)针对A节点,更新如下数值:A节点的左子节点为V4,右子节点为空,V4节点的父子节点为A。
这样就建立树节点之间的引用关系,同时得到根节点为A节点,最终形成的语义树如上述图2所示。
继续参考图5,示出了本申请实施例一提供的逻辑校验方法的实现流程图,为了便于说明,仅示出与本申请相关的部分。
作为实施例一的一些可选实现方式中,上述步骤S103之后,还包括:步骤S401、步骤S402、步骤S403以及步骤S404。
在步骤S401中,获取目标语义树的节点类型。
在步骤S402中,判断所述本地实体库中是否存在与所述节点类型相对应的实体三元组。
在步骤S403中,若所述本地实体库中存在与所述节点类型相对应的实体三元组,则执行所述将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作的步骤。
在步骤S404中,若所述本地实体库中不存在与所述节点类型相对应的实体三元组,则输出节点错误信号。
在本申请实施例中,判断是否存在实体三元组的过程是利用后续遍历树搜索算法,自底向上搜索整个树,同时从数据库中取提前定义的概念图谱三元组,对节点进行类型比对,确保每个节点符合定义的三元组,若符合则继续向上搜索,不符合则返回出错节点。 逻辑校验的目的在于既可以发现语义的缺失、冗余以及错位(为语义树的修正提供基础),也可以为语义解析模块提供出错信息,做出修正。
综上所述,本申请实施例提供的语义分析方法置至少具有以下有益效果:
通过将用户输入的查询文本翻译成逻辑文本,有效帮助我们将自然语言问句转化为机器可识别的表达,澄清了问句中模糊的表述,将问句以更规范、更清晰的规则展现,为后续基于自然语言的功能实现奠定了坚实的基础;并将所述逻辑文本转换成语义树,可以以严谨的逻辑顺序组织语义,逻辑规则与语义树的转换可以使人理解的语言信息转化为计算机可识别的数据结构,为后续执行查询操作提供基础,逻辑规则的校验为语义的检查以及修复提供基础,将语义树作为输入内容进行问答操作,可以结合用户输入的文本的上下文逻辑关系,识别到用户的真实情绪,能够向用户提供更加契合用户需求的回答内容。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机流程来指令相关的硬件来完成,该计算机流程可存储于一计算机可读取存储介质中,该流程在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。
应该理解的是,虽然附图的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,附图的流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
实施例二
进一步参考图6,作为对上述图1所示方法的实现,本申请提供了一种语义识别装置的一个实施例,该装置实施例与图1所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图6所示,本申请实施例二提供的语义识别装置100包括:请求接收模块110、文本获取模块120、语义转换模块130以及语义输入模块140。其中:
请求接收模块110,用于接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;
文本获取模块120,用于读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;
语义转换模块130,用于基于语义树转换规则将所述逻辑文本信息转换成目标语义树;
语义输入模块140,用于将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。
在本申请实施例中,用户终端可以是诸如移动电话、智能电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端,应当理解,此处对用户终端的举例仅为方便理解,不用于限定本申请。
在本申请实施例中,智能问答系统主要用于精确的定位网站用户所需要的提问知识,通过与网站用户进行交互,为网站用户提供个性化的信息服务。
在本申请实施例中,查询请求指的是用户通过该用户终端向系统发送的包含用户需要提问的内容的数据流信息,该查询请求可以是文本输入的文本数据,也可以是语音输入的音频数据。当该查询请求为音频数据的时候,需要对该音频数据进行语音识别操作,转换成系统可进行语义分析的文本数据,应当理解,此处对查询请求的举例仅为方便理解,不用于限定本申请。
在本申请实施例中,查询文本信息指的是用户输入的文本数据,或者是用户输入的音 频数据转换成的文本数据,该查询文本信息为用户最原始的语义内容。
在本申请实施例中,本地实体库主要用于预先存储实体内容的知识库。
在本申请实施例中,预设逻辑规则主要用于精确表达自然语言信息,并便于机器进行识别,该预设逻辑规则可根据实际需要进行对应设计。
在本申请实施例中,翻译操作指的是识别上述查询文本信息后,通过实体连接的方式,将查询文本信息与上述知识库中的实体内容进行对照,获取实体内容一致的文本,并通过基于语义表示的逻辑规则符号集对该文本进行翻译,从而获得上述逻辑文本信息。
在本申请实施例中,将问句中出现的最大的排序实体作为该问句的主题实体词,将用户最终询问的实体作为查询图链路的结尾。通过遍历问句中出现的实体、关系、属性,得到从主题实体词到结尾实体词的核心推理链路。针对每一条核心推导链路,将其转化为树结构进行存储,通过比较该树结构与已知意图的相似性,得到与该问句最相似的核心推导链路。最终将该核心推导链路的链接信息解析为查询参数和查询流程。
在本申请实施例中,语义树转换规则指的是逻辑规则以“<>”表达最小语义。我们首先将逻辑规则切分为一系列最小语义单元,然后将最小语义单元转换为语义树的节点(语义组合与拼装),根据语义单元之间的引用关系建立语义树,这种引用关系代表了查询的先后关系以及知识图谱实体之间的关联方式。
在实际应用中,叶子节点对应三元组的实体,非叶子节点对应三元组的实体间的关系或者实体的属性,答案节点位于根节点处。以XX公司的交易对手的敞口信息为例,XX公司和交易对手为实体,交易关系为实体间关系,敞口信息为属性,最后的答案节点询问的是属性值,如图2所示。
通过将用户输入的查询文本翻译成逻辑文本,有效帮助我们将自然语言问句转化为机器可识别的表达,澄清了问句中模糊的表述,将问句以更规范、更清晰的规则展现,为后续基于自然语言的功能实现奠定了坚实的基础;并将所述逻辑文本转换成语义树,可以以严谨的逻辑顺序组织语义,逻辑规则与语义树的转换可以使人理解的语言信息转化为计算机可识别的数据结构,为后续执行查询操作提供基础,逻辑规则的校验为语义的检查以及修复提供基础,将语义树作为输入内容进行问答操作,可以结合用户输入的文本的上下文逻辑关系,识别到用户的真实情绪,能够向用户提供更加契合用户需求的回答内容。
作为实施例一的一些可选实现方式中,该预设逻辑规则具体包括Unary一元规则、Binary二元规则以及Aggregation聚合规则。
在本申请实施例中,为精确表达自然语言信息,并以机器可识别的逻辑规则展现,设计了三种语义单元模板,分别是Unary一元规则、Binary二元规则以及Aggregation聚合规则,具体规则如下:
(1)Unary一元规则
对于问句中的实体e,需要明确实体e表示的是一类实体还是一个实例Instance。若问句中仅出现了实体的类别,表示成<Unary(class=’E’)>;若问句中出现的是实体的实例值,则需找到其对应的实体类别,表示成<Unary(class=’E’,value=’Instance’)>。例如,定义‘机构’为一种实体类型。当问句中出现‘公司’时,表示成<Unary(class=’机构’)>,若问句中出现‘XXX公司’时,则表示成<Unary(class=’机构’,value=’XXX公司’)>。
(2)Binary二元规则
Binary主要用于描述三元组的关系,三元组可以理解为(头实体、关系、尾实体),(头实体、属性、属性值)或(关系,关系属性,关系属性值)。Binary规则是已知其中两个元素,求第三个元素,使用‘?’来标记要查询的元素。
关系类问题,S和E表示的是实体,rel表示的是关系
Binary(S,rel?,E)返回的是S和E之间的关系;
Binary(S,rel,E?)返回的是S的rel是什么;
Binary(S?,rel,E)回答的是有哪些实体和E有rel关系;
b)实体属性类问题,S表示实体,PRO表示属性,value表示属性值
Binary(S,PRO,value?)返回的是S的属性PRO是多少;
Binary(S?,PRO,value)求的是属性PRO是value的实体S;
Binary(S,PRO?,value)求的是value是S的什么属性;
c)关系属性类问题,R表示关系,RPRO表示关系的属性,value表示属性值
Binary(R,RPRO,value?)求的是关系的属性RPRO是多少;
(3)Aggregation聚合规则
此处引用了一系列聚合操作符,来表达问句中的运算逻辑和限定逻辑,主要有如下七种:
Rank操作
参数设置:by—排序的属性;obj—操作的对象;range—排序的返回范围
用途:排序,用于回答‘前N个’,‘第N个’等问题
Count操作
参数设置:obj—计数的对象;con—计数时过滤条件
用途:统计,用于回答‘有多少个’类似问题
Sum操作
参数设置:obj—求和的对象;con—加总时过滤条件
用途:对数值类属性做加总计算
Opr操作
参数设置:‘=’--计算方法(+-*/and or);
S—数值1;E—数值2;con—计算时的过滤条件
用途:二元计算,用于回答各类计算问题
Filter操作
参数设置:obj--过滤的对象;con—过滤条件
用途:对于关系的属性进行筛选操作
Time操作
参数设置:con—时间限定范围
用途:用于表示问句的时间跨度
Trend&Distribution操作
参数设置:无
用途:分布与变化趋势计算
整个逻辑规则由多个语义单元组成,单个语义单元的语法规范如下:
<unit_code:semantic_unit>
逻辑规则构建应遵循了原问句的语序,语义单元的排列顺序应与原问句中该语义所在位置一致。
unit_code代表语义单元的编码,逻辑规则应有且只有一个主单元。主单元表示问句最终要返回的答案内容,用A表示,主单元一定是最后执行的。语义单元编码的原则是从A先向前再向后命名扩展,比如:V5 V4 V3 V2 V1 A V6 V7 V8。
semantic_unit即为上单元提到的三元组表示,不再复述。
继续参考图7,示出了图6中文本获取模块120的结构示意图为了便于说明,仅示出与本申请相关的部分。
在本申请实施例二的一些可选的实现方式中,文本获取模块120包括:数据获取子模块121、主题确定子模块122、结尾确定子模块123、中间文本获取子模块124、最优意图子模块125以及文本生成子模块126。其中:
数据获取子模块121,用于在所述本地实体库中获取与所述查询文本信息相对应的实 体数据;
主题确定子模块122,用于基于预设权重值确定与所述实体数据相对应的主题实体词;
结尾确定子模块123,用于将所述查询文本信息的末端实体数据作为结尾实体词;
中间文本获取子模块124,用于分别将所述主题实体词以及结尾实体词作为初始逻辑文本的首位实体词,获得中间逻辑文本;
最优意图子模块125,用于在意图数据库中获取与所述中间逻辑文本相似度最高的最优意图;
文本生成子模块126,用于基于所述最优意图生成所述逻辑文本信息。
在本申请实施例中,可通过识别问句中出现内容,获得关键词,并与本地实体库存在的实体进行比较,最终获取关键词与实体相一致的数据,作为该实体数据。
在本申请实施例中,对主题确定子模块122中找出来的多个实体,选择一个作为主题实体词。通过本地实体中实体间的指向关系,预设每种实体的权重值。将权重大于0的实体作为主题实体词的候选集,按照顺序对每个候选主题词尝试后续操作。
在本申请实施例中,将问句结束时要询问的实体作为结尾实体词。当结尾实体词为关系时,尝试进行修正。
在本申请实施例中,将主题确定子模块122中得到的主题实体词和结尾确定子模块123中得到的结尾实体词作为链路的首尾两端,在图谱中进行遍历。得到候选的子图集合。
在本申请实施例中,将候选子图与意图库中已有的意图进行相似性判断。相似性通过实体、关系、位置等是否一致来判断。得到最相似的一个意图返回。
在本申请实施例中,根据意图子图的图结构,生成逻辑形式。
在实际应用中,将节点(实体类型)对应到uniary表示规则,class对应实体类型,value对应具体实例值,例如:平安人寿。若没有具体的实体值,uniary表示可以增加value的信息。边(关系、属性实体)对应到binary表示规则。Binary的第一个位置为该边对应的节点信息,第二个位置为边的表示信息,例如:属性实体出险率。第三个位置根据该边为关系还是属性实体分别填充对应的节点信息。例如:该问题中只有一个Binary表示,第二个位置为出险率,即属性实体。此时若存在出险率的属性值,例如出险率的值是否大于20%,大于20%为出险率的属性值。则第三个位置填充>20%,若不存在对应的属性值,则根据逻辑形式的定义,填充指代实体A。
最后得到如下逻辑形式:
<V1:Uniary(class=专业公司,value=平安人寿)>
<A:Binary(V1,出险率,A?)>
继续参考图8,示出了图6中语义转换模块130的结构示意图,为了便于说明,仅示出与本申请相关的部分。
在本申请实施例二的一些可选的实现方式中,上述语义转换模块130包括:语义切分子模块131、节点转换子模块132以及语义树构建子模块133。其中:
语义切分子模块131,用于对所述逻辑文本信息进行语义切分操作,获得语义单元;
节点转换子模块132,用于对所述语义单元进行节点转换操作,获得语义节点;
语义树构建子模块133,用于基于所述语义节点构建语义树,获得所述目标语义树。
在实际应用中,流程会以<>为节点单元将如上述逻辑规则分拆成五个节点。每个节点建立一个树节点对象(每个树节点对象有如下属性:名字,类型,值,左子节点,右子节点,父节点等),例如以<V3:Binary(V2?,交易关系,V1)>节点为例,树节点对象的名字为V3,类型为Binary,值为(V2?,交易关系,V1),左子节点、右子节点、父节点初始化为空。后续描述中,我们以节点对象的名字表示节点名称,如<V1:Uniary(class='机构',value=’XX公司’)>描述为V1节点。
根据五个树节点对象建立树,主要更新每个树节点的左子节点,右子节点,父节点,例如:
1)针对V3节点,更新如下数值:V3的左子节点为V2,右子节点为V1,V2的父节点为V3,V1的父节点为V3。
2)针对V1节点,更新如下数值:V1的左子节点为空,右子节点为空。
3)针对V4节点,更新如下数值:V4的左子节点为V3,右子节点为空,V3的父节点为V4。
4)针对A节点,更新如下数值:A节点的左子节点为V4,右子节点为空,V4节点的父子节点为A。
这样就建立树节点之间的引用关系,同时得到根节点为A节点,最终形成的语义树如上述图2所示。
在本申请实施例二的一些可选的实现方式中,上述语义分析装置100还包括:类型获取子模块、实体判断子模块、语义输入子模块以及错误信号输出子模块。其中:
类型获取子模块,用于获取所述目标语义树的节点类型;
实体判断子模块,用于判断所述本地实体库中是否存在与所述节点类型相对应的实体三元组;
语义输入子模块,用于若所述本地实体库中存在与所述节点类型相对应的实体三元组,则执行所述将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作的步骤;
错误信号输出子模块,用于若所述本地实体库中不存在与所述节点类型相对应的实体三元组,则输出节点错误信号。
为解决上述技术问题,本申请实施例还提供计算机设备。具体请参阅图9,图9为本实施例计算机设备基本结构框图。
所述计算机设备9包括通过系统总线相互通信连接存储器91、处理器92、网络接口93。需要指出的是,图中仅示出了具有组件91-93的计算机设备9,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。其中,本技术领域技术人员可以理解,这里的计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。
所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。
所述存储器91至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等,所述计算机可读存储介质可以是非易失性,也可以是易失性。在一些实施例中,所述存储器91可以是所述计算机设备9的内部存储单元,例如该计算机设备9的硬盘或内存。在另一些实施例中,所述存储器91也可以是所述计算机设备9的外部存储设备,例如该计算机设备9上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器91还可以既包括所述计算机设备9的内部存储单元也包括其外部存储设备。本实施例中,所述存储器91通常用于存储安装于所述计算机设备9的操作系统和各类应用软件,例如语义分析方法的计算机可读指令等。此外,所述存储器91还可以用于暂时地存储已经输出或者将要输出的各类数据。
所述处理器92在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器92通常用于控制所述计算机设备9的总体操作。本实施例中,所述处理器92用于运行所述存储器91中存储的计算机 可读指令或者处理数据,例如运行所述语义分析方法的计算机可读指令。
所述网络接口93可包括无线网络接口或有线网络接口,该网络接口93通常用于在所述计算机设备9与其他电子设备之间建立通信连接。
本申请还提供了另一种实施方式,即提供一种计算机可读存储介质,所述计算机可读存储介质存储有语义分析流程,所述语义分析流程可被至少一个处理器执行,以使所述至少一个处理器执行如上述的语义分析方法的步骤。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
显然,以上所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例,附图中给出了本申请的较佳实施例,但并不限制本申请的专利范围。本申请可以以许多不同的形式来实现,相反地,提供这些实施例的目的是使对本申请的公开内容的理解更加透彻全面。尽管参照前述实施例对本申请进行了详细的说明,对于本领域的技术人员来而言,其依然可以对前述各具体实施方式所记载的技术方案进行修改,或者对其中部分技术特征进行等效替换。凡是利用本申请说明书及附图内容所做的等效结构,直接或间接运用在其他相关的技术领域,均同理在本申请专利保护范围之内。

Claims (20)

  1. 一种语义分析方法,其中,包括下述步骤:
    接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;
    读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;
    基于语义树转换规则将所述逻辑文本信息转换成目标语义树;
    将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。
  2. 根据权利要求1所述的语义分析方法,其中,所述读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息的步骤具体包括:
    在所述本地实体库中获取与所述查询文本信息相对应的实体数据;
    基于预设权重值确定与所述实体数据相对应的主题实体词;
    将所述查询文本信息的末端实体数据作为结尾实体词;
    分别将所述主题实体词以及结尾实体词作为初始逻辑文本的首位实体词,获得中间逻辑文本;
    在意图数据库中获取与所述中间逻辑文本相似度最高的最优意图;
    基于所述最优意图生成所述逻辑文本信息。
  3. 根据权利要求1所述的语义分析方法,其中,所述基于语义树转换规则将所述逻辑文本信息转换成目标语义树的步骤具体包括:
    对所述逻辑文本信息进行语义切分操作,获得语义单元;
    对所述语义单元进行节点转换操作,获得语义节点;
    基于所述语义节点构建语义树,获得所述目标语义树。
  4. 根据权利要求1所述的语义分析方法,其中,在所述基于语义树转换规则将所述逻辑文本信息转换成目标语义树的步骤之后,所述方法还包括:
    获取所述目标语义树的节点类型;
    判断所述本地实体库中是否存在与所述节点类型相对应的实体三元组;
    若所述本地实体库中存在与所述节点类型相对应的实体三元组,则执行所述将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作的步骤;
    若所述本地实体库中不存在与所述节点类型相对应的实体三元组,则输出节点错误信号。
  5. 根据权利要求1所述的语义分析方法,其中,所述预设逻辑规则具体包括Unary一元规则、Binary二元规则以及Aggregation聚合规则。
  6. 一种语义分析装置,其中,所述装置包括:
    请求接收模块,用于接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;
    文本获取模块,用于读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;
    语义转换模块,用于基于语义树转换规则将所述逻辑文本信息转换成目标语义树;
    语义输入模块,用于将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。
  7. 根据权利要求6所述的语义分析装置,其中,所述文本获取模块包括:
    数据获取子模块,用于在所述本地实体库中获取与所述查询文本信息相对应的实体数据;
    主题确定子模块,用于基于预设权重值确定与所述实体数据相对应的主题实体词;
    结尾确定子模块,用于将所述查询文本信息的末端实体数据作为结尾实体词;
    中间文本获取子模块,用于分别将所述主题实体词以及结尾实体词作为初始逻辑文本 的首位实体词,获得中间逻辑文本;
    最优意图子模块,用于在意图数据库中获取与所述中间逻辑文本相似度最高的最优意图;
    文本生成子模块,用于基于所述最优意图生成所述逻辑文本信息。
  8. 根据权利要求6所述的语义分析装置,其中,所述语义转换模块包括:
    语义切分子模块,用于对所述逻辑文本信息进行语义切分操作,获得语义单元;
    节点转换子模块,用于对所述语义单元进行节点转换操作,获得语义节点;
    语义树构建子模块,用于基于所述语义节点构建语义树,获得所述目标语义树。
  9. 根据权利要求6所述的语义分析装置,其中,所述装置还包括:
    节点类型获取子模块,用于获取所述目标语义树的节点类型;
    三元组判断子模块,用于判断所述本地实体库中是否存在与所述节点类型相对应的实体三元组;
    语义输入子模块,用于若所述本地实体库中存在与所述节点类型相对应的实体三元组,则执行所述将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作的步骤;
    节点错误子模块,用于若所述本地实体库中不存在与所述节点类型相对应的实体三元组,则输出节点错误信号。
  10. 根据权利要求6所述的语义分析装置,其中,所述预设逻辑规则具体包括Unary一元规则、Binary二元规则以及Aggregation聚合规则。
  11. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述计算机可读指令时实现如下所述的语义分析方法的步骤:
    接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;
    读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;
    基于语义树转换规则将所述逻辑文本信息转换成目标语义树;
    将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。
  12. 根据权利要求11所述的计算机设备,其中,所述读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息的步骤具体包括:
    在所述本地实体库中获取与所述查询文本信息相对应的实体数据;
    基于预设权重值确定与所述实体数据相对应的主题实体词;
    将所述查询文本信息的末端实体数据作为结尾实体词;
    分别将所述主题实体词以及结尾实体词作为初始逻辑文本的首位实体词,获得中间逻辑文本;
    在意图数据库中获取与所述中间逻辑文本相似度最高的最优意图;
    基于所述最优意图生成所述逻辑文本信息。
  13. 根据权利要求11所述的计算机设备,其中,所述基于语义树转换规则将所述逻辑文本信息转换成目标语义树的步骤具体包括:
    对所述逻辑文本信息进行语义切分操作,获得语义单元;
    对所述语义单元进行节点转换操作,获得语义节点;
    基于所述语义节点构建语义树,获得所述目标语义树。
  14. 根据权利要求11所述的计算机设备,其中,在所述基于语义树转换规则将所述逻辑文本信息转换成目标语义树的步骤之后,所述方法还包括:
    获取所述目标语义树的节点类型;
    判断所述本地实体库中是否存在与所述节点类型相对应的实体三元组;
    若所述本地实体库中存在与所述节点类型相对应的实体三元组,则执行所述将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作的步骤;
    若所述本地实体库中不存在与所述节点类型相对应的实体三元组,则输出节点错误信号。
  15. 根据权利要求11所述的计算机设备,其中,所述预设逻辑规则具体包括Unary一元规则、Binary二元规则以及Aggregation聚合规则。
  16. 一种计算机可读存储介质,其中,所述计算机可读指令被一种处理器执行时,使得所述一种处理执行所述的语义分析方法的步骤:
    接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;
    读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;
    基于语义树转换规则将所述逻辑文本信息转换成目标语义树;
    将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息的步骤具体包括:
    在所述本地实体库中获取与所述查询文本信息相对应的实体数据;
    基于预设权重值确定与所述实体数据相对应的主题实体词;
    将所述查询文本信息的末端实体数据作为结尾实体词;
    分别将所述主题实体词以及结尾实体词作为初始逻辑文本的首位实体词,获得中间逻辑文本;
    在意图数据库中获取与所述中间逻辑文本相似度最高的最优意图;
    基于所述最优意图生成所述逻辑文本信息。
  18. 根据权利要求16所述的计算机可读存储介质,其中,所述基于语义树转换规则将所述逻辑文本信息转换成目标语义树的步骤具体包括:
    对所述逻辑文本信息进行语义切分操作,获得语义单元;
    对所述语义单元进行节点转换操作,获得语义节点;
    基于所述语义节点构建语义树,获得所述目标语义树。
  19. 根据权利要求16所述的计算机可读存储介质,其中,在所述基于语义树转换规则将所述逻辑文本信息转换成目标语义树的步骤之后,所述方法还包括:
    获取所述目标语义树的节点类型;
    判断所述本地实体库中是否存在与所述节点类型相对应的实体三元组;
    若所述本地实体库中存在与所述节点类型相对应的实体三元组,则执行所述将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作的步骤;
    若所述本地实体库中不存在与所述节点类型相对应的实体三元组,则输出节点错误信号。
  20. 根据权利要求16所述的计算机可读存储介质,其中,所述预设逻辑规则具体包括Unary一元规则、Binary二元规则以及Aggregation聚合规则。
PCT/CN2020/098939 2020-05-29 2020-06-29 一种语义分析方法、装置、计算机设备及存储介质 WO2021135103A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010477643.0 2020-05-29
CN202010477643.0A CN111782781A (zh) 2020-05-29 2020-05-29 一种语义分析方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021135103A1 true WO2021135103A1 (zh) 2021-07-08

Family

ID=72754431

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/098939 WO2021135103A1 (zh) 2020-05-29 2020-06-29 一种语义分析方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN111782781A (zh)
WO (1) WO2021135103A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114490928B (zh) * 2021-12-31 2023-03-24 广州探迹科技有限公司 一种语义搜索的实现方法、系统、计算机设备和存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1908935A (zh) * 2006-08-01 2007-02-07 华为技术有限公司 一种自然语言的搜索方法及系统
CN102214232A (zh) * 2011-06-28 2011-10-12 东软集团股份有限公司 一种文本数据相似度的计算方法及装置
CN104142917A (zh) * 2014-05-21 2014-11-12 北京师范大学 一种用于语言理解的层次语义树构建方法及系统
CN104750795A (zh) * 2015-03-12 2015-07-01 北京云知声信息技术有限公司 一种智能语义检索系统和方法
CN105701253A (zh) * 2016-03-04 2016-06-22 南京大学 中文自然语言问句语义化的知识库自动问答方法
CN105868249A (zh) * 2015-12-15 2016-08-17 乐视网信息技术(北京)股份有限公司 数据查询控制方法及装置
CN107169092A (zh) * 2017-05-12 2017-09-15 暴风体育(北京)有限责任公司 交互过程中智能识别并处理敏感内容的方法及系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1908935A (zh) * 2006-08-01 2007-02-07 华为技术有限公司 一种自然语言的搜索方法及系统
CN102214232A (zh) * 2011-06-28 2011-10-12 东软集团股份有限公司 一种文本数据相似度的计算方法及装置
CN104142917A (zh) * 2014-05-21 2014-11-12 北京师范大学 一种用于语言理解的层次语义树构建方法及系统
CN104750795A (zh) * 2015-03-12 2015-07-01 北京云知声信息技术有限公司 一种智能语义检索系统和方法
CN105868249A (zh) * 2015-12-15 2016-08-17 乐视网信息技术(北京)股份有限公司 数据查询控制方法及装置
CN105701253A (zh) * 2016-03-04 2016-06-22 南京大学 中文自然语言问句语义化的知识库自动问答方法
CN107169092A (zh) * 2017-05-12 2017-09-15 暴风体育(北京)有限责任公司 交互过程中智能识别并处理敏感内容的方法及系统

Also Published As

Publication number Publication date
CN111782781A (zh) 2020-10-16

Similar Documents

Publication Publication Date Title
US11227118B2 (en) Methods, devices, and systems for constructing intelligent knowledge base
US20230142217A1 (en) Model Training Method, Electronic Device, And Storage Medium
CN107451153B (zh) 输出结构化查询语句的方法和装置
JP6901816B2 (ja) エンティティ関係データ生成方法、装置、機器、及び記憶媒体
US20190220752A1 (en) Method, apparatus, server, and storage medium for incorporating structured entity
JP2020520485A (ja) 視覚的分析との相互作用のため語用論の原理を適用するシステムおよび方法
CN110750649A (zh) 知识图谱构建及智能应答方法、装置、设备及存储介质
CN109408811B (zh) 一种数据处理方法及服务器
CN111831911A (zh) 查询信息的处理方法、装置、存储介质和电子装置
CN111782763A (zh) 基于语音语义的信息检索方法、及其相关设备
CN112287069B (zh) 基于语音语义的信息检索方法、装置及计算机设备
US20220391426A1 (en) Multi-system-based intelligent question answering method and apparatus, and device
CN111078842A (zh) 查询结果的确定方法、装置、服务器及存储介质
CN115827819A (zh) 一种智能问答处理方法、装置、电子设备及存储介质
CN111553556A (zh) 业务数据分析方法、装置、计算机设备及存储介质
CN113407677A (zh) 评估咨询对话质量的方法、装置、设备和存储介质
CN116303537A (zh) 数据查询方法及装置、电子设备、存储介质
WO2021135103A1 (zh) 一种语义分析方法、装置、计算机设备及存储介质
CN117076636A (zh) 一种智能客服的信息查询方法、系统和设备
CN116737758A (zh) 一种数据库查询语句的生成方法、装置、设备及存储介质
CN112989011B (zh) 数据查询方法、数据查询装置和电子设备
KR102560521B1 (ko) 지식 그래프 생성 방법 및 장치
CN114428788A (zh) 自然语言处理方法、装置、设备及存储介质
CN114625889A (zh) 一种语义消歧方法、装置、电子设备及存储介质
CN113741864A (zh) 基于自然语言处理的语义化服务接口自动设计方法与系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20909873

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20909873

Country of ref document: EP

Kind code of ref document: A1