Resource data display method based on knowledge graph and related equipment
Through a knowledge graph-based method, a keyword database is constructed and entities and relationships are identified, the problem of inefficient resource data display in the existing technology is solved, and efficient resource data display and visualization are achieved.
Patent Information
- Application Number
- CN202411372721.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-18
AI Technical Summary
The existing resource data display methods cannot effectively process a large number of complex resource data, resulting in inefficient display.
Using a resource data display method based on knowledge graph, a keyword database is constructed, entities and relationships are identified, and visual resource data is finally generated through semantic association algorithms and fragment recursion algorithms.
It improves the efficiency of resource data display, can quickly understand the connections between relevant entities, and enhances the visualization and understanding of data.
Smart Images

Figure CN119476275A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a resource data display method based on a knowledge graph and related equipment. Background Art
[0002] The data types of resource data are diverse. When faced with numerous and complex resource data, how to ensure the reasonable display of resource data becomes an important issue.
[0003] However, the existing resource data display methods cannot cope with the large amount of resource data, which seriously affects the display efficiency of resource data. Summary of the invention
[0004] In view of this, the purpose of this application is to propose a resource data display method and related equipment based on knowledge graph to solve the above technical problems.
[0005] Based on the above objectives, the first aspect of the present application provides a resource data display method based on a knowledge graph, comprising:
[0006] Acquire text data corresponding to a target task, wherein the text data includes a plurality of vocabulary segments;
[0007] filtering the plurality of vocabulary segments to obtain a plurality of filtered vocabulary segments;
[0008] Determining semantic similarities between the plurality of filtered vocabulary segments by a semantic association algorithm, and constructing a keyword database corresponding to the plurality of filtered vocabulary segments based on the semantic similarities;
[0009] Using a fragment recursive algorithm to perform entity recognition on the keyword database to obtain multiple keyword entities;
[0010] Perform entity relationship recognition on multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities;
[0011] A knowledge graph is constructed based on the multiple keyword entities and the entity relationships corresponding to the multiple keyword entities, resource data of the target task is generated according to the knowledge graph, and the resource data is visualized.
[0012] Optionally, filtering the multiple vocabulary segments to obtain multiple filtered vocabulary segments includes:
[0013] Counting two adjacent vocabulary segments having the same word length and a preset number of consecutive words and / or characters in the plurality of vocabulary segments, wherein the two adjacent vocabulary segments include a first vocabulary segment and a second vocabulary segment;
[0014] The following operations are performed on each pair of two adjacent vocabulary fragments to obtain multiple filtered vocabulary fragments:
[0015] Obtaining the word frequency of the first vocabulary segment and the word frequency of the second vocabulary segment;
[0016] In response to the word frequency of the first vocabulary segment being less than the word frequency of the second vocabulary segment, filtering the first vocabulary segment from the plurality of vocabulary segments; or,
[0017] In response to the word frequency of the first vocabulary segment being equal to the word frequency of the second vocabulary segment, filtering the first vocabulary segment and the second vocabulary segment from a plurality of vocabulary segments; or,
[0018] In response to the word frequency of the first vocabulary segment being greater than the word frequency of the second vocabulary segment, the second vocabulary segment is filtered from the plurality of vocabulary segments.
[0019] Optionally, filtering the multiple vocabulary segments to obtain multiple filtered vocabulary segments includes:
[0020] Determining a sub-lexical string in each lexical segment and a parent lexical string corresponding to the sub-lexical string;
[0021] For each sub-vocabulary string and the parent vocabularies string corresponding to the sub-vocabulary string, the following operations are performed to obtain multiple filtered vocabularies fragments:
[0022] Obtaining the word length of the parent vocabulary string, the word length of the child vocabulary string, the word length of the vocabulary fragment, the word frequency of the parent vocabulary string, the word frequency of the child vocabulary string, and the word frequency of the vocabulary fragment;
[0023] Determining an absolute value of a word length difference based on the word length of the parent vocabulary string and the word length of the child vocabulary string;
[0024] Determining an absolute value of a word frequency difference based on a word frequency of the parent word string and a word frequency of the child word string;
[0025] In response to the difference between the word frequency of the vocabulary segment and the word frequency of the parent vocabulary string being greater than the absolute value of the word frequency difference, filtering the parent vocabulary string and retaining the vocabulary segment; or
[0026] In response to the difference between the word frequency of the vocabulary segment and the word frequency of the parent vocabulary string being less than or equal to the absolute value of the word frequency difference, filtering the vocabulary segment and retaining the parent vocabulary string; or,
[0027] In response to the difference between the word length of the parent vocabulary string and the word length of the vocabulary fragment being less than or equal to the absolute value of the word length difference, filtering the parent vocabulary string and retaining the vocabulary fragment; or
[0028] In response to the difference between the word length of the parent vocabulary string and the word length of the vocabulary fragment being greater than the absolute value of the word length difference, filtering the vocabulary fragment and retaining the parent vocabulary string; or
[0029] In response to the difference between the word frequency of the sub-lexical string and the word frequency of the lexical fragment being less than or equal to the absolute value of the word frequency difference, filtering the sub-lexical string and retaining the lexical fragment; or
[0030] In response to the difference between the word frequency of the sub-lexical string and the word frequency of the lexical fragment being greater than the absolute value of the word frequency difference, filtering the lexical fragment and retaining the sub-lexical string; or
[0031] In response to the difference between the word length of the vocabulary segment and the word length of the sub-lexical string being less than or equal to the absolute value of the word length difference, filtering the vocabulary segment and retaining the sub-lexical string; or,
[0032] In response to the difference between the word length of the vocabulary segment and the word length of the sub-vocabulary string being greater than the absolute value of the word length difference, the sub-vocabulary string is filtered and the vocabulary segment is retained.
[0033] Optionally, determining the semantic similarity between the plurality of filtered vocabulary segments by a semantic association algorithm includes:
[0034] taking any filtered vocabulary segment among the plurality of filtered vocabulary segments as a target vocabulary segment;
[0035] Determine a word vector w1 of the target vocabulary segment and a word vector w2 of any other vocabulary segment among the plurality of filtered vocabulary segments except the target vocabulary segment;
[0036] The semantic similarity (w1, w2) is determined based on w1 and w2 by the following formula:
[0037]
[0038] Optionally, constructing a keyword database corresponding to a plurality of filtered vocabulary segments based on the semantic similarity includes:
[0039] Sorting the semantic similarities between the target vocabulary segment and each other vocabulary segment according to a preset sorting rule to obtain a sorting result;
[0040] The keyword database is constructed based on the ranking results.
[0041] Optionally, the fragment recursive algorithm is used to perform entity recognition on the keyword database to obtain multiple keyword entities, including:
[0042] Perform word embedding processing on multiple keyword data in the keyword database to obtain keyword vectors corresponding to the multiple keyword data;
[0043] Perform feature extraction on multiple keyword vectors to obtain keyword features corresponding to the multiple keyword vectors;
[0044] Based on multiple keyword features, probability prediction is performed through conditional random fields to obtain multiple keyword entities.
[0045] Optionally, the performing entity relationship recognition on the multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities includes:
[0046] Add multiple keyword entities as variable nodes to the pre-constructed initial factor graph, and determine the candidate entity relationships between the multiple keyword entities;
[0047] Determining factor nodes according to the entity relationships to be selected between the multiple keyword entities, and determining the link relationship between the factor nodes and the variable nodes, the factor nodes representing the interaction and / or dependency relationship between the multiple keyword entities;
[0048] Performing undirected connection processing on the factor nodes and the variable nodes to obtain a target factor graph;
[0049] Based on the target factor graph, edge probability processing is performed on the candidate entity relationships between the keyword entities to obtain edge probabilities corresponding to the candidate entity relationships;
[0050] The entity relationship is determined according to the marginal probability corresponding to each candidate entity relationship.
[0051] Based on the same inventive concept, the second aspect of the present application provides a resource data display device based on a knowledge graph, comprising:
[0052] An acquisition module is configured to acquire text data corresponding to a target task, wherein the text data includes a plurality of vocabulary segments;
[0053] A filtering module, configured to filter the plurality of vocabulary segments to obtain a plurality of filtered vocabulary segments;
[0054] A database construction module is configured to determine the semantic similarity between the plurality of filtered vocabulary segments through a semantic association algorithm, and to construct a keyword database corresponding to the plurality of filtered vocabulary segments based on the semantic similarity;
[0055] An entity recognition module is configured to perform entity recognition on the keyword database using a fragment recursive algorithm to obtain a plurality of keyword entities;
[0056] An entity relationship recognition module is configured to perform entity relationship recognition on multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities;
[0057] The resource data display module is configured to construct a knowledge graph based on the multiple keyword entities and the entity relationships corresponding to the multiple keyword entities, generate resource data of the target task according to the knowledge graph, and visualize the resource data.
[0058] Based on the same inventive concept, the third aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method described in the first aspect above when executing the computer program.
[0059] Based on the same inventive concept, the fourth aspect of the present application provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the method described in the first aspect above.
[0060] From the above, it can be seen that the resource data display method and related equipment based on the knowledge graph provided by the present application determine the semantic similarity between multiple filtered vocabulary fragments through a semantic association algorithm, and construct a keyword database corresponding to the multiple filtered vocabulary fragments based on the semantic similarity, and then use the fragment recursive algorithm to perform entity recognition on the keyword database to obtain multiple keyword entities, and then perform entity relationship recognition on the multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities. Finally, based on the multiple keyword entities and the entity relationships corresponding to the multiple keyword entities, a knowledge graph is constructed. The use of the knowledge graph can quickly understand the relationship between related entities, and then the resource data of the target task is generated according to the knowledge graph and the visual display is performed to improve the display efficiency of the resource data. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0062] Figure 1 This is a flowchart of a method for displaying resource data based on a knowledge graph according to an embodiment of the present application;
[0063] Figure 2 This is a structural block diagram of a resource data display device based on a knowledge graph according to an embodiment of the present application;
[0064] Figure 3 Schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0065] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0066] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0067] It is understandable that before using the technical solutions of each embodiment of the present application, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.
[0068] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to the electronic device, application, server, storage medium or other software or hardware that performs the operation of the technical solution of the present application according to the prompt message.
[0069] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0070] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation method of this application. Other methods that meet relevant laws and regulations may also be applied to the implementation method of this application.
[0071] An embodiment of the present application provides a resource data display method based on a knowledge graph, which determines the semantic similarity between multiple filtered vocabulary fragments through a semantic association algorithm, and constructs a keyword database corresponding to the multiple filtered vocabulary fragments based on the semantic similarity, then uses a fragment recursive algorithm to perform entity recognition on the keyword database to obtain multiple keyword entities, then performs entity relationship recognition on the multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities, and finally constructs a knowledge graph based on the multiple keyword entities and the entity relationships corresponding to the multiple keyword entities. The knowledge graph can be used to quickly understand the connections between related entities, and then the resource data of the target task is generated according to the knowledge graph and visualized for display, which can improve the display efficiency of the resource data.
[0072] like Figure 1 As shown, the method of this embodiment includes:
[0073] Step 101: Acquire text data corresponding to a target task, wherein the text data includes a plurality of vocabulary segments.
[0074] In this step, the target task represents the work to be completed or the problem to be solved, which determines the type of text data that needs to be collected when performing the target task or generated. For example, if the target task is to perform sentiment analysis on literature in a certain field, then the text data that needs to be obtained should be comments and articles in the field that contain sentiment.
[0075] Text data consists of a series of vocabulary fragments, which are the smallest units that make up text. They can be words, phrases, symbols, etc. In the text processing process, it is usually necessary to perform operations such as word segmentation (i.e., dividing continuous text into independent vocabulary fragments), part-of-speech tagging (identifying the part of speech of each vocabulary fragment, such as nouns, verbs, etc.), and named entity recognition (identifying specific entities in the text, such as names of people, places, etc.) on these vocabulary fragments for further analysis and processing.
[0076] Step 102: Filter the multiple vocabulary segments to obtain multiple filtered vocabulary segments.
[0077] In this step, multiple vocabulary segments refer to the basic units into which the text data is decomposed, which can be words, phrases, symbols, or character strings recognized according to specific rules. These vocabulary segments are the basis for subsequent processing and analysis.
[0078] By filtering multiple word segments, it is possible to decide which word segments to keep and which to remove based on predefined rules or conditions. These rules can be based on a variety of factors, such as the length of the word segment, the frequency of occurrence, the semantic meaning, whether it contains specific characters or patterns, etc.
[0079] After the filtering step, part of the original vocabulary fragment set is retained to form a new, filtered vocabulary fragment set. This set is usually purer and more targeted, which helps to improve the efficiency and accuracy of subsequent analysis or processing.
[0080] Step 103: determine the semantic similarity between the multiple filtered vocabulary segments through a semantic association algorithm, and construct a keyword database corresponding to the multiple filtered vocabulary segments based on the semantic similarity.
[0081] In this step, the semantic association algorithm is the key to understanding the deep meaning connection between vocabulary fragments. It can analyze the context, meaning, usage and relationship between vocabulary fragments (such as synonyms, antonyms, hyponyms, etc.).
[0082] Semantic association algorithms include algorithms based on vector space models (such as TF-IDF, Word2Vec, BERT, etc.), which map vocabulary fragments to vectors in a high-dimensional space and can evaluate the semantic similarity between vocabulary fragments by calculating the distance or similarity between vectors.
[0083] Based on the semantic similarity, the similarity scores between the filtered word segments can be calculated, and this score reflects the semantic proximity of the word segments.
[0084] The calculation method of similarity score varies from algorithm to algorithm, but is usually based on the position relationship of vocabulary fragments in semantic space (such as Euclidean distance, cosine similarity, etc.).
[0085] Based on the calculated semantic similarity scores, word segments with similar or related meanings can be organized together to form keyword groups or topics.
[0086] These groups or topics can be further indexed, categorized, and stored to build a structured keyword database.
[0087] Each keyword or keyword group in the database may be accompanied by relevant meta-information, such as frequency of occurrence, contextual information, other associated keywords, etc., to facilitate subsequent query, analysis and application.
[0088] The constructed keyword database can be applied to a variety of scenarios, such as text classification, information retrieval, recommendation system, sentiment analysis, etc.
[0089] With the continuous addition of new data and continuous optimization of algorithms, the keyword database can be continuously updated and expanded to adapt to changing needs and environments, which helps to better understand and utilize the information in text data.
[0090] Step 104: perform entity recognition on the keyword database using a fragment recursive algorithm to obtain a plurality of keyword entities.
[0091] In this step, the keyword database is a collection that stores a large number of keywords, which can be high-frequency words in text data, terms in specific fields, or user-defined keywords, etc. They are usually used in various natural language processing (NLP) tasks such as search, information retrieval, text classification, and sentiment analysis.
[0092] Entity recognition, also known as named entity recognition (NER), is an important task in NLP. Its goal is to identify entities with specific meanings in text, such as names of people, places, organizations, time expressions, quantity expressions, etc. These entities are crucial for understanding text content, building knowledge graphs, question-answering systems, and other applications.
[0093] A fragment recursive algorithm is a recursive method for processing strings or text fragments. It can be used to solve problems involving text segmentation, pattern matching, substructure extraction, etc. In the context of entity recognition, a fragment recursive algorithm may be used to recursively analyze each fragment (which can be a word, phrase, or sentence) in the text to identify the parts that match a specific entity pattern.
[0094] In the process of entity recognition using the fragment recursive algorithm, the algorithm traverses the keyword data in the keyword database. For each data, the algorithm checks whether it conforms to the predefined entity pattern (these patterns may be defined based on regular expressions, machine learning models, or other rules). If the fragment conforms to the pattern of an entity, it will be recognized as an entity and output as a result.
[0095] Multiple keyword entities can be identified from the keyword database. These entities can be entities explicitly mentioned in this application or implicit entities inferred from context or patterns. Each entity will be assigned a type label (such as a person's name, place name, etc.) to facilitate subsequent processing and analysis.
[0096] Step 105 , performing entity relationship recognition on the multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities.
[0097] In this step, entity relation extraction is to identify the semantic relations between two or more entities from the given multiple keyword entities. Entity relations describe a certain connection or attribute between these entities, such as "birthplace", "located in", etc.
[0098] Multiple keyword entities and entity relationships corresponding to multiple keyword entities help to gain a deeper understanding of the semantic content of text data.
[0099] Step 106: construct a knowledge graph based on the multiple keyword entities and the entity relationships corresponding to the multiple keyword entities, generate resource data of the target task according to the knowledge graph, and visualize the resource data.
[0100] In this step, the knowledge graph is a structured knowledge base that displays entities and their relationships in the form of a graph. In the graph, nodes represent entities and edges represent the relationships between entities.
[0101] Integrate the extracted keyword entities and their entity relationships into the knowledge graph to form a structured knowledge network. This process may involve steps such as data cleaning, deduplication, fusion, and graph structure optimization. The knowledge graph can quickly understand the connections between related entities.
[0102] Resource data refers to the data set or dataset required for a specific target task (such as decision support, information retrieval, intelligent question answering, etc.). Its generation process can be based on the constructed knowledge graph, extracting, integrating and transforming relevant data according to the needs of the target task, and generating resource data that meets the task requirements. This process may involve a variety of data processing technologies such as data query, data aggregation, and data conversion, which can improve the display efficiency of resource data.
[0103] The data is then intuitively displayed in the form of graphics, images, etc. through visualization techniques (such as charts, graphs, maps, etc.), which helps users quickly obtain the required information and improve decision-making efficiency and accuracy.
[0104] Through the above scheme, the semantic similarity between multiple filtered vocabulary fragments is determined by a semantic association algorithm, and a keyword database corresponding to the multiple filtered vocabulary fragments is constructed based on the semantic similarity. Then, the keyword database is subjected to entity recognition using a fragment recursive algorithm to obtain multiple keyword entities. Subsequently, entity relationship recognition is performed on the multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities. Finally, a knowledge graph is constructed based on the multiple keyword entities and the entity relationships corresponding to the multiple keyword entities. The knowledge graph can be used to quickly understand the connections between related entities, and then the resource data of the target task is generated according to the knowledge graph and visualized, which can improve the display efficiency of the resource data.
[0105] In some embodiments, step 102 includes:
[0106] Step A1, counting two adjacent vocabulary segments having the same word length and a preset number of consecutive words and / or characters in the plurality of vocabulary segments, wherein the two adjacent vocabulary segments include a first vocabulary segment and a second vocabulary segment.
[0107] Step A2, performing the following operations on each pair of two adjacent vocabulary segments to obtain a plurality of filtered vocabulary segments:
[0108] Step A21, obtaining the word frequency of the first vocabulary segment and the word frequency of the second vocabulary segment.
[0109] Step A22: In response to the word frequency of the first vocabulary segment being less than the word frequency of the second vocabulary segment, filtering the first vocabulary segment from the plurality of vocabulary segments. Or,
[0110] Step A23: In response to the word frequency of the first vocabulary segment being equal to the word frequency of the second vocabulary segment, filtering the first vocabulary segment and the second vocabulary segment from a plurality of vocabulary segments. Or,
[0111] Step A24: in response to the word frequency of the first vocabulary segment being greater than the word frequency of the second vocabulary segment, filtering the second vocabulary segment from a plurality of vocabulary segments.
[0112] In the above scheme, first, adjacent and similar vocabulary segments are counted: all vocabulary segments are traversed to find pairs of adjacent vocabulary segments with the same word length and the same preset number of consecutive words and / or characters. Here, "adjacent" means that these vocabulary segments appear consecutively in the original data; "same word length" means that the number of words or characters contained in the vocabulary segments is the same; "same preset number of consecutive words and / or characters" is a threshold condition used to determine whether two vocabulary segments are similar enough, such as the first three consecutive words or characters are the same.
[0113] The word segments are then compared and filtered: for each pair of such adjacent word segments (called the first word segment and the second word segment), the method obtains their word frequencies, that is, the number of times they appear in the text.
[0114] Next, compare the two vocabulary segments based on their word frequency and decide which one (or which ones) should be filtered out:
[0115] If the word frequency of the first vocabulary segment is less than the word frequency of the second vocabulary segment, the first vocabulary segment is filtered out from the vocabulary segment set. This is because, in most cases, the vocabulary segment with a higher word frequency may be more representative or more commonly used.
[0116] If two lexical fragments have equal frequency, both of them are filtered out from the lexical fragment set. This is because the fact that they appear at the same frequency may mean that they can be used interchangeably or that they are not very discriminative in this particular text analysis task.
[0117] If the word frequency of the first vocabulary segment is greater than the word frequency of the second vocabulary segment, the second vocabulary segment is filtered out from the vocabulary segment set, and the first vocabulary segment with a higher word frequency is retained.
[0118] The present application can achieve that the original vocabulary segment set is filtered, and only those vocabulary segments that win in different word frequency comparisons are retained, or in some cases, redundant vocabulary segments with equal word frequencies are removed at the same time. Such a filtering process helps to reduce the redundancy of vocabulary segments and improve the efficiency and accuracy of subsequent text processing or analysis.
[0119] In some embodiments, step 102 includes:
[0120] Step B1, determining the sub-lexical strings in each lexical segment and the parent lexical strings corresponding to the sub-lexical strings.
[0121] Step B2: For each sub-lexical string and the parent lexical string corresponding to the sub-lexical string, the following operations are performed to obtain a plurality of filtered lexical segments:
[0122] Step B21, obtaining the word length of the parent vocabulary string, the word length of the child vocabulary string, the word length of the vocabulary segment, the word frequency of the parent vocabulary string, the word frequency of the child vocabulary string and the word frequency of the vocabulary segment.
[0123] Step B22, determining the absolute value of the word length difference based on the word length of the parent word string and the word length of the child word string;
[0124] Step B23, determining the absolute value of the word frequency difference based on the word frequency of the parent word string and the word frequency of the child word string.
[0125] Step B24, in response to the difference between the word frequency of the vocabulary segment and the word frequency of the parent vocabulary string being greater than the absolute value of the word frequency difference, filtering the parent vocabulary string and retaining the vocabulary segment. Or,
[0126] Step B25, in response to the difference between the word frequency of the vocabulary segment and the word frequency of the parent vocabulary string being less than or equal to the absolute value of the word frequency difference, filtering the vocabulary segment and retaining the parent vocabulary string.
[0127] or,
[0128] Step B26, in response to the difference between the word length of the parent vocabulary string and the word length of the vocabulary fragment being less than or equal to the absolute value of the word length difference, filtering the parent vocabulary string and retaining the vocabulary fragment.
[0129] or,
[0130] Step B27, in response to the difference between the word length of the parent vocabulary string and the word length of the vocabulary segment being greater than the absolute value of the word length difference, filtering the vocabulary segment and retaining the parent vocabulary string. Or,
[0131] Step B28, in response to the difference between the word frequency of the sub-lexical string and the word frequency of the lexical fragment being less than or equal to the absolute value of the word frequency difference, filtering the sub-lexical string and retaining the lexical fragment.
[0132] or,
[0133] Step B29, in response to the difference between the word frequency of the sub-lexical string and the word frequency of the lexical segment being greater than the absolute value of the word frequency difference, filtering the lexical segment and retaining the sub-lexical string. Or,
[0134] Step B210, in response to the difference between the word length of the vocabulary segment and the word length of the sub-lexical string being less than or equal to the absolute value of the word length difference, filtering the vocabulary segment and retaining the sub-lexical string.
[0135] or,
[0136] Step B211, in response to the difference between the word length of the vocabulary segment and the word length of the sub-lexical string being greater than the absolute value of the word length difference, filtering the sub-lexical string and retaining the vocabulary segment.
[0137] In the above scheme, the parent-child relationship is first determined: for each vocabulary segment, its possible child vocabulary strings and parent vocabulary strings need to be determined. The child vocabulary string is a subset of the vocabulary segment, while the parent vocabulary string is a larger vocabulary that contains the vocabulary segment.
[0138] For each vocabulary segment, its child vocabulary strings, and its parent vocabulary string, the following statistics need to be obtained:
[0139] The word length (i.e., the number of characters in the word), the word frequency (i.e., the number of times the word appears in the data set), and the difference are calculated, where the difference is calculated as follows:
[0140] Absolute value of word length difference: Calculate the difference between the length of the parent word string and the length of the child word string, and take its absolute value.
[0141] Absolute value of frequency difference: Calculate the difference between the frequency of the parent string and the frequency of the child string, and take its absolute value.
[0142] Based on the above information, a series of conditions are used to decide whether to keep or filter a word fragment, sub-word string or parent word string. These conditions include:
[0143] If the difference between the word frequency of the lexical fragment and the word frequency of the parent lexical string is greater than the absolute value of the word frequency difference, the parent lexical string is filtered and the lexical fragment is retained. This indicates that the lexical fragment is more independent or more commonly used in frequency.
[0144] If the difference between the word frequency of the word segment and the word frequency of the parent word string is less than or equal to the absolute value of the word frequency difference, the word segment is filtered and the parent word string is retained. This means that the parent word string is more representative in frequency.
[0145] Similarly, a lexical fragment is compared with its sublexical string based on the difference in word length and word frequency to decide which one to keep.
[0146] These conditions ensure that lexical segments are retained based on their relative length and frequency with respect to the parent and child lexical strings, helping to select lexical segments that best meet specific conditions.
[0147] Finally, a plurality of filtered lexical fragments are outputted, which have specific advantages or characteristics in word length and word frequency relative to their child lexical strings and parent lexical strings.
[0148] This process is very useful in fields such as text processing, natural language processing, and information retrieval, and can help improve the accuracy and efficiency of vocabulary processing.
[0149] In some embodiments, in step 103, determining the semantic similarity between the plurality of filtered vocabulary segments by a semantic association algorithm includes:
[0150] Step C1: taking any filtered vocabulary segment among the plurality of filtered vocabulary segments as a target vocabulary segment.
[0151] Step C2, determining the word vector w1 of the target vocabulary segment and the word vector w2 of any other vocabulary segment among the multiple filtered vocabulary segments except the target vocabulary segment.
[0152] Step C3, based on w1 and w2, determine the semantic similarity similarity(w1, w2) by the following formula:
[0153]
[0154] In the above scheme, among the multiple filtered vocabulary segments, a vocabulary segment is first selected as a "target vocabulary segment". This selection can be random or based on a specific rule or condition.
[0155] For the selected target vocabulary segment, a word vector technology (such as Word2Vec, GloVe, BERT, etc.) is used to determine its corresponding word vector. The word vector is a numerical vector that represents the position of the word in the semantic space.
[0156] Similarly, for each of the other vocabulary segments except the target vocabulary segment, the same word embedding technique is used to determine their respective word embeddings.
[0157] Next, a similarity measurement method (such as Euclidean distance, etc.) is used to calculate the similarity between the word vector of the target vocabulary segment and the word vector of other vocabulary segments.
[0158] The values of semantic similarity range from -1 to 1, where 1 indicates perfect similarity, -1 indicates perfect opposite, and 0 indicates no linear correlation.
[0159] This process can be repeated for each lexical segment as a target lexical segment to calculate the semantic similarity between all lexical segment pairs.
[0160] The obtained similarity matrix can be used for further analysis, such as clustering, classification, recommendation system and other tasks.
[0161] This process effectively quantifies the semantic similarity between multiple vocabulary fragments through word embedding and similarity measurement techniques, providing a basis for a variety of applications in natural language processing.
[0162] In some embodiments, in step 103, the step of constructing a keyword database corresponding to the plurality of filtered vocabulary segments based on the semantic similarity includes:
[0163] Step D1, sorting the semantic similarities between the target vocabulary segment and each other vocabulary segment according to a preset sorting rule to obtain a sorting result.
[0164] Step D2: construct the keyword database based on the ranking results.
[0165] In the above scheme, after obtaining the semantic similarities between the target vocabulary segment and each other vocabulary segment, it is necessary to sort these similarities according to the preset sorting rules. The sorting rules can be formulated according to actual needs, such as simply sorting the similarities from high to low, or sorting according to other more complex rules (such as considering the weight of the vocabulary segment, domain relevance, etc.). The purpose of sorting is to organize these vocabulary segments in a certain logical order when constructing the keyword database later.
[0166] Based on the above sorting results, we can start to build a keyword database. The keyword database is a structured storage system used to store and manage keywords and related information (such as semantic similarity, domain labels, etc.). During the construction process, the sorted vocabulary fragments can be stored in the database according to certain formats and rules. At the same time, it may be necessary to associate some additional information with each vocabulary fragment, such as its frequency of occurrence in the text, context, etc. The keyword database constructed in this way not only contains rich vocabulary resources, but also provides convenient query and management functions, which provides strong support for subsequent natural language processing, text mining and other tasks.
[0167] In some embodiments, step 104 includes:
[0168] Step E1, performing word embedding processing on multiple keyword data in the keyword database to obtain keyword vectors corresponding to the multiple keyword data.
[0169] Step E2: extracting features from the multiple keyword vectors to obtain keyword features corresponding to the multiple keyword vectors.
[0170] Step E3, performing probability prediction based on multiple keyword features through conditional random fields to obtain multiple keyword entities.
[0171] In the above scheme, word embedding is a technology that maps words or phrases in the vocabulary to real vector space. For each keyword data in the keyword database, it will be processed by word embedding to obtain a vector of fixed dimension, namely the keyword vector. This vector can capture the semantic information of the keyword, so that semantically similar words will also be close to each other in the vector space.
[0172] After obtaining the vector representation of each keyword, we need to perform feature extraction on these vectors. The purpose of feature extraction is to extract useful information for subsequent tasks (such as entity recognition) from the original vector data. This step may involve transforming, combining, filtering, and other operations on the vectors to obtain a higher-level representation (i.e., keyword features). These features may include contextual information, part of speech, semantic relationships, etc. of the vocabulary, which are crucial for identifying keyword entities.
[0173] Conditional random fields (CRF) are used for sequence labeling tasks such as named entity recognition (NER). In this step, the CRF model is used to perform probability prediction on the keyword features after feature extraction to identify multiple keyword entities in the keyword database.
[0174] The CRF model takes into account the dependency between labels, that is, the labeling of a word is not only related to its own characteristics, but also affected by the labels of the words before and after it. This makes the CRF model more accurate when dealing with sequence labeling tasks than models such as the Hidden Markov Model (HMM) that only consider the current state transition.
[0175] In some embodiments, step 105 includes:
[0176] Step F1, adding multiple keyword entities as variable nodes into a pre-constructed initial factor graph, and determining candidate entity relationships between the multiple keyword entities.
[0177] Step F2, determining factor nodes according to the entity relationships to be selected between multiple keyword entities, and determining the link relationship between the factor nodes and the variable nodes, the factor nodes representing the interaction and / or dependency relationship between the multiple keyword entities.
[0178] Step F3, performing undirected connection processing on the factor nodes and the variable nodes to obtain a target factor graph.
[0179] Step F4, performing edge probability processing on the candidate entity relationships between the keyword entities based on the target factor graph to obtain the edge probability corresponding to each candidate entity relationship.
[0180] Step F5, determining the entity relationship according to the edge probability corresponding to each candidate entity relationship.
[0181] In the above scheme, multiple keyword entities (such as names of people, places, and organizations) are mapped to variable nodes of the factor graph. The factor graph is a probabilistic graph model used to represent the interactions and dependencies between variables. The variable node represents a specific keyword entity and is the basic unit for relational reasoning in the graph.
[0182] Based on context information, grammatical structure, semantic knowledge, etc., various possible relationships between these keyword entities are preliminarily inferred (such as "birthplace", "work at", "is part of...", etc.). These relationships are used as candidate entity relationships for subsequent analysis and screening.
[0183] Factor nodes are used in factor graphs to represent interactions and / or dependencies between variable nodes (i.e., keyword entities). For each entity relationship to be selected, one or more factor nodes are created to represent the possibility or strength of the relationship. Factor nodes are connected to related variable nodes through link relationships, which reflect the correspondence between entities and relationships.
[0184] All variable nodes, factor nodes, and the links between them are integrated to form a complete undirected graph (although factor graphs are usually considered directed graphs, here it may mean ignoring the directionality to simplify processing). This graph is the target factor graph, which contains all the entities to be analyzed and the possible relationships between them.
[0185] Marginal probability refers to the probability of a variable (here, the candidate entity relationship) given the state of other variables (other entities and relationships). Through complex probabilistic reasoning algorithms (such as belief propagation, variational inference, etc.), the marginal probability of each candidate entity relationship can be calculated, which reflects the possibility of the relationship being established.
[0186] The final entity relationship is determined based on the calculated edge probability. Usually, the candidate relationship with the highest edge probability is selected as the final recognition result. This process may also need to consider some additional factors, such as the semantic rationality of the relationship, contextual consistency, etc.
[0187] The accuracy of entity relations can be improved by constructing factor graphs and utilizing probabilistic reasoning techniques to identify entity relations between multiple keyword entities.
[0188] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0189] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0190] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a resource data display device based on a knowledge graph.
[0191] refer to Figure 2 , the resource data display device based on knowledge graph includes:
[0192] An acquisition module 201 is configured to acquire text data corresponding to a target task, wherein the text data includes a plurality of vocabulary segments;
[0193] A filtering module 202 is configured to filter the plurality of vocabulary segments to obtain a plurality of filtered vocabulary segments;
[0194] A database construction module 203 is configured to determine the semantic similarity between the multiple filtered vocabulary segments through a semantic association algorithm, and construct a keyword database corresponding to the multiple filtered vocabulary segments based on the semantic similarity;
[0195] The entity recognition module 204 is configured to perform entity recognition on the keyword database using a fragment recursive algorithm to obtain a plurality of keyword entities;
[0196] An entity relationship identification module 205 is configured to perform entity relationship identification on multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities;
[0197] The resource data display module 206 is configured to construct a knowledge graph based on the multiple keyword entities and the entity relationships corresponding to the multiple keyword entities, generate resource data of the target task according to the knowledge graph, and visualize the resource data.
[0198] In some embodiments, the filtering module 202 is specifically configured to:
[0199] Counting two adjacent vocabulary segments having the same word length and a preset number of consecutive words and / or characters in the plurality of vocabulary segments, wherein the two adjacent vocabulary segments include a first vocabulary segment and a second vocabulary segment;
[0200] The following operations are performed on each pair of two adjacent vocabulary fragments to obtain multiple filtered vocabulary fragments:
[0201] Obtaining the word frequency of the first vocabulary segment and the word frequency of the second vocabulary segment;
[0202] In response to the word frequency of the first vocabulary segment being less than the word frequency of the second vocabulary segment, filtering the first vocabulary segment from the plurality of vocabulary segments; or,
[0203] In response to the word frequency of the first vocabulary segment being equal to the word frequency of the second vocabulary segment, filtering the first vocabulary segment and the second vocabulary segment from a plurality of vocabulary segments; or,
[0204] In response to the word frequency of the first vocabulary segment being greater than the word frequency of the second vocabulary segment, the second vocabulary segment is filtered from the plurality of vocabulary segments.
[0205] In some embodiments, the filtering module 202 is specifically configured to:
[0206] Determining a sub-lexical string in each lexical segment and a parent lexical string corresponding to the sub-lexical string;
[0207] For each sub-vocabulary string and the parent vocabularies string corresponding to the sub-vocabulary string, the following operations are performed to obtain multiple filtered vocabularies fragments:
[0208] Obtaining the word length of the parent vocabulary string, the word length of the child vocabulary string, the word length of the vocabulary fragment, the word frequency of the parent vocabulary string, the word frequency of the child vocabulary string, and the word frequency of the vocabulary fragment;
[0209] Determining an absolute value of a word length difference based on the word length of the parent vocabulary string and the word length of the child vocabulary string;
[0210] Determining an absolute value of a word frequency difference based on a word frequency of the parent word string and a word frequency of the child word string;
[0211] In response to the difference between the word frequency of the vocabulary segment and the word frequency of the parent vocabulary string being greater than the absolute value of the word frequency difference, filtering the parent vocabulary string and retaining the vocabulary segment; or
[0212] In response to the difference between the word frequency of the vocabulary segment and the word frequency of the parent vocabulary string being less than or equal to the absolute value of the word frequency difference, filtering the vocabulary segment and retaining the parent vocabulary string; or,
[0213] In response to the difference between the word length of the parent vocabulary string and the word length of the vocabulary fragment being less than or equal to the absolute value of the word length difference, filtering the parent vocabulary string and retaining the vocabulary fragment; or
[0214] In response to the difference between the word length of the parent vocabulary string and the word length of the vocabulary fragment being greater than the absolute value of the word length difference, filtering the vocabulary fragment and retaining the parent vocabulary string; or
[0215] In response to the difference between the word frequency of the sub-lexical string and the word frequency of the lexical fragment being less than or equal to the absolute value of the word frequency difference, filtering the sub-lexical string and retaining the lexical fragment; or
[0216] In response to the difference between the word frequency of the sub-lexical string and the word frequency of the lexical fragment being greater than the absolute value of the word frequency difference, filtering the lexical fragment and retaining the sub-lexical string; or
[0217] In response to the difference between the word length of the vocabulary segment and the word length of the sub-lexical string being less than or equal to the absolute value of the word length difference, filtering the vocabulary segment and retaining the sub-lexical string; or,
[0218] In response to the difference between the word length of the vocabulary segment and the word length of the sub-vocabulary string being greater than the absolute value of the word length difference, the sub-vocabulary string is filtered and the vocabulary segment is retained.
[0219] In some embodiments, the database construction module 203 is specifically configured to:
[0220] taking any filtered vocabulary segment among the plurality of filtered vocabulary segments as a target vocabulary segment;
[0221] Determine a word vector w1 of the target vocabulary segment and a word vector w2 of any other vocabulary segment among the plurality of filtered vocabulary segments except the target vocabulary segment;
[0222] The semantic similarity (w1, w2) is determined based on w1 and w2 by the following formula:
[0223]
[0224] In some embodiments, the database construction module 203 is specifically configured to:
[0225] Sorting the semantic similarities between the target vocabulary segment and each other vocabulary segment according to a preset sorting rule to obtain a sorting result;
[0226] The keyword database is constructed based on the ranking results.
[0227] In some embodiments, the entity identification module 204 is specifically configured to:
[0228] Perform word embedding processing on multiple keyword data in the keyword database to obtain keyword vectors corresponding to the multiple keyword data;
[0229] Perform feature extraction on multiple keyword vectors to obtain keyword features corresponding to the multiple keyword vectors;
[0230] Based on multiple keyword features, probability prediction is performed through conditional random fields to obtain multiple keyword entities.
[0231] In some embodiments, the entity relationship identification module 205 is specifically configured to:
[0232] Add multiple keyword entities as variable nodes to the pre-constructed initial factor graph, and determine the candidate entity relationships between the multiple keyword entities;
[0233] Determining factor nodes according to the entity relationships to be selected between the multiple keyword entities, and determining the link relationship between the factor nodes and the variable nodes, the factor nodes representing the interaction and / or dependency relationship between the multiple keyword entities;
[0234] Performing undirected connection processing on the factor nodes and the variable nodes to obtain a target factor graph;
[0235] Based on the target factor graph, edge probability processing is performed on the candidate entity relationships between the keyword entities to obtain edge probabilities corresponding to the candidate entity relationships;
[0236] The entity relationship is determined according to the marginal probability corresponding to each candidate entity relationship.
[0237] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0238] The device of the above embodiment is used to implement the corresponding resource data display method based on knowledge graph in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0239] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the resource data display method based on the knowledge graph described in any of the above embodiments is implemented.
[0240] Figure 3 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 301, a memory 302, an input / output interface 303, a communication interface 304, and a bus 305. The processor 301, the memory 302, the input / output interface 303, and the communication interface 304 are connected to each other in communication within the device through the bus 305.
[0241] The processor 301 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0242] The memory 302 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 302 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 302 and called and executed by the processor 301.
[0243] The input / output interface 303 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.
[0244] The communication interface 304 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0245] The bus 305 comprises a pathway for transmitting information between the various components of the device (eg, the processor 301 , the memory 302 , the input / output interface 303 , and the communication interface 304 ).
[0246] It should be noted that, although the above device only shows the processor 301, the memory 302, the input / output interface 303, the communication interface 304 and the bus 305, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0247] The electronic device of the above-mentioned embodiment is used to implement the corresponding resource data display method based on knowledge graph in any of the above-mentioned embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0248] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the resource data display method based on the knowledge graph as described in any of the above embodiments.
[0249] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0250] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the resource data display method based on the knowledge graph as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0251] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0252] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0253] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0254] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.
Claims
1. A resource data display method based on knowledge graph, characterized in that: include: Acquire text data corresponding to a target task, wherein the text data includes a plurality of vocabulary segments; filtering the plurality of vocabulary segments to obtain a plurality of filtered vocabulary segments; Determining semantic similarities between the plurality of filtered vocabulary segments by a semantic association algorithm, and constructing a keyword database corresponding to the plurality of filtered vocabulary segments based on the semantic similarities; Using a fragment recursive algorithm to perform entity recognition on the keyword database to obtain multiple keyword entities; Perform entity relationship recognition on multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities; A knowledge graph is constructed based on the multiple keyword entities and the entity relationships corresponding to the multiple keyword entities, resource data of the target task is generated according to the knowledge graph, and the resource data is visualized.
2. The method according to claim 1, characterized in that The filtering of the plurality of vocabulary segments to obtain a plurality of filtered vocabulary segments includes: Counting two adjacent vocabulary segments having the same word length and a preset number of consecutive words and / or characters in the plurality of vocabulary segments, wherein the two adjacent vocabulary segments include a first vocabulary segment and a second vocabulary segment; The following operations are performed on each pair of two adjacent vocabulary fragments to obtain multiple filtered vocabulary fragments: Obtaining the word frequency of the first vocabulary segment and the word frequency of the second vocabulary segment; In response to the word frequency of the first vocabulary segment being less than the word frequency of the second vocabulary segment, filtering the first vocabulary segment from the plurality of vocabulary segments; or, In response to the word frequency of the first vocabulary segment being equal to the word frequency of the second vocabulary segment, filtering the first vocabulary segment and the second vocabulary segment from a plurality of vocabulary segments; or, In response to the word frequency of the first vocabulary segment being greater than the word frequency of the second vocabulary segment, the second vocabulary segment is filtered from the plurality of vocabulary segments.
3. The method according to claim 1, characterized in that The filtering of the plurality of vocabulary segments to obtain a plurality of filtered vocabulary segments includes: Determining a sub-lexical string in each lexical segment and a parent lexical string corresponding to the sub-lexical string; For each sub-vocabulary string and the parent vocabularies string corresponding to the sub-vocabulary string, the following operations are performed to obtain multiple filtered vocabularies fragments: Obtaining the word length of the parent vocabulary string, the word length of the child vocabulary string, the word length of the vocabulary fragment, the word frequency of the parent vocabulary string, the word frequency of the child vocabulary string, and the word frequency of the vocabulary fragment; Determining an absolute value of a word length difference based on the word length of the parent vocabulary string and the word length of the child vocabulary string; Determining an absolute value of a word frequency difference based on a word frequency of the parent word string and a word frequency of the child word string; In response to the difference between the word frequency of the vocabulary segment and the word frequency of the parent vocabulary string being greater than the absolute value of the word frequency difference, filtering the parent vocabulary string and retaining the vocabulary segment; or In response to the difference between the word frequency of the vocabulary segment and the word frequency of the parent vocabulary string being less than or equal to the absolute value of the word frequency difference, filtering the vocabulary segment and retaining the parent vocabulary string; or, In response to the difference between the word length of the parent vocabulary string and the word length of the vocabulary fragment being less than or equal to the absolute value of the word length difference, filtering the parent vocabulary string and retaining the vocabulary fragment; or In response to the difference between the word length of the parent vocabulary string and the word length of the vocabulary fragment being greater than the absolute value of the word length difference, filtering the vocabulary fragment and retaining the parent vocabulary string; or In response to the difference between the word frequency of the sub-lexical string and the word frequency of the lexical fragment being less than or equal to the absolute value of the word frequency difference, filtering the sub-lexical string and retaining the lexical fragment; or In response to the difference between the word frequency of the sub-lexical string and the word frequency of the lexical fragment being greater than the absolute value of the word frequency difference, filtering the lexical fragment and retaining the sub-lexical string; or In response to the difference between the word length of the vocabulary segment and the word length of the sub-lexical string being less than or equal to the absolute value of the word length difference, filtering the vocabulary segment and retaining the sub-lexical string; or, In response to the difference between the word length of the vocabulary segment and the word length of the sub-vocabulary string being greater than the absolute value of the word length difference, the sub-vocabulary string is filtered and the vocabulary segment is retained.
4. The method according to claim 1, characterized in that The determining of the semantic similarity between the plurality of filtered vocabulary segments by a semantic association algorithm comprises: taking any filtered vocabulary segment among the plurality of filtered vocabulary segments as a target vocabulary segment; Determine a word vector w1 of the target vocabulary segment and a word vector w2 of any other vocabulary segment among the plurality of filtered vocabulary segments except the target vocabulary segment; The semantic similarity (w1, w2) is determined based on w1 and w2 by the following formula:
5. The method according to claim 4, characterized in that The step of constructing a keyword database corresponding to a plurality of filtered vocabulary segments based on the semantic similarity includes: Sorting the semantic similarities between the target vocabulary segment and each other vocabulary segment according to a preset sorting rule to obtain a sorting result; The keyword database is constructed based on the ranking results.
6. The method according to claim 1, characterized in that The fragment recursive algorithm is used to perform entity recognition on the keyword database to obtain multiple keyword entities, including: Perform word embedding processing on multiple keyword data in the keyword database to obtain keyword vectors corresponding to the multiple keyword data; Perform feature extraction on multiple keyword vectors to obtain keyword features corresponding to the multiple keyword vectors; Based on multiple keyword features, probability prediction is performed through conditional random fields to obtain multiple keyword entities.
7. The method according to claim 1, characterized in that The step of identifying entity relationships of multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities includes: Add multiple keyword entities as variable nodes to the pre-constructed initial factor graph, and determine the candidate entity relationships between the multiple keyword entities; Determining factor nodes according to the entity relationships to be selected between the multiple keyword entities, and determining the link relationship between the factor nodes and the variable nodes, the factor nodes representing the interaction and / or dependency relationship between the multiple keyword entities; Performing undirected connection processing on the factor nodes and the variable nodes to obtain a target factor graph; Based on the target factor graph, edge probability processing is performed on the candidate entity relationships between the keyword entities to obtain edge probabilities corresponding to the candidate entity relationships; The entity relationship is determined according to the marginal probability corresponding to each candidate entity relationship.
8. A resource data display device based on knowledge graph, characterized in that: include: An acquisition module is configured to acquire text data corresponding to a target task, wherein the text data includes a plurality of vocabulary segments; A filtering module, configured to filter the plurality of vocabulary segments to obtain a plurality of filtered vocabulary segments; A database construction module is configured to determine the semantic similarity between the plurality of filtered vocabulary segments through a semantic association algorithm, and to construct a keyword database corresponding to the plurality of filtered vocabulary segments based on the semantic similarity; An entity recognition module is configured to perform entity recognition on the keyword database using a fragment recursive algorithm to obtain a plurality of keyword entities; An entity relationship recognition module is configured to perform entity relationship recognition on multiple keyword entities to obtain entity relationships corresponding to the multiple keyword entities; The resource data display module is configured to construct a knowledge graph based on the multiple keyword entities and the entity relationships corresponding to the multiple keyword entities, generate resource data of the target task according to the knowledge graph, and visualize the resource data.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.