WO2020108641A1 - 本体建立方法、装置及存储介质 - Google Patents

本体建立方法、装置及存储介质 Download PDF

Info

Publication number
WO2020108641A1
WO2020108641A1 PCT/CN2019/122159 CN2019122159W WO2020108641A1 WO 2020108641 A1 WO2020108641 A1 WO 2020108641A1 CN 2019122159 W CN2019122159 W CN 2019122159W WO 2020108641 A1 WO2020108641 A1 WO 2020108641A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
degree
words
word
type
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2019/122159
Other languages
English (en)
French (fr)
Inventor
吴小飞
浦世亮
姜伟浩
闫春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Publication of WO2020108641A1 publication Critical patent/WO2020108641A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/36Creation of semantic tools, e.g. ontology or thesauri

Definitions

  • This application relates to the technical field of big data processing, and in particular to an ontology creation method, device, and storage medium.
  • Ontology is a data structure, which is used to explain certain documents in a standard and standardized manner, so that these documents can be shared according to the ontology.
  • the ontology includes multiple concepts and the conceptual relationship between two concepts that are related in multiple concepts, and the conceptual relationship is directional.
  • the direction of the conceptual relationship is used to indicate the attribution relationship between the two concepts.
  • creating an ontology for multiple documents describing umbrellas the ontology includes multiple concepts, such as umbrellas, utensils, umbrella handles, and so on.
  • Embodiments of the present application provide an ontology creation method, device, and storage medium, which can improve the efficiency of ontology creation.
  • the technical solution is as follows:
  • a method for establishing an ontology includes:
  • each multi-group includes two words of the first type and one word of the second type, the words of the first type refer to Words indicating the attributes of the object itself, the second type of words refers to words used to indicate the association relationship between different objects;
  • an ontology for the at least one document is established.
  • the determining two concepts corresponding to the two first-type words in each multi-group of the plurality of multi-groups, and the conceptual relationship corresponding to the second-type words in each multi-group include: :
  • the reference database includes each of the multiple words
  • the concepts represented by the words and the conceptual relationship between different concepts, the multi-group A is any one of the multi-groups;
  • the searching for two concepts corresponding to the two first-class words in the multi-group A from the reference database includes:
  • first-type word B of the two first-type words in the multi-group A determine words in the at least one document that have the same meaning as the first-type word B, and the first-type word B is Any one of the two first-class words;
  • the concept corresponding to the word B of the first type is searched from the reference database.
  • the method further includes:
  • the method further includes:
  • LDA Latent Dirichlet Allocation, latent Dirichlet distribution
  • Target path Selecting a target path from the multiple paths according to the path lengths of the multiple paths, the target path including at least one conceptual relationship;
  • the establishing an ontology for the at least one document according to the plurality of semantic relation data sets includes:
  • a semantic relationship graph is established, a node in the semantic relationship graph corresponds to a concept in the multiple semantic relationship groups, and between two nodes in the semantic relationship graph Is the conceptual relationship between the corresponding two concepts, and the direction between the two nodes is the direction indicated by the conceptual relationship between the corresponding two concepts, each node is configured with Out Degree, and the in-degree of each node refers to the number of other nodes pointing to the corresponding node, and the out-degree of each node refers to the number of other nodes pointing to the corresponding node;
  • the resulting semantic relationship graph is used as the ontology established for the at least one document.
  • the cropping the first node includes:
  • Determining at least one node in the semantic relationship graph, the document position of the concept corresponding to the at least one node in the at least one document and the word indicated by the concept corresponding to the first node The document positions in the at least one document are adjacent;
  • the degree of connection between any two nodes is used to indicate the degree of association between the two nodes.
  • the determining the node with the largest degree of connection with the first node among the at least one node includes:
  • the first formula is:
  • the Wi and the Wj are respectively two nodes for determining the degree of connection
  • the Sim(Wi, Wj) is the similarity between the node Wi and the node Wj
  • the Rel(Wi, Wj) Is the correlation between the node Wi and the node Wj
  • the ⁇ and the ⁇ are the weighting coefficient configured for the similarity and the weighting coefficient configured for the correlation, respectively, the sum of the ⁇ and the ⁇ is 1 ;
  • a node having the highest degree of connectivity with the first node among the at least one node is determined.
  • the determining, according to the degree of connectivity determined according to the first formula, the node with the largest degree of connectivity with the first node among the at least one node includes:
  • the maximum degree of connectivity determined according to the first formula after the update is less than the degree of connectivity threshold, then return to the step of adjusting the values of the ⁇ and the ⁇ until the determined maximum degree of connectivity is greater than Or equal to the connectivity threshold, and the node corresponding to the maximum connectivity determined last time is determined as the node with the largest connectivity among the at least one node and the first node.
  • the method further includes:
  • the isolated node is configured to point to one in the semantic relationship graph with an in-degree equal to 0 and an out-degree greater than 0 At the node, get the updated semantic relationship diagram;
  • an operation of cropping any first node with an in-degree equal to 0 and an out-degree greater than 0 is performed.
  • the determining multiple groups based on the at least one document includes:
  • the plurality of multi-groups are determined according to the part of speech of each of the plurality of words and the document position of each word in the at least one document.
  • an ontology building device comprising:
  • An obtaining module configured to obtain at least one document used to build the ontology, and determine a plurality of multi-groups according to the at least one document, each multi-group includes two words of the first type and one word of the second type, Words refer to words used to indicate the attributes of the objects themselves, and the second type of words refer to words used to indicate the association between different objects;
  • a determining module configured to determine two concepts respectively corresponding to two first-type words in each multi-group of the plurality of multi-groups, and a conceptual relationship corresponding to second-type words in each plurality of tuples, Use the determined two concepts to replace the corresponding two first-type words, and use the determined concept relations to replace the corresponding second-type words to obtain multiple semantic relationship data sets;
  • the establishment module is used to establish an ontology for the at least one document according to the plurality of semantic relation data sets.
  • the determination module includes:
  • the first search unit is configured to search for two concepts corresponding to the two first-type words in the multi-group A from the reference database for the multi-group A in the multiple multi-groups, the reference database Including the concept represented by each word in multiple words and the conceptual relationship between different concepts, the multi-group A is any one of the multiple multi-groups;
  • the second searching unit is configured to continue searching for the concept relationship corresponding to the second type of words in the multi-group A from the reference database according to the two concepts found.
  • the first search unit is used to:
  • the concept corresponding to the word B of the first type is searched from the reference database.
  • the first search unit is also used to:
  • the device further includes:
  • the creating unit is configured to create a concept for the first-type word B through the LDA algorithm if the concept corresponding to the first-type word B is not found from the reference database.
  • the second search unit is used to:
  • Target path Selecting a target path from the multiple paths according to the path lengths of the multiple paths, the target path including at least one conceptual relationship;
  • the establishment module includes:
  • the establishment unit is configured to establish a semantic relationship graph according to the multiple semantic relationship data groups, a node in the semantic relationship map corresponds to a concept in the multiple semantic relationship groups, and two in the semantic relationship map
  • the relationship between the two nodes is the conceptual relationship between the corresponding two concepts, and the direction between the two nodes is the direction indicated by the conceptual relationship between the corresponding two concepts, each node
  • a cropping unit configured to crop any first node whose in-degree is equal to 0 and whose out-degree is greater than 0;
  • a setting unit configured to cut all in-degrees in the semantic relation graph equal to 0 and out-degrees greater than 0 when all the first nodes with in-degrees equal to 0 and out-degrees greater than 0 are clipped
  • the in-degree of the other nodes pointed by the first node is set to 0;
  • the cropping unit is further configured to return to execute any first node with an in-degree equal to 0 and an out-degree greater than 0 for other nodes except the first node that has been cropped.
  • the cropping unit is used to:
  • Determining at least one node in the semantic relationship graph, the document position of the concept corresponding to the at least one node in the at least one document and the word indicated by the concept corresponding to the first node The document positions in the at least one document are adjacent;
  • the degree of connection between any two nodes is used to indicate the degree of association between the two nodes.
  • the cropping unit is also used to:
  • the first formula is:
  • the Wi and the Wj are respectively two nodes for determining the degree of connection
  • the Sim(Wi, Wj) is the similarity between the node Wi and the node Wj
  • the Rel(Wi, Wj) Is the correlation between the node Wi and the node Wj
  • the ⁇ and the ⁇ are the weighting coefficient configured for the similarity and the weighting coefficient configured for the correlation, respectively, the sum of the ⁇ and the ⁇ is 1 ;
  • a node having the highest degree of connectivity with the first node among the at least one node is determined.
  • the cropping unit is also used to:
  • the maximum degree of connectivity determined according to the first formula after the update is less than the degree of connectivity threshold, then return to the step of adjusting the values of the ⁇ and the ⁇ until the determined maximum degree of connectivity is greater than Or equal to the connectivity threshold, and the node corresponding to the maximum connectivity determined last time is determined as the node with the largest connectivity among the at least one node and the first node.
  • the establishment module further includes:
  • a configuration unit configured to configure the isolated node to point to the semantic relationship graph whose in-degree is equal to 0 and out if there is an isolated node with an in-degree equal to 0 and an out-degree equal to 0 At a node with a degree greater than 0, the updated semantic relationship graph is obtained;
  • the cropping unit is also used to perform an operation of cropping any first node whose in-degree is equal to 0 and whose out-degree is greater than 0 based on the updated semantic relationship graph.
  • the acquisition module includes:
  • the word segmentation processing unit is used to perform word segmentation processing on each document in the at least one document to obtain multiple words
  • a first determining unit configured to determine the part of speech of each of the plurality of words
  • the second determining unit is configured to determine the plurality of multivariate groups based on the part of speech of each of the plurality of words and the document position of each word in the at least one document.
  • an ontology building device comprising:
  • Memory for storing processor executable instructions
  • the processor is configured to perform the steps of any of the methods described in the first aspect above.
  • a computer-readable storage medium having instructions stored on the computer-readable storage medium, which when executed by a processor implements the steps of any of the methods of the first aspect described above.
  • a computer program product containing instructions, which when executed on a computer, causes the computer to perform the steps of any method described in the first aspect above.
  • multiple multi-groups are determined according to the at least one document, multiple semantic relation data groups are determined according to the multiple multi-groups, and then multiple semantic relation data groups are established according to Ontology for at least one document.
  • Ontology In the whole process of building ontology, no human participation is needed, which improves the efficiency of building ontology.
  • FIG. 1 is a flowchart of an ontology establishment method provided by an embodiment of the present application
  • FIG. 2 is a flowchart of a method for querying concepts and concept relationships provided by embodiments of the present application
  • FIG. 3 is a schematic diagram of a conceptual diagram provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of an ontology building device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a terminal provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • FIG. 1 is a flowchart of an ontology creation method provided by an embodiment of the present application. As shown in Figure 1, the method includes the following steps:
  • Step 101 Obtain at least one document for building ontology, and determine a plurality of multi-groups according to the at least one document, each multi-group includes two words of the first type and one word of the second type, the words of the first type refer to Words indicating the attributes of the objects themselves, and words of the second type refer to words indicating the association relationship between different objects.
  • each multi-group includes two words of the first type and one word of the second type.
  • the words of the first type refer to words used to indicate the attributes of the object itself, such as nouns.
  • the second type of words refers to words used to indicate the association between different objects, such as verbs.
  • the words included in each multi-group are words in at least one document, which can ensure that the ontology created subsequently is obtained based on the information in at least one document, and the accuracy of the built ontology is improved.
  • the ontology creation method provided by the embodiment of the present application may be executed by the terminal, and at this time, at least one document used for establishing the ontology may be previously input to the terminal by the administrator.
  • the ontology creation method provided by the embodiment of the present application may also be executed by a server. At this time, at least one document used to establish the ontology may be uploaded to the server by the administrator in advance through the terminal.
  • the embodiments of the present application are not limited herein.
  • determining multiple multi-groups according to at least one document may be: performing word segmentation processing on each document in at least one document to obtain multiple words; determining the part of speech of each of the multiple words; according to The part-of-speech of each word in the plurality of words and the document position of each word in at least one document determine a plurality of plural groups.
  • the word segmentation processing for at least one document may use the word segmentation method based on the forward maximum matching in the string matching, and of course, other word segmentation methods may also be used, which is not limited herein in the embodiments of the present application.
  • each word may have different parts of speech
  • multiple words can be divided according to the position of each word in the document to obtain multiple word sequences, for example, all words in a piece of text can be combined into one word sequence .
  • the implementation of determining the part-of-speech of each word in the plurality of words may be: for any word sequence, according to the different part-of-speech corresponding to each word included in the word sequence, combining different parts-of-speech to obtain the A plurality of parts-of-speech sequences of a word sequence, and each part-of-speech sequence includes a part-of-speech corresponding to the words in the word sequence.
  • the probability of each part-of-speech sequence in the multiple parts-of-speech sequences is judged by the evaluation function, the part-of-speech sequence with the highest probability is selected from the multiple parts-of-speech sequences, and the part-of-speech in the part-of-speech sequence with the highest probability is determined as the part-of-speech of the corresponding word.
  • the multiple words after the word segmentation process are arranged in order of position in the document, the multiple words are determined based on the part of speech of each of the multiple words and the document position of each word in at least one document.
  • the implementation of the multi-group can be: for any first type of words, find the second type of words after the first type and adjacent to the first type of words in multiple words, and then continue to search and sort in the After the second type of word and a word of the first type adjacent to the second type of word, combine these three words to get a multi-group.
  • At least one document may have other parts-of-speech words, such as adverbs or prepositions, in addition to the first-type words and the second-type words, and these other parts-of-speech words do not contribute much to building the ontology, Therefore, before word segmentation processing is performed on each document in at least one document, at least one document may be further subjected to useless word filtering operation to filter out useless words in at least one document.
  • other parts-of-speech words such as adverbs or prepositions
  • step 101 may be performed by a computing model based on a distributed computing framework.
  • at least one document is divided into different partitions, and the above step 101 may be executed in parallel between each partition, thereby increasing the speed of building the ontology.
  • dividing at least one document into different partitions may refer to dividing each document into a partition, or may refer to dividing several adjacent paragraphs into a partition, or dividing a paragraph into a partition, this application is implemented Examples are not limited here.
  • step 102 is performed in units of partitions, that is, each partition executes step 102 in parallel according to the documents classified into itself.
  • Step 102 Determine the two concepts corresponding to the two first-type words in each multi-group and the conceptual relationship corresponding to the second-type words in each multi-group, and then determine the determined The two concepts respectively replace the corresponding two first-type words, and replace the determined concept relations with the corresponding second-type words to obtain multiple semantic relationship data sets.
  • step 102 may be performed based on the reference database. That is, based on the reference database, the two concepts corresponding to the two first-type words in each multi-group and the conceptual relationship corresponding to the second-type words in each multiple tuple are determined.
  • the following multiple Multi-element group A in multi-element group is used as an example to explain how to determine two concepts corresponding to two first-type words in a multi-element group, and the conceptual relationship corresponding to the second-type word in each multiple tuple.
  • the multi-group A is any multi-group among the multi-groups.
  • Step 1021 Find two concepts respectively corresponding to the two first-type words in the multi-group A from the reference database.
  • the reference database includes the concepts represented by each word in the multiple words and the conceptual relationship between different concepts.
  • the reference database may be a HowNet database.
  • HowNet database is a concept that uses the concepts represented by Chinese and English words as a description object to reveal the relationship between concepts and concepts and the attributes of concepts.
  • database HowNet database uses KDML (Knowledge database mark-up language, knowledge system description language), using a nested structure to describe concepts and attributes of concepts. That is to say, a complex concept is explained with a simpler concept, and a simpler concept is explained with a simpler concept until it can be expressed with a meaning source, which refers to the most basic unit that can express the meaning of a word.
  • KDML Knowledge database mark-up language, knowledge system description language
  • FIG. 3 is a schematic diagram of a conceptual diagram provided by an embodiment of the present application.
  • facilities, domain ⁇ sports
  • sports ⁇ , location ⁇ compete
  • KDML expressed the meaning: the venue is a facility, the domain to which the facility belongs is the sports domain, the facility is the location of the game, and the facility is also the place to exercise ( Location). In other words, the stadium is a place for sports competitions and fitness exercises.
  • a concept in the reference database may correspond to one word in at least one document, or may correspond to multiple words in at least one document.
  • the words “rice bowl”, “career”, and “errand” are multiple words with similar meanings, and they represent the same concept. Therefore, to find two concepts corresponding to the two first-class words in the multi-group A from the reference database may be implemented as follows: for the first-class word B in the two first-class words in the multi-group A, determine At least one document that has the same meaning as the first-type word B; if there is no word in the at least one document that has the same meaning as the first-type word B, the first-type word B is found in the reference database. concept. Among them, the first-type word B is any one of the two first-type words in the multi-group A.
  • At least one document has words with the same meaning as the first-type word B, determine the number of occurrences of the first-type word B and words with the same meaning as the first-type word B in at least one document; From the first type of word B, and words with the same meaning as the first type of word B, determine the word with the largest number of occurrences; find the concept corresponding to the word with the largest number of occurrences from the reference database, and use the found concept The concept corresponding to the first type of word B.
  • the words with the same meaning as the first type of word B in the above implementation means: Words in the partition where the first type of word B is located have the same meaning as the first type of word B.
  • the LDA Latent Dirichlet Allocation, latent Dirichlet distribution
  • LDA algorithm is the first Category B creates a concept.
  • LDA algorithm is an important model for text semantic analysis.
  • the implementation of creating a concept for the first type of word B through the LDA algorithm can be: conceptually modeling all the words in the LDA list of the partition where the first type of word B is located to obtain a concept tree for the LDA list , Add the concept tree to the reference database, and then look up the concept corresponding to the first type of word B from the reference database, which is equivalent to creating a concept for the first type of word B.
  • Step 1022 Based on the two concepts found, continue to search for the concept relationship corresponding to the second type of words in the multi-group A from the reference database.
  • step 1022 may be: determining the found from the reference database Multiple paths are obtained from the path between the two concepts; according to the path length of the multiple paths, a target path is selected from the multiple paths, and the target path includes at least one concept relationship; from at least one concept relationship, select a multi-group The conceptual relationship with the highest similarity between the second-type words in A, and the selected conceptual relationship is determined as the conceptual relationship corresponding to the second-type words in the multi-group A.
  • the implementation of selecting a target path from the multiple paths may be as follows: the path with the largest path length among the multiple paths is used as the target path.
  • the target path may also be determined according to other principles, which is not limited herein.
  • each semantic relation data group includes two concepts and the conceptual relationship between the two concepts, at least one The body of the document.
  • Step 103 Create an ontology for at least one document according to multiple semantic relation data sets.
  • each semantic relationship data group includes two concepts and the conceptual relationship between the two concepts
  • the mesh structure data indicated by the multiple semantic relationship data groups can be directly targeted Ontology of at least one document.
  • the same concept may exist between different partitions, resulting in bloated network structure data indicated by multiple semantic relation data groups, which is not conducive to other users from Query information in the mesh data indicated by multiple semantic relation data groups. Therefore, in the embodiment of the present application, the mesh structure data indicated by the multiple semantic relation data groups can also be tailored to improve the versatility of the established ontology.
  • the implementation method of cutting the network structure data indicated by multiple semantic relationship data groups may be: according to multiple semantic relationship data groups, a semantic relationship graph is established, and a node in the semantic relationship graph corresponds to multiple semantic relationships A concept in the group, the relationship between two nodes in the semantic relationship diagram is the conceptual relationship between the corresponding two concepts, and the direction between the two nodes is the conceptual relationship between the corresponding two concepts
  • each node is configured with an in-degree and an out-degree
  • the in-degree of each node refers to the number of other nodes pointing to the node
  • the out-degree of each node refers to the node The number of other nodes pointed to.
  • the first node For any first node with an in-degree equal to 0 and an out-degree greater than 0, the first node is clipped; when all the first nodes with an in-degree equal to 0 and an out-degree greater than 0 are clipped on the semantic relationship graph , Set the in-degree of all nodes pointed to by nodes whose in-degree is equal to 0 and whose out-degree is greater than 0 in the semantic relationship graph to 0; for nodes other than the first node that has been clipped, return to execute Any first node whose in-degree is equal to 0 and whose out-degree is greater than 0, the step of trimming the first node until all nodes in the semantic relationship graph are traversed, and the resulting semantic relationship graph is taken as at least one The ontology created by the document.
  • establishing a semantic relationship graph according to multiple semantic relationship data groups refers to correlating the concepts in the multiple semantic relationship data groups according to the conceptual relationship, and the resulting data system is called a semantic relationship graph.
  • a breadth-first approach is used to traverse all the nodes in the semantic relationship graph.
  • breadth first refers to processing first the nodes whose in-degree is equal to 0 and the out-degree is greater than 0, and then the nodes directly pointed by the nodes whose in-degree is equal to 0 and the out-degree is greater than 0.
  • other traversal methods can also be used to traverse the nodes in the semantic relationship graph, such as the depth-first traversal method, which will not be described one by one in the embodiments of the present application.
  • cropping the first node may be: determining at least one node in the semantic relationship graph, and the position of the word indicated by the concept corresponding to the at least one node in the document in at least one document The term indicated by the concept corresponding to the first node is adjacent to the document position in at least one document; determine the node with the highest degree of connection to the first node among the at least one node, delete and delete at least one node to determine Nodes other than the node, and delete the relationship between the other nodes and the first node.
  • At least one node means that the word indicated by the corresponding concept and the word indicated by the concept corresponding to the first node are in the same partition.
  • the degree of connection between any two nodes is used to indicate the degree of association between the two nodes.
  • the node with the highest degree of connection with the first node is determined in at least one node May be implemented as follows: determining the degree of connectivity between each node in the at least one node and the first node based on the first formula, and determining the degree of connectivity between the first node and the first node according to the degree of connectivity determined according to the first formula The node with the highest degree of node connectivity.
  • the first formula is:
  • Wi and Wj are the two nodes used to determine the connection degree respectively
  • Joint(Wi, Wj) represents the connection degree between the node Wi and the node Wj
  • Sim(Wi, Wj) is the node Wi and the node Wj
  • the similarity between Rel(Wi, Wj) is the correlation between the node Wi and the node Wj
  • ⁇ and ⁇ are the weighting coefficients configured for the similarity and the weighting coefficients configured for the correlation
  • ⁇ and ⁇ The sum is 1.
  • the similarity between the node Wi and the node Wj can be determined by the length of the path between the node Wi and the node Wj in the semantic relationship graph, and the embodiments of the present application will not be described in detail here.
  • the correlation between Wi and the node Wj may be determined by the number of occurrences of the word corresponding to the node Wi and the word corresponding to the node Wj in at least one document.
  • the number of occurrences of the words corresponding to the node Wi and the words corresponding to the node Wj in at least one document refers to the words corresponding to the node Wi and the words corresponding to the node Wj
  • the connection degree determination method provided in the embodiment of the present application can make the connection degree combine the word-sentence context and the similarity relationship contained in the reference database, thereby making the determined conceptual relationship more in line with the relationship between the two words relationship.
  • the node with the highest connection degree can be directly determined.
  • This implementation manner is simple to operate and easy to implement.
  • the maximum connection does not meet the specified requirements, so that the maximum connection is directly determined according to the above implementation method
  • the node may not be able to represent the node with the highest correlation with the first node.
  • the maximum connectivity among the connectivity determined according to the first formula is less than the connectivity threshold, adjust the values of ⁇ and ⁇ to obtain the updated first formula; based on the updated first formula, determine at least The connection between each node in a node and the first node; if the maximum connection in the connection determined according to the updated first formula is less than the connection threshold, then return to the value of performing adjustment ⁇ and ⁇ Until the determined maximum connectivity is greater than or equal to the connectivity threshold, the node corresponding to the last determined maximum connectivity is determined as the node with the largest connectivity among the at least one node and the first node.
  • the conceptual relationship corresponding to the second type of words in the multi-group A may be null, so there may be isolated nodes in the semantic relationship graph whose in-degree is equal to 0 and out-degree is also equal to 0. For these isolated nodes, these isolated nodes can be merged into other nodes first, and then the semantic relationship graph is clipped.
  • multiple multi-groups are determined according to the at least one document, multiple semantic relation data groups are determined according to the multiple multi-groups, and then multiple semantic relation data groups are established according to Ontology for at least one document.
  • Ontology In the whole process of building ontology, no human participation is needed, which improves the efficiency of building ontology.
  • FIG. 4 is an ontology creation device provided by an embodiment of the present application. As shown in FIG. 4, the device 400 includes:
  • the obtaining module 401 is used to obtain at least one document for establishing the ontology, and determine a plurality of multi-groups according to the at least one document, each multi-group includes two words of the first type and one word of the second type, the words of the first type Refers to the words used to describe the properties of the object itself, the second type of words refers to the words used to indicate the association between different objects;
  • the determining module 402 is used to determine two concepts corresponding to the two first-type words in each multi-group and the concept relations corresponding to the second-type words in each multi-group, and Replace the determined two concepts with the corresponding two first-type words, and replace the determined concept relations with the corresponding second-type words to obtain multiple semantic relationship data sets;
  • the establishment module 403 is used to establish an ontology for at least one document according to multiple semantic relation data sets.
  • the determination module 402 includes:
  • the first search unit is used to search for two concepts corresponding to the two first-class words in the multi-group A from the reference database for any multi-group A in the multi-group.
  • the reference database refers to A database describing the concepts represented by each word in multiple words and the conceptual relationship between different concepts;
  • the second searching unit is used to continue searching for the concept relationship corresponding to the second type of words in the multi-group A from the reference database according to the two concepts found.
  • the first search unit is used to:
  • the concept corresponding to the first-type word B is searched from the reference database.
  • the first search unit is also used to:
  • At least one document has a word with the same meaning as the first-type word B, determine the number of occurrences of the first-type word B and words with the same meaning as the first-type word B in at least one document;
  • the device 400 further includes:
  • a creating unit is used to create a concept for the first-type word B through the LDA algorithm if the concept corresponding to the first-type word B is not found from the reference database.
  • the second search unit is used to:
  • the target path includes at least one conceptual relationship
  • the concept relationship with the greatest similarity between the second type words in the multi-group A is selected from the at least one concept relationship, and the selected concept relationship is determined as the concept relationship corresponding to the second type words in the multi-group A.
  • the establishment module 403 includes:
  • the establishment unit is used to establish a semantic relationship graph based on multiple semantic relationship data groups.
  • a node in the semantic relationship map corresponds to a concept in the multiple semantic relationship groups.
  • the relationship between the two nodes in the semantic relationship graph is The conceptual relationship between the corresponding two concepts, and the direction between the two nodes is the direction indicated by the conceptual relationship between the corresponding two concepts, each node is configured with an in-degree and out-degree, and each The in-degree of each node refers to the number of nodes pointing to each node, and the out-degree of each node refers to the number of nodes pointing to each node;
  • the cropping unit is used to crop the first node for any first node whose in-degree is equal to 0 and whose out-degree is greater than 0;
  • the setting unit is used to cut the nodes pointed to by all nodes whose in-degree is equal to 0 and whose out-degree is greater than 0 when all nodes with an in-degree equal to 0 and an out-degree greater than 0 are clipped
  • the in-degree of the point is set to 0;
  • the cropping unit is also used to perform the step of cropping the first node for any first node whose in-degree is equal to 0 and whose out-degree is greater than 0, except for the nodes that have been clipped, until After traversing all the nodes in the speech relationship graph, the resulting semantic relationship graph is used as the ontology established for at least one document.
  • the cutting unit is used to:
  • Identify the node with at least one node that has the highest degree of connectivity with the first node delete the other nodes except the determined node in at least one node, and delete the other nodes and the first node relationship.
  • the cropping unit is also used for:
  • the first formula is:
  • Wi and Wj are the two nodes used to determine the connectivity
  • Sim(Wi, Wj) is the similarity between the node Wi and the node Wj
  • Rim(Wi, Wj) is the node Wi and the node Wj
  • ⁇ and ⁇ are weighting coefficients configured for similarity and weighting coefficients configured for correlation, respectively, the sum of ⁇ and ⁇ is 1;
  • the node with the highest degree of connectivity to the first node among at least one node is determined.
  • the cropping unit is also used for:
  • the maximum connectivity in the connectivity determined according to the updated first formula is less than the connectivity threshold, then return to the step of adjusting the values of ⁇ and ⁇ until the determined maximum connectivity is greater than or equal to the connectivity threshold, and the final The node corresponding to the maximum connectivity determined at a time is determined as the node with the largest connectivity to the first node among the at least one node.
  • the establishment module further includes:
  • the configuration unit is used to configure an isolated node to point to a node whose in-degree is equal to 0 and whose out-degree is greater than 0 in the semantic relationship graph if there is an isolated node with an in-degree equal to 0 and an out-degree equal to 0 Click to get the updated semantic relationship diagram;
  • the cropping unit is also used to perform an operation of cropping the first node for any first node whose in-degree is equal to 0 and whose out-degree is greater than 0 based on the updated semantic relationship graph.
  • the obtaining module 401 includes:
  • the word segmentation processing unit is used to perform word segmentation processing on each document in at least one document to obtain multiple words
  • the first determining unit is used to determine the part of speech of each of the multiple words
  • the second determining unit is configured to determine a plurality of multi-groups based on the part of speech of each of the plurality of words and the document position of each word in at least one document.
  • multiple multi-groups are determined according to the at least one document, multiple semantic relation data groups are determined according to the multiple multi-groups, and then multiple semantic relation data groups are established according to Ontology for at least one document.
  • Ontology In the whole process of building ontology, no human participation is needed, which improves the efficiency of building ontology.
  • the ontology building device provided in the above embodiments only uses the division of the above functional modules as an example to illustrate the creation of the ontology.
  • the above functions can be allocated by different functional modules according to needs.
  • the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the ontology building device and the ontology building method embodiment provided in the above embodiments belong to the same concept. For the implementation process, refer to the method embodiments, which will not be repeated here.
  • FIG. 5 is a structural block diagram of a terminal 500 provided by an embodiment of the present application.
  • the terminal 500 may be: a smart phone, a tablet computer, an MP3 player (Moving Pictures Experts Group Audio III), motion picture expert compression standard audio level 3), MP4 (Moving Pictures Experts Group Audio Audio Layer IV, motion picture expert compression standard audio Level 4) Player, laptop or desktop computer.
  • the terminal 500 may also be called other names such as user equipment, portable terminal, laptop terminal, and desktop terminal.
  • the terminal 500 includes a processor 501 and a memory 502.
  • the processor 501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on.
  • the processor 501 may adopt at least one hardware form of DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). achieve.
  • the processor 501 may also include a main processor and a coprocessor.
  • the main processor is a processor for processing data in a wake-up state, also known as a CPU (Central Processing Unit, central processor); the coprocessor is A low-power processor for processing data in the standby state.
  • the processor 501 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used to render and draw content that needs to be displayed on the display screen.
  • the processor 501 may further include an AI (Artificial Intelligence, artificial intelligence) processor, which is used to process computing operations related to machine learning.
  • AI Artificial Intelligence, artificial intelligence
  • the memory 502 may include one or more computer-readable storage media, which may be non-transitory.
  • the memory 502 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices.
  • the non-transitory computer-readable storage medium in the memory 502 is used to store at least one instruction that is executed by the processor 501 to implement the ontology establishment provided by the method embodiment in the present application method.
  • the terminal 500 may optionally further include: a peripheral device interface 503 and at least one peripheral device.
  • the processor 501, the memory 502 and the peripheral device interface 503 may be connected by a bus or a signal line.
  • Each peripheral device may be connected to the peripheral device interface 503 through a bus, a signal line, or a circuit board.
  • the peripheral device includes at least one of a radio frequency circuit 504, a touch display screen 505, a camera 506, an audio circuit 507, a positioning component 508, and a power supply 509.
  • the peripheral device interface 503 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 501 and the memory 502.
  • the processor 501, the memory 502, and the peripheral device interface 503 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 501, the memory 502, and the peripheral device interface 503 or Both can be implemented on a separate chip or circuit board, which is not limited in this embodiment.
  • the radio frequency circuit 504 is used to receive and transmit RF (Radio Frequency) signals, also called electromagnetic signals.
  • the radio frequency circuit 504 communicates with a communication network and other communication devices through electromagnetic signals.
  • the radio frequency circuit 504 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal.
  • the radio frequency circuit 504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and so on.
  • the radio frequency circuit 504 can communicate with other terminals through at least one wireless communication protocol.
  • the wireless communication protocol includes but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity, wireless fidelity) networks.
  • the radio frequency circuit 504 may further include NFC (Near Field Communication) related circuits, which is not limited in this application.
  • the display screen 505 is used to display UI (User Interface).
  • the UI may include graphics, text, icons, video, and any combination thereof.
  • the display screen 505 also has the ability to collect touch signals on or above the surface of the display screen 505.
  • the touch signal can be input to the processor 501 as a control signal for processing.
  • the display screen 505 can also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
  • the display screen 505 there may be one display screen 505, which is provided with the front panel of the terminal 500; in other embodiments, there may be at least two display screens 505, which are respectively provided on different surfaces of the terminal 500 or have a folded design; In still other embodiments, the display screen 505 may be a flexible display screen, which is disposed on the curved surface or the folding surface of the terminal 500. Even, the display screen 505 can also be set as a non-rectangular irregular figure, that is, a special-shaped screen.
  • the display screen 505 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light emitting diode) and other materials.
  • the camera component 506 is used to collect images or videos.
  • the camera assembly 506 includes a front camera and a rear camera.
  • the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal.
  • the camera assembly 506 may also include a flash.
  • the flash can be a single-color flash or a dual-color flash. Dual color temperature flash refers to the combination of warm light flash and cold light flash, which can be used for light compensation at different color temperatures.
  • the audio circuit 507 may include a microphone and a speaker.
  • the microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals and input them to the processor 501 for processing, or input them to the radio frequency circuit 504 to implement voice communication.
  • the microphone can also be an array microphone or an omnidirectional acquisition microphone.
  • the speaker is used to convert the electrical signal from the processor 501 or the radio frequency circuit 504 into sound waves.
  • the speaker can be a traditional thin-film speaker or a piezoelectric ceramic speaker.
  • the speaker When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible by humans, but also convert electrical signals into sound waves inaudible to humans for distance measurement and other purposes.
  • the audio circuit 507 may also include a headphone jack.
  • the positioning component 508 is used to locate the current geographic location of the terminal 500 to implement navigation or LBS (Location Based Service).
  • the positioning component 508 may be a positioning component based on the GPS (Global Positioning System) of the United States, the Beidou system of China, the Grenas system of Russia, or the Galileo system of the European Union.
  • the power supply 509 is used to supply power to various components in the terminal 500.
  • the power source 509 may be alternating current, direct current, disposable batteries, or rechargeable batteries.
  • the rechargeable battery may support wired charging or wireless charging.
  • the rechargeable battery can also be used to support fast charging technology.
  • the terminal 500 further includes one or more sensors 510.
  • the one or more sensors 510 include, but are not limited to: an acceleration sensor 511, a gyro sensor 512, a pressure sensor 513, a fingerprint sensor 514, an optical sensor 515, and a proximity sensor 516.
  • the acceleration sensor 511 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established with the terminal 500.
  • the acceleration sensor 511 can be used to detect components of gravity acceleration on three coordinate axes.
  • the processor 501 may control the touch display screen 505 to display the user interface in a landscape view or a portrait view according to the gravity acceleration signal collected by the acceleration sensor 511.
  • the acceleration sensor 511 can also be used for game or user movement data collection.
  • the gyro sensor 512 can detect the body direction and rotation angle of the terminal 500, and the gyro sensor 512 can cooperate with the acceleration sensor 511 to collect a 3D motion of the user on the terminal 500. Based on the data collected by the gyro sensor 512, the processor 501 can realize the following functions: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
  • the pressure sensor 513 may be disposed on the side frame of the terminal 500 and/or the lower layer of the touch display screen 505.
  • the processor 501 can perform left-right hand recognition or shortcut operation according to the grip signal collected by the pressure sensor 513.
  • the processor 501 controls the operability control on the UI interface according to the user's pressure operation on the touch display screen 505.
  • the operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
  • the fingerprint sensor 514 is used to collect the user's fingerprint, and the processor 501 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 514, or the fingerprint sensor 514 identifies the user's identity based on the collected fingerprint. When the user's identity is recognized as a trusted identity, the processor 501 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings.
  • the fingerprint sensor 514 may be provided on the front, back, or side of the terminal 500. When a physical button or manufacturer logo is provided on the terminal 500, the fingerprint sensor 514 may be integrated with the physical button or manufacturer logo.
  • the optical sensor 515 is used to collect the ambient light intensity.
  • the processor 501 can control the display brightness of the touch display 505 according to the ambient light intensity collected by the optical sensor 515. Exemplarily, when the ambient light intensity is high, the display brightness of the touch display screen 505 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 505 is reduced.
  • the processor 501 can also dynamically adjust the shooting parameters of the camera assembly 506 according to the ambient light intensity collected by the optical sensor 515.
  • the proximity sensor 516 also called a distance sensor, is usually provided on the front panel of the terminal 500.
  • the proximity sensor 516 is used to collect the distance between the user and the front of the terminal 500.
  • the processor 501 controls the touch display 505 to switch from the bright screen state to the breathing screen state; when the proximity sensor 516 detects When the distance from the user to the front of the terminal 500 gradually becomes larger, the processor 501 controls the touch display 505 to switch from the breath-hold state to the bright-screen state.
  • FIG. 5 does not constitute a limitation on the terminal 500, and may include more or fewer components than shown, or combine certain components, or adopt different component arrangements.
  • Embodiments of the present application also provide a non-transitory computer-readable storage medium.
  • the terminal can execute the ontology creation method provided in the foregoing embodiment.
  • An embodiment of the present application also provides a computer program product containing instructions, which, when it runs on a terminal, causes the terminal to execute the ontology creation method provided in the foregoing embodiment.
  • the server may be a server in a background server cluster.
  • the server 600 includes a central processing unit (CPU) 601, a system memory 604 including a random access memory (RAM) 602 and a read-only memory (ROM) 603, and a system bus 605 connecting the system memory 604 and the central processing unit 601.
  • the server 600 also includes a basic input/output system (I/O system) 606 that helps transfer information between various devices in the computer, and a mass storage device 607 for storing the operating system 613, application programs 614, and other program modules 615 .
  • I/O system basic input/output system
  • the basic input/output system 606 includes a display 608 for displaying information and an input device 609 for a user to input information, such as a mouse and a keyboard.
  • the display 608 and the input device 609 are both connected to the central processing unit 601 through the input and output controller 610 connected to the system bus 605.
  • the basic input/output system 606 may also include an input-output controller 610 for receiving and processing input from a number of other devices such as a keyboard, mouse, or electronic stylus.
  • the input output controller 610 also provides output to a display screen, printer, or other type of output device.
  • the mass storage device 607 is connected to the central processing unit 601 through a mass storage controller (not shown) connected to the system bus 605.
  • the mass storage device 607 and its associated computer-readable medium provide non-volatile storage for the server 600. That is, the mass storage device 607 may include a computer-readable medium (not shown) such as a hard disk or CD-ROM drive.
  • Computer-readable media may include computer storage media and communication media.
  • Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data.
  • Computer storage media include RAM, ROM, EPROM, EEPROM, flash memory, or other solid-state storage technologies, CD-ROM, DVD, or other optical storage, tape cassettes, magnetic tape, magnetic disk storage, or other magnetic storage devices.
  • RAM random access memory
  • ROM read-only memory
  • EPROM Erasable programmable read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other solid-state storage technologies
  • CD-ROM, DVD or other optical storage
  • tape cassettes magnetic tape
  • magnetic disk storage or other magnetic storage devices.
  • computer storage medium is not limited to the above types.
  • the above-mentioned system memory 604 and mass storage device 607 may be collectively referred to as a memory.
  • the server 600 may also be operated by a remote computer connected to the network through a network such as the Internet. That is, the server 600 can be connected to the network 612 through the network interface unit 611 connected to the system bus 605, or the network interface unit 611 can also be used to connect to other types of networks or remote computer systems (not shown).
  • the above memory also includes one or more programs.
  • One or more programs are stored in the memory and configured to be executed by the CPU.
  • the one or more programs include instructions for performing the ontology creation method provided by the above embodiment.
  • An embodiment of the present application further provides a non-transitory computer-readable storage medium, and when the instructions in the storage medium are executed by the processor of the server, the mobile server can execute the ontology creation method provided by the foregoing embodiment.
  • An embodiment of the present application also provides a computer program product containing instructions, which, when it runs on a server, causes the server to execute the ontology creation method provided by the foregoing embodiment.
  • the program may be stored in a computer-readable storage medium.
  • the mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

本申请公开了一种本体建立方法、装置及存储介质,属于大数据处理技术领域。所述方法包括:对于用于建立本体的至少一个文档,根据至少一个文档确定多个多元组,根据多个多元组确定多个语义关系数据组,然后根据多个语义关系数据组,建立针对至少一个文档的本体。整个建立本体的过程中,无需人工参与,提高了建立本体的效率。

Description

本体建立方法、装置及存储介质
本申请要求于2018年11月30日提交的申请号为201811459195.0、发明名称为“本体建立方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及大数据处理技术领域,特别涉及一种本体建立方法、装置及存储介质。
背景技术
本体是一种数据结构,该数据结构用于对某些文档采用标准的、规范的方式进行说明,以便于根据该本体对这些文档进行共享。其中,本体包括多个概念和多个概念中存在关联的两个概念之间的概念关系,且概念关系是有方向的,概念关系的方向用于指示这两个概念之间的归属关系。比如,针对描述雨伞的多个文档建立一个本体,该本体中包括多个概念,比如雨伞、用具、伞把等。其中,概念“雨伞”和概念“用具”之间存在一个概念关系,且该概念关系由“雨伞”指向“用具”,用于指示概念“雨伞”归属于概念“用具”。概念“雨伞”和概念“伞把”之间也存在一个概念关系,且该概念关系由“伞把”指向“雨伞”,用于指示概念“伞把”归属于概念“雨伞”。
相关技术中,当需要建立本体时,获取用于建立本体的至少一个文档,通过人工方式对至少一个文档中每个文档中的词语进行归类,然后根据归类之后的多个词语建立本体。该建立本体的过程人工参与度较高,严重影响了建立本体的效率。
发明内容
本申请实施例提供了一种本体建立方法、装置及存储介质,可以提高建立本体的效率。所述技术方案如下:
第一方面,提供了一种本体建立方法,所述方法包括:
获取用于建立本体的至少一个文档,根据所述至少一个文档确定多个多元组,每个多元组包括两个第一类词语和一个第二类词语,所述第一类词语是指用于指示对象自身属性的词语,所述第二类词语是指用于指示不同对象之间的关联关系的词语;
确定所述多个多元组中每个多元组中的两个第一类词语分别对应的两个概念,以及每个多个元组中的第二类词语对应的概念关系,采用确定的两个概念分别替换对应的两个第一类词语,采用确定的概念关系替换对应的第二类词语,得到多个语义关系数据组;
根据所述多个语义关系数据组,建立针对所述至少一个文档的本体。
可选地,所述确定所述多个多元组中每个多元组中的两个第一类词语分别对应的两个概念,以及每个多元组中的第二类词语对应的概念关系,包括:
对于所述多个多元组中的多元组A,从参考数据库中查找与所述多元组A中的两个第一类词语分别对应的两个概念,所述参考数据库包括多个词语中每个词语所代表的概念以及不同概念之间的概念关系,所述多元组A为所述多个多元组中任一个;
根据查找到的两个概念,从所述参考数据库中继续查找与所述多元组A中的第二类词语对应的概念关系。
可选地,所述从参考数据库中查找所述多元组A中的两个第一类词语分别对应的两个概念,包括:
对于所述多元组A中两个第一类词语中的第一类词语B,确定所述至少一个文档中与所述第一类词语B的词义相同的词语,所述第一类词语B为所述两个第一类词语中任一个;
如果所述至少一个文档中不存在词义与所述第一类词语B的词义相同的词语,则从所述参考数据库中查找所述第一类词语B对应的概念。
可选地,所述确定所述至少一个文档中词义与所述第一类词语B的词义相同的词语之后,还包括:
如果所述至少一个文档中存在词义与所述第一类词语B的词义相同的词语,则确定所述第一类词语B,以及词义与所述第一类词语B的词义相同的词语分别在所述至少一个文档中的出现次数;
从所述第一类词语B,以及与所述第一类词语B的词义相同的词语中,确定出现次数最大的词语;
从所述参考数据库中查找所述出现次数最大的词语对应的概念,将查找到的概念作为所述第一类词语B对应的概念。
可选地,所述方法还包括:
如果没有从所述参考数据库中查找到所述第一类词语B对应的概念,则通过LDA(Latent Dirichlet Allocation,潜在狄利克雷分布)算法为所述第一类词语B创建一个概念。
可选地,所述根据查找到的两个概念,从所述参考数据库中继续查找与所述多元组A中的第二类词语对应的概念关系,包括:
从所述参考数据库中确定所述查找到的两个概念之间的路径,得到多条路径;
根据所述多条路径的路径长度,从所述多条路径中选择一条目标路径,所述目标路径中包括至少一个概念关系;
从所述至少一个概念关系中选择与所述多元组A中的第二类词语之间相似度最大的概念关系,将选择的概念关系确定为与所述多元组A中的第二类词语对应的概念关系。
可选地,所述根据所述多个语义关系数据组,建立针对所述至少一个文档的本体,包括:
根据所述多个语义关系数据组,建立语义关系图,所述语义关系图中的一个结点对应所述多个语义关系组中的一个概念,所述语义关系图中两个结点之间的关系为对应的两个概念之间的概念关系,且所述两个结点之间的方向为对应的两个概念之间的概念关系所指示的方向,每个结点配置有入度和出度,且每个结点的入度是指指向相应结点的其他结点的数量,每个结点的出度是指相应结点指向的其他结点的数量;
对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪;
当对所述语义关系图中所有入度等于0且出度大于0的结点均裁剪完时,将所述语义关系图中所有入度等于0且出度大于0的结点指向的结点的入度设置为0;
对除了已经裁剪的结点之外的其他节点,返回执行对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪的步骤,直至遍历完所述语音关系图中的所有结点,将最终得到的语义关系图作为针对所述至少一个文档建立的本体。
可选地,所述对所述第一结点进行裁剪,包括:
确定所述语义关系图中的至少一个结点,所述至少一个结点对应的概念所指示的词语在所述至少一个文档中的文档位置与所述第一结点对应的概念所指示的词语在所述至少一个文档中的文档位置相邻;
确定所述至少一个结点中与所述第一结点连接度最大的结点,删除所述至少一个结点中除确定出的结点之外的其他结点,以及所述其他结点与所述第一结点之间的关系,任意两个结点之间的连接度用于指示所述两个结点之间的关联程度。
可选地,所述确定所述至少一个结点中与所述第一结点连接度最大的结点,包括:
基于第一公式确定所述至少一个结点中每个结点与所述第一结点之间的连接度;
其中,所述第一公式为:
Figure PCTCN2019122159-appb-000001
所述Wi和所述Wj分别为用于确定连接度的两个结点,所述Sim(Wi,Wj)为结点Wi和结点Wj之间的相似度,所述Rel(Wi,Wj)为结点Wi和结点Wj之间的相关度,所述α和所述β分别为针对相似度配置的加权系数和针对相关度配置的加权系数,所述α和所述β的和为1;
根据按照所述第一公式确定的连接度,确定所述至少一个结点中与所述第一结点连接度最大的结点。
可选地,所述根据按照所述第一公式确定的连接度,确定所述至少一个结点中与所述第一结点连接度最大的结点,包括:
如果按照所述第一公式确定的连接度中的最大连接度小于连接度阈值,则调整所述α和所述β的数值,得到更新之后的第一公式;
基于更新之后的第一公式确定所述至少一个结点中每个结点与所述第一结点之间的连接度;
如果按照所述更新之后的第一公式确定的连接度中的最大连接度小于所述连接度阈值,则返回执行调整所述α和所述β的数值的步骤,直至确定出的最大连接度大于或等于所述连接度阈值,将最后一次确定出的最大连接度对应的结点确定为所述至少一个结点中与所述第一结点连接度最大的结点。
可选地,所述对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪之前,还包括:
如果所述语义关系图中存在入度等于0且出度也等于0的孤立结点,将所述孤立结点配置为指向所述语义关系图中的入度等于0且出度大于0的一个结点上,得到更新之后的语义关系图;
基于更新之后的语义关系图,执行对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪的操作。
可选地,所述根据所述至少一个文档确定多个多元组,包括:
对所述至少一个文档中每个文档进行分词处理,得到多个词语;
确定所述多个词语中每个词语的词性;
根据所述多个词语中每个词语的词性和每个词语在所述至少一个文档中的文档位置,确定所述多个多元组。
第二方面,提供了一种本体建立装置,所述装置包括:
获取模块,用于获取用于建立本体的至少一个文档,根据所述至少一个文档确定多个多元组,每个多元组包括两个第一类词语和一个第二类词语,所述第一类词语是指用于指示对象自身属性的词语,所述第二类词语是指用于指示不同对象之间的关联关系的词语;
确定模块,用于确定所述多个多元组中每个多元组中的两个第一类词语分别对应的两个概念,以及每个多个元组中的第二类词语对应的概念关系,采用确定的两个概念分别替换对应的两个第一类词语,采用确定的概念关系替换对应的第二类词语,得到多个语义关系数据组;
建立模块,用于根据所述多个语义关系数据组,建立针对所述至少一个文档的本体。
可选地,所述确定模块包括:
第一查找单元,用于对于所述多个多元组中的多元组A,从参考数据库中查找与所述多元组A中的两个第一类词语分别对应的两个概念,所述参考数据库包括多个词语中每个词语所代表的概念以及不同概念之间的概念关系,所述多元组A为所述多个多元组中任一个;
第二查找单元,用于根据查找到的两个概念,从所述参考数据库中继续查找与所述多元组A中的第二类词语对应的概念关系。
可选地,所述第一查找单元,用于:
对于所述多元组A中两个第一类词语中的第一类词语B,确定所述至少一 个文档中词义与所述第一类词语B的词义相同的词语,所述第一类词语B为所述两个第一类词语中任一个;
如果所述至少一个文档中不存在与所述第一类词语B的词义相同的词语,则从所述参考数据库中查找所述第一类词语B对应的概念。
可选地,所述第一查找单元,还用于:
如果所述至少一个文档中存在词义与所述第一类词语B的词义相同的词语,则确定所述第一类词语B,以及与所述第一类词语B的词义相同的词语分别在所述至少一个文档中的出现次数;
从所述第一类词语B,以及词义与所述第一类词语B的词义相同的词语中,确定出现次数最大的词语;
从所述参考数据库中查找所述出现次数最大的词语对应的概念,并将查找到的概念作为所述第一类词语B对应的概念。
可选地,所述装置还包括:
创建单元,用于如果没有从所述参考数据库中查找到所述第一类词语B对应的概念,则通过LDA算法为所述第一类词语B创建一个概念。
可选地,所述第二查找单元,用于:
从所述参考数据库中确定所述查找到的两个概念之间的路径,得到多条路径;
根据所述多条路径的路径长度,从所述多条路径中选择一条目标路径,所述目标路径中包括至少一个概念关系;
从所述至少一个概念关系中选择与所述多元组A中的第二类词语之间相似度最大的概念关系,将选择的概念关系确定为与所述多元组A中的第二类词语对应的概念关系。
可选地,所述建立模块包括:
建立单元,用于根据所述多个语义关系数据组,建立语义关系图,所述语义关系图中的一个结点对应所述多个语义关系组中的一个概念,所述语义关系图中两个结点之间的关系为对应的两个概念之间的概念关系,且所述两个结点之间的方向为对应的两个概念之间的概念关系所指示的方向,每个结点配置有入度和出度,且每个结点的入度是指指向相应结点的其他结点的数量,每个结点的出度是指相应结点指向的其他结点的数量;
裁剪单元,用于对于入度等于0且出度大于0的任一第一结点,对所述第 一结点进行裁剪;
设置单元,用于当对所述语义关系图中所有入度等于0且出度大于0的第一结点均裁剪完时,将所述语义关系图中所有入度等于0且出度大于0的第一结点指向的其他结点的入度设置为0;
所述裁剪单元,还用于对除已经裁剪的第一结点之外的其他结点,返回执行对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪的步骤,直至遍历完所述语音关系图中的所有结点,将最终得到的语义关系图作为针对所述至少一个文档建立的本体。
可选地,所述裁剪单元,用于:
确定所述语义关系图中的至少一个结点,所述至少一个结点对应的概念所指示的词语在所述至少一个文档中的文档位置与所述第一结点对应的概念所指示的词语在所述至少一个文档中的文档位置相邻;
确定所述至少一个结点中与所述第一结点连接度最大的结点,删除所述至少一个结点中除确定出的结点之外的其他结点,以及所述其他结点与所述第一结点之间的关系,任意两个结点之间的连接度用于指示所述两个结点之间的关联程度。
可选地,所述裁剪单元,还用于:
基于第一公式确定所述至少一个结点中每个结点与所述第一结点之间的连接度;
其中,所述第一公式为:
Figure PCTCN2019122159-appb-000002
所述Wi和所述Wj分别为用于确定连接度的两个结点,所述Sim(Wi,Wj)为结点Wi和结点Wj之间的相似度,所述Rel(Wi,Wj)为结点Wi和结点Wj之间的相关度,所述α和所述β分别为针对相似度配置的加权系数和针对相关度配置的加权系数,所述α和所述β的和为1;
根据按照所述第一公式确定的连接度,确定所述至少一个结点中与所述第一结点连接度最大的结点。
可选地,所述裁剪单元,还用于:
如果按照所述第一公式确定的连接度中的最大连接度小于连接度阈值,则调整所述α和所述β的数值,得到更新之后的第一公式;
基于更新之后的第一公式确定所述至少一个结点中每个结点与所述第一结点之间的连接度;
如果按照所述更新之后的第一公式确定的连接度中的最大连接度小于所述连接度阈值,则返回执行调整所述α和所述β的数值的步骤,直至确定出的最大连接度大于或等于所述连接度阈值,将最后一次确定出的最大连接度对应的结点确定为所述至少一个结点中与所述第一结点连接度最大的结点。
可选地,所述建立模块还包括:
配置单元,用于如果所述语义关系图中存在入度等于0且出度也等于0的孤立结点,将所述孤立结点配置为指向所述语义关系图中的入度等于0且出度大于0的一个结点上,得到更新之后的语义关系图;
所述裁剪单元,还用于基于更新之后的语义关系图,执行对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪的操作。
可选地,所述获取模块包括:
分词处理单元,用于对所述至少一个文档中每个文档进行分词处理,得到多个词语;
第一确定单元,用于确定所述多个词语中每个词语的词性;
第二确定单元,用于根据所述多个词语中每个词语的词性和每个词语在所述至少一个文档中的文档位置,确定所述多个多元组。
第三方面,提供了一种本体建立装置,所述装置包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为执行上述第一方面所述的任一项方法的步骤。
第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有指令,所述指令被处理器执行时实现上述第一方面所述的任一项方法的步骤。
第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的任一方法的步骤。
本申请实施例提供的技术方案带来的有益效果是:
在本申请实施例中,对于用于建立本体的至少一个文档,根据至少一个文 档确定多个多元组,根据多个多元组确定多个语义关系数据组,然后根据多个语义关系数据组,建立针对至少一个文档的本体。整个建立本体的过程中,无需人工参与,提高了建立本体的效率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种本体建立方法流程图;
图2是本申请实施例提供的一种查询概念和概念关系的方法流程图;
图3是本申请实施例提供的一种概念图的示意图;
图4是本申请实施例提供的一种本体建立装置示意图;
图5是本申请实施例提供的一种终端的结构示意图;
图6是本申请实施例提供的一种服务器的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
图1是本申请实施例提供的一种本体建立方法流程图。如图1所示,该方法包括如下步骤:
步骤101:获取用于建立本体的至少一个文档,并根据至少一个文档确定多个多元组,每个多元组包括两个第一类词语和一个第二类词语,第一类词语是指用于指示对象自身属性的词语,第二类词语是指用于指示不同对象之间的关联关系的词语。
在本申请实施例中,为了确保建立的本体能够最大可能描述至少一个文档中的内容,在建立本体时,先根据至少一个文档确定多个多元组。其中,每个多元组包括两个第一类词语和一个第二类词语,第一类词语是指用于指示对象自身属性的词语,比如名词。第二类词语是指用于指示不同对象之间的关联关系的词语,比如动词。且每个多元组中包括的词语均是至少一个文档中的词语,如此可以确保后续建立的本体是根据至少一个文档中的信息得到的,提高了建 立的本体的准确性。
其中,本申请实施例提供的本体建立方法可以由终端来执行,此时,用于建立本体的至少一个文档可以是管理员预先输入至终端的。本申请实施例提供的本体建立方法也可以由服务器来执行,此时,用于建立本体的至少一个文档可以是管理员预先通过终端上传至服务器的。本申请实施例在此不做限定。
在一种可能的实现方式中,根据至少一个文档确定多个多元组可以为:对至少一个文档中每个文档进行分词处理,得到多个词语;确定多个词语中每个词语的词性;根据多个词语中每个词语的词性和每个词语在至少一个文档中的文档位置,确定多个多元组。
其中,对至少一个文档进行分词处理可以采用基于字符串匹配中的正向最大匹配分词方法,当然也可以采用其他的分词方法,本申请实施例在此不做限定。
另外,由于每个词语可能有不同的词性,因此可以将多个词语按照各个词语在文档中的位置进行划分,得到多个词语序列,比如,可以将一段文本中的所有词语组合为一个词语序列。此时,确定多个词语中每个词语的词性的实现方式可以为:对于任一词语序列,按照该词语序列包括的每个词语对应的不同的词性,将不同的词性进行组合,得到针对该词语序列的多个词性序列,每个词性序列包括与该词语序列中的词语一一对应的词性。通过评估函数判断该多个词性序列中每个词性序列的概率,从多个词性序列中选择概率最大的词性序列,并将概率最大的词性序列中的词性确定为对应的词语的词性。
另外,由于按照分词处理之后的多个词语是按照在文档中的位置顺序排列的,因此,根据多个词语中每个词语的词性和每个词语在至少一个文档中的文档位置,确定多个多元组的实现方式可以为:对于任一第一类词语,在多个词语中查找排序在该第一类之后且与该第一类词语相邻的第二类词语,再继续查找排序在该第二类词语之后且与该第二类词语相邻的一个第一类词语,将这三个词语组合,便可得到一个多元组。
可选地,由于至少一个文档除了第一类词语和第二类词语之外,可能还存在其他词性的词语,比如副词或介词等,而这些其他词性的词语对建立本体的贡献度不大,因此在上述对至少一个文档中每个文档进行分词处理之前,还可以先对至少一个文档进行无用词过滤操作,以过滤掉至少一个文档中无用的词语。
另外,在本申请实施例中,由于用于建立本体的文档通常数量较多,为了提高建立本体的效率,可以通过基于分布式计算框架的计算模型来执行步骤101。示例性地,将至少一个文档划分到不同的分区,各个分区之间可以并行地执行上述步骤101,进而提高了建立本体的速度。其中,将至少一个文档划分到不同的分区可以是指将每个文档划分到一个分区,也可以是指相邻的几个段落划分到一个分区,或者是一个段落划分到一个分区,本申请实施例在此不做限定。
其中,当至少一个文档被划分到不同的分区时,下述步骤102是以分区为单位执行的,也即是,各个分区并行地根据划入自身的文档执行步骤102。
步骤102:确定多个多元组中每个多元组中的两个第一类词语分别对应的两个概念,以及每个多个元组中的第二类词语对应的概念关系,并将确定的两个概念分别替换对应的两个第一类词语,将确定的概念关系替换对应的第二类词语,得到多个语义关系数据组。
由于目前已经存在有大量用于表征概念的数据库,因此,在本申请实施例中,可以基于参考数据库执行步骤102。也即是,基于参考数据库确定每个多元组中的两个第一类词语分别对应的两个概念,以及每个多个元组中的第二类词语对应的概念关系。由于确定每个多元组中的两个第一类词语分别对应的两个概念,以及每个多个元组中的第二类词语对应的概念关系的实现方式基本相同,因此,下面以多个多元组中多元组A为例说明如何确定一个多元组中的两个第一类词语分别对应的两个概念,以及每个多个元组中的第二类词语对应的概念关系。其中,多元组A为多个多元组中任一多元组。本申请实施例提供的一种查询概念和概念关系的方法流程图,如图2所示,该方法包括如下两个步骤。
步骤1021:从参考数据库中查找与多元组A中的两个第一类词语分别对应的两个概念,参考数据库包括多个词语中每个词语所代表的概念以及不同概念之间的概念关系。
其中,参考数据库可以为HowNet(知网)数据库。为了后续便于说明,在此对HowNet数据库进行简单介绍:HowNet数据库是一个以汉语和英语的词语所代表的概念为描述对象,以揭示概念与概念之间以及概念所具有的属性之间的关系的数据库。HowNet数据库采用KDML(Knowledge database mark-up language,知识系统描述语言),利用嵌套式的结构,对概念以及概念的属性进行描述。也即是,对于一个复杂的概念用较简单的概念进行解释,较简单的概 念再用更简单的概念解释,直到能够用义原表示为止,义原是指能够表达词义的最基本的单元。这种结构其实质是一种隐含的图结构,称之为概念图。
图3是本申请实施例提供的一种概念图的示意图。如图3所示,概念“场馆”在HowNet数据库中的描述可以为:NO.(编号)=129348,W_C(概念名称)=奥运场馆,DEF(定义文件扩展名,Definitions File Name Extension)={facilities|设施,domain(领域)={sports|体育},location(地方)={compete|比赛、exercise|锻炼}。在“场馆”的概念描述中,KDML表示了这样的含义:场馆是一个设施,这个设施所属的领域(Domain)是体育领域,这个设施是比赛的地方(Location),这个设施也是锻炼的地方(Location)。也就是说,场馆是一个用来进行体育比赛和健身锻炼的场所。
基于上述参考数据库的介绍可知,参考数据库中的一个概念可能对应至少一个文档中的一个词语,也可以对应至少一个文档中的多个词语。比如,词语“饭碗”、“职业”、“差事”就是多个词义相近的词,它们代表的是同一个概念。因此,从参考数据库中查找多元组A中的两个第一类词语分别对应的两个概念的实现方式可以为:对于多元组A中两个第一类词语中的第一类词语B,确定至少一个文档中词义与第一类词语B的词义相同的词语;如果至少一个文档中不存在词义与第一类词语B的词义相同的词语,则从参考数据库中查找第一类词语B对应的概念。其中,第一类词语B为多元组A中两个第一类词语中任一个。
如果至少一个文档中存在词义与第一类词语B的词义相同的词语,则确定第一类词语B,以及词义与第一类词语B的词义相同的词语分别在至少一个文档中的出现次数;从第一类词语B,以及词义与第一类词语B的词义相同的词语中,确定出现次数最大的词语;从参考数据库中查找出现次数最大的词语对应的概念,并将查找到的概念作为第一类词语B对应的概念。
其中,当至少一个文档被划分到不同的分区时,由于各个分区并行地根据划入自身的文档执行步骤102,因此,上述实现方式中,与第一类词语B的词义相同的词语是指:在第一类词语B所在的分区内词义与第一类词语B的词义相同的词语。
另外,在按照上述方式从参考数据库中查找与第一类词语B对应的概念时,可能存在没有查找到的情况,此时则通过LDA(Latent Dirichlet Allocation,潜在狄利克雷分布)算法为第一类词语B创建一个概念。其中,LDA算法是文本 语义分析的一个重要模型。
其中,当至少一个文档被划分到不同的分区时,由于各个分区并行地根据划入自身的文档执行步骤102,此时,为每个分区配置一个LDA列表,对于任一分区,该LDA列表用于存放该分区内没有从参考数据库中查找到对应的概念的词语。因此,通过LDA算法为第一类词语B创建一个概念的实现方式可以为:对第一类词语B所在的分区的LDA列表中的所有词语进行概念建模,得到针对该LDA列表的一个概念树,将该概念树添加到参考数据库中,然后再从参考数据库中查找第一类词语B对应的概念,相当于为第一类词语B创建了一个概念。
步骤1022:根据查找到的两个概念,从参考数据库中继续查找与多元组A中的第二类词语对应的概念关系。
由图3可知,参考数据库中的不同的两个概念之间存在的不止一条路径,每条路径上存在不止一个概念关系,因此,步骤1022的实现方式可以为:从参考数据库中确定查找到的两个概念之间的路径,得到多条路径;根据多条路径的路径长度,从多条路径中选择一条目标路径,目标路径中包括至少一个概念关系;从至少一个概念关系中选择与多元组A中的第二类词语之间相似度最大的概念关系,并将选择的概念关系确定为与多元组A中的第二类词语对应的概念关系。
其中,根据多条路径的路径长度,从多条路径中选择一条目标路径的实现方式可以为:从多条路径中路径长度最大的一条路径作为目标路径。当然,本申请实施例中还可以根据其他原则确定目标路径,在此不做限定。
另外,由于在文档中通常存在一些通用的动词,比如“是”“为”等动词,这些动词对于建立本体的贡献度并不大,因此,在从参考数据库中确定查找到的两个概念之间的路径之前,还可以确定多元组A包括的第二类词语的TF-IDF(term frequency–inverse document frequency,信息检索数据挖掘的常用加权技术)值,根据TF-IDF值确定该第二类词语是否为通用的动词,如果是,则过滤掉该通用的动词,此时则不再执行“从参考数据库中确定查找到的两个概念之间的路径”的步骤,而是将多元组A中的第二类词语对应的概念关系设置为空值。如果根据TF-IDF值确定该第二类词语不是通用的动词,则执行上述“从参考数据库中确定查找到的两个概念之间的路径”,以从参考数据库中确定为与多元组A中的第二类词语对应的概念关系。
通过上述步骤101和步骤102可以得到多个语义关系数据组,由于每个语 义关系数据组中包括两个概念和这两个概念之间的概念关系,因此可以通过下述步骤103建立针对至少一个文档的本体。
步骤103:根据多个语义关系数据组,建立针对至少一个文档的本体。
在本申请实施例汇中,由于每个语义关系数据组中包括两个概念和这两个概念之间的概念关系,因此可以直接将多个语义关系数据组所指示的网状结构数据作为针对至少一个文档的本体。
可选地,当通过分区模式执行上述步骤101和步骤102时,不同的分区之间可能存在相同的概念,导致多个语义关系数据组所指示的网状结构数据比较臃肿,不利于其他用户从多个语义关系数据组所指示的网状结构数据中查询信息。因此,在本申请实施例中,还可以对多个语义关系数据组所指示的网状结构数据进行裁剪,以提高建立的本体的通用性。
其中,对多个语义关系数据组所指示的网状结构数据进行裁剪的实现方式可以为:根据多个语义关系数据组,建立语义关系图,语义关系图中的一个结点对应多个语义关系组中的一个概念,语义关系图中两个结点之间的关系为对应的两个概念之间的概念关系,且两个结点之间的方向为对应的两个概念之间的概念关系所指示的方向,每个结点配置有入度和出度,且每个结点的入度是指指向该结点的其他结点的数量,每个结点的出度是指该结点指向的其他结点的数量。对于入度等于0且出度大于0的任一第一结点,对第一结点进行裁剪;当对语义关系图中所有入度等于0且出度大于0的第一结点均裁剪完时,将语义关系图中所有入度等于0且出度大于0的结点指向的结点的入度设置为0;对除了已经裁剪的第一结点之外的其他结点,返回执行对于入度等于0且出度大于0的任一第一结点,对第一结点进行裁剪的步骤,直至遍历完语义关系图中的所有结点,将最终得到的语义关系图作为针对至少一个文档建立的本体。
其中,根据多个语义关系数据组,建立语义关系图是指将多个语义关系数据组中的各个概念按照概念关系进行关联,得到的数据体系称之为语义关系图。
另外,在对语义关系图进行裁剪时,采用的是广度优先的方式遍历语义关系图中所有的结点。其中,广度优先是指先处理入度等于0且出度大于0的结点,再处理入度等于0且出度大于0的结点直接指向的结点,该过程如上述实现方式。当然,也可以其他的遍历方式来遍历语义关系图中的结点,比如深度优先的遍历方式,本申请实施例在此不再一一说明。
在一种可能的实现方式中,对第一结点进行裁剪可以为:确定语义关系图 中的至少一个结点,这至少一个结点对应的概念所指示的词语在至少一个文档中的文档位置与第一结点对应的概念所指示的词语在至少一个文档中的文档位置相邻;确定至少一个结点中与第一结点连接度最大的结点,删除至少一个结点中除确定出的结点之外的其他结点,并删除其他结点与第一结点之间的关系。
其中,当至少一个文档被划分到不同的分区时,至少一个结点则是指对应的概念所指示的词语与第一结点对应的概念所指示的词语在同一分区内。
另外,任意两个结点之间的连接度用于指示这两个结点之间的关联程度,在本申请实施例中,确定至少一个结点中与第一结点连接度最大的结点的实现方式可以为:基于第一公式确定至少一个结点中每个结点与第一结点之间的连接度,根据按照第一公式确定的连接度,确定至少一个结点中与第一结点连接度最大的结点。
其中,第一公式为:
Figure PCTCN2019122159-appb-000003
Wi和Wj分别为用于确定连接度的两个结点,Joint(Wi,Wj)表示结点Wi和结点Wj之间的连接度,Sim(Wi,Wj)为结点Wi和结点Wj之间的相似度,Rel(Wi,Wj)为结点Wi和结点Wj之间的相关度,α和β分别为针对相似度配置的加权系数和针对相关度配置的加权系数,α和β的和为1。
其中,结点Wi和结点Wj之间的相似度可以通过结点Wi和结点Wj在语义关系图中的路径的长度来确定,本申请实施例在此不再详细阐述。Wi和结点Wj之间的相关度可以通过结点Wi对应的词语和结点Wj对应的词语在至少一个文档中的出现次数来确定。并且,当至少一个文档被划分到不同的分区时,结点Wi对应的词语和结点Wj对应的词语在至少一个文档中的出现次数是指结点Wi对应的词语和结点Wj对应的词语在同一分区中出现次数。因此,通过本申请实施例提供的连接度的确定方式,可以使得连接度结合了词句上下文语境和参考数据库中包含的相似度关系,从而使得确定出的概念关系更加符合两个词语之间的关系。
在上述实现方式中,在确定至少一个结点中每个结点与第一结点之间的连接度之后,可以直接确定连接度最大的结点,这种实现方式操作简单,易于实现。但是实际应用中,可能存在确定至少一个结点中每个结点与第一结点之间的连接度之后,最大的连接度不满足指定要求,这样按照上述实现方式直接确定出连接度最大的结点可能不能代表与第一节点关联度最大的结点。
因此,可选地,如果按照第一公式确定的连接度中的最大连接度小于连接 度阈值,则调整α和β的数值,得到更新之后的第一公式;基于更新之后的第一公式确定至少一个结点中每个结点与第一结点之间的连接度;如果按照更新之后的第一公式确定的连接度中的最大连接度小于连接度阈值,则返回执行调整α和β的数值的步骤,直至确定出的最大连接度大于或等于连接度阈值,将最后一次确定出的最大连接度对应的结点确定为至少一个结点中与第一结点连接度最大的结点。
另外,由于在步骤102中,多元组A中的第二类词语对应的概念关系可能为空值,因此,语义关系图中可能存在入度等于0且出度也等于0的孤立结点。对于这些孤立结点,可以先将这些孤立结点并入到其他结点中,然后在对语义关系图进行裁剪。也即是,在对于入度等于0且出度大于0的任一第一结点,对第一结点进行裁剪之前,还可以执行如下操作:如果语义关系图中存在入度等于0且出度也等于0的孤立结点,将孤立结点配置为指向语义关系图中的入度等于0且出度大于0的一个结点上,得到更新之后的语义关系图;基于更新之后的语义关系图,执行对于入度等于0且出度大于0的任一第一结点,对第一结点进行裁剪的操作。通过这种合并的方式,可以确保将步骤102建立的本体中的每个概念都与其他概念之间存在关系。
在本申请实施例中,对于用于建立本体的至少一个文档,根据至少一个文档确定多个多元组,根据多个多元组确定多个语义关系数据组,然后根据多个语义关系数据组,建立针对至少一个文档的本体。整个建立本体的过程中,无需人工参与,提高了建立本体的效率。
图4是本申请实施例提供的一种本体建立装置。如图4所示,该装置400包括:
获取模块401,用于获取用于建立本体的至少一个文档,并根据至少一个文档确定多个多元组,每个多元组包括两个第一类词语和一个第二类词语,第一类词语是指用于描述对象自身属性的词语,第二类词语是指用于指示不同对象之间的关联关系的词语;
确定模块402,用于确定多个多元组中每个多元组中的两个第一类词语分别对应的两个概念,以及每个多个元组中的第二类词语对应的概念关系,并将确定的两个概念分别替换对应的两个第一类词语,将确定的概念关系替换对应的第二类词语,得到多个语义关系数据组;
建立模块403,用于根据多个语义关系数据组,建立针对至少一个文档的本体。
可选地,确定模块402包括:
第一查找单元,用于对于多个多元组中任一多元组A,从参考数据库中查找与多元组A中的两个第一类词语分别对应的两个概念,参考数据库是指用于描述多个词语中每个词语所代表的概念以及不同概念之间的概念关系的数据库;
第二查找单元,用于根据查找到的两个概念,从参考数据库中继续查找与多元组A中的第二类词语对应的概念关系。
可选地,第一查找单元,用于:
对于多元组A中两个第一类词语中的任一第一类词语B,确定至少一个文档中与第一类词语B的词义相同的词语;
如果至少一个文档中不存在与第一类词语B的词义相同的词语,则从参考数据库中查找第一类词语B对应的概念。
可选地,第一查找单元,还用于:
如果至少一个文档中存在与第一类词语B的词义相同的词语,则确定第一类词语B,以及与第一类词语B的词义相同的词语分别在至少一个文档中的出现次数;
从第一类词语B,以及与第一类词语B的词义相同的词语中,确定出现次数最大的词语;
从参考数据库中查找出现次数最大的词语对应的概念,并将查找到的概念作为第一类词语B对应的概念。
可选地,装置400还包括:
创建单元,用于如果没有从参考数据库中查找到第一类词语B对应的概念,则通过LDA算法为第一类词语B创建一个概念。
可选地,第二查找单元,用于:
从参考数据库中确定查找到的两个概念之间的路径,得到多条路径;
根据多条路径的路径长度,从多条路径中选择一条目标路径,目标路径中包括至少一个概念关系;
从至少一个概念关系中选择与多元组A中的第二类词语之间相似度最大的概念关系,并将选择的概念关系确定为与多元组A中的第二类词语对应的概念 关系。
可选地,建立模块403包括:
建立单元,用于根据多个语义关系数据组,建立语义关系图,语义关系图中的一个结点对应多个语义关系组中的一个概念,语义关系图中两个结点之间的关系为对应的两个概念之间的概念关系,且两个结点之间的方向为对应的两个概念之间的概念关系所指示的方向,每个结点配置有入度和出度,且每个结点的入度是指指向每个结点的结点的数量,每个结点的出度是指每个结点指向的结点的数量;
裁剪单元,用于对于入度等于0且出度大于0的任一第一结点,对第一结点进行裁剪;
设置单元,用于当对语义关系图中所有入度等于0且出度大于0的结点均裁剪完时,将语义关系图中所有入度等于0且出度大于0的结点指向的结点的入度设置为0;
裁剪单元,还用于对除了已经裁剪的结点之外的其他节点,返回执行对于入度等于0且出度大于0的任一第一结点,对第一结点进行裁剪的步骤,直至遍历完语音关系图中的所有结点,将最终得到的语义关系图作为针对至少一个文档建立的本体。
可选地,裁剪单元,用于:
确定语义关系图中的至少一个结点,至少一个结点对应的概念所指示的词语在至少一个文档中的文档位置与第一结点对应的概念所指示的词语在至少一个文档中的文档位置相邻;
确定至少一个结点中与第一结点连接度最大的结点,删除至少一个结点中除确定出的结点之外的其他结点,并删除其他结点与第一结点之间的关系。
可选地,裁剪单元,还用于:
基于第一公式确定至少一个结点中每个结点与第一结点之间的连接度;
其中,第一公式为:
Figure PCTCN2019122159-appb-000004
Wi和Wj分别为用于确定连接度的两个结点,Sim(Wi,Wj)为结点Wi和结点Wj之间的相似度,Rim(Wi,Wj)为结点Wi和结点Wj之间的相关度,α和β分别为针对相似度配置的加权系数和针对相关度配置的加权系数,α和β的和为1;
根据按照第一公式确定的连接度,确定至少一个结点中与第一结点连接度 最大的结点。
可选地,裁剪单元,还用于:
如果按照第一公式确定的连接度中的最大连接度小于连接度阈值,则调整α和β的数值,得到更新之后的第一公式;
基于更新之后的第一公式确定至少一个结点中每个结点与第一结点之间的连接度;
如果按照更新之后的第一公式确定的连接度中的最大连接度小于连接度阈值,则返回执行调整α和β的数值的步骤,直至确定出的最大连接度大于或等于连接度阈值,将最后一次确定出的最大连接度对应的结点确定为至少一个结点中与第一结点连接度最大的结点。
可选地,建立模块还包括:
配置单元,用于如果语义关系图中存在入度等于0且出度也等于0的孤立结点,将孤立结点配置为指向语义关系图中的入度等于0且出度大于0的一个结点上,得到更新之后的语义关系图;
裁剪单元,还用于基于更新之后的语义关系图,执行对于入度等于0且出度大于0的任一第一结点,对第一结点进行裁剪的操作。
可选地,获取模块401包括:
分词处理单元,用于对至少一个文档中每个文档进行分词处理,得到多个词语;
第一确定单元,用于确定多个词语中每个词语的词性;
第二确定单元,用于根据多个词语中每个词语的词性和每个词语在至少一个文档中的文档位置,确定多个多元组。
在本申请实施例中,对于用于建立本体的至少一个文档,根据至少一个文档确定多个多元组,根据多个多元组确定多个语义关系数据组,然后根据多个语义关系数据组,建立针对至少一个文档的本体。整个建立本体的过程中,无需人工参与,提高了建立本体的效率。
需要说明的是:上述实施例提供的本体建立装置在建立本体时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的本体建立装置与本体建立方法实施例属于同一构思,其实现过程详见方法实施例,这里不再赘述。
图5是本申请实施例提供的一种终端500的结构框图。该终端500可以是:智能手机、平板电脑、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、笔记本电脑或台式电脑。终端500还可能被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。
通常,终端500包括有:处理器501和存储器502。
处理器501可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器501可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器501也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器501可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器501还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。
存储器502可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器502还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器502中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器501所执行以实现本申请中方法实施例提供的本体建立方法。
在一些实施例中,终端500还可选包括有:外围设备接口503和至少一个外围设备。处理器501、存储器502和外围设备接口503之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口503相连。示例性地,外围设备包括:射频电路504、触摸显示屏505、摄像头506、音频电路507、定位组件508和电源509中的至少一种。
外围设备接口503可被用于将I/O(Input/Output,输入/输出)相关的至少 一个外围设备连接到处理器501和存储器502。在一些实施例中,处理器501、存储器502和外围设备接口503被集成在同一芯片或电路板上;在一些其他实施例中,处理器501、存储器502和外围设备接口503中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。
射频电路504用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路504通过电磁信号与通信网络以及其他通信设备进行通信。射频电路504将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路504包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路504可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:城域网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路504还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请对此不加以限定。
显示屏505用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏505是触摸显示屏时,显示屏505还具有采集在显示屏505的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器501进行处理。此时,显示屏505还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏505可以为一个,设置终端500的前面板;在另一些实施例中,显示屏505可以为至少两个,分别设置在终端500的不同表面或呈折叠设计;在再一些实施例中,显示屏505可以是柔性显示屏,设置在终端500的弯曲表面上或折叠面上。甚至,显示屏505还可以设置成非矩形的不规则图形,也即异形屏。显示屏505可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。
摄像头组件506用于采集图像或视频。可选地,摄像头组件506包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施 例中,摄像头组件506还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。
音频电路507可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器501进行处理,或者输入至射频电路504以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在终端500的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器501或射频电路504的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路507还可以包括耳机插孔。
定位组件508用于定位终端500的当前地理位置,以实现导航或LBS(Location Based Service,基于位置的服务)。定位组件508可以是基于美国的GPS(Global Positioning System,全球定位系统)、中国的北斗系统、俄罗斯的格雷纳斯系统或欧盟的伽利略系统的定位组件。
电源509用于为终端500中的各个组件进行供电。电源509可以是交流电、直流电、一次性电池或可充电电池。当电源509包括可充电电池时,该可充电电池可以支持有线充电或无线充电。该可充电电池还可以用于支持快充技术。
在一些实施例中,终端500还包括有一个或多个传感器510。该一个或多个传感器510包括但不限于:加速度传感器511、陀螺仪传感器512、压力传感器513、指纹传感器514、光学传感器515以及接近传感器516。
加速度传感器511可以检测以终端500建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器511可以用于检测重力加速度在三个坐标轴上的分量。处理器501可以根据加速度传感器511采集的重力加速度信号,控制触摸显示屏505以横向视图或纵向视图进行用户界面的显示。加速度传感器511还可以用于游戏或者用户的运动数据的采集。
陀螺仪传感器512可以检测终端500的机体方向及转动角度,陀螺仪传感器512可以与加速度传感器511协同采集用户对终端500的3D动作。处理器501根据陀螺仪传感器512采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。
压力传感器513可以设置在终端500的侧边框和/或触摸显示屏505的下层。当压力传感器513设置在终端500的侧边框时,可以检测用户对终端500的握持信号,由处理器501根据压力传感器513采集的握持信号进行左右手识别或快捷操作。当压力传感器513设置在触摸显示屏505的下层时,由处理器501根据用户对触摸显示屏505的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。
指纹传感器514用于采集用户的指纹,由处理器501根据指纹传感器514采集到的指纹识别用户的身份,或者,由指纹传感器514根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器501授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器514可以被设置终端500的正面、背面或侧面。当终端500上设置有物理按键或厂商Logo时,指纹传感器514可以与物理按键或厂商Logo集成在一起。
光学传感器515用于采集环境光强度。在一个实施例中,处理器501可以根据光学传感器515采集的环境光强度,控制触摸显示屏505的显示亮度。示例性地,当环境光强度较高时,调高触摸显示屏505的显示亮度;当环境光强度较低时,调低触摸显示屏505的显示亮度。在另一个实施例中,处理器501还可以根据光学传感器515采集的环境光强度,动态调整摄像头组件506的拍摄参数。
接近传感器516,也称距离传感器,通常设置在终端500的前面板。接近传感器516用于采集用户与终端500的正面之间的距离。在一个实施例中,当接近传感器516检测到用户与终端500的正面之间的距离逐渐变小时,由处理器501控制触摸显示屏505从亮屏状态切换为息屏状态;当接近传感器516检测到用户与终端500的正面之间的距离逐渐变大时,由处理器501控制触摸显示屏505从息屏状态切换为亮屏状态。
本领域技术人员可以理解,图5中示出的结构并不构成对终端500的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。
本申请实施例还提供了一种非临时性计算机可读存储介质,当所述存储介质中的指令由终端的处理器执行时,使得终端能够执行上述实施例提供的本体 建立方法。
本申请实施例还提供了一种包含指令的计算机程序产品,当其在终端上运行时,使得终端执行上述实施例提供的本体建立方法。
图6是本申请实施例提供的一种服务器结构示意图。该服务器可以是后台服务器集群中的服务器。
服务器600包括中央处理单元(CPU)601、包括随机存取存储器(RAM)602和只读存储器(ROM)603的系统存储器604,以及连接系统存储器604和中央处理单元601的系统总线605。服务器600还包括帮助计算机内的各个器件之间传输信息的基本输入/输出系统(I/O系统)606,和用于存储操作系统613、应用程序614和其他程序模块615的大容量存储设备607。
基本输入/输出系统606包括有用于显示信息的显示器608和用于用户输入信息的诸如鼠标、键盘之类的输入设备609。其中显示器608和输入设备609都通过连接到系统总线605的输入输出控制器610连接到中央处理单元601。基本输入/输出系统606还可以包括输入输出控制器610以用于接收和处理来自键盘、鼠标、或电子触控笔等多个其他设备的输入。类似地,输入输出控制器610还提供输出到显示屏、打印机或其他类型的输出设备。
大容量存储设备607通过连接到系统总线605的大容量存储控制器(未示出)连接到中央处理单元601。大容量存储设备607及其相关联的计算机可读介质为服务器600提供非易失性存储。也就是说,大容量存储设备607可以包括诸如硬盘或者CD-ROM驱动器之类的计算机可读介质(未示出)。
不失一般性,计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、EPROM、EEPROM、闪存或其他固态存储其技术,CD-ROM、DVD或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知计算机存储介质不局限于上述几种。上述的系统存储器604和大容量存储设备607可以统称为存储器。
根据本申请的各种实施例,服务器600还可以通过诸如因特网等网络连接到网络上的远程计算机运行。也即服务器600可以通过连接在系统总线605上的网络接口单元611连接到网络612,或者说,也可以使用网络接口单元611来 连接到其他类型的网络或远程计算机系统(未示出)。
上述存储器还包括一个或者一个以上的程序,一个或者一个以上程序存储于存储器中,被配置由CPU执行。所述一个或者一个以上程序包含用于进行上述实施例提供的本体建立方法的指令。
本申请实施例还提供了一种非临时性计算机可读存储介质,当所述存储介质中的指令由服务器的处理器执行时,使得移服务器能够执行上述实施例提供的本体建立方法。
本申请实施例还提供了一种包含指令的计算机程序产品,当其在服务器上运行时,使得服务器执行上述实施例提供的本体建立方法。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (26)

  1. 一种本体建立方法,其特征在于,所述方法包括:
    获取用于建立本体的至少一个文档,根据所述至少一个文档确定多个多元组,每个多元组包括两个第一类词语和一个第二类词语,所述第一类词语是指用于指示对象自身属性的词语,所述第二类词语是指用于指示不同对象之间的关联关系的词语;
    确定所述多个多元组中每个多元组中的两个第一类词语分别对应的两个概念,以及每个多个元组中的第二类词语对应的概念关系,采用确定的两个概念分别替换对应的两个第一类词语,采用确定的概念关系替换对应的第二类词语,得到多个语义关系数据组;
    根据所述多个语义关系数据组,建立针对所述至少一个文档的本体。
  2. 如权利要求1所述的方法,其特征在于,所述确定所述多个多元组中每个多元组中的两个第一类词语分别对应的两个概念,以及每个多元组中的第二类词语对应的概念关系,包括:
    对于所述多个多元组中的多元组A,从参考数据库中查找与所述多元组A中的两个第一类词语分别对应的两个概念,所述参考数据库包括多个词语中每个词语对应的概念以及不同概念之间的概念关系,所述多元组A为所述多个多元组中任一个;
    根据查找到的两个概念,从所述参考数据库中继续查找与所述多元组A中的第二类词语对应的概念关系。
  3. 如权利要求2所述的方法,其特征在于,所述从参考数据库中查找所述多元组A中的两个第一类词语分别对应的两个概念,包括:
    对于所述多元组A中两个第一类词语中的第一类词语B,确定所述至少一个文档中词义与所述第一类词语B的词义相同的词语,所述第一类词语B为所述两个第一类词语中任一个;
    如果所述至少一个文档中不存在词义与所述第一类词语B的词义相同的词语,则从所述参考数据库中查找所述第一类词语B对应的概念。
  4. 如权利要求3所述的方法,其特征在于,所述确定所述至少一个文档中词义与所述第一类词语B的词义相同的词语之后,还包括:
    如果所述至少一个文档中存在词义与所述第一类词语B的词义相同的词语,则确定所述第一类词语B,以及词义与所述第一类词语B的词义相同的词语分别在所述至少一个文档中的出现次数;
    从所述第一类词语B,以及词义与所述第一类词语B的词义相同的词语中,确定出现次数最大的词语;
    从所述参考数据库中查找所述出现次数最大的词语对应的概念,将查找到的概念作为所述第一类词语B对应的概念。
  5. 如权利要求3或4所述的方法,其特征在于,所述方法还包括:
    如果没有从所述参考数据库中查找到所述第一类词语B对应的概念,则通过潜在狄利克雷分布LDA算法为所述第一类词语B创建一个概念。
  6. 如权利要求2所述的方法,其特征在于,所述根据查找到的两个概念,从所述参考数据库中继续查找与所述多元组A中的第二类词语对应的概念关系,包括:
    从所述参考数据库中确定所述查找到的两个概念之间的路径,得到多条路径;
    根据所述多条路径的路径长度,从所述多条路径中选择一条目标路径,所述目标路径中包括至少一个概念关系;
    从所述至少一个概念关系中选择与所述多元组A中的第二类词语之间相似度最大的概念关系,将选择的概念关系确定为与所述多元组A中的第二类词语对应的概念关系。
  7. 如权利要求1所述的方法,其特征在于,所述根据所述多个语义关系数据组,建立针对所述至少一个文档的本体,包括:
    根据所述多个语义关系数据组,建立语义关系图,所述语义关系图中的一个结点对应所述多个语义关系组中的一个概念,所述语义关系图中两个结点之间的关系为对应的两个概念之间的概念关系,且所述两个结点之间的方向为对 应的两个概念之间的概念关系所指示的方向,每个结点配置有入度和出度,且每个结点的入度是指指向相应结点的其他结点的数量,每个结点的出度是指相应结点指向的其他结点的数量;
    对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪;
    当对所述语义关系图中所有入度等于0且出度大于0的第一结点均裁剪完时,将所述语义关系图中所有入度等于0且出度大于0的第一结点指向的其他结点的入度设置为0;
    对除已经裁剪的第一结点之外的其他结点,返回执行对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪的步骤,直至遍历完所述语音关系图中的所有结点,将最终得到的语义关系图作为针对所述至少一个文档建立的本体。
  8. 如权利要求7所述的方法,其特征在于,所述对所述第一结点进行裁剪,包括:
    确定所述语义关系图中的至少一个结点,所述至少一个结点对应的概念所指示的词语在所述至少一个文档中的文档位置与所述第一结点对应的概念所指示的词语在所述至少一个文档中的文档位置相邻;
    确定所述至少一个结点中与所述第一结点连接度最大的结点,删除所述至少一个结点中除确定出的结点之外的其他结点,以及所述其他结点与所述第一结点之间的关系,任意两个结点之间的连接度用于指示所述两个结点之间的关联程度。
  9. 如权利要求8所述的方法,其特征在于,所述确定所述至少一个结点中与所述第一结点连接度最大的结点,包括:
    基于第一公式确定所述至少一个结点中每个结点与所述第一结点之间的连接度;
    其中,所述第一公式为:
    Figure PCTCN2019122159-appb-100001
    所述Wi和所述Wj分别为用于确定连接度的两个结点,所述Sim(Wi,Wj)为结点Wi和结点Wj之间的相似度,所述Rel(Wi,Wj)为结点Wi和结点Wj之间的相关度,所述α和所述β分别为针对相似度配置的加权系数和针对相关 度配置的加权系数,所述α和所述β的和为1;
    根据按照所述第一公式确定的连接度,确定所述至少一个结点中与所述第一结点连接度最大的结点。
  10. 如权利要求9所述的方法,其特征在于,所述根据按照所述第一公式确定的连接度,确定所述至少一个结点中与所述第一结点连接度最大的结点,包括:
    如果按照所述第一公式确定的连接度中的最大连接度小于连接度阈值,则调整所述α和所述β的数值,得到更新之后的第一公式;
    基于更新之后的第一公式确定所述至少一个结点中每个结点与所述第一结点之间的连接度;
    如果按照所述更新之后的第一公式确定的连接度中的最大连接度小于所述连接度阈值,则返回执行调整所述α和所述β的数值的步骤,直至确定出的最大连接度大于或等于所述连接度阈值,将最后一次确定出的最大连接度对应的结点确定为所述至少一个结点中与所述第一结点连接度最大的结点。
  11. 如权利要求7所述的方法,其特征在于,所述对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪之前,还包括:
    如果所述语义关系图中存在入度等于0且出度也等于0的孤立结点,将所述孤立结点配置为指向所述语义关系图中的入度等于0且出度大于0的一个结点上,得到更新之后的语义关系图;
    基于更新之后的语义关系图,执行对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪的操作。
  12. 如权利要求1所述的方法,其特征在于,所述根据所述至少一个文档确定多个多元组,包括:
    对所述至少一个文档中每个文档进行分词处理,得到多个词语;
    确定所述多个词语中每个词语的词性;
    根据所述多个词语中每个词语的词性和每个词语在所述至少一个文档中的文档位置,确定所述多个多元组。
  13. 一种本体建立装置,其特征在于,所述装置包括:
    获取模块,用于获取用于建立本体的至少一个文档,根据所述至少一个文档确定多个多元组,每个多元组包括两个第一类词语和一个第二类词语,所述第一类词语是指用于指示对象自身属性的词语,所述第二类词语是指用于指示不同对象之间的关联关系的词语;
    确定模块,用于确定所述多个多元组中每个多元组中的两个第一类词语分别对应的两个概念,以及每个多个元组中的第二类词语对应的概念关系,采用确定的两个概念分别替换对应的两个第一类词语,采用确定的概念关系替换对应的第二类词语,得到多个语义关系数据组;
    建立模块,用于根据所述多个语义关系数据组,建立针对所述至少一个文档的本体。
  14. 如权利要求13所述的装置,其特征在于,所述确定模块包括:
    第一查找单元,用于对于所述多个多元组中的多元组A,从参考数据库中查找与所述多元组A中的两个第一类词语分别对应的两个概念,所述参考数据库包括多个词语中每个词语所代表的概念以及不同概念之间的概念关系,所述多元组A为所述多个多元组中任一个;
    第二查找单元,用于根据查找到的两个概念,从所述参考数据库中继续查找与所述多元组A中的第二类词语对应的概念关系。
  15. 如权利要求14所述的装置,其特征在于,所述第一查找单元,用于:
    对于所述多元组A中两个第一类词语中的第一类词语B,确定所述至少一个文档中词义与所述第一类词语B的词义相同的词语,所述第一类词语B为所述两个第一类词语中任一个;
    如果所述至少一个文档中不存在词义与所述第一类词语B的词义相同的词语,则从所述参考数据库中查找所述第一类词语B对应的概念。
  16. 如权利要求15所述的装置,其特征在于,所述第一查找单元,还用于:
    如果所述至少一个文档中存在词义与所述第一类词语B的词义相同的词语, 则确定所述第一类词语B,以及词义与所述第一类词语B的词义相同的词语分别在所述至少一个文档中的出现次数;
    从所述第一类词语B,以及词义与所述第一类词语B的词义相同的词语中,确定出现次数最大的词语;
    从所述参考数据库中查找所述出现次数最大的词语对应的概念,并将查找到的概念作为所述第一类词语B对应的概念。
  17. 如权利要求15或16所述的装置,其特征在于,所述装置还包括:
    创建单元,用于如果没有从所述参考数据库中查找到所述第一类词语B对应的概念,则通过潜在狄利克雷分布LDA算法为所述第一类词语B创建一个概念。
  18. 如权利要求14所述的装置,其特征在于,所述第二查找单元,用于:
    从所述参考数据库中确定所述查找到的两个概念之间的路径,得到多条路径;
    根据所述多条路径的路径长度,从所述多条路径中选择一条目标路径,所述目标路径中包括至少一个概念关系;
    从所述至少一个概念关系中选择与所述多元组A中的第二类词语之间相似度最大的概念关系,将选择的概念关系确定为与所述多元组A中的第二类词语对应的概念关系。
  19. 如权利要求13所述的装置,其特征在于,所述建立模块包括:
    建立单元,用于根据所述多个语义关系数据组,建立语义关系图,所述语义关系图中的一个结点对应所述多个语义关系组中的一个概念,所述语义关系图中两个结点之间的关系为对应的两个概念之间的概念关系,且所述两个结点之间的方向为对应的两个概念之间的概念关系所指示的方向,每个结点配置有入度和出度,且每个结点的入度是指指向相应结点的其他结点的数量,每个结点的出度是指相应结点指向的其他结点的数量;
    裁剪单元,用于对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪;
    设置单元,用于当对所述语义关系图中所有入度等于0且出度大于0的第一结点均裁剪完时,将所述语义关系图中所有入度等于0且出度大于0的第一结点指向的其他结点的入度设置为0;
    所述裁剪单元,还用于对除已经裁剪的第一结点之外的其他结点,返回执行对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪的步骤,直至遍历完所述语音关系图中的所有结点,将最终得到的语义关系图作为针对所述至少一个文档建立的本体。
  20. 如权利要求19所述的装置,其特征在于,所述裁剪单元,用于:
    确定所述语义关系图中的至少一个结点,所述至少一个结点对应的概念所指示的词语在所述至少一个文档中的文档位置与所述第一结点对应的概念所指示的词语在所述至少一个文档中的文档位置相邻;
    确定所述至少一个结点中与所述第一结点连接度最大的结点,删除所述至少一个结点中除确定出的结点之外的其他结点,以及所述其他结点与所述第一结点之间的关系,任意两个结点之间的连接度用于指示所述两个结点之间的关联程度。
  21. 如权利要求20所述的装置,其特征在于,所述裁剪单元,还用于:
    基于第一公式确定所述至少一个结点中每个结点与所述第一结点之间的连接度;
    其中,所述第一公式为:
    Figure PCTCN2019122159-appb-100002
    所述Wi和所述Wj分别为用于确定连接度的两个结点,所述Sim(Wi,Wj)为结点Wi和结点Wj之间的相似度,所述Rel(Wi,Wj)为结点Wi和结点Wj之间的相关度,所述α和所述β分别为针对相似度配置的加权系数和针对相关度配置的加权系数,所述α和所述β的和为1;
    根据按照所述第一公式确定的连接度,确定所述至少一个结点中与所述第一结点连接度最大的结点。
  22. 如权利要求21所述的装置,其特征在于,所述裁剪单元,还用于:
    如果按照所述第一公式确定的连接度中的最大连接度小于连接度阈值,则 调整所述α和所述β的数值,得到更新之后的第一公式;
    基于更新之后的第一公式确定所述至少一个结点中每个结点与所述第一结点之间的连接度;
    如果按照所述更新之后的第一公式确定的连接度中的最大连接度小于所述连接度阈值,则返回执行调整所述α和所述β的数值的步骤,直至确定出的最大连接度大于或等于所述连接度阈值,将最后一次确定出的最大连接度对应的结点确定为所述至少一个结点中与所述第一结点连接度最大的结点。
  23. 如权利要求19所述的装置,其特征在于,所述建立模块还包括:
    配置单元,用于如果所述语义关系图中存在入度等于0且出度也等于0的孤立结点,将所述孤立结点配置为指向所述语义关系图中的入度等于0且出度大于0的一个结点上,得到更新之后的语义关系图;
    所述裁剪单元,还用于基于更新之后的语义关系图,执行对于入度等于0且出度大于0的任一第一结点,对所述第一结点进行裁剪的操作。
  24. 如权利要求13所述的装置,其特征在于,所述获取模块包括:
    分词处理单元,用于对所述至少一个文档中每个文档进行分词处理,得到多个词语;
    第一确定单元,用于确定所述多个词语中每个词语的词性;
    第二确定单元,用于根据所述多个词语中每个词语的词性和每个词语在所述至少一个文档中的文档位置,确定所述多个多元组。
  25. 一种本体建立装置,其特征在于,所述装置包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为执行上述权利要求1至权利要求12中的任一项权利要求所述的方法的步骤。
  26. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有指令,所述指令被处理器执行时实现上述权利要求1至权利要求12中的 任一项权利要求所述的方法的步骤。
PCT/CN2019/122159 2018-11-30 2019-11-29 本体建立方法、装置及存储介质 Ceased WO2020108641A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811459195.0 2018-11-30
CN201811459195.0A CN111259161B (zh) 2018-11-30 2018-11-30 本体建立方法、装置及存储介质

Publications (1)

Publication Number Publication Date
WO2020108641A1 true WO2020108641A1 (zh) 2020-06-04

Family

ID=70852655

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/122159 Ceased WO2020108641A1 (zh) 2018-11-30 2019-11-29 本体建立方法、装置及存储介质

Country Status (2)

Country Link
CN (1) CN111259161B (zh)
WO (1) WO2020108641A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040054672A1 (en) * 2002-09-03 2004-03-18 International Business Machines Corporation Information search support system, application server, information search method, and program product
CN101681353A (zh) * 2007-03-30 2010-03-24 纽科股份有限公司 用于知识导航和发现的数据结构、系统和方法
CN101710343A (zh) * 2009-12-11 2010-05-19 北京中机科海科技发展有限公司 一种基于文本挖掘的本体自动构建系统及方法
CN103207856A (zh) * 2013-04-03 2013-07-17 同济大学 一种本体概念及层次关系生成方法
CN106445990A (zh) * 2016-06-25 2017-02-22 上海大学 事件本体构建方法
CN108491385A (zh) * 2018-03-16 2018-09-04 广西师范大学 一种基于依存关系的教学领域本体自动生成方法与装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040054672A1 (en) * 2002-09-03 2004-03-18 International Business Machines Corporation Information search support system, application server, information search method, and program product
CN101681353A (zh) * 2007-03-30 2010-03-24 纽科股份有限公司 用于知识导航和发现的数据结构、系统和方法
CN101710343A (zh) * 2009-12-11 2010-05-19 北京中机科海科技发展有限公司 一种基于文本挖掘的本体自动构建系统及方法
CN103207856A (zh) * 2013-04-03 2013-07-17 同济大学 一种本体概念及层次关系生成方法
CN106445990A (zh) * 2016-06-25 2017-02-22 上海大学 事件本体构建方法
CN108491385A (zh) * 2018-03-16 2018-09-04 广西师范大学 一种基于依存关系的教学领域本体自动生成方法与装置

Also Published As

Publication number Publication date
CN111259161B (zh) 2022-02-08
CN111259161A (zh) 2020-06-09

Similar Documents

Publication Publication Date Title
CN109918669B (zh) 实体确定方法、装置及存储介质
WO2020224222A1 (zh) 目标群组检测方法、装置、计算机设备及存储介质
CN110807325B (zh) 谓词识别方法、装置及存储介质
CN113222771B (zh) 一种基于知识图谱确定目标群体的方法、装置及电子设备
CN113569042B (zh) 文本信息分类方法、装置、计算机设备及存储介质
CN110837557B (zh) 摘要生成方法、装置、设备及介质
CN114706846B (zh) 查询数据的方法、装置、设备及存储介质
WO2022057435A1 (zh) 基于搜索的问答方法及存储介质
CN111061803A (zh) 任务处理方法、装置、设备及存储介质
CN111324699A (zh) 语义匹配的方法、装置、电子设备及存储介质
CN113032587B (zh) 多媒体信息推荐方法、系统、装置、终端和服务器
CN109917988B (zh) 选中内容显示方法、装置、终端及计算机可读存储介质
CN109902089B (zh) 利用异构索引的查询方法、装置、电子设备及介质
CN111475611B (zh) 词典管理方法、装置、计算机设备及存储介质
CN113783909B (zh) 数据需求的生成方法、装置、终端、服务器及存储介质
WO2021218634A1 (zh) 内容推送
CN114283049B (zh) 图像处理方法、装置、计算机设备及存储介质
CN113704448B (zh) 模型训练方法、文本推送方法、装置、计算机设备及介质
CN111597823A (zh) 中心词提取方法、装置、设备及存储介质
CN112000900A (zh) 推荐景点信息的方法、装置、电子设备及存储介质
CN113947687B (zh) 档案生成方法、装置及存储介质
CN111984738A (zh) 数据关联方法、装置、设备及存储介质
WO2020108641A1 (zh) 本体建立方法、装置及存储介质
CN117591746A (zh) 资源推荐方法、装置、计算机设备及存储介质
CN109918566B (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: 19891189

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: 19891189

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19891189

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 01.12.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19891189

Country of ref document: EP

Kind code of ref document: A1