A natural language semantic understanding method and device based on a vertical domain knowledge graph

By constructing a natural language semantic understanding method based on vertical domain knowledge graphs, the ambiguity problem of semantic understanding in voice assistants across diverse business scenarios has been solved, thereby improving user satisfaction.

CN115033661BActive Publication Date: 2025-11-04HISENSE VISUAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210638362.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-07
Publication Date
2025-11-04
Estimated Expiration
2042-06-07

AI Technical Summary

Technical Problem

When faced with diverse business needs, voice assistants struggle to accurately distinguish between similar statements, leading to incorrect business positioning and a decline in user experience.

Method used

We construct a natural language semantic understanding method based on vertical domain knowledge graphs. Through word segmentation, relation set determination, and target word segmentation result determination, we eliminate ambiguity and improve semantic understanding capabilities.

Benefits of technology

It improved the natural language semantic understanding capabilities of the voice assistant, thereby enhancing user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033661B_ABST
    Figure CN115033661B_ABST
Patent Text Reader

Abstract

The application provides a natural language semantic understanding method and device based on a vertical field knowledge graph, which comprises the following steps: performing word segmentation processing on input text to obtain at least one candidate word segmentation result; determining a relationship set corresponding to each candidate word segmentation result in the at least one candidate word segmentation result based on a knowledge graph, wherein each element in the relationship set represents a relationship corresponding to a word segmentation entity pair of the candidate word segmentation result corresponding to the relationship set, and the type of the relationship is related to two ontologies corresponding to the word segmentation entity pair and the word segmentation entity pair; and determining a target word segmentation result from the candidate word segmentation result according to the relationship set corresponding to each candidate word segmentation result in the at least one candidate word segmentation result. The optimal target candidate word segmentation result can be confirmed, the candidate word segmentation result with ambiguity is eliminated, and the user satisfaction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of natural language processing, and in particular to a natural language semantic understanding method and device based on a vertical domain knowledge graph. BACKGROUND

[0002] With more and more smart home device functions being accessed by a voice assistant, the business connected by the voice assistant is becoming more and more diversified. With the deepening of business connection, the voice assistant's support for business is also constantly enriched. When the voice assistant accesses more businesses, similar expressions may correspond to different businesses, and the voice assistant's ability to distinguish similar expressions is weak, which leads to incorrect business positioning and incorrect operations. Therefore, with the expansion of the knowledge base, various word segmentation ambiguities and semantic understanding ambiguities are constantly generated, which greatly affects business positioning and user experience.

[0003] How to improve the semantic understanding ability of the voice assistant for natural language and thus improve user satisfaction is worth studying. SUMMARY

[0004] The present application provides a natural language semantic understanding method and device based on a vertical domain knowledge graph, which can solve the word segmentation disambiguation problem and the semantic disambiguation problem of word segmentation, improve the semantic understanding ability of the terminal device, and thus improve user satisfaction.

[0005] In a first aspect, the present application provides a natural language semantic understanding method based on a vertical domain knowledge graph, comprising:

[0006] performing word segmentation processing on an input text to obtain at least one candidate word segmentation result;

[0007] determining, based on a knowledge graph, a relationship set corresponding to each candidate word segmentation result in the at least one candidate word segmentation result, each element in the relationship set representing a relationship corresponding to a word segmentation entity pair of the candidate word segmentation result corresponding to the relationship set, the type of the relationship being related to two ontologies corresponding to the word segmentation entity pair and the word segmentation entity pair;

[0008] determining, from the candidate word segmentation result, a target word segmentation result according to the relationship set corresponding to each candidate word segmentation result in the at least one candidate word segmentation result.

[0009] In a second aspect, the present application provides a vertical domain knowledge graph construction method, comprising:

[0010] determining an ontology semantic rule library, the ontology semantic rule library including a plurality of ontologies of a vertical domain and relationships between the ontologies in the plurality of ontologies, each ontology of the plurality of ontologies being a semantic role annotation, and the relationships between the ontologies being semantic dependency relationships;

[0011] crawl structured data of a vertical field of the Internet, extract a plurality of entities and store them into a vertical field dictionary, the vertical field dictionary being used to represent a corresponding relationship between the plurality of ontologies and the plurality of entities, wherein the plurality of entities are instances corresponding to the plurality of ontologies;

[0012] extract an association relationship between entities according to the structured data and establish an entity relationship database;

[0013] construct a vertical field knowledge graph according to the ontology semantic rule database, the vertical field dictionary and the entity relationship database.

[0014] In a third aspect, an apparatus for natural language semantic understanding based on a vertical field knowledge graph is provided, and the apparatus comprises:

[0015] a word segmentation processing module configured to perform word segmentation processing on an input text to obtain at least one candidate word segmentation result;

[0016] a relationship set determination module configured to determine, based on a knowledge graph, a relationship set corresponding to each candidate word segmentation result in the at least one candidate word segmentation result, each element in the relationship set being a relationship corresponding to a word segmentation entity pair of the candidate word segmentation result corresponding to the relationship set, and the type of the relationship being related to the two ontologies corresponding to the word segmentation entity pair and the word segmentation entity pair;

[0017] a target word segmentation result determination module configured to determine, according to the relationship set corresponding to each candidate word segmentation result in the at least one candidate word segmentation result, a target word segmentation result from the candidate word segmentation result.

[0018] As can be seen from the above embodiments, in the scheme of the present application, the target candidate word segmentation result is confirmed according to the relationship set corresponding to each candidate word segmentation result in each candidate word segmentation result. Since the type of the relationship between the word segmentation entity pairs in the relationship set is related to the two ontologies corresponding to the word segmentation entity pair and the word segmentation entity pair, the relationship information between the word segmentation entity pairs in the relationship set includes not only the relationship information between the word segmentation entities, but also the relationship information between the corresponding ontologies. Therefore, the optimal target candidate word segmentation result can be confirmed according to the relationship set, and the candidate word segmentation result with ambiguity is eliminated, thereby improving user satisfaction. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the present application, the drawings required in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0020] Figure 1An exemplary system architecture of a terminal device to which the interaction method and the interaction apparatus of the present application can be applied is shown.

[0021] Figure 2 A hardware configuration block diagram of a terminal device 200 according to an exemplary embodiment is shown.

[0022] Figure 3 An exemplary system architecture diagram of a terminal device whose operating system is an Android system is shown.

[0023] Figure 4 An interaction network architecture schematic diagram of a terminal device provided by an embodiment of the present application is shown.

[0024] Figure 5 A construction method flowchart of a knowledge graph provided by an embodiment of the present application is shown.

[0025] Figure 6 A knowledge graph structure schematic diagram provided by the present application is shown.

[0026] Figure 7 Another example of a knowledge graph provided by an embodiment of the present application is shown.

[0027] Figure 8 A natural language semantic understanding method based on a vertical field knowledge graph provided by an embodiment of the present application is shown.

[0028] Figure 9 Another example of a natural language semantic understanding method based on a vertical field knowledge graph provided by the present application is shown.

[0029] Figure 10 A candidate node path schematic diagram provided by an embodiment of the present application is shown.

[0030] Figure 11 A node path schematic diagram of a ring structure provided by an embodiment of the present application is shown.

[0031] Figure 12 A candidate node path schematic diagram provided by an embodiment of the present application is shown.

[0032] Figure 13 Another example of a node path schematic diagram of a ring structure provided by an embodiment of the present application is shown.

[0033] Figure 14 Another example of a node path schematic diagram of a ring structure provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0034] In order to make the purposes and embodiments of the present application clearer, the following will clearly and completely describe the exemplary embodiments of the present application in conjunction with the accompanying drawings of the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only a part of the embodiments of the present application, but not all embodiments of the present application.

[0035] It should be noted that the brief description of the terms in the present application is only for the convenience of understanding the embodiments described next, and is not intended to limit the embodiments of the present application. Unless otherwise specified, these terms should be understood according to their ordinary and general meanings.

[0036] The terms "first", "second", "third" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit the specific order or sequence, unless otherwise specified. It should be understood that the terms used in this way can be interchanged under appropriate circumstances.

[0037] Figure 1 An exemplary system architecture of the terminal device to which the interactive method and the interactive device of the present application can be applied is shown. As shown in the figure, 10 is a server, 200 is a terminal device, and exemplary includes (smart TV 200a, mobile device 200b, smart speaker 200c). Figure 1

[0038] The server 10 and the terminal device 200 in the present application communicate data through various communication methods. The terminal device 200 can be allowed to communicate and connect through a local area network (LAN), a wireless local area network (WLAN) and other networks. The server 10 can provide various content and interaction to the terminal device 200. Exemplarily, the terminal device 200 and the server 10 can send and receive information, and receive software program updates.

[0039] The server 10 can be a server that provides various services, such as a background server that provides support for audio data collected by the terminal device 200. The background server can analyze and process the received audio data and the like, and feed back the processing result (such as endpoint information) to the terminal device. The server 10 can be a server cluster, or multiple server clusters, and can include one or more types of servers.

[0040] ​The terminal device 200 can be hardware or software. When the terminal device 200 is hardware, it can be various electronic devices with a sound collection function, including but not limited to a smart speaker, a smart phone, a television, a tablet computer, an e-book reader, a smart watch, a player, a computer, an AI device, a robot, a smart vehicle, and the like. When the terminal device 200, 201, 202 is software, it can be installed in the above-mentioned electronic devices. It can be implemented as multiple software or software modules (for example, used to provide a sound collection service) or as a single software or software module. This is not specifically limited here.

[0041] It should be noted that the natural language semantic understanding method based on the vertical knowledge graph provided in the embodiments of the present application can be executed by the server 10, and can also be executed by the server 10 and the terminal device 200 together, and the present application does not limit this.

[0042] Figure 2 A hardware configuration block diagram of the terminal device 200 according to an exemplary embodiment is shown. As shown in the figure, Figure 2 The terminal device 200 shown includes at least one of a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface 280. The controller includes a central processor, an audio processor, RAM, ROM, a first interface to an n-th interface for input / output.

[0043] The communicator 220 is a component for communicating with external devices or servers according to various communication protocol types. For example, the communicator can include at least one of a Wifi module, a Bluetooth module, a wired Ethernet module, and other network communication protocol chips or near field communication protocol chips, and an infrared receiver. The terminal device 200 can establish transmission and reception of control signals and data signals with the server 10 through the communicator 220.

[0044] The user interface can be used to receive external control signals.

[0045] The detector 230 is used to collect signals of the external environment or interaction with the outside. For example, the detector 230 includes a light receiver for collecting ambient light intensity, or the detector 230 includes an image collector such as a camera, which can be used to collect external environment scenes, user attributes or user interaction gestures, or the detector 230 includes a sound collector such as a microphone, etc., for receiving external sound.

[0046] The sound collector can be a microphone, also known as a "microphone", "sound receiver", which can be used to receive the user's voice and convert the sound signal into an electrical signal. The terminal device 200 can be provided with at least one microphone. In other embodiments, the terminal device 200 can be provided with two microphones, in addition to collecting sound signals, it can also realize the noise reduction function. In other embodiments, the terminal device 200 can also be provided with three, four or more microphones to realize the collection of sound signals, noise reduction, and can also identify the sound source to realize the directional recording function and the like.

[0047] In addition, the microphone can be built-in on the terminal device 200, or the microphone is connected to the terminal device 200 through a wired or wireless manner. Of course, the position of the microphone on the terminal device 200 is not limited in the embodiments of the present application. Alternatively, the terminal device 200 can not include the microphone, that is, the microphone is not provided in the terminal device 200. The terminal device 200 can be externally connected to the microphone (also referred to as a microphone) through an interface (such as a USB interface 130). The externally connected microphone can be fixed on the terminal device 200 by an external fixing member (such as a camera support with a clamp).

[0048] The controller 250 controls the operation of the display device and responds to the user's operation by storing various software control programs in the storage. The controller 250 controls the overall operation of the terminal device 200.

[0049] For example, the controller includes at least one of a central processing unit (CPU), an audio processor, a RAM (Random Access Memory), a ROM (Read-Only Memory), a first interface to an n-th interface for input / output, a communication bus, and the like.

[0050] Figure 3 An exemplary system architecture diagram of a terminal device with an Android system as the operating system is shown. In some examples, the operating system of the terminal device is taken as an example of an Android system, as shown in Figure 3 As shown in

[0051] As shown in Figure 3 The hardware layer can include Figure 2The controller 250, the communicator 220, the detector 230, etc. shown. The application layer 21 includes one or more applications. The applications can be system applications or third-party applications. For example, the application layer 21 includes a speech recognition application, which can provide a voice interaction interface and service for implementing the connection of the smart television 200-1 and the server 10.

[0052] The kernel layer 22 serves as software middleware between the hardware layer and the application layer 21, and is used to manage and control hardware and software resources.

[0053] In some examples, the kernel layer 22 includes a detector driver, which is used to send the voice data collected by the detector 230 to the speech recognition application. For example, the speech recognition application in the terminal device 200 is started, and the terminal device 200 establishes a communication connection with the server 10, the detector driver is used to send the voice data input by the user and collected by the detector 230 to the speech recognition application. Then, the speech recognition application sends the query information containing the voice data to the intent recognition module 202 in the server. The intent recognition module 202 is used to input the voice data sent by the terminal device 200 into the intent recognition model.

[0054] To clearly illustrate the embodiments of the present application, the following will be described in conjunction with Figure 4 A speech recognition network architecture provided by the embodiments of the present application is described.

[0055] Referring to Figure 4 , Figure 4 An interactive network architecture of a terminal device provided by the embodiments of the present application is shown. Figure 4 In the above, the terminal device is used to receive input information and output the processing result of the information. The speech recognition module is deployed with a speech recognition service for recognizing audio as text; the semantic understanding module is deployed with a semantic understanding service for performing semantic analysis on the text; and the business management module is deployed with a business instruction management service for providing business instructions. In one embodiment, Figure 4 In the architecture shown, there can be multiple entity service devices deployed with different business services, or one or more entity service devices can be integrated with one or more function services.

[0056] In some embodiments, the following describes the process of processing the information of the input terminal device based on Figure 4 The architecture shown processes the information of the input terminal device, and takes the query sentence input by voice as an example:

[0057] [Speech Recognition]

[0058] The terminal device can perform noise reduction processing and feature extraction on the audio of the query sentence after receiving the query sentence input through voice. The noise reduction processing here can include steps such as removing echo and environmental noise.

[0059] [semantic understanding]

[0060] The acoustic model and the language model are used to perform natural language understanding on the recognized candidate text and the associated context information, to parse the text into structured, machine-readable information, such as business domain, intent, word slot, and semantic expression. An executable intent determination intent confidence score is obtained, and the semantic understanding module selects one or more candidate executable intents based on the determined intent confidence score,

[0061] [business management]

[0062] The semantic understanding module issues a query instruction to the corresponding business management module according to the semantic analysis result of the text of the query sentence to obtain a query result given by the business service, and performs an action required to complete the user's final request, and feeds back a device execution instruction corresponding to the query result.

[0063] It should be noted that, Figure 4 The architecture shown is only an example and does not limit the scope of protection of the present application. In the embodiments of the present application, other architectures can also be used to implement similar functions, for example: all or part of the above processes can be completed by an intelligent terminal, which will not be described here.

[0064] Since the embodiments of the present application relate to the field of natural language processing, in order to facilitate understanding, the following will first briefly introduce the related terms.

[0065] (1) Natural language processing (NLP): Natural language (natural language) is human language, and natural language processing (NLP) is the processing of human language. Natural language processing is a systematic analysis, understanding and information extraction process of text data in an intelligent and efficient way. By using NLP and its components, we can manage very large blocks of text data, or perform a large number of automated tasks, and solve various problems such as named entity recognition (NER), relation extraction (RE), information extraction (IE), sentiment analysis, speech recognition, question answering and topic segmentation.

[0066] Exemplary, natural language processing tasks can have the following categories.

[0067] Sequence labeling: Each word in a sentence requires the model to give a classification category according to the context. For example, Chinese word segmentation, part-of-speech tagging, named entity recognition, semantic role labeling.

[0068] Classification task: The entire sentence outputs a classification value, such as text classification.

[0069] Sentence relationship inference: Given two sentences, determine whether the two sentences have a certain nominal relationship. For example, entilment, QA, semantic rewriting, natural language inference.

[0070] Generative task: Output a piece of text, generate another piece of text. For example, machine translation, text summarization, writing poetry,

[0071] The following are some examples of natural language processing cases.

[0072] Word segmentation (word segmentation or word breaker, WB): Continuous natural language text is divided into a sequence of semantically reasonable and complete words, which can solve the problem of cross ambiguity. Example: To graduating and non-graduating students; Word segmentation 1: To graduation, and, not yet graduated, of, classmates; Word segmentation 2: To graduation, and, not yet graduated, of, classmates.

[0073] Named entity recognition (named entity recognition, NER): Recognize entities (people, places, organizations, times, works, etc.) in natural language text that have specific meanings, and can integrate non-registered words from the granularity. Example: Huang San's beautiful life diary; Word segmentation: Huang San, beautiful life diary; Entity: beautiful life diary -> movie.

[0074] Semantic role labeling: From the semantic point of view, it describes the structural information of the sentence. At present, the system used for semantic role labeling usually takes the sentence to be labeled as input, and outputs the semantic structure tree of the sentence. Among them, the semantic structure tree describes all the semantic roles of the predicate in the sentence and the category of each semantic role. Usually, semantic role labeling can extract some structured information in the sentence, which is very important for machine understanding, information extraction, deep question answering and other applications.

[0075] (2) Knowledge graph: Knowledge graph aims to describe various entities or ontology and their relationships in the real world, which constitutes a huge semantic network graph. The node represents the entity or ontology, and the edge is composed of attributes or relationships. We use relationships to describe the association between two entities, such as the relationship between Beijing and China; for the attributes of an entity, we use "attribute-value pairs" to describe its internal characteristics, such as a certain person who has the attributes of a film and television actor, a singer, and a voice actor. The current knowledge graph has been used to refer to various large-scale knowledge bases.

[0076] Entity: refers to a certain thing that has distinguishability and independent existence. For example, a person, a city, a plant, a commodity, etc. The world is composed of specific things, which are referred to as entities, such as "Huang San" and "Li Si". Entity is the most basic element in knowledge graph, and different entities have different relationships.

[0077] Ontology: a collection of entities with the same characteristics, such as actors, singers, directors, etc. Ontology mainly refers to collections, categories, object types, and types of things.

[0078] Property (value): points from an entity to its attribute value. Different property types correspond to different types of attribute edges. For example, "height", "age", and "weight" are several different attributes of the entity "Huang San". Attribute value mainly refers to the value of the object's specified attribute, for example, the value of "Huang San's height" attribute is "180cm".

[0079] Relation: formalized as a function that maps kk points to a Boolean value. On the knowledge graph, the relationship is a function that maps kk graph nodes (entities, semantic classes, attribute values) to a Boolean value.

[0080] Based on the above definition, in order to facilitate the processing and understanding of the computer, the knowledge can be represented in a more formalized and simplified manner, that is, triple. Triple is a general representation of knowledge graph. The basic form of triple mainly includes (entity 1-relation-entity 2) and (entity-attribute-attribute value). Each entity (extension of concept) can be identified by a globally unique ID, and each attribute-attribute value pair (AVP) can be used to describe the internal characteristics of the entity, and the relation can be used to connect two entities and describe the association between them. For example, Huang San is an entity (person), I and my friends are an entity (movie), (Huang San-actor-I and my friends) is an example of a (entity-relation-entity) triple, Huang San is an entity, height is an attribute, and 180cm is an attribute value. (Huang San-height-180cm) constitutes a (entity-attribute-attribute value) triple example. The difference between attribute and relation is that the two entities corresponding to the triple where the attribute is located are mostly an entity and a string, while the two entities corresponding to the triple where the relation is located are mostly two entities. In the embodiments of the present application, for the convenience of understanding and description, the attribute value in the triple where the attribute is located is also regarded as an entity, and the attribute is regarded as a connection between two entities. In other words, the knowledge represented based on triple in the embodiments of the present application is used to indicate the connection between two entities, wherein the connection between two entities can be the relation between two entities (for example, (entity 1-relation-entity 2)), or the connection between two entities can be an attribute of one of the entities, and the other entity is the attribute value of the attribute (for example, (entity-attribute-attribute value)). The knowledge represented based on triple in the embodiments of the present application can also be called structured knowledge. It should also be understood that the representation form of triple is not limited to the forms of (entity 1-relation-entity 2) and (entity-attribute-attribute value) described above, for example, it can also be represented as (entity 1-entity 2-relation) and (entity-attribute value-attribute). In some embodiments, the attribute can also be regarded as a kind of generalized relation.

[0081] Based on the application field of knowledge graph, at present, knowledge graph is usually divided into general knowledge graph and vertical knowledge graph (also known as industry knowledge graph).

[0082] Vertical domain knowledge graph: that is, vertical knowledge graph. The vertical knowledge graph faces a specific field, is constructed based on industry knowledge, and emphasizes the depth of knowledge.

[0083] Embodiments of the present disclosure are directed to a knowledge graph in a vertical field, i.e., a vertical knowledge graph. The vertical knowledge graph is directed to a specific field or a subfield under a specific field, such as a traditional Chinese medicine field, an ocean field, an entertainment field, or a film and television subfield under the entertainment field, and the like. For example, a traditional Chinese medicine knowledge graph can include disease knowledge, symptom knowledge, Chinese herbal medicine knowledge, prescription knowledge, and the like. An intelligent question answering function related to traditional Chinese medicine can be implemented based on the traditional Chinese medicine knowledge graph. An ocean knowledge graph can include fish knowledge, ocean economy knowledge, and island knowledge, and the like. An intelligent question answering function related to the ocean can be implemented based on the ocean knowledge graph. The entertainment field can include film and television knowledge, music knowledge, actor knowledge, singer knowledge, and the like, and an intelligent question answering function related to entertainment can be implemented based on the entertainment knowledge graph.

[0084] The voice assistant of the terminal device 200 is increasingly interfaced with more services, and the voice assistant increasingly supports more statements for the services. Due to the possibility of a polysemy scenario, the current voice assistant sometimes has difficulty in distinguishing the correct semantics, and thus it is urgent to improve the semantic understanding capability of the voice assistant for natural language.

[0085] To solve the above problem, the present application provides a method for constructing a knowledge graph in a vertical field. The following will be described in combination with Figure 5 Figure 5 is a flowchart of a method for constructing a knowledge graph provided by an embodiment of the present application.

[0086] S310, determining an ontology semantic rule library.

[0087] The ontology semantic rule library includes a plurality of ontologies in a vertical field, and a relationship between the ontologies in the plurality of ontologies, each ontology of the plurality of ontologies is defined as a semantic role label, and the relationship between the ontologies in the plurality of ontologies is a semantic dependency relationship.

[0088] As can be seen, the ontology semantic rule library is a database composed of ontology data, and relationship data between the ontologies.

[0089] The plurality of ontologies can belong to a plurality of subfields in a vertical field, for example, the plurality of ontologies all belong to the entertainment field, and a part of the ontologies belong to the film and television field, and a part of the ontologies belong to the music field.

[0090] The relationship between the ontologies is defined as a semantic dependency relationship, i.e., a semantic layer dependency relationship between the ontologies.

[0091] ​Exemplarily, the semantic dependency relationship between the ontology and the ontology includes an action relationship or an attribute connection relationship or other connection relationships. The action relationship refers to that ontology 1 makes a certain action to obtain ontology 2. The attribute connection relationship refers to that ontology 2 is a certain attribute of ontology 1, and the relationship between ontology 1 and ontology 2 is an attribute connection relationship. Of course, the semantic dependency relationship can also include other types of relationships, which can be defined according to actual needs, and the present application does not limit this. For example, the semantic dependency relationship between the ontology and the ontology can also be defined in combination with the grammatical part of speech.

[0092] The semantic dependency relationship between the ontology and the ontology is exemplified below in combination with Table 1.

[0093] Table 1

[0094] Number Body 1 Body 2 Semantic dependency relationship name Field type 1 Actor Movie Acting Film and television 2 Singer Song Sing Music 3 Director Movie Direct Film and television 4 Movie Song Theme song Music

[0095] Table 1 is an ontology dependency relationship library. As shown in Table 1, “actor” and “movie” are two ontologies, and there is a “performing” relationship (that is, an action relationship) between the two in the field of film and television. “Singer” and “song” are two ontologies, and there is a “singing” relationship (that is, an action relationship) between the two in the field of music. “Movie” and “song” are two ontologies, and there is a “theme song” relationship (that is, an attribute connection relationship) between the two in the field of music, in which the song (theme song) is an attribute of the movie.

[0096] The dependency relationship graph structure between the ontologies can be obtained through Table 1, as shown in Figure 6 . Figure 6 is an example of a knowledge graph structure provided by the present application. In the example, the black vertices are ontologies, the ontologies are certain semantic role annotations, the semantic dependency relationship between the ontologies is represented by edges, and the attributes of the edges include the semantic dependency relationship name and the field type. For example, the relationship between the ontology “actor” and the ontology “movie” is “performing”, and the relationship between the ontology “director” and the ontology “movie” is “directing”.

[0097] In S320, a vertical field dictionary is determined, and a corresponding relationship between the ontology and the entity is determined.

[0098] Specifically, structured data in the vertical field of the Internet is crawled, and a plurality of entities are extracted and stored in a vertical field dictionary according to semantic role annotation types. The vertical field dictionary is used to represent the corresponding relationship between the plurality of ontologies and the plurality of entities, wherein the plurality of entities are instances corresponding to the plurality of ontologies.

[0099] The vertical field dictionary is a database, which includes various entities and attribute information corresponding to each entity. The attribute information of the entity includes a semantic role annotation (that is, a corresponding ontology), and each entity corresponds to one semantic role annotation or a plurality of semantic role annotations, that is, each entity corresponds to one ontology or a plurality of ontologies. Through the vertical field dictionary, the corresponding relationship between the entity and the ontology can be obtained.

[0100] Exemplarily, the server 10 collects structured data in the field of films and television through a web crawler, obtains entity information such as actors, directors, film types, release regions, languages, release times, and the like of films and television, and stores the entity information into a vertical domain dictionary according to semantic role labeling types of the entities. The data format in the vertical domain dictionary is described below through Table 2.

[0101] Exemplarily, the content of semantic role labeling of the entities (i.e., the content of the ontology) can be determined according to general segmentation and labeling dictionaries of the voice assistant.

[0102] Table 2

[0103]

[0104] As shown in Table 2, the attribute information corresponding to the entity “Huang X” includes semantic role labeling such as “singer, cast, direct, programHost”, that is, the multiple ontologies corresponding to “Huang X” include “singer, cast, direct, programHost”. The attribute information corresponding to the entity “Me and my friends” includes semantic role labeling such as “musicName, title, audioName, childAudioNames, eduKeys”, that is, the multiple ontologies corresponding to “Me and my friends” include “musicName, title, audioName, childAudioNames, eduKeys”.

[0105] The corresponding relationship between the ontology and the entity can be that one ontology corresponds to multiple entities or one entity corresponds to multiple ontologies, such as Figure 7 as shown, Figure 7 is another example of a knowledge graph diagram provided by the present application according to an embodiment. As shown in Figure 7 , the relationship between the entity “Huang X” and the entity “Me and my friends” is “act”, the relationship between the entity “Huang X” and the ontology “actor” is “is”, and the ontologies corresponding to the entity “Huang X” include “actor”, “singer”, and “director”. The ontologies corresponding to the entity “actor” include “Chen XX” and “Huang X”.

[0106] S330, establishing an entity relationship library.

[0107] Specifically, the association relationship between entities is extracted according to structured data, and an entity relationship library is established.

[0108] It should be noted that the association relationship between entities is extracted according to objective structured data, and the semantic dependency relationship between ontologies is defined according to the scene of the vertical domain, and the semantic dependency relationship can be updated according to the association relationship between entities.

[0109] Still taking the film and television field as an example, the server 10 obtains entity information of the film and television, such as actors, directors, film and television types, release areas, languages, release times, etc., extracts the associated relationship therefrom and stores it in the entity relationship database. As shown in Figure 7 , the associated relationship between the entity "Huang X" and the entity "I and my friends" is performance.

[0110] S340, constructing a vertical field knowledge graph.

[0111] Specifically, the vertical field knowledge graph is constructed by fusing the ontology semantic rule database, the vertical field dictionary and the entity relationship database.

[0112] The following will be combined Figure 7 to illustrate the construction of the knowledge graph:

[0113] First, the person skilled in the art can define the ontology of the entertainment field according to prior knowledge, including the ontology "movie name", "actor" and "director" of the film and television field, and the ontology "singer" and "song name" of the music field, input the defined ontology into the server 10, and the server 10 constructs an initial knowledge graph (as shown in Figure 6 ) by taking these ontologies as vertices (black vertices) and taking the semantic dependency relationship between the vertices as edges between the corresponding ontology nodes. Then, the entity nodes (white vertices) are determined according to the above entity data of the film and television field in the vertical field dictionary, the edges between the entity nodes are determined according to the associated relationship data between the entities in the film and television field in the entity relationship database, and the edges between the ontology nodes and the entity nodes are determined according to the corresponding relationship data between the ontology and the entity in the vertical field dictionary. The above entity nodes, edges between entity nodes and edges between entity nodes and ontology nodes are added to the initial knowledge graph to form the final knowledge graph, for example Figure 7 .

[0114] The application defines the attribute of the ontology as the semantic role labeling of the vertical field, defines the semantic dependency relationship between the ontologies, extracts the entities and the associated relationship between the entities from the structured data of the vertical field, and then determines the corresponding relationship between the ontology and the entity. The final vertical field knowledge graph formed by the relationship between the entities not only includes the associated relationship, but also includes the indirect relationship of the semantic dependency relationship between the corresponding ontologies, so as to facilitate subsequent semantic disambiguation according to the relationship between the entities in the vertical field knowledge graph.

[0115] In order to solve the problem of semantic ambiguity, the application further provides a natural language semantic understanding method based on the above vertical field knowledge graph, Figure 8 is an example of a natural language semantic understanding method based on a vertical field knowledge graph provided by the application, and the following will be combinedFigure 8 The method is described, wherein the subject performing the method is the server 10.

[0116] S410, the input text is segmented to obtain at least one candidate segmentation result.

[0117] Exemplarily, the input text is the text recognized by the terminal device 200 after receiving the voice, and the terminal device 200 sends the input text to the server 10.

[0118] Exemplarily, the segmentation processing is that the server 10 calls a segmenter to perform full segmentation processing on the input text.

[0119] The candidate segmentation results are exemplarily described below in combination with Table Three.

[0120] Table Three

[0121]

[0122] The candidate segmentation results obtained by the full segmentation method are shown in Table Three, for example, the candidate segmentation results of “the TV series starring Chen XX” after removing stop words include candidate segmentation result 1 and candidate segmentation result 2.

[0123] S420, determining a relationship set corresponding to each candidate segmentation result based on the knowledge graph.

[0124] Wherein, the each candidate segmentation result belongs to the at least one candidate segmentation result described above. Each element in the relationship set represents a relationship corresponding to a segmentation entity pair of the candidate segmentation result corresponding to the relationship set, and the type of the relationship is related to the two ontologies corresponding to the segmentation entity pair and the segmentation entity pair.

[0125] It should be noted that a segmentation entity pair of a candidate segmentation result refers to two segmentation words in the candidate segmentation result corresponding to two entity nodes in the vertical field knowledge graph. For example, as shown in Table Three, the candidate segmentation result 2 in “I want to listen to the song sung by Hua XX” includes the segmentation “Hua XX” and the segmentation “song”, and the vertical field knowledge graph includes an entity node named “Hua XX” and an entity node named “song”.

[0126] It should be understood that each element in the relationship set represents a relationship corresponding to a segmentation entity pair, and each element includes the segmentation entity pair and the relationship corresponding to the segmentation entity pair. For example, taking the candidate segmentation result 2 of “the TV series starring Chen XX” as an example, the content of the entity pair and the relationship between the entity pairs in the corresponding relationship set is shown in the following Table Four, and the content of the ontology pair and the relationship between the ontology pairs in the corresponding relationship set is shown in the following Table Five.

[0127] Table Four

[0128] Word segmentation entity 1 Word segmentation entity 2 Relationship name Chen XX Television series Acting

[0129] Table Five

[0130] Body 1 (the body corresponding to the word segmentation entity 1) Body 2 (the body corresponding to the word segmentation entity 2) Relationship name Actor (Chen XX) Television drama (television series) Acting

[0131] As shown in Table Four, the segmented entity pair "Chen XX" and "TV series" and the relationship "act" therebetween are an element in the relationship set. As shown in Table Five, the two ontologies corresponding to the segmented entity pair "Chen XX" and "TV series" are "actor" and "TV series" respectively, and the ontology pair "actor" and "TV series" and the relationship "act" therebetween are an element in the relationship set.

[0132] As can be seen from Table Four, the number of elements in the relationship set can be determined by using the arrangement combination calculation method of the segmented entities in the corresponding candidate segmented result. It should be noted that the part of speech of "act" is a verb, and in the knowledge graph, it exists in the form of an edge, so "act" is not a segmented entity, and therefore there is only one combination of the segmented entity pair in Table Four.

[0133] In one example, the type of the relationship is a lower-level relationship, an upper-level relationship, or a non-existent relationship.

[0134] The lower-level relationship indicates the association relationship between the two entity nodes corresponding to the segmented entity pair in the knowledge graph. Since the association relationship between the entity nodes in the knowledge graph is extracted from the structured data, it is the same as the association relationship between the segmented entities, and therefore it can also be said that the lower-level relationship indicates the association relationship between the segmented entities.

[0135] The upper-level relationship indicates the semantic dependency relationship between the two ontology nodes in the knowledge graph, and the two ontologies are the semantic role labels corresponding to the two segmented entities of the segmented entity pair. As can be seen, the upper-level relationship is an indirect relationship between the segmented entity pair, and the lower-level relationship is a direct relationship between the segmented entity pair.

[0136] The non-existent relationship indicates that there is no association relationship between the two entity nodes corresponding to the segmented entity pair in the knowledge graph, or one or both of the segmented entities in the segmented entity pair do not have corresponding entity nodes in the knowledge graph, and therefore there is no relationship.

[0137] The present application simultaneously considers the three types of relationships between the segmented entity pair, i.e., the direct relationship, the indirect relationship, and the non-existent relationship, so as to subsequently obtain accurate candidate segmented results according to the type of the relationship.

[0138] S430, determine the target segmented result.

[0139] In one example, the server 10 determines the target segmentation result from each candidate segmentation result according to a relationship set corresponding to the candidate segmentation result.

[0140] Specifically, the server 10 loads the general vertical field dictionary and the vertical field knowledge graph, and according to the segmentation query in each candidate segmentation result, the server 10 further acquires the lower-level relationship or the upper-level relationship between the two segmentation entities (also referred to as segmentation entity nodes) in the vertical field knowledge graph. When both the lower-level relationship and the upper-level relationship exist between the two segmentation entities, the server 10 acquires the lower-level relationship and the upper-level relationship between the two segmentation entities. Finally, the server 10 groups the relationships between all pairs of segmentation entities in the candidate segmentation result into the relationship set corresponding to the candidate segmentation result.

[0141] In one example, if the input text only includes one word, the server 10 takes the input text as the target segmentation result.

[0142] According to the relationship set corresponding to each candidate segmentation result in all candidate segmentation results, the server 10 confirms the target candidate segmentation result. Since the type of the relationship between the pairs of segmentation entities in the relationship set is related to the two ontologies corresponding to the pairs of segmentation entities and the pairs of segmentation entities, the information of the relationship between the pairs of segmentation entities in the relationship set is more abundant, so that the server 10 can confirm the optimal target candidate segmentation result according to the relationship set, and eliminate the candidate segmentation results with ambiguity. Further, the type of the relationship between the pairs of segmentation entities is divided into the lower-level relationship, the upper-level relationship, and the non-existing relationship. The pairs of segmentation entities having the lower-level relationship means that the pairs of segmentation entities are connected through edges in the knowledge graph, and have a direct relationship. The pairs of segmentation entities having the upper-level relationship means that the two entities corresponding to the pairs of segmentation entities are connected through edges in the knowledge graph, and the pairs of segmentation entities have an indirect relationship. The non-existing relationship between the pairs of segmentation entities means that there is no association between the two segmentation entities in the knowledge graph, or one of the two segmentation entities or both of the two segmentation entities have no meaning, and there is no corresponding entity node in the knowledge graph. By classifying the type of the relationship between the pairs of segmentation entities, the server 10 can more accurately determine the optimal target candidate segmentation result in the subsequent process.

[0143] Further exemplary, the step S430 includes the following sub-steps:

[0144] S431, determining the score of the relationship set corresponding to each candidate segmentation result.

[0145] Specifically, the server 10 determines the score of the relationship set corresponding to each candidate segmentation result according to a first parameter, the first parameter comprising a first weight corresponding to each relationship in the relationship set, and a first proportion of the length of the segmentation entity pair corresponding to the element to the length of the input text, wherein the value of the first weight is related to the type of the relationship.

[0146] For example, the type of the relationship is the lower layer relationship, the first weight is 1.2; the type of the relationship is the upper layer relationship, the first weight is 0.8; the type of the relationship is the non-existent relationship, the first weight is 0.5.

[0147] It should be noted that the value of the first weight can be set according to actual needs, and the present application does not limit this.

[0148] Further exemplarily, before determining the score of the relationship set corresponding to each candidate segmentation result according to the first parameter, if the relationship between a segmentation entity pair in the relationship set includes an upper layer relationship and a lower layer relationship, the element corresponding to the upper layer relationship between the segmentation entity pair in the relationship set is deleted.

[0149] For example, there are both the lower layer relationship "perform" and the upper layer relationship "perform" between "Huang X" and "I and my friends", the lower layer relationship "perform" is retained, and the upper layer relationship "perform" is deleted.

[0150] S432, determining the target segmentation result.

[0151] Specifically, the server 10 determines the target segmentation result from at least one candidate segmentation result according to the score of the relationship set corresponding to each candidate segmentation result.

[0152] The determination of the target segmentation result of the input text in S431 and S432 is exemplarily illustrated below in combination with formula (1).

[0153]

[0154] Wherein, M represents the number of elements (i.e. the number of relationships) in the relationship set corresponding to a candidate segmentation result, 1≤m≤M, the first proportion q m represents the proportion of the length of all segments in the mth element in the relationship set to the length of the input text, the first weight P m is 0.8 when the relationship in the mth element in the relationship set is an upper layer relationship, the first weight P m is 1.2 when the relationship in the mth element in the relationship set is a lower layer relationship, and the first weight P mScore is the maximum score in the scores of the relationship sets corresponding to the N candidate segmentation results, that is, the candidate segmentation result corresponding to Score is the target segmentation result.

[0155] The following describes the determination of the target segmentation result by the server 10 in combination with the input text "Chen XX starring TV series" in Table 3 according to Formula (1).

[0156] (1) The server 10 determines the candidate segmentation results of the input text

[0157] The candidate segmentation results of the input text "Chen XX starring TV series" include the candidate segmentation result 1 "Chen X, X main, perform, TV series" and the candidate segmentation result 2 "Chen XX, starring, TV series".

[0158] (2) The server 10 determines the relationship set of each candidate segmentation result

[0159] After removing the stop words, the relationship set of the candidate segmentation result 1 is shown in Table 6 and Table 7.

[0160] Table 6

[0161] Word segmentation entity 1 Word segmentation entity 2 Relationship name Chen X (no entity in the knowledge graph) X master (no entity in the knowledge graph) No relationship Chen X (no entity in the knowledge graph) Television series No relationship X master (no entity in the knowledge graph) Television series No relationship

[0162] Table 7

[0163] Body 1 (word segmentation entity 1) Body 2 (word segmentation entity 2) Relationship name No body of Chen X in the knowledge graph No body of X master in the knowledge graph No relationship No body of Chen X in the knowledge graph Television drama (television series) No relationship No body of X master in the knowledge graph Television drama (television series) No relationship

[0164] As can be seen from Table 6 and Table 7, "Chen X" and "X main" do not have corresponding entity nodes in the knowledge graph, and therefore, there is no relationship between the segmentation entity pairs in which "Chen X" and "X main" are located. Similarly, "Chen X" and "X main" do not have corresponding ontology nodes in the knowledge graph, and therefore, the upper relationships between the segmentation entity pairs in which "Chen X" and "X main" are located are also non-existent.

[0165] Optionally, the upper relationship between the segmentation entity pairs "Chen X" and "X main" is "non-existent", and the lower relationship is also "non-existent", and therefore, the upper relationship in the relationship set is deleted, and similarly, the relationship between "Chen X" and "TV series" also deletes the upper relationship, and the relationship between "X main" and "TV series" also deletes the upper relationship.

[0166] The relationship set of the candidate segmentation result 2 is shown in Table 4 and Table 5.

[0167] Optionally, the relationship between "Chen XX" and "TV series" includes the upper relationship "perform" and the lower relationship "perform", and therefore, the lower relationship "perform" is retained in the relationship set.

[0168] (3) The server 10 determines the score of the relation set of each candidate word segmentation result.

[0169] Score of candidate word segmentation result 1

[0170] Score of candidate word segmentation result 2

[0171] (4) The server 10 determines the target word segmentation result

[0172] The score of the candidate word segmentation result 2 is higher than that of the candidate word segmentation result 1, so the candidate word segmentation result 2 is the target word segmentation result.

[0173] The word segmentation in the candidate word segmentation result 1 such as "Chen X" and "X main" has no corresponding entity node in the vertical domain knowledge graph, and it can also be understood that such word segmentation is meaningless, and the score of the relation set is naturally low. In contrast, the word segmentation in the candidate word segmentation result 2 such as "Chen XX" and "television series" has corresponding entity nodes in the vertical domain knowledge graph, and they are connected by the "act" edge, and there is a direct relationship between the entity pairs, so the score of the relation set is naturally high. It can be seen that the target word segmentation result obtained by the above method is optimal.

[0174] The server 10 of the present application calculates the score of the relation set corresponding to each candidate word segmentation result, which is related to the type of the relationship between the word segmentation entity pairs and the proportion of the length of the word segmentation entity pairs to the length of the input text, which can make the relationship score of each candidate word segmentation result more accurate, so as to obtain an accurate optimal target word segmentation result. Further, when the word segmentation entity pairs have both upper and lower relationships, only the lower relationship between them is retained, and then only the lower relationship between the word segmentation entity pairs is involved in the calculation of the score of the relation set. By giving priority to the lower relationship between the word segmentation entity pairs, the accuracy of the score of the relation set can be further guaranteed, the effect of word segmentation disambiguation is further improved, the accuracy of word segmentation is improved, and the user's satisfaction is improved.

[0175] When there are multiple semantic role labels for word segmentation, it will increase the difficulty of understanding the input text. For example, the semantic role labels of "Huang X" are "singer" and "actor", and the semantic role labels of "my friends and I" are "movie name" and "song name". Then for the input text "Huang X and my friends", there are two ways of understanding "Huang X" sings "my friends" or "Huang X" acts "my friends", and "Huang X" acts "my friends" is the correct way of understanding. Therefore, how to obtain the correct semantic role label of the word segmentation of the input text and achieve the disambiguation effect of multi-semantic role labeling of word segmentation is worth studying.

[0176] After obtaining the target word segmentation result through the above embodiments, to solve the above problems, the present application further provides a natural language semantic understanding method based on a vertical domain knowledge graph to solve the disambiguation problem of semantic role labeling of word segmentation. Figure 9 It is a schematic flowchart of another example of the natural language semantic understanding method provided by the present application based on a vertical domain knowledge graph. The following will be combined with Figure 9 to illustrate this method. Here, the server 10 that executes this method is taken as an example.

[0177] S510, Obtain the semantic role labeling of each word segmentation candidate.

[0178] Specifically, after the server 10 obtains the target word segmentation result, by querying the vertical domain dictionary, it outputs all the semantic role labelings of each word in the target word segmentation result in the form of a list, as shown in Table VIII below.

[0179] Table VIII

[0180]

[0181]

[0182] As shown in Table VIII, a word in the input text may correspond to multiple semantic role labelings. For example, there are multiple semantic role labelings for "Huang X", including singer, cast, direct, and programHost. There are also multiple semantic role labelings for "me and my friends", including musicName, title, audioName, childAudioNames, and eduKeys.

[0183] S520, Determine the candidate node paths based on the knowledge graph of the vertical domain.

[0184] The server 10 determines the candidate node paths based on the knowledge graph according to all the words in the target word segmentation result and the semantic role labeling of each word segmentation candidate in the target word segmentation result.

[0185] Exemplarily, the server 10 calls the knowledge graph reasoning interface and inputs all the words in the target word segmentation result and the semantic role labeling of each word segmentation candidate to this reasoning interface. The knowledge graph determines the entity nodes corresponding to the word segmentation entities according to all the words, determines the corresponding ontology nodes according to the semantic role labeling of each word segmentation candidate, and finally determines the edges of the node paths according to the entity nodes and ontology nodes, and integrates the above entity nodes, ontology nodes, and edges to output the candidate node paths.

[0186] Among them, the candidate node paths include:

[0187] All entity nodes corresponding to all segmented entities in the target segmented result, all ontology nodes corresponding to semantic role labels of all segmented candidates in the target segmented result, edges between two entity nodes in all entity nodes, edges between two ontology nodes in all ontology nodes, and an edge between the first entity node and the first ontology node constitute the target node path, the first entity node being one of all entity nodes, and the first ontology node being one of all ontology nodes.

[0188] The following describes the target node path in combination with Figure 7 The candidate node path is described as follows. Figure 7 As shown in the table, the input text is "Huang X's me and my friends", the segmented entity nodes include "Huang X" and "me and my friends", the ontology node corresponding to the semantic role label "singer" of "Huang X" is "singer", the ontology node corresponding to the semantic role label "cast" of "Huang X" is "actor", the ontology node corresponding to the semantic role label "direct" of "Huang X" is "director", the ontology node corresponding to the semantic role label "title" of "me and my friends" is "movie name", and the ontology node corresponding to the semantic role label "musicName" of "me and my friends" is "song name". The edges between the above entity nodes, the edges between the ontology nodes, and the above entity nodes and the above ontology nodes constitute the node path of "Huang X's me and my friends".

[0189] In S530, the target node path is determined.

[0190] Specifically, the server 10 determines the target node path according to the candidate node path. The target node path includes the entity node corresponding to each segmented entity, the ontology node corresponding to one of the semantic role labels of each segmented entity, and the edges connecting the entity nodes and the ontology nodes.

[0191] For example, a target node path includes the entities "Huang X" and "me and my friends", the ontologies "actor" and "movie name", and the edges between "Huang X" and "me and my friends", the edges between "actor" and "movie name", the edges between "Huang X" and "actor", and the edges between "me and my friends" and "movie name".

[0192] In one possible implementation, the method S530 includes:

[0193] If the candidate node path includes a first node path, and the first node path is in a ring structure, the first node path is determined as the target node path.

[0194] The node path in the ring structure refers to that all nodes and edges in the node path form a ring structure, that is, each node is connected with another two nodes, wherein all nodes include all segmented entity nodes of the input text and all ontology nodes corresponding to the segmented entity.

[0195] Figure 10 is a schematic diagram of a candidate node path provided by an embodiment of the present application, Figure 11 is a schematic diagram of a node path in a ring structure provided by an embodiment of the present application, and the following will be illustrated by combining Figure 10 and Figure 11 to illustrate the node path in the ring structure.

[0196] First, the server 10 determines a candidate node path according to the semantic role labeling result of the input text "Li XX's me and my friends" in Table Eight and the knowledge graph in Figure 7 , as shown in Figure 10 , then determines a node path in a ring structure according to the candidate node path in Figure 10 , as shown in Figure 11 . It can be seen that the node paths formed by "Li XX", "singer", "me and my friends" and "song name" form a ring, that is, each node is connected with another two nodes, and the path is the target node path.

[0197] Exemplarily, if the candidate node path includes multiple node paths in a ring structure, the second node path is determined as the target node path, wherein the semantic dependency relationship between any two ontologies of the second node path is the same as the association relationship between the two segmented entities corresponding to the two ontologies.

[0198] Figure 12 is a schematic diagram of a candidate node path provided by an embodiment of the present application, Figure 13 is another schematic diagram of a node path in a ring structure provided by an embodiment of the present application, Figure 14 is another schematic diagram of a node path in a ring structure provided by an embodiment of the present application, and the following will be illustrated by combining Figure 12 , Figure 13 and Figure 14 to illustrate how to determine the second node path.

[0199] First, the server 10 determines a candidate node path according to the semantic role labeling result of the input text "Huang X's me and my friends" in Table Eight and the knowledge graph in Figure 7 , as shown in Figure 12 , then determines a node path in a ring structure according to the candidate node path in Figure 12 , as shown in Figure 13 and Figure 14 . Among them, Figure 13The node paths formed by the nodes "Huang X", "Actor", "Me and My Friends", and "Movie Title" form a loop. Figure 14 The node paths formed by the nodes "Huang X", "Singer", "Song Title", and "Me and My Friends" form a loop. However, the relationship between "Huang X" and "Me and My Friends" is "acting". Figure 13 The semantic dependency relationship between "actor" and "movie title" is "act," similar to the association between "Huang X" and "me and my friends." Figure 14 The semantic dependency between "singer" and "song title" is "sing," which differs from the association between "Huang X" and "me and my friends." Therefore, Figure 13 The node path in the loop is the target node path. Although Figure 14 The node paths in the loop also form a cycle, but there are cases where the semantic dependency relationship between two ontologies differs from the association relationship between the two word segmentation entities corresponding to those two ontologies. Therefore... Figure 14 The node path in the code is not the target node path.

[0200] By employing the above method, this application can easily, quickly, and accurately find the target node path by identifying looping node paths in the candidate node paths. This reduces the semantic annotation results of word segmentation and solves the semantic disambiguation problem of polysemy.

[0201] In one possible implementation, method S530 further includes:

[0202] If the candidate node paths do not include node paths with a ring structure, then the number of edges in each candidate node path is determined, and then the node paths whose number of edges meets the first preset condition are determined as the target node paths.

[0203] For example, the first preset condition is that the number of edges in the node path is the minimum.

[0204] Using the above method, when there are no looping node paths among the candidate node paths, a node path with the number of edges that meets the first preset condition is searched. Furthermore, the node path with the fewest edges is determined as the target node path, which can exclude node paths with redundant ontology information, making the target node path more accurate.

[0205] Furthermore, in one possible implementation, method S530 further includes:

[0206] If the number of edges of each node path in the candidate node paths meets the first preset condition, the node path meeting the second preset condition in the plurality of node paths is determined as the target node path, where the second preset condition is that the semantic dependency relationship between any two ontologies in the node path is the same as the association relationship between the two ontologies corresponding to the two segmented words.

[0207] For example, the second preset condition is that the semantic dependency relationship between any two ontologies in the node path is the same as the verb relationship between the two subject-predicate segmented words corresponding to the two ontologies.

[0208] Further, if the number of edges of each node path in the plurality of node paths meets the first preset condition, and the plurality of node paths does not include a node path meeting the second preset condition, the plurality of node paths is determined as the target node path.

[0209] As shown in Table Nine below, the input text "Korean X dubbing movie" has only one target node path, because the association relationship between the segmented entities "Korean X" and "movie" in the target node path in the knowledge graph is "dubbing", and the semantic dependency relationship between the corresponding ontologies "dubbing actor" and "film and television type" is "dubbing".

[0210] However, the input text "Korean X movie" has two target node paths, because the association relationship between the segmented entities "Korean X" and "movie" in the node paths meeting the first preset condition in the knowledge graph is "dubbing" and "acting", and the semantic dependency relationship between the corresponding ontologies "dubbing actor" and "film and television type" is "dubbing", and the semantic dependency relationship between "actor" and "film and television type" is "acting", which does not meet the second preset condition (i.e., there is no verb relationship between "Korean X" and "movie" in the input text, but there is a semantic dependency relationship between the ontologies in the knowledge graph, in other words, the association relationship between the segmented entities is different from the association relationship between the corresponding ontologies).

[0211] Table Nine

[0212]

[0213]

[0214] In the above manner, when the candidate node paths include a plurality of node paths, and the number of edges of each node path in the plurality of node paths meets the first preset condition, the target node path is determined by further determining whether the semantic dependency relationship between any two ontologies in the node path and the association relationship between the two ontologies corresponding to the two ontologies are the same, which can further reduce the number of target node paths, thereby reducing the number of target semantic role labels, and improving the semantic disambiguation effect of the word segmentation.

[0215] S540, determining the target semantic role label of each word in the target word segmentation result.

[0216] Specifically, the server 10 determines the target semantic role label of each word in the target word segmentation result according to the target node path.

[0217] For example, the server 10 determines the entity node in the target node path and the ontology node corresponding to the entity node, then determines the semantic role label corresponding to the ontology node according to the ontology node, and finally determines the target semantic role label corresponding to each word entity. For reference, see the target semantic role label list in Table 9.

[0218] In a possible implementation, the semantic positioning and intent understanding processing are performed according to the word segmentation and semantic role label result, and subsequent semantic processing is performed.

[0219] In the above embodiment, the application first determines the candidate semantic role label in the target word segmentation result, then determines the candidate node path, and then determines the target node path from the candidate node path, and finally determines the target semantic role label of each word according to the target node path, which can reduce the number of semantic role labels of word segmentation, eliminate the semantic ambiguity of word segmentation, and thus facilitate subsequent semantic positioning and intent understanding processing and other semantic processing, thereby improving user satisfaction. Further, embodiments of how to accurately determine the target node path are also provided, and specific effects are described above and will not be repeated here.

[0220] According to the above embodiment, the application further provides a natural language semantic understanding device based on a vertical domain knowledge graph, comprising:

[0221] A word segmentation processing module is configured to perform word segmentation processing on an input text to obtain at least one candidate word segmentation result.

[0222] A relationship set determination module is configured to determine a relationship set corresponding to each candidate word segmentation result in the at least one candidate word segmentation result based on a knowledge graph, each element in the relationship set being a relationship corresponding to a word entity pair in the candidate word segmentation result corresponding to the relationship set, and the type of the relationship being related to the two ontologies corresponding to the word entity pair and the word entity pair.

[0223] The target word segmentation result determination module is configured to determine a target word segmentation result from the candidate word segmentation results according to the relationship set corresponding to each candidate word segmentation result.

[0224] Other embodiments of the device are described in the above embodiments of the natural language semantic understanding method, which are not described here again.

[0225] It should be understood that, although each step in the flowchart of the accompanying drawings is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless explicitly stated herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.

[0226] The above only describes some embodiments of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should also be considered as the protection scope of the present application.

Claims

1. A natural language semantic understanding method based on vertical domain knowledge graphs, characterized in that, include: Perform word segmentation on the input text to obtain at least one candidate word segmentation result; Based on the knowledge graph, a relation set corresponding to each candidate word segmentation result in the at least one candidate word segmentation result is determined. Each element in the relation set represents a relation corresponding to a word segmentation entity pair of the candidate word segmentation result corresponding to the relation set. The type of the relation is related to the word segmentation entity pair and the two ontologies corresponding to the word segmentation entity pair. The score of the relation set corresponding to each candidate word segmentation result is determined according to the first parameter, the first parameter including the first weight corresponding to each relation in the relation set, and the first proportion of the length of the word segmentation entity pair corresponding to the element to the length of the input text, wherein the value of the first weight is related to the type of the relation; The target word segmentation result is determined from the at least one candidate word segmentation result based on the score of the relation set corresponding to each candidate word segmentation result.

2. The method according to claim 1, characterized in that, The relationship can be a lower-level relationship, an upper-level relationship, or a non-existent relationship. The lower-level relationship represents the association between the two entity nodes corresponding to the word segmentation entity pair in the knowledge graph. The upper-level relationship represents the semantic dependency relationship between the two ontology nodes in the knowledge graph. The two ontology nodes are the semantic role labels corresponding to the two word segmentation entities of the word segmentation entity pair. The non-existent relationship means that there is no association between the two entity nodes corresponding to the word segmentation entity pair in the knowledge graph, or that one or both word segmentation entities in the word segmentation entity pair do not have corresponding entity nodes in the knowledge graph.

3. The method according to claim 2, characterized in that, Before determining the score of the relation set corresponding to each candidate word segmentation result based on the first parameter, the method further includes: If the relationship between a pair of word segmentation entities in the relation set includes a higher-level relationship and a lower-level relationship, then delete the element in the relation set whose relationship between the word segmentation entity pairs is a higher-level relationship.

4. The method according to claim 2, characterized in that, The method further includes: Obtain the semantic role annotation for each candidate word in the target word segmentation result; Based on all word segments in the target word segmentation result and the semantic role annotation of each candidate word segmentation in the target word segmentation result, candidate node paths are determined based on the knowledge graph, wherein the candidate node paths include: The target word segmentation result consists of all entity nodes corresponding to all segmented entities in the knowledge graph, all ontology nodes corresponding to the semantic role annotations of all segmented candidates in the target word segmentation result in the knowledge graph, the edges between two entity nodes among all entity nodes, the edges between two ontology nodes among all ontology nodes, and the edges between the first entity node and the first ontology node. The first entity node is one of the all entity nodes, and the first ontology node is one of the all ontology nodes. The target node path is determined based on the candidate node paths; The target semantic role labeling of each word in the target word segmentation result is determined based on the target node path.

5. The method according to claim 4, characterized in that, Determining the target node path based on the candidate node paths includes: If the candidate node path includes a first node path, and the first node path is a ring structure, then the first node path is determined to be the target node path.

6. The method according to claim 4, characterized in that, Determining the target node path based on the candidate node paths includes: If the candidate node paths do not include node paths with a ring structure, then determine the number of edges in each node path among the candidate node paths. The node path whose number of edges meets the first preset condition is determined as the target node path.

7. The method according to claim 6, characterized in that, The step of determining the target node path based on the number of edges in each node path among the candidate node paths includes: If the candidate node path includes multiple node paths, and the number of edges in each of the multiple node paths meets the first preset condition, then the node path that meets the second preset condition among the multiple node paths is determined as the target node path, wherein the second preset condition is that the semantic dependency relationship between any two ontologies in the node path is the same as the association relationship between the two word segmentation entities corresponding to the two ontologies. If the number of edges in each of the multiple node paths meets the first preset condition, and the multiple node paths do not include node paths that meet the second preset condition, then the multiple node paths are determined to be target node paths.

8. A method for constructing a knowledge graph in a vertical domain, characterized in that, include: An ontology semantic rule base is determined, which includes multiple ontology in a vertical domain, as well as the relationships between ontology in the multiple ontology. Each ontology is labeled with a semantic role, and the relationships between ontology are semantic dependencies. Structured data from vertical domains of the Internet is crawled, entity information of multiple entities is obtained from the structured data, and the semantic role labeling type included in the entity information of each entity is stored in the vertical domain dictionary. The vertical domain dictionary is used to represent the correspondence between the multiple ontologies and the multiple entities, wherein the multiple entities are instances corresponding to the multiple ontologies. Based on the structured data, extract the relationships between entities and establish an entity relationship database; A vertical domain knowledge graph is constructed based on the ontology semantic rule base, the vertical domain dictionary, and the entity relation base.

9. A natural language semantic understanding device based on a vertical domain knowledge graph, characterized in that, include: The word segmentation module is used to segment the input text to obtain at least one candidate word segmentation result; The relation set determination module is used to determine the relation set corresponding to each candidate word segmentation result in the at least one candidate word segmentation result based on the knowledge graph. Each element in the relation set is a relation corresponding to a word segmentation entity pair of the candidate word segmentation result corresponding to the relation set. The type of the relation is related to the word segmentation entity pair and the two ontologies corresponding to the word segmentation entity pair. The target word segmentation result determination module is used to determine the score of the relation set corresponding to each candidate word segmentation result according to a first parameter. The first parameter includes a first weight corresponding to each relation in the relation set and a first proportion of the length of the word segmentation entity pair corresponding to the element to the length of the input text. The value of the first weight is related to the type of the relation. The target word segmentation result is determined from the at least one candidate word segmentation result based on the score of the relation set corresponding to each candidate word segmentation result.

Citation Information

Patent Citations

  • Cross-language multi-source vertical domain knowledge graph construction method

    CN112199511A

  • Citrus management and control question and answer module construction method based on knowledge graph and question and answer system

    CN114036281A