Knowledge Graph-Based Learning Method, System, Device, and Medium in the Textile Field
By constructing a learning method in the textile field based on knowledge graphs, using the depth-first search algorithm and similarity calculation, relevant vocabulary is recommended, and the problem of inconsistent interpretation of textile professional terms and unit of measurement in cross-regional trade is solved, the industry threshold is lowered, and user learning efficiency is improved.
Patent Information
- Application Number
- CN202310100352.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-07
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2043-02-07
AI Technical Summary
In the textile field, it is difficult for both parties to reach the consistent supply and demand standards during cross-regional trade. The quality of the existing search engine explanations is uneven, and it is difficult for new practitioners to systematically learn textile professional terms and units of measurement, resulting in high industry thresholds and difficulty in entering the industry.
Build a learning method in the textile field based on knowledge graphs, query the object interpretation through a deep priority search algorithm, and combine similarity calculation and query frequency to recommend related vocabulary and provide convenient vocabulary query and learning functions.
It has achieved vocabulary query and learning in the textile field, lowered the industry threshold, and improved the efficiency of users to understand professional terms and units of measurement.
Smart Images

Figure CN116150400B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge graph retrieval, and more specifically, to a learning method, system, device and medium for the textile field based on a knowledge graph. Background Art
[0002] In the textile field, there are many professional terms and measurement units. In the current market environment, there are differences in measurement units with the same name in different cities or even different regions of the same city, resulting in a situation where when conducting cross-regional trade, the trading parties reach an agreement on the literal or oral commodity attributes, but the actual supply and demand standards are not unified, and the wrong goods are purchased.
[0003] Moreover, the explanations of professional terms and measurement units in the textile field obtained by using search engines such as Google and Baidu vary in quality and lack industry credibility. In addition, the separate vocabulary interpretations are difficult for beginners in the industry to systematically learn and remember, which is not conducive to user learning, does not conform to the existing proven scientific memory methods, makes the industry threshold high, and it is difficult to enter the industry. Summary of the Invention
[0004] Aiming at the deficiencies of the existing technology, the purpose of the present invention is to provide a learning method, system, device and medium for the textile field based on a knowledge graph, which has the functional advantages of facilitating vocabulary query in the textile field, recommending vocabulary in the textile field to users for learning, and facilitating users to learn textile industry knowledge.
[0005] The above technical object of the present invention is achieved through the following technical solutions:
[0006] A learning method for the textile field based on a knowledge graph includes:
[0007] Receiving a query vocabulary;
[0008] Using a depth-first search algorithm to query the target interpretation corresponding to the query vocabulary from a preset textile knowledge graph, taking the vocabulary corresponding to the query vocabulary in the textile knowledge graph as the target vocabulary, and taking the remaining vocabulary in the textile knowledge graph as candidate vocabulary;
[0009] Calculating the similarity between the target vocabulary and each candidate vocabulary to obtain the corresponding similarity score;
[0010] Selecting a first recommended vocabulary from all candidate vocabulary according to the similarity score;
[0011] Selecting a second recommended vocabulary from historical query data according to the query frequency;
[0012] Sending the target interpretation, the first recommended vocabulary and the second recommended vocabulary to the user terminal.
[0013] Optionally, the method for constructing the textile knowledge graph includes:
[0014] Obtain a first textile corpus;
[0015] Preprocess the first textile corpus to obtain a corresponding second textile corpus;
[0016] Input the second textile corpus into a neural network model to obtain triples with entity relationships;
[0017] Store the triples in a database, and construct a textile knowledge graph according to the database.
[0018] Optionally, the first textile corpus includes: multiple textile professional terms and their corresponding interpretations, and multiple textile measurement units and their corresponding interpretations; the preprocessing of the first textile corpus to obtain a corresponding second textile corpus includes:
[0019] Remove special characters and punctuation marks in the first textile corpus to obtain a corresponding filtered corpus;
[0020] Add the textile professional terms and textile measurement units to a dictionary to obtain a textile dictionary;
[0021] Segment the filtered corpus according to the textile user dictionary to obtain a corresponding second textile corpus.
[0022] Optionally, the use of the depth-first search algorithm to query the target interpretation corresponding to the query term from a preset textile knowledge graph includes:
[0023] Use the depth-first search algorithm to search the textile knowledge graph for textile professional terms or textile measurement units that match the query term, and record them as target terms;
[0024] Take the interpretation corresponding to the target term as the target interpretation.
[0025] Optionally, the calculation of the similarity scores between the target term and each candidate term includes:
[0026] Use a knowledge representation learning model to obtain a first vector representation of the target term and second vector representations of each candidate term;
[0027] Adopt cosine similarity to calculate the node distance scores between the first node of the first vector representation and the second nodes corresponding to each second candidate term;
[0028] Adopt one-hot encoding to obtain the relationship vectors corresponding to the target term and each candidate term;
[0029] Calculate the relationship similarity scores of each relationship vector using cosine similarity;
[0030] Fuse each of the node distance scores and the corresponding relationship similarity scores to obtain the corresponding similarity scores.
[0031] Optionally, the selecting the first recommended word from all candidate words according to the similarity score includes:
[0032] Select the first recommended word from all candidate words according to the first preset number of recommendations in descending order of the similarity score.
[0033] Optionally, the selecting the second recommended word from historical query data according to the query frequency includes:
[0034] Select the second recommended word from historical query data according to the second preset number of recommendations in descending order of the query frequency.
[0035] A textile field learning system based on a knowledge graph, comprising:
[0036] A receiving module, configured to receive a query word;
[0037] A query module, configured to use a depth-first search algorithm to query the target interpretation corresponding to the query word from a preset textile knowledge graph, use the word corresponding to the query word in the textile knowledge graph as the target word, and use the remaining words in the textile knowledge graph as candidate words;
[0038] A calculation module, configured to calculate the similarity between the target word and each candidate word to obtain the corresponding similarity score;
[0039] A first recommendation module, configured to select the first recommended word from all candidate words according to the similarity score;
[0040] A second recommendation module, configured to select the second recommended word from historical query data according to the query frequency;
[0041] A sending module, configured to send the target interpretation, the first recommended word, and the second recommended word to the client.
[0042] A computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.
[0043] A computer-readable storage medium stores a computer program thereon, characterized in that when the computer program is executed by a processor, the steps of the above method are implemented.
[0044] In summary, the present invention has the following beneficial effects: A textile knowledge graph is constructed through textile professional terms and their interpretations and measurement units and their interpretations in the textile field, which is convenient for querying vocabulary in the textile field and for users to learn textile industry knowledge. In addition, the present invention can also select some words from the candidate words and return them to the user terminal to recommend relevant learning to the user. The recommended words can be selected from words with high similarity to the target word for recommendation, or words with high query frequency can be selected for recommendation, which is more helpful for learning textile industry vocabulary. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a schematic flowchart of a learning method for the textile field based on a knowledge graph provided by the present invention;
[0046] Figure 2 is a structural block diagram of a learning system for the textile field based on a knowledge graph provided by the present invention;
[0047] Figure 3 is an internal structure diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0048] In order to make the objectives, features, and advantages of the present invention more obvious and understandable, the following provides a detailed description of the specific embodiments of the present invention with reference to the accompanying drawings. Several embodiments of the present invention are given in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein.
[0049] In the present invention, unless otherwise clearly defined and limited, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features.
[0050] The following provides a detailed description of the present invention with reference to the accompanying drawings and embodiments.
[0051] The present invention provides a learning method for the textile field based on a knowledge graph, as Figure 1 shown, including:
[0052] Step 100: Receive a query word;
[0053] Step 200: Use a depth-first search algorithm to query the target interpretation corresponding to the query word from a preset textile knowledge graph, use the word corresponding to the query word in the textile knowledge graph as the target word, and use the remaining words in the textile knowledge graph as candidate words;
[0054] Step 300: Calculate the similarity between the target vocabulary and each candidate vocabulary to obtain the corresponding similarity score;
[0055] Step 400: Select the first recommended vocabulary from all candidate vocabularies according to the similarity score;
[0056] Step 500: Select the second recommended vocabulary from the historical query data according to the query frequency;
[0057] Step 600: Send the target paraphrase, the first recommended vocabulary, and the second recommended vocabulary to the client.
[0058] In practical applications, the query vocabulary can be input through the client text or selected from the visual graph displayed on the client. Using the depth-first search algorithm, each node in the textile knowledge graph can be traversed in sequence. The node represents an entity until a node matching the query vocabulary is found. The entity corresponding to this node is the target vocabulary, and the paraphrase corresponding to the target vocabulary is the target paraphrase. After determining the target vocabulary in the textile knowledge graph according to the query vocabulary, the remaining vocabulary in the textile knowledge graph is used as candidate vocabularies, so as to select some vocabularies from the candidate vocabularies and return them to the client for recommending relevant learning to the user. The recommended vocabulary can be the vocabulary with high similarity to the target vocabulary or the vocabulary with high query frequency, which is more helpful for learning textile industry vocabulary. The first recommended vocabulary and the second recommended vocabulary can be displayed to the user in the form of a visual graph through the client.
[0059] Furthermore, the construction method of the textile knowledge graph includes:
[0060] Obtain the first textile corpus;
[0061] Preprocess the first textile corpus to obtain the corresponding second textile corpus;
[0062] Perform named entity recognition on the second textile corpus to obtain multiple entities;
[0063] Combine all the entities in pairs to obtain multiple entity groups, and classify the relationships of all entity groups to obtain triples with entity relationships;
[0064] Store the triples in the database and construct the textile knowledge graph according to the database.
[0065] In practical applications, the first textile corpus set includes: a plurality of corpora; the corpora are textile industry terms and their corresponding interpretations or textile measurement units and their corresponding interpretations. If the textile industry terms are process-related professional terms, a clear and detailed description of the process and process characteristics will be given to the process-related professional terms. For example, "Woven fabric refers to the process of forming a woven fabric with yarns as warp and weft according to various fabric structures. Its tissues include three major categories: plain weave, twill weave, and satin weave, as well as their variations." A clear and definite definition is given to the textile measurement units. For example, "D is the unit of thickness and transparency." In order to perform more accurate knowledge extraction and classification on the first textile corpus set, it is usually necessary to perform preprocessing such as filtering and cleaning on the first textile corpus set to obtain a second textile corpus set. The neural network model adopts a convolutional neural network architecture based on the attention mechanism. A classifier is connected to the convolutional neural network architecture. By pre-training the convolutional neural network architecture connected with the classifier using a large number of corpus samples, a triple with entity relationships is obtained. After inputting each processed corpus in the second textile corpus set into the neural network model, a corresponding triple with entity relationships is obtained. In this application, the triples are stored in the OrientDB graph database, and the OrientDB graph database fuses the triples to obtain a textile knowledge graph.
[0066] Further, the preprocessing of the first textile corpus set to obtain the corresponding second textile corpus set includes:
[0067] Removing special characters and punctuation marks in the first textile corpus set to obtain a corresponding filtered corpus set;
[0068] Adding the textile professional terms and textile measurement units to a dictionary to obtain a textile dictionary;
[0069] Performing word segmentation on the filtered corpus set according to the textile user dictionary to obtain the corresponding second textile corpus set.
[0070] Specifically, after removing the special symbols and punctuation marks from each corpus in the first textile corpus set, the interference of symbols is reduced, making the corpus more concise. For example, "Woven fabric refers to the process of forming a woven fabric with warp and weft yarns according to various fabric structures. Its organizations include three major categories: plain weave, twill weave, and satin weave, as well as their variations" becomes "Woven fabric refers to the process of forming a woven fabric with warp and weft yarns according to various fabric structures. Its organizations include three major categories: plain weave, twill weave, and satin weave, as well as their variations". The said dictionary is an existing common sense dictionary. By adding textile professional terms and textile measurement units in the textile field to the common sense dictionary, a textile dictionary is obtained, which facilitates word segmentation of the corpus according to the textile dictionary to obtain the refined corpus and form the second textile corpus set. For example, "Woven fabric refers to the process of forming a woven fabric with warp and weft yarns according to various fabric structures. Its organizations include three major categories: plain weave, twill weave, and satin weave, as well as their variations" becomes "Woven fabric is that warp and weft yarns form a woven fabric according to fabric structures, including plain weave, twill weave, satin weave, and their variations", making the corpus in the second corpus set represented in the form of characters and words, and removing the words and phrases without entity meaning.
[0071] Furthermore, the process of using the depth - first search algorithm to query the target interpretation corresponding to the query term from the preset textile knowledge graph includes:
[0072] Using the depth - first search algorithm to search for textile professional terms or textile measurement units that match the query term from the textile knowledge graph and recording them as target terms;
[0073] Taking the interpretation corresponding to the target term as the target interpretation.
[0074] In practical applications, the depth - first search algorithm (Depth First Search, abbreviated as DFS): an algorithm used to traverse or search trees or graphs, which can traverse each node in the textile knowledge graph. Thus, after receiving a query term, it can use the depth - first search algorithm to traverse the nodes in the textile knowledge graph until the entity in a node is the same as the query term. At this time, the query for the target term corresponding to the query term from the textile knowledge graph is completed, and the target interpretation corresponding to the target term is sent to the client. The target interpretation can be presented in the form of a visual graph, which is easier to understand than pure text expression and helps users learn textile professional terms and textile measurement units in the textile field.
[0075] Furthermore, the process of calculating the similarity scores corresponding to the target term and each candidate term includes:
[0076] Using a knowledge representation learning model to obtain the first vector representation of the target term and the second vector representations of each candidate term;
[0077] Calculate the node distance scores between the first node represented by the first vector and the second nodes corresponding to each second candidate word using cosine similarity;
[0078] Obtain the relationship vectors corresponding to the target word and each candidate word using one - hot encoding;
[0079] Calculate the relationship similarity scores of each relationship vector using cosine similarity;
[0080] Fuse each of the node distance scores and the corresponding relationship similarity scores to obtain the corresponding similarity scores.
[0081] In practical applications, the knowledge representation learning model is also pre - constructed. The pre - trained model BERT - Base - Chinese is used, and the pre - trained model is fine - tuned using textile professional terms and their interpretations and textile measurement units and their interpretations in the textile field. The pre - trained model after fine - tuning initializes all triples in the textile knowledge graph into vector - form triples to obtain the vector representations of entities and relationships, and then the first vector representation of the target word and the second vector representations of each candidate word can be obtained. One - hot encoding is the representation of categorical variables as binary vectors. In this application, it is necessary to first delimit other types of entity categories that each type of entity - relationship node needs to be associated with. For example, the relationship nodes of fabric - type entities are associated with measurement - unit - type entities, and the relationship nodes of process - type entities are associated with fabric - type entities. After determining the category entities associated with the target word and candidate words, one - hot encoding can be used to obtain the relationship vectors of the target word and candidate words. Specifically, the weights of the node distance scores and relationship similarity scores can be adjusted according to the actual situation to obtain the similarity scores after fusing the adjusted node distance scores and relationship similarity scores.
[0082] Further, the selecting the first recommended word from all candidate words according to the similarity scores includes:
[0083] Select the first recommended word from all candidate words according to the first preset number of recommendations in descending order of the similarity scores.
[0084] In practical applications, the first preset number of recommendations can change according to the user's level. The higher the level, the larger the first preset number of recommendations. According to the similarity scores, a first sorting table of candidate words can be obtained. The higher the similarity score, the higher the relevance between the candidate word and the target word. Selecting candidate words in descending order according to the first preset number of recommendations facilitates users to learn words related to the target word after querying the interpretation of the query word, so as to better understand the meaning of the query word.
[0085] Further, the selecting the second recommended word from the historical query data according to the query frequency includes:
[0086] Select the second recommended terms from the historical query data according to the second preset recommended number in the order from high to low of the query frequency.
[0087] In practical applications, the second preset recommended number can also change according to the user's level. The higher the level, the larger the second preset recommended number. Count the query frequencies of each term in the historical query data. According to the query frequencies of each term, a second sorting table of the terms in the historical query data can be obtained. The higher the query frequency, the more it indicates that the term in the historical query data is the term that most users need to query. Select terms from the second sorting table in the order from high to low according to the second preset recommended number, and use the selected terms as the second recommended terms, which is convenient for users to learn after querying the definitions of the query terms, and provide the terms that most users need to query for users to refer to, so as to facilitate users to choose to learn.
[0088] The learning method in the textile field based on the knowledge graph of the present invention constructs a textile knowledge graph through textile professional terms and their definitions and measurement units and their definitions in the textile field, which is convenient for querying terms in the textile field and convenient for users to learn textile industry knowledge. In addition, the present invention can also select some terms from the candidate terms and return them to the user terminal to recommend relevant learning to users. The recommended terms can be terms with high similarity to the target term selected for recommendation, or terms with high query frequency selected for recommendation, which is more helpful for learning textile industry terms.
[0089] As Figure 2 shown, the present invention also provides a learning system in the textile field based on the knowledge graph, including:
[0090] A receiving module 10 for receiving query terms;
[0091] A query module 20 for querying the target definition corresponding to the query term from the preset textile knowledge graph by using the depth-first search algorithm, taking the term corresponding to the query term in the textile knowledge graph as the target term, and taking the remaining terms in the textile knowledge graph as candidate terms;
[0092] A calculation module 30 for calculating the similarity between the target term and each candidate term to obtain the corresponding similarity score;
[0093] A first recommendation module 40 for selecting first recommended terms from all candidate terms according to the similarity score;
[0094] A second recommendation module 50 for selecting second recommended terms from the historical query data according to the query frequency;
[0095] A sending module 60, configured to send the target paraphrase, the first recommended word, and the second recommended word to the client.
[0096] For the specific limitations of the textile field learning system based on the knowledge graph, reference can be made to the limitations of the textile field learning method based on the knowledge graph in the above text, which will not be elaborated here. Each module of the above-mentioned textile field learning system based on the knowledge graph can be implemented in whole or in part by software, hardware, and their combinations. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0097] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 3 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a textile field learning method based on the knowledge graph.
[0098] Those skilled in the art can understand that Figure 3 the structure shown in
[0099] is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0099] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the following steps are implemented:
[0100] Receive a query word;
[0101] Use the depth-first search algorithm to query the target paraphrase corresponding to the query word from a preset textile knowledge graph, use the words corresponding to the query word in the textile knowledge graph as target words, and use the remaining words in the textile knowledge graph as candidate words;
[0102] Calculate the similarity between the target word and each candidate word to obtain the corresponding similarity score;
[0103] Select a first recommended word from all candidate words according to the similarity score;
[0104] Select a second recommended word from the historical query data according to the query frequency;
[0105] Send the target paraphrase, the first recommended word, and the second recommended word to the client.
[0106] In one embodiment, the method for constructing the textile knowledge graph includes:
[0107] Obtain a first textile corpus;
[0108] Preprocess the first textile corpus to obtain a corresponding second textile corpus;
[0109] Input the second textile corpus into a neural network model to obtain triples with entity relationships;
[0110] Store the triples in a database, and construct a textile knowledge graph according to the database.
[0111] In one embodiment, the first textile corpus includes: a plurality of textile technical terms and their corresponding paraphrases, and a plurality of textile measurement units and their corresponding paraphrases; the preprocessing of the first textile corpus to obtain a corresponding second textile corpus includes:
[0112] Remove special characters and punctuation marks from the first textile corpus to obtain a corresponding filtered corpus;
[0113] Add the textile technical terms and textile measurement units to a dictionary to obtain a textile dictionary;
[0114] Segment the filtered corpus according to the textile user dictionary to obtain a corresponding second textile corpus.
[0115] In one embodiment, the use of the depth-first search algorithm to query the target paraphrase corresponding to the query word from the preset textile knowledge graph includes:
[0116] Use the depth-first search algorithm to search for textile technical terms or textile measurement units that match the query word in the textile knowledge graph and record them as target words;
[0117] Take the paraphrase corresponding to the target word as the target paraphrase.
[0118] In one embodiment, the calculation of the similarity between the target word and each candidate word to obtain a corresponding similarity score includes:
[0119] Use a knowledge representation learning model to obtain a first vector representation of the target word and a second vector representation of each candidate word;
[0120] Calculate the node distance scores between the first node represented by the first vector and the second nodes corresponding to each of the second candidate words using cosine similarity;
[0121] Obtain the relationship vectors corresponding to the target word and each candidate word using one-hot encoding;
[0122] Calculate the relationship similarity scores of each relationship vector using cosine similarity;
[0123] Fuse each of the node distance scores and the corresponding relationship similarity scores to obtain the corresponding similarity scores.
[0124] In one embodiment, the selecting the first recommended word from all candidate words according to the similarity scores includes:
[0125] Select the first recommended word from all candidate words according to the first preset number of recommendations in descending order of the similarity scores.
[0126] In one embodiment, the selecting the second recommended word from historical query data according to the query frequency includes:
[0127] Select the second recommended word from historical query data according to the second preset number of recommendations in descending order of the query frequency.
[0128] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0129] Receive a query word;
[0130] Use the depth-first search algorithm to query the target interpretation corresponding to the query word from a preset textile knowledge graph, use the word corresponding to the query word in the textile knowledge graph as the target word, and use the remaining words in the textile knowledge graph as candidate words;
[0131] Calculate the similarity between the target word and each candidate word to obtain the corresponding similarity scores;
[0132] Select the first recommended word from all candidate words according to the similarity scores;
[0133] Select the second recommended word from historical query data according to the query frequency;
[0134] Send the target interpretation, the first recommended word, and the second recommended word to the client.
[0135] In one embodiment, the method for constructing the textile knowledge graph includes:
[0136] Obtain the first textile corpus;
[0137] Preprocess the first textile corpus to obtain the corresponding second textile corpus;
[0138] Input the second textile corpus into a neural network model to obtain triples with entity relationships;
[0139] Store the triples in a database and construct a textile knowledge graph based on the database.
[0140] In one embodiment, the first textile corpus includes: a plurality of textile technical terms and their corresponding definitions, and a plurality of textile measurement units and their corresponding definitions; the preprocessing of the first textile corpus to obtain the corresponding second textile corpus includes:
[0141] Remove special characters and punctuation marks in the first textile corpus to obtain a corresponding filtered corpus;
[0142] Add the textile technical terms and textile measurement units to a dictionary to obtain a textile dictionary;
[0143] Perform word segmentation on the filtered corpus according to the textile user dictionary to obtain the corresponding second textile corpus.
[0144] In one embodiment, the use of the depth-first search algorithm to query the target definition corresponding to the query term from a preset textile knowledge graph includes:
[0145] Use the depth-first search algorithm to search the textile knowledge graph for textile technical terms or textile measurement units that match the query term and record them as target terms;
[0146] Take the definition corresponding to the target term as the target definition.
[0147] In one embodiment, the calculation of the similarity scores between the target term and each candidate term includes:
[0148] Use a knowledge representation learning model to obtain the first vector representation of the target term and the second vector representations of each candidate term;
[0149] Adopt cosine similarity to calculate the node distance scores between the first node of the first vector representation and the second nodes corresponding to each second candidate term;
[0150] Adopt one-hot encoding to obtain the relationship vectors corresponding to the target term and each candidate term;
[0151] Adopt cosine similarity to calculate the relationship similarity scores of each relationship vector;
[0152] Fuse the respective node distance scores and the corresponding relationship similarity scores to obtain the corresponding similarity scores.
[0153] In one embodiment, the selecting the first recommended word from all candidate words according to the similarity score includes:
[0154] Select the first recommended word from all candidate words according to the first preset number of recommendations in descending order of the similarity score.
[0155] In one embodiment, the selecting the second recommended word from the historical query data according to the query frequency includes:
[0156] Select the second recommended word from the historical query data according to the second preset number of recommendations in descending order of the query frequency.
[0157] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0158] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
Claims
1. A learning method in the textile field based on a knowledge graph, characterized in that Including: Receiving a query term; Using a depth-first search algorithm to query the target interpretation corresponding to the query term from a preset textile knowledge graph, taking the terms corresponding to the query term in the textile knowledge graph as target terms, and taking the remaining terms in the textile knowledge graph as candidate terms; Calculating the similarity between the target terms and each candidate term to obtain the corresponding similarity scores; Selecting the first recommended term from all candidate terms according to the similarity scores; Selecting the second recommended term from historical query data according to the query frequency; Sending the target interpretation, the first recommended term, and the second recommended term to the client; The construction method of the textile knowledge graph includes: Obtaining a first textile corpus; Preprocessing the first textile corpus to obtain a corresponding second textile corpus; Inputting the second textile corpus into a neural network model to obtain triples with entity relationships; Storing the triples in a database and constructing a textile knowledge graph according to the database; The first textile corpus includes: multiple textile professional terms and their corresponding interpretations, and multiple textile measurement units and their corresponding interpretations; the preprocessing of the first textile corpus to obtain a corresponding second textile corpus includes: Removing special characters and punctuation marks from the first textile corpus to obtain a corresponding filtered corpus; Adding the textile professional terms and textile measurement units to a dictionary to obtain a textile dictionary; Segmenting the filtered corpus according to the textile user dictionary to obtain a corresponding second textile corpus; The using a depth-first search algorithm to query the target interpretation corresponding to the query term from a preset textile knowledge graph includes: Using a depth-first search algorithm to search for textile professional terms or textile measurement units that match the query term in the textile knowledge graph and recording them as target terms; Taking the interpretation corresponding to the target term as the target interpretation; The calculating the similarity between the target terms and each candidate term to obtain the corresponding similarity scores includes: Using a knowledge representation learning model to obtain the first vector representation of the target term and the second vector representations of each candidate term; Calculating the node distance scores between the first node of the first vector representation and the second nodes corresponding to each second candidate term using cosine similarity; Obtaining the relationship vectors corresponding to the target term and each candidate term using one-hot encoding; Calculating the relationship similarity scores of each relationship vector using cosine similarity; Fusing each of the node distance scores and the corresponding relationship similarity scores to obtain the corresponding similarity scores.
2. The learning method in the textile field based on the knowledge graph according to claim 1, wherein The selecting the first recommended term from all candidate terms according to the similarity scores includes: Selecting the first recommended term from all candidate terms according to the first preset number of recommendations in descending order of the similarity scores.
3. The learning method in the textile field based on the knowledge graph according to claim 1, characterized in that, The selecting the second recommended term from historical query data according to the query frequency includes: Selecting the second recommended term from historical query data according to the second preset number of recommendations in descending order of the query frequency.
4. A learning system in the textile field based on a knowledge graph, characterized in that, Including: A receiving module for receiving a query term; A query module, configured to query the target interpretation corresponding to the query term from a preset textile knowledge graph by using a depth-first search algorithm, use the term corresponding to the query term in the textile knowledge graph as the target term, and use the remaining terms in the textile knowledge graph as candidate terms; A calculation module, configured to calculate the similarity between the target term and each candidate term to obtain the corresponding similarity score; A first recommendation module, configured to select a first recommended term from all candidate terms according to the similarity score; A second recommendation module, configured to select a second recommended term from historical query data according to the query frequency; A sending module, configured to send the target interpretation, the first recommended term, and the second recommended term to the client.
5. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Information query method and device
CN110502645A
Material recommendation method, system and equipment based on natural language and medium
CN114265926A
Method and device for determining recommended vocabularies, electronic equipment and storage medium
CN114706970A