Data processing method, device and equipment

By combining large language model and knowledge graph database, identifying the object's element information and generating classification prompt information, the long-tail problem in object classification is solved, high-precision judgment and data retrieval accuracy are achieved, and the exposure and sales of long-tail objects are improved.

CN120407765APending Publication Date: 2025-08-01ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510414090.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

There is a serious long tail phenomenon in object classification, resulting in low sales and exposure of a large number of products, making it difficult to attract consumers' attention, and causing cold start problems.

Method used

By receiving the classification problem data input by the user, using the large language model to identify element information, and obtaining the target object association sub-graph from the preset knowledge graph database, generating classification prompt information, and inputting the large language model to improve classification accuracy.

Benefits of technology

Effectively reduce or avoid the long-tail knowledge phenomenon, improve high-precision judgment of object classification, enhance the accuracy of data retrieval, and improve the exposure and sales of long-tail objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407765A_ABST
    Figure CN120407765A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data processing method, device and equipment. The method comprises the steps of receiving problem data input by a user and used for classifying target objects; inputting the problem data into a large language model to obtain identification element information for the target object contained in the problem data; based on the identification element information, obtaining a target object associated sub-graph matched with the identification element information from a preset knowledge graph database; classification prompt information is generated on the basis of the target object association subgraph, the recognition element information and the question data, the classification prompt information is input into the large language model, answer data for the question data are obtained, and the answer data comprise the category corresponding to the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of computer technology, and particularly to a data processing method, apparatus, and device. Background Art

[0002] There is a serious long-tail phenomenon in object classification. The objects can include various types. Taking commodities as an example, there is a serious long-tail phenomenon in commodity categories. Especially in the development of business, commodity categories are constantly expanding. Under the condition of privacy compliance, the commodity categories of mini-programs, live broadcasts, etc. are constantly increasing, which inevitably leads to the cold start situation. The serious long-tail problem in commodity categories is because with the development of business, the number of commodity categories is constantly increasing, resulting in a large number of long-tail commodities such as mini-programs and live broadcasts. The sales volume and exposure of these commodities are relatively low, making it difficult to attract the attention of consumers and highlighting the cold start situation. Therefore, it is necessary to provide a better classification scheme for long-tail objects, so as to reduce or avoid the long-tail knowledge phenomenon in object classification, achieve high-precision judgment of object classification, and then reasonably classify and integrate long-tail objects to improve their exposure. Summary of the Invention

[0003] The purpose of the embodiments of this specification is to provide a better classification scheme for long-tail objects, so as to reduce or avoid the long-tail knowledge phenomenon in object classification, achieve high-precision judgment of object classification, and then reasonably classify and integrate long-tail objects to improve their exposure.

[0004] In order to achieve the above technical solution, the embodiments of this specification are implemented as follows: A data processing method provided by the embodiments of this specification, the method includes: receiving problem data input by a user for classifying a target object; inputting the problem data into a large language model to obtain identification element information for the target object included in the problem data; based on the identification element information, obtaining a target object associated sub-graph that matches the identification element information from a preset knowledge graph database; generating classification prompt information based on the target object associated sub-graph, the identification element information, and the problem data, and inputting the classification prompt information into the large language model to obtain answer data for the problem data, where the answer data includes the category corresponding to the target object.

[0005] A data processing device provided by an embodiment of this specification, the device includes: a question receiving module, which receives question data input by a user for classifying a target object; a feature recognition module, which inputs the question data into a large language model to obtain recognition feature information of the target object included in the question data; a sub-graph retrieval module, which based on the recognition feature information, obtains a target object associated sub-graph that matches the recognition feature information from a preset knowledge graph database; an answer determination module, which generates classification prompt information based on the target object associated sub-graph, the recognition feature information, and the question data, inputs the classification prompt information into the large language model to obtain answer data for the question data, and the answer data includes the category corresponding to the target object.

[0006] A data processing device provided by an embodiment of this specification, the data processing device includes: a processor; and a memory arranged to store computer-executable instructions, the executable instructions when executed cause the processor to: receive question data input by a user for classifying a target object; input the question data into a large language model to obtain recognition feature information of the target object included in the question data; based on the recognition feature information, obtain a target object associated sub-graph that matches the recognition feature information from a preset knowledge graph database; generate classification prompt information based on the target object associated sub-graph, the recognition feature information, and the question data, input the classification prompt information into the large language model to obtain answer data for the question data, and the answer data includes the category corresponding to the target object.

[0007] An embodiment of this specification also provides a storage medium, the storage medium is used to store computer-executable instructions, and the executable instructions when executed by a processor implement the following process: receive question data input by a user for classifying a target object; input the question data into a large language model to obtain recognition feature information of the target object included in the question data; based on the recognition feature information, obtain a target object associated sub-graph that matches the recognition feature information from a preset knowledge graph database; generate classification prompt information based on the target object associated sub-graph, the recognition feature information, and the question data, input the classification prompt information into the large language model to obtain answer data for the question data, and the answer data includes the category corresponding to the target object.

[0008] An embodiment of this specification also provides a computer program product, including a computer program, which when executed by a processor implements the following process: receiving problem data input by a user for classifying a target object; inputting the problem data into a large language model to obtain identification element information for the target object included in the problem data; based on the identification element information, obtaining a target object associated sub-graph that matches the identification element information from a preset knowledge graph database; generating classification prompt information based on the target object associated sub-graph, the identification element information, and the problem data, inputting the classification prompt information into the large language model to obtain answer data for the problem data, where the answer data includes the category corresponding to the target object. Description of the Drawings

[0009] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. Figure 1 Schematic diagram of an embodiment of a data processing method in this specification; Figure 2 Schematic diagram of a page for object classification in this specification; Figure 3 Schematic diagram of a data processing process in this specification; Figure 4 Schematic diagram of a category tree structure data in this specification; Figure 5 Schematic diagram of another category tree structure data in this specification; Figure 6 Schematic diagram of an attribute item tree structure data in this specification; Figure 7 Schematic diagram of an attribute tree structure data of a multi-level category in this specification; Figure 8 Schematic diagram of another embodiment of a data processing method in this specification; Figure 9 Schematic diagram of yet another embodiment of a data processing method in this specification; Figure 10 Schematic diagram of yet another embodiment of a data processing method in this specification; Figure 11 Schematic diagram of yet another embodiment of a data processing method in this specification; Figure 12 Schematic diagram of a data processing device in this specification; Figure 13 This is a schematic diagram of a data processing device in this specification. Specific implementation manners

[0010] The embodiments of this specification provide a data processing method, apparatus, and device.

[0011] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of this specification.

[0012] The embodiments of this specification provide an object classification mechanism based on a knowledge graph and a RAG model. Through this object classification mechanism, the long-tail phenomenon existing in object classification can be alleviated or even avoided. There is a serious long-tail phenomenon in object classification, and the objects therein can include various types. Taking commodities as an example, there is a serious long-tail phenomenon in commodity categories. Especially in the business development, the commodity categories are constantly expanding, and the commodity categories such as mini-programs and live broadcasts are constantly increasing. Inevitably, there will be a cold start problem. The reason for the serious long-tail problem in commodity categories is that with the business development, the commodity categories are constantly increasing, resulting in a large number of long-tail commodities such as mini-programs and live broadcasts. The sales volume and exposure of these commodities are relatively low, making it difficult to attract the attention of consumers and causing the cold start problem. Therefore, it is necessary to reasonably classify and integrate the long-tail commodities, find out the needs of consumers through data analysis and market research, and promote these commodities targeted to improve their exposure and sales volume. At the same time, by improving the quality and service level of the commodities, more consumers can be attracted to pay attention to and purchase the long-tail commodities, thereby increasing their sales volume and benefits.

[0013] In addition to the online small model required for product categories to ensure the user experience provided for user products, an offline error correction ability is also needed to provide more information to a larger model for comprehensive judgment. When users use product categories, in addition to the online small model to ensure a fast user experience, they also need the offline error correction ability and a larger model to provide more information for comprehensive judgment. The offline error correction ability can help users discover errors or inaccurate information during use and correct them, improving the accuracy and reliability of product categories. The larger model can provide more data and information, enabling users to have a more comprehensive understanding and comparison, and thus make more accurate decisions. Comprehensive judgment can help users make decisions in complex scenarios. For example, when choosing a product, multiple factors such as price, quality, and reputation need to be considered. Therefore, the offline error correction ability and the larger model can provide users with a better product category experience.

[0014] In practical applications, the above-mentioned long-tail phenomenon of object classification can be processed through rules, mainly implemented based on keyword hits. However, in terms of effect, both accuracy and recall are limited in this way. On the other hand, since the category system is also constantly updated, it means that continuous manual input is required to modify the rules, resulting in very low efficiency. Additionally, the above-mentioned long-tail phenomenon of object classification can also be processed through a small classification model. Since the model requires training data, but during the cold start of certain categories (or product categories), there is no data for these products, and effective training cannot be carried out, which also means that it is difficult to solve the problem through the method of training first and then deploying under the condition of cold start. Furthermore, the above-mentioned long-tail phenomenon of object classification can also be processed through a large model. However, this method also has many problems. First, insufficient domain information: Although the large model is trained only based on public datasets, this also means that it lacks non-public information such as domain-specific or proprietary information, which may lead to the situation that in some cases, the large model cannot provide more accurate or comprehensive answers. Second, there may be misguidance: Although the large model tries its best to provide information and answers based on the existing data, in cases beyond its scope, it may give incorrect or fictional information because the large model cannot directly obtain new information or synchronize with real-time data. Third, it cannot obtain real-time information: Due to the very high training cost of the large model, it cannot update its knowledge base in real time. Therefore, the large model may not be able to provide the latest information or keep up with rapidly changing situations. Fourth, the pre-trained data cannot be changed: The pre-trained data used by the large model may contain incorrect or outdated information and cannot be corrected or deleted, which means that the large model may answer based on inaccurate or outdated data. Finally, it lacks long-term memory: The large model is designed to give accurate answers based on the input data, but it does not have true long-term memory ability, which means that the large model may perform poorly when dealing with complex problems or situations that require context understanding. Therefore, the embodiments of this specification are based on a knowledge graph to reduce or avoid the occurrence of long-tail knowledge phenomena, and through the RAG model, connect it with the large model to make a high-precision judgment on the classification of products through the large model. For specific processing, please refer to the specific content in the following embodiments.

[0015] Such as Figure 1As shown in the figure, an embodiment of this specification provides a data processing method. The execution subject of this method can be a terminal device, a server, etc. The terminal device can be a mobile terminal device such as a mobile phone or a tablet computer, or a computer device such as a notebook computer or a desktop computer. Alternatively, it can also be an IoT device (such as a smart watch, a vehicle-mounted device, etc.). The server can be an independent server or a server cluster composed of multiple servers. The server can be a background server for financial services or online shopping services, or a background server for a certain application program. In this embodiment, the server is used as an example of the execution subject for detailed description. For the case where the execution subject is a terminal device, reference can be made to the following description of the server, which will not be elaborated here. The method can specifically include the following steps: In step S102, receive the question data input by the user for classifying the target object.

[0016] Among them, the user can be any user. In this embodiment, the user can be any user who asks a question. The target object can be any object, and there can be multiple types of target objects. For example, the target object can be a commodity, a service, insurance, a financial product (including funds, stocks, etc.), a video, a text book, etc. The commodities can include multiple types. For example, they can include clothing, 3C digital products, food, outdoor products, etc. Each of the above categories can be further subdivided into finer-grained categories. For example, clothing can specifically include men's clothing, women's clothing, etc. Women's clothing can specifically include skirts, tops, etc. Skirts can include dresses, half skirts, etc., which can be specifically set according to the actual situation. The question data can be the data of the specified question raised by the user. For example, if the target object is a walking stick, the question data can be "Which category does the children's walking stick for fracture, axillary walking stick with airbag, axillary crutch for the young and old with fracture, anti-slip double crutch, walking aid belong to?" etc., which can be specifically set according to the actual situation.

[0017] In practice, when the user needs to determine the category to which a certain object (i.e., the target object) belongs, the user can obtain a question-and-answer page through the terminal device, such as Figure 2 As shown in the figure, the question-and-answer page can include an input box for question data, an output box for answer data, a confirm button, a cancel button, etc. The user can enter the question data to be queried (i.e., the question data for classifying the target object) in the input box for question data on the above question-and-answer page. After the input is completed, the user can click the confirm button. At this time, the user's terminal device can obtain the content of the question data in the input box for question data and can send the target question data to the server. The server can receive the question data input by the user for classifying the target object.

[0018] In step S104, the above problem data is input into a large language model to obtain the recognition element information for the target object contained in the problem data.

[0019] Among them, the large language model can be composed of hundreds of millions of parameters, based on deep learning algorithms, and pre-trained using large-scale corpora. For example, the large language model can be a large model based on BERT or a large model based on the Transformer architecture, etc. Specifically, the large language model can include GPT-3, ChatGPT, etc., and can be specifically set according to the actual situation. The recognition element information can be key information related to the target object determined based on the problem data. The recognition element information can include key information for determining the category to which the target object belongs. The recognition element information can include one or more different types of information. For example, the recognition element information can include information about the target object (which can include the identifier, size, location, etc. of the target object), information about other entities (identifiers, attributes, etc. of other entities), relationship information between the target object and other entities, etc. As in the above example, other entities can include children, young people, elderly people with fractures, armpits, walking aids, and crutches, etc. The relationship between the target object and children, young people, or elderly people with fractures is that children, young people, or elderly people with fractures can use the crutches. The relationship between the target object and the armpit is that the crutches can be used under the armpit. The relationship between the target object and the walking aid or crutches is that they are synonyms or the walking aid or crutches are attributes of the crutches (i.e., walking assistance and crutches, etc.), and can be specifically set according to the actual situation.

[0020] In implementation, the large language model can be used to determine relevant recognition element information based on the input data. Based on this, the architecture of the large language model can be pre-constructed according to the actual situation, and a large amount of training data can be used to train the large language model to obtain a trained large language model. Alternatively, a pre-trained large language model can be obtained, and then a certain number of training samples can be used to fine-tune the pre-trained large language model to obtain a fine-tuned large language model. After that, the above problem data can be input into the large language model. The large language model can analyze the problem data, extract the information of the entities contained therein, and determine the association relationships between different entities. In addition, the information of the entities obtained above can also be extended according to common knowledge. For example, synonyms or near-synonyms of each of the above entities can be obtained, or relevant information such as the basic attributes (such as material, size, use, etc.), composition, or structure of each entity can be obtained. The information obtained above can be used as the recognition element information for the target object contained in the problem data.

[0021] In addition, the above problem data can be directly input into the large language model as described above. In practical applications, prompt information Prompt applied to the large language model can also be generated based on the above problem data. For example, if the problem data is "Which category does the children's crutch for fracture, axillary crutch with airbag, axillary crutch for young people with fracture, elderly crutch with anti-slip, double crutch walking aid belong to?", the prompt information Prompt generated based on the above problem data can be like: Please analyze "Which category does the children's crutch for fracture, axillary crutch with airbag, axillary crutch for young people with fracture, elderly crutch with anti-slip, double crutch walking aid belong to?" and determine the recognition element information therein, etc. Then, the generated prompt information Prompt can be input into the large language model to obtain the recognition element information for the target object included in the problem data, which can be specifically set according to the actual situation, and the embodiments of this specification do not limit this.

[0022] In step S106, based on the above recognition element information, a target object associated sub-graph that matches the recognition element information is obtained from a preset knowledge graph database.

[0023] Among them, the knowledge graph database can be a database storing a large number of knowledge graphs. In practical applications, the knowledge graph database may only store knowledge graphs. In addition, in addition to storing knowledge graphs, it can also store the corresponding representation vectors (such as Embedding vectors, etc.), text description information, or identifiers of the knowledge graphs. In this way, the corresponding knowledge graphs can be indexed through the representation vectors, text description information, or identifiers, which can be specifically set according to the actual situation. The target object associated sub-graph can be a knowledge graph related to the target object and matching the recognition element information. A knowledge graph mainly consists of two main parts, namely nodes (or vertices) and edges. Nodes represent entities or objects in the knowledge domain. Each node corresponds to a unique entity and is identified by a unique identifier. For example, in a knowledge graph about fishing products, the nodes can be "fishing rod" and "fishing", etc. Edges represent the association relationships between two nodes. For example, an edge "What is the scenario" may connect the node of "fishing rod" and the node of "fishing".

[0024] In implementation, as Figure 3As shown, the classification process of the target object can be completed through a RAG (Retrieval-Augmented Generation) model. Specifically, the GraphRAG model can be selected as the RAG model. The GraphRAG model combines a language model with a knowledge graph retrieval mechanism. When generating text or answering questions, the GraphRAG model first retrieves relevant knowledge graphs from a large knowledge graph database, and then uses the retrieved knowledge graphs to guide the generation of text or answers, thereby improving the quality and accuracy of predictions. The processing process of the GraphRAG model can specifically include identifying element information extraction - vectorization (such as Embedding processing, etc.) - retrieval - large model induction generation. Specifically, for vectorization processing, the identifying element information can be vectorized to obtain the Embedding vector corresponding to the identifying element information. Through the above vectorization processing, the corresponding relationship between the Embedding vector and the identifying element information can be constructed. For the retrieval processing, a large database (i.e., the knowledge graph database) can be preset in advance, and retrieval processing can be performed from the knowledge graph database based on the identifying element information. The retrieval methods can include multiple types, for example, similarity-based retrieval, keyword-based retrieval, SQL-based retrieval, etc. For example, based on the identifying element information, entities and / or association relationships with a similarity greater than a preset threshold to the identifying element information can be retrieved from the knowledge graph database through a similarity-based retrieval method (the similarity can be determined by algorithms such as Euclidean distance similarity algorithm, Manhattan distance similarity algorithm, cosine distance similarity algorithm, etc.), or, based on the identifying element information, retrieval processing can be performed from the knowledge graph database through a keyword-based retrieval method. Specifically, keywords can be extracted from the identifying element information, and the retrieved keywords can be used to perform retrieval processing from the knowledge graph database to obtain entities and / or association relationships similar or close to the identifying element information, which can be set according to the actual situation. The target object association subgraph matching the identifying element information can be determined based on the above obtained entities and / or association relationships.

[0025] Generally, the retrieval results obtained through retrieval processing are not ideal because the retrieval dimension may not be optimal, and the results of a single retrieval may not be so relevant. At this time, some strategies need to be used to re-rank the retrieval results to make them more in line with the sorting of the application scenario. A judge can be preset in advance to review the relevance to trigger re-ranking. Through automatic sorting (Rerank), the obtained retrieval results can be made more in line with the application scenario.

[0026] In addition, in the GraphRAG model, in addition to mainly including retrieval processing, it also includes enhancement processing. Specifically, a prompt information template can be preset, and the target object association subgraph that matches the recognition element information, together with the question data, can be embedded into the above prompt information template to generate corresponding prompt information.

[0027] In step S108, classification prompt information is generated based on the target object association subgraph, recognition element information, and question data, and the classification prompt information is input into the large language model to obtain answer data for the above question data, where the answer data includes the category corresponding to the target object.

[0028] Among them, the classification prompt information can be a prompt information Prompt that can be directly used in the large language model to classify the target object.

[0029] In implementation, the target object association subgraph, recognition element information, and question data can be respectively converted into representation vectors, the above representation vectors can be fused to obtain a fused vector, the fused vector can be converted into text data, and this text data can be used as the classification prompt information. Since the target object association subgraph and recognition element information contain rich information related to the target object, the classification prompt information generated based on the target object association subgraph, recognition element information, and question data can enable the large language model to more accurately identify the key information in the target object, thereby overcoming problems such as the knowledge blind spot or weak information of the direct use of the large language model, solving the long-tail problem of object category classification, and improving the high-precision judgment of object classification. The classification prompt information can be input into the large language model, and the large language model can accurately understand the context information of the target object through the classification prompt information, analyze its logic, accurately identify the key information, and finally generate answer data including the category corresponding to the target object.

[0030] The embodiments of this specification provide a data processing method, which receives question data input by a user for classifying a target object, and then inputs the question data into a large language model to obtain identification element information for the target object contained in the question data. Thereafter, based on the identification element information, a target object associated subgraph matching the identification element information can be obtained from a preset knowledge graph database. Finally, classification prompt information can be generated based on the target object associated subgraph, the identification element information and the question data, and the classification prompt information is input into the large language model to obtain answer data for the question data, where the answer data includes the category corresponding to the target object. In this way, due to the integration of the knowledge of the knowledge graph, the problem of long-tail categories having no training samples is well cold-started, thereby reducing or avoiding the long-tail knowledge phenomenon based on the knowledge graph, and connecting it with the large model through the RAG model. The large model makes high-precision judgments on the classification of goods, thereby improving the accuracy of object long-tail category recognition, and the accuracy of data retrieval can be improved through the RAG model.

[0031] In practical applications, the above-mentioned knowledge graph database can be constructed in a variety of different ways. The following provides an implementation method, which can specifically include the processing of the following steps A2 and A4.

[0032] In step A2, category tree structure data of objects related to the target object is obtained. The category tree structure data includes information of different levels and categories corresponding to each level. The category corresponding to the lowest level is a leaf category.

[0033] Among them, the category tree structure data can be as follows Figure 4 As shown, it can include a variety of different levels, such as Figure 4 Women's wear / ladies' boutique-dresses include two levels: women's wear / ladies' boutique and dresses; children's wear / baby wear / parent-child wear-skirts (new)-dresses include three levels: children's wear / baby wear / parent-child wear, skirts and dresses; sportswear / casual wear-sports skirts-sports dresses include three levels: sportswear / casual wear, sports skirts and sports dresses, etc. In addition, the categories corresponding to different levels can be the same or different. Each level can include one or more categories, where the category is the classification of the object. The tree-structured data composed of categories is the category tree structure data (or category tree structure data). Categories can have different granularities. Large-grained categories such as "3C digital" are approximately equal to the industry level, and fine-grained categories such as "skirts" are approximately equal to the granularity of fine-grained categories. The above Figure 4Women's clothing / Ladies' fine goods, dresses, children's clothing / baby clothing / maternity clothing, skirts, sportswear / casual clothing, sports skirts, sports dresses... are all categories at different levels. Among them, the category corresponding to the highest level from top to bottom can be the first-level category, the category corresponding to the second level can be the second-level category, the category corresponding to the third level can be the third-level category, and so on until the lowest level. The category corresponding to the lowest level is the leaf category. The first-level category can be the category with the largest granularity, which can be the industry granularity, such as "clothing", "3C digital", etc. The second-level category, third-level category, fourth-level category... can be relatively fine-grained categories. The leaf category is the category with the smallest granularity, which can be, for example, Figure 4 dresses, sports dresses, square dresses, etc. in

[0034] In implementation, different-level categories can be set according to the different levels of the category, that is, the first-level category - the second-level category - the third-level category - the fourth-level category -... - the leaf category. Finally, a category tree structure data can be formed, such as Figure 5 shown. The category tree structure data includes first-level categories such as clothing and 3C digital under the category. Among them, the first-level category "clothing" can also include second-level categories such as "skirt" and "dress". It should be noted that the category classification in the category tree structure data can also include category words. The category word is an instance under the category classification, which can be a specific object, and the granularity can be smaller than the category. For example, under the category "sofa", there can be a category word "lazy sofa". In addition, in some cases, the name of the category classification itself can also be a category word. For example, under the category "dress", it can include the category word "dress".

[0035] In step A4, a first knowledge graph for the category of the object is constructed based on the category tree structure data, and the first knowledge graph is stored in the knowledge graph database.

[0036] In implementation, each first-level category in the category tree structure data can be obtained. For each first-level category, the information of different-level categories under the first-level category can be extracted, and a corresponding subgraph can be constructed based on the extracted information. For example, as Figure 5 shown, for the first-level category "clothing", the first-level category "clothing" and second-level categories such as "skirt" and "dress" are extracted, and a corresponding subgraph can be constructed based on the extracted information. The subgraph can be such as clothing - skirt, clothing - dress, etc., which can be set according to the actual situation. Through the above method, the subgraph corresponding to each first-level category can be obtained, and the subgraphs corresponding to multiple first-level categories can be fused. Finally, the first knowledge graph for the category of the object can be obtained, and the first knowledge graph can be stored in the knowledge graph database.

[0037] It should be noted that, for the convenience of searching for knowledge graphs in the knowledge graph database, corresponding index information can be set for each knowledge graph in the knowledge graph database. The index information of the knowledge graph can be constructed in a variety of different ways. For example, an identifier (such as a name or a code, etc.) can be set for each knowledge graph according to the actual situation. Or, the representation vector of each knowledge graph can be calculated, and the index information of the knowledge graph can be constructed based on the obtained representation vector (such as directly using the obtained representation vector as the index information of the knowledge graph or performing a specified calculation on the obtained representation vector, and using the calculation result as the index information of the knowledge graph, etc.). Specifically, it can be set according to the actual situation.

[0038] In practical applications, in addition to constructing the knowledge graph database in the above manner, it can also be constructed in a variety of different ways. The following provides another implementation method, which specifically can include the processing of step B2 and step B4.

[0039] In step B2, obtain the attribute items of the categories corresponding to each level in the category tree structure data and the attribute values corresponding to the attribute items.

[0040] Among them, an attribute item can be an item of a certain attribute information. For example, the skirt length can be an attribute of a dress, and the attribute information of this attribute can be the skirt length. Or, a corresponding attribute item can be set, that is, the skirt length, etc. Specifically, it can be set according to the actual situation. An attribute value can be the value of the attribute that the attribute item can contain. For example, for a dress, it can include a five-point sleeve, a seven-point sleeve, etc. Among them, the five-point sleeve or the seven-point sleeve, etc. can be the attribute values.

[0041] In implementation, structured attribute items and structured attribute values can also be constructed. Among them, the structured attribute item can also be called an attribute item tree, such as Figure 6 in the upper part (i.e., the yellow part) above, the attribute item tree can be composed of attribute items with complete paths of attribute items. For example, Figure 6 the path of the "sleeve length" attribute item is "style - sleeve type - sleeve length". The path of the attribute item represents the inclusion relationship of the attribute item semantically, which is an expression from coarse-grained to fine-grained, from the whole to the details. The attribute item is the root node of the attribute value tree, and non-leaf attribute items can also contain attribute values. The structured attribute value can also be called an attribute value tree, such as Figure 6 in the lower part (i.e., the green part) below, the attribute value tree can be composed of attribute values with complete paths of attribute values. For example, Figure 6 the path of the "seven-point sleeve" is "sleeve length - medium sleeve - seven-point sleeve". The path of the attribute value represents the inclusion relationship of the attribute value semantically, which is also an expression from coarse-grained to fine-grained, from the whole to the details.

[0042] Based on the above, an attribute tree for the first-level category and an attribute tree for the leaf category can also be set up. Among them, the attribute tree of the first-level category is the effective range of the structure of the attribute items and the attribute value tree, and this range is the first-level category. Different first-level categories allow different structures of the attribute item tree and the attribute value tree structure. For example, the structure of the attribute items and attribute values under "Apparel" can be different from that under "3C Digital". The attribute tree of the first-level category is the union of the attribute trees of all leaf categories under the first-level category, and it maintains the relationship between the attribute items and attribute values under the first-level category. As Figure 7 shown, the attribute tree of the leaf category inherits from the attribute tree of the first-level category and is a subset of the attribute tree of the first-level category. The range of the attribute items and attribute values that the leaf category can inherit is called the attribute value range of the leaf category. For example, for the attribute item, the "Dress" category can inherit the "Skirt Length" attribute under the "Apparel" first-level category and cannot inherit the "Pant Length" attribute under the "Apparel" first-level category. For the attribute value, "T-shirt" can inherit "Material - Cotton" under the "Apparel" first-level category and does not inherit "Material - Down" under the "Apparel" first-level category. Under the same first-level category, different leaf categories can have different value ranges, but for the same value, its path is the same. The above design ensures the standardization and consistency of the attributes of different leaf categories. Through the above method, the attribute trees of different levels of categories can be obtained. Through the above attribute trees, the attribute items of the categories corresponding to each level in the category tree structure data and the attribute values corresponding to the attribute items can be obtained.

[0043] In step B4, based on the path information of different attribute items of the categories corresponding to each level and the path information of the attribute values corresponding to different attribute items, a second knowledge graph for the attributes of the object is constructed and stored in the knowledge graph database.

[0044] In implementation, based on the attribute trees of different levels of categories, and the attribute items of the categories corresponding to each level and the attribute values corresponding to the attribute items obtained from the category tree structure data, the path information of different attribute items of the categories corresponding to each level and the path information of the attribute values corresponding to different attribute items can be obtained from the attribute trees of different levels of categories. Based on the path information of different attribute items of the categories corresponding to each level and the path information of the attribute values corresponding to different attribute items, the attribute trees of different levels of categories can be converted into corresponding knowledge graphs, and the converted knowledge graphs can be used as the second knowledge graph for the attributes of the object. Then, the second knowledge graph can be stored in the knowledge graph database.

[0045] In practical applications, the specific processing method of constructing the second knowledge graph for the attributes of the object based on the path information of different attribute items of the category corresponding to each level and the path information of the attribute values corresponding to different attribute items can be various. Hereinafter, an optional processing method is provided, which may specifically include the processing of step B42 and step B44.

[0046] In step B42, obtain the path information of different attribute items of the category corresponding to each level, the path information of the attribute values corresponding to different attribute items, and the path information of the synonymous attribute values of the attribute values corresponding to different attribute items.

[0047] In implementation, the attribute value with an attribute path is a node in the attribute tree. Some nodes may have synonyms (i.e., synonymous attribute values), and the synonymous attribute values can be saved in a specified field of the node (such as Figure 6 the alias field in etc.). When using the attribute tree, the attribute values of the above-mentioned specified fields will be normalized to the belonging nodes. Based on the attribute trees of the categories at different levels, the synonymous attribute values of the attribute values corresponding to different attribute items, and the attribute items and the attribute values corresponding to the attribute items of the category corresponding to each level obtained from the obtained category tree structure data, the path information of different attribute items of the category corresponding to each level, the path information of the attribute values corresponding to different attribute items, and the path information of the synonymous attribute values of the attribute values corresponding to different attribute items can be obtained from the attribute trees of the categories at different levels.

[0048] In step B44, construct the second knowledge graph for the attributes of the object based on the path information of different attribute items of the category corresponding to each level, the path information of the attribute values corresponding to different attribute items, and the path information of the synonymous attribute values of the attribute values corresponding to different attribute items.

[0049] In implementation, based on the path information of different attribute items of the category corresponding to each level, the path information of the attribute values corresponding to different attribute items, and the path information of the synonymous attribute values of the attribute values corresponding to different attribute items, the attribute trees of the categories at different levels can be converted into corresponding knowledge graphs, and the converted knowledge graphs can be used as the second knowledge graph for the attributes of the object.

[0050] In practical applications, in addition to constructing the knowledge graph database in the above manner, it can also be constructed in a variety of different ways. Hereinafter, an implementable way is provided, which may specifically include the processing of step C2 and step C4.

[0051] In step C2, obtain the application scenario information and / or synonyms of the object related to the target object.

[0052] Among them, the synonyms can be synonyms of objects related to the target object, or synonyms of the application scenario information of objects related to the target object, etc., which can be specifically set according to the actual situation.

[0053] In implementation, when constructing a knowledge graph, other knowledge can be introduced. For example, keywords, synonyms, and application scenarios (including usage scenarios) can enrich the association information of objects, making the knowledge graph more complete and useful. For example, when constructing a knowledge graph of a fishing rod, keywords, synonyms, and application scenario information can be introduced. First, there is a subordinate relationship between the fishing rod and fishing in an application scenario because a fishing rod is usually used for fishing activities. This subordinate relationship can help users better understand the usage method and application scenario of the fishing rod. Second, fishing and road pressure are synonyms, which means that in some regions or specific contexts, fishing may be called road pressure. This synonym relationship can help users more comprehensively understand the names of fishing activities in different regions or different contexts. Therefore, one or more of the application scenario information of objects related to the target object, the synonyms of objects related to the target object, and the synonyms of the application scenario information of objects related to the target object can be obtained.

[0054] In step C4, based on the application scenario information and / or synonyms of objects related to the target object, construct a third knowledge graph for other knowledge of the object, and store the third knowledge graph in the knowledge graph database.

[0055] The above construction of the knowledge graph and storing the constructed knowledge graph in the knowledge graph database can be stored by indexing the information of the knowledge graph in the way of LlamaIndex, which is convenient for subsequent retrieval. The way of LlamaIndex is a retrieval enhancement mechanism based on the knowledge graph. By constructing the knowledge expression of the graph model, the entities and association relationships are displayed in the form of a graph, and then the large language model is used for retrieval enhancement processing. The knowledge graph can be equivalent to an extremely large vocabulary, and the entities and association relationships correspond to words. Through the above method, entities and association relationships can be jointly modeled as units during retrieval.

[0056] In practical applications, the above-mentioned recognition element information may include first entity information. Based on this, the specific processing method of the above step S106 can be various. Hereinafter, another optional processing method is provided, such as Figure 8 As shown, it specifically may include the processing of the following steps S10602 to step S10606.

[0057] In step S10602, obtain the representation vector corresponding to the first entity information in the recognition element information.

[0058] In implementation, the knowledge graph database contains entities and association relationships. The knowledge graph database may also contain representation vectors corresponding to entity information and representation vectors corresponding to association relationships. Entity information (i.e., the first entity information) contained therein can be extracted from the recognition element information. The specified vectorization processing rule (which can be the same as the vectorization processing rule used to determine the representation vector corresponding to the entity information and the representation vector corresponding to the association relationship in the knowledge graph database) can be used to perform vectorization processing on the first entity information in the recognition element information, and a representation vector corresponding to the first entity information in the recognition element information is obtained. This representation vector can be, for example, an Embedding vector, etc.

[0059] In step S10604, based on the representation vector corresponding to the first entity information, a first graph entity representation vector whose similarity to the representation vector corresponding to the first entity information in the knowledge graph database is greater than a preset first similarity threshold is obtained through a preset similarity algorithm.

[0060] Among them, there can be various similarity algorithms, for example, Euclidean distance similarity algorithm, Manhattan distance similarity algorithm, cosine distance similarity algorithm, etc., which can be specifically set according to the actual situation. The first similarity threshold can be set according to the actual situation, specifically such as 80% or 90%, etc.

[0061] In step S10606, corresponding second entity information is determined based on the obtained first graph entity representation vector, and a target object association subgraph containing the second entity information is obtained from the knowledge graph database based on the second entity information.

[0062] In practical applications, one or more different keywords may be included in the above recognition element information. Based on this, the specific processing method of the above step S106 can be various. Hereinafter, an optional processing method is provided, as Figure 9 shown, which specifically may include the processing of the following steps S10608 to S10612.

[0063] In step S10608, based on each keyword in the recognition element information, third entity information that matches each keyword is respectively obtained from the knowledge graph database.

[0064] In implementation, specified keywords can be extracted from the recognition element information. Based on each keyword in the recognition element information, retrieval processing is performed from the knowledge graph database through a keyword-based retrieval method to obtain entity information that is the same as, similar to, or close to each keyword, and the obtained entity information can be used as the third entity information.

[0065] In step S10610, a first object association subgraph containing the third entity information is obtained from the knowledge graph database based on the third entity information.

[0066] In step S10612, based on the first object-associated subgraph, determine the target object-associated subgraph.

[0067] In implementation, the first object-associated subgraph can be directly used as the target object-associated subgraph. Or, a first object-associated subgraph that meets specified conditions (such as containing a certain entity information, etc.) can be selected from multiple first object-associated subgraphs as the target object-associated subgraph. Or, incorrect or redundant first object-associated subgraphs can be removed from multiple first object-associated subgraphs, and the remaining first object-associated subgraphs can be used as the target object-associated subgraph, etc. It can be specifically set according to the actual situation.

[0068] In practical applications, the specific processing method of step S10612 can be diverse. Here is another optional processing method, as Figure 10 shown, which can specifically include the processing of the following step S106122 and step S10614.

[0069] In step S106122, based on the representation vectors corresponding to the entity information included in the first object-associated subgraph, use a preset similarity algorithm to obtain from the knowledge graph database second graph entity representation vectors whose similarity to the representation vectors corresponding to the entity information included in the first object-associated subgraph is greater than a preset second similarity threshold.

[0070] Among them, the second similarity threshold can be the same as the above first similarity threshold or different from the first similarity threshold, and it can be specifically set according to the actual situation.

[0071] In implementation, retrieval processing can also be performed from the knowledge graph database through a hybrid entity retrieval method. Refer to the following configuration information of the query engine kg_hybrid_query_engine = kg_index.as_query_engine( include_text=True, response_mode="tree_summarize", embedding_mode="hybrid", similarity_top_k=3, explore_global_knowledge=True, ) By specifying embedding_mode = "hybrid", the configuration information of the above query engine is to use the hybrid entity retrieval method - a vector-based retrieval method and a keyword-based retrieval method to retrieve information from the knowledge graph database, and deduplication processing can be performed. The hybrid entity retrieval method can use keywords to find relevant entity information and / or association relationships. Then, it also uses the vector-based retrieval method to find similar entity information and / or association relationships based on semantic similarity. Therefore, in essence, the hybrid entity retrieval method combines keyword search and semantic search, leveraging the advantages of both methods to improve the accuracy and relevance of search results. Based on this, the representation vectors corresponding to the entity information included in the first object association subgraph can also be calculated in the above manner. After that, based on the representation vectors corresponding to the entity information included in the first object association subgraph, the second graph entity representation vectors with a similarity greater than the preset second similarity threshold to the representation vectors corresponding to the entity information included in the first object association subgraph can be obtained from the knowledge graph database. The specific processing process can refer to the foregoing relevant content and will not be elaborated here.

[0072] In step S106124, based on the obtained second graph entity representation vectors, the corresponding fourth entity information is determined, and based on the fourth entity information, the target object association subgraph containing the fourth entity information is obtained from the knowledge graph database.

[0073] In implementation, the obtained second graph entity representation vectors can be used to retrieve in the knowledge graph database to obtain the fourth entity information corresponding to the obtained second graph entity representation vectors, and the target object association subgraph containing the fourth entity information can be extracted from the knowledge graph database based on the fourth entity information.

[0074] In practical applications, the specific processing manner of generating classification prompt information based on the target object association subgraph, recognition element information, and problem data in step S108 above can be diverse. Here is another optional processing manner, as Figure 11 shown, which can specifically include the processing of the following steps S1082 and step S1084.

[0075] In step S1082, the target object association subgraph is converted into corresponding text data, and the text data is used to describe the entities and the association relationships between the entities in the target object association subgraph.

[0076] In step S1084, classification prompt information is generated based on the text data, recognition element information, and problem data.

[0077] The embodiment of this specification provides a data processing method. By receiving the question data input by the user for classifying the target object, then, the question data can be input into the large language model to obtain the recognition element information of the target object contained in the question data. After that, based on the recognition element information, the target object associated sub-graph matching the recognition element information can be obtained from the preset knowledge graph database. Finally, the classification prompt information can be generated based on the target object associated sub-graph, the recognition element information and the question data, and the classification prompt information can be input into the large language model to obtain the answer data for the question data. The answer data includes the category corresponding to the target object. In this way, due to the integration of the knowledge of the knowledge graph, the problem of no training samples for long-tail categories is well cold-started, so that the long-tail knowledge phenomenon is reduced or avoided based on the knowledge graph, and through the RAG model, it is connected to the large model, and the large model is used to accurately judge the classification of the commodity, improving the recognition accuracy of the long-tail categories of the object, and the accuracy of data retrieval can be improved through the RAG model.

[0078] The following combines specific application scenarios to elaborate in detail on the data processing method provided by the embodiment of this specification. The target object is any commodity in the e-commerce field (for the convenience of subsequent description, denoted as the target commodity). The category tree structure data of the object related to the target object is the category tree structure data of the commodity, and the application scenario information and / or synonyms of the object related to the target object can be the application scenario information and / or synonyms of the commodity. The target object associated sub-graph is the target commodity associated sub-graph, and the first object associated sub-graph is the first commodity associated sub-graph.

[0079] The embodiment of this specification provides a data processing method. The execution subject of this method can be a terminal device or a server, etc. The terminal device can be a mobile terminal device such as a mobile phone or a tablet computer, or a computer device such as a notebook computer or a desktop computer, or it can also be an IoT device (specifically such as a smart watch, a vehicle-mounted device, etc.). The server can be an independent server or a server cluster composed of multiple servers. The server can be a background server such as a financial service or an online shopping service, or a background server of a certain application program. In this embodiment, the case where the execution subject is a server is taken as an example for detailed description. For the case where the execution subject is a terminal device, reference can be made to the following case of the server, which will not be elaborated here. This method can specifically include the following steps: In step D02, the category tree structure data of the commodity is obtained. The category tree structure data includes information on different levels and the categories corresponding to each level. The category corresponding to the lowest level is the leaf category.

[0080] In step D04, a first knowledge graph for the categories of goods is constructed based on the category tree structure data, and the first knowledge graph is stored in the knowledge graph database.

[0081] In step D06, the attribute items corresponding to the categories at each level in the category tree structure data and the attribute values corresponding to the attribute items are obtained.

[0082] In step D08, the path information of different attribute items corresponding to the categories at each level, the path information of the attribute values corresponding to different attribute items, and the path information of the synonymous attribute values of the attribute values corresponding to different attribute items are obtained.

[0083] In step D10, a second knowledge graph for the attributes of goods is constructed based on the path information of different attribute items corresponding to the categories at each level, the path information of the attribute values corresponding to different attribute items, and the path information of the synonymous attribute values of the attribute values corresponding to different attribute items, and the second knowledge graph is stored in the knowledge graph database.

[0084] In step D12, the application scenario information and / or synonyms of the goods are obtained.

[0085] In step D14, a third knowledge graph for other knowledge of the goods is constructed based on the application scenario information and / or synonyms of the goods, and the third knowledge graph is stored in the knowledge graph database.

[0086] In step D16, question data for classifying the target goods input by the user is received.

[0087] In step D18, the above question data is input into the large language model to obtain the recognition element information for the target goods contained in the question data.

[0088] In step D20, the representation vector corresponding to the first entity information in the recognition element information is obtained.

[0089] In step D22, based on the representation vector corresponding to the first entity information, the first graph entity representation vector whose similarity with the representation vector corresponding to the first entity information in the knowledge graph database is greater than the preset first similarity threshold is obtained through a preset similarity algorithm.

[0090] In step D24, the corresponding second entity information is determined based on the obtained first graph entity representation vector, and the target goods association subgraph containing the second entity information is obtained from the knowledge graph database based on the second entity information.

[0091] It is also possible to retrieve the corresponding entity information and / or information on the association relationship through other retrieval methods, specifically the keyword-based retrieval method described below: Based on each keyword in the recognition element information, third entity information that matches each keyword is respectively obtained from the knowledge graph database; based on the third entity information, a first commodity association sub-graph containing the third entity information is obtained from the knowledge graph database; based on the first commodity association sub-graph, a target commodity association sub-graph is determined. And the following hybrid entity retrieval method: Based on each keyword in the recognition element information, third entity information that matches each keyword is respectively obtained from the knowledge graph database; based on the third entity information, a first commodity association sub-graph containing the third entity information is obtained from the knowledge graph database; based on the representation vectors corresponding to the entity information included in the first commodity association sub-graph, second graph entity representation vectors with a similarity greater than a preset second similarity threshold to the representation vectors corresponding to the entity information included in the first commodity association sub-graph are obtained from the knowledge graph database through a preset similarity algorithm; based on the obtained second graph entity representation vectors, corresponding fourth entity information is determined, and based on the fourth entity information, a target commodity association sub-graph containing the fourth entity information is obtained from the knowledge graph database.

[0092] In step D26, the target commodity association sub-graph is converted into corresponding text data, and the text data is used to describe the entities and the association relationships between the entities in the target commodity association sub-graph.

[0093] In step D28, classification prompt information is generated based on the text data, the recognition element information, and the question data, and the classification prompt information is input into the large language model to obtain answer data for the above question data, and the answer data includes the category (or product category, etc.) corresponding to the target commodity.

[0094] The specific processing procedures for the above steps can be referred to the relevant content above and will not be elaborated here. Through the above processing, reasonable classification and integration of long-tail commodities can be achieved, consumer demands can be found through data analysis and market research, these commodities can be promoted targetedly to increase their exposure and sales. At the same time, by improving the quality and service level of the commodities, more consumers can be attracted to pay attention to and purchase long-tail commodities, thereby increasing their sales volume and benefits.

[0095] An embodiment of this specification provides a data processing method. By receiving problem data input by a user for classifying a target object, then, the problem data can be input into a large language model to obtain identification element information for the target object included in the problem data. After that, based on the identification element information, a target object associated sub-graph matching the identification element information can be obtained from a preset knowledge graph database. Finally, classification prompt information can be generated based on the target object associated sub-graph, the identification element information, and the problem data, and the classification prompt information is input into the large language model to obtain answer data for the problem data. The answer data includes the category corresponding to the target object. In this way, due to the integration of the knowledge of the knowledge graph, the problem of long-tail categories having no training samples is well cold-started, thereby reducing or avoiding the occurrence of long-tail knowledge phenomena based on the knowledge graph. And through the RAG model, it is connected to the large model, and the large model makes a high-precision judgment on the classification of goods, improving the recognition accuracy of long-tail categories of objects. Moreover, the accuracy of data retrieval can be improved through the RAG model.

[0096] The above is the data processing method provided by the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a data processing device, as Figure 12 shown.

[0097] The data processing device includes: a problem receiving module 1201, an element identification module 1202, a sub-graph retrieval module 1203, and an answer determination module 1204, where: The problem receiving module 1201 receives problem data input by a user for classifying a target object; The element identification module 1202 inputs the problem data into a large language model to obtain identification element information for the target object included in the problem data; The sub-graph retrieval module 1203, based on the identification element information, obtains a target object associated sub-graph matching the identification element information from a preset knowledge graph database; The answer determination module 1204 generates classification prompt information based on the target object associated sub-graph, the identification element information, and the problem data, and inputs the classification prompt information into the large language model to obtain answer data for the problem data. The answer data includes the category corresponding to the target object.

[0098] In the embodiment of this specification, the device further includes: A first data acquisition module that acquires category tree structure data of objects related to the target object. The category tree structure data includes information on different levels and the categories corresponding to each level. The category corresponding to the lowest level is the leaf category; The first knowledge graph construction module constructs a first knowledge graph for the category of the object based on the category tree structure data, and stores the first knowledge graph in the knowledge graph database.

[0099] In the embodiments of the present specification, the device further includes: The second data acquisition module acquires the attribute items corresponding to the categories at each level in the category tree structure data and the attribute values corresponding to the attribute items. The second knowledge graph construction module constructs a second knowledge graph for the attributes of the object based on the path information of different attribute items corresponding to the categories at each level and the path information of the attribute values corresponding to the different attribute items, and stores the second knowledge graph in the knowledge graph database.

[0100] In the embodiments of the present specification, the second knowledge graph construction module includes: The information acquisition unit acquires the path information of different attribute items corresponding to the categories at each level, the path information of the attribute values corresponding to the different attribute items, and the path information of the synonymous attribute values of the attribute values corresponding to the different attribute items. The knowledge graph construction unit constructs a second knowledge graph for the attributes of the object based on the path information of different attribute items corresponding to the categories at each level, the path information of the attribute values corresponding to the different attribute items, and the path information of the synonymous attribute values of the attribute values corresponding to the different attribute items.

[0101] In the embodiments of the present specification, the device further includes: The third data acquisition module acquires the application scenario information and / or synonyms of the objects related to the target object. The third knowledge graph construction module constructs a third knowledge graph for other knowledge of the object based on the application scenario information and / or synonyms of the objects related to the target object, and stores the third knowledge graph in the knowledge graph database.

[0102] In the embodiments of the present specification, the recognition element information includes first entity information, and the sub-graph retrieval module 1203 includes: The characterization acquisition unit acquires the characterization vector corresponding to the first entity information in the recognition element information. The similarity retrieval unit, based on the characterization vector corresponding to the first entity information, acquires, from the knowledge graph database through a preset similarity algorithm, a first graph entity characterization vector whose similarity with the characterization vector corresponding to the first entity information is greater than a preset first similarity threshold. The first sub-graph retrieval unit determines the corresponding second entity information based on the acquired first graph entity characterization vector, and acquires, from the knowledge graph database based on the second entity information, a target object associated sub-graph containing the second entity information.

[0103] In the embodiments of the present specification, the recognition element information includes one or more different keywords. The sub-graph retrieval module 1203 includes: A keyword processing unit, which respectively obtains third entity information matching each keyword from the knowledge graph database based on each keyword in the recognition element information; A keyword retrieval unit, which obtains a first object-associated sub-graph containing the third entity information from the knowledge graph database based on the third entity information; A second sub-graph retrieval unit, which determines the target object-associated sub-graph based on the first object-associated sub-graph.

[0104] In the embodiments of the present specification, the second sub-graph retrieval unit, based on the feature vectors corresponding to the entity information included in the first object-associated sub-graph, obtains, from the knowledge graph database through a preset similarity algorithm, second graph entity feature vectors whose similarity to the feature vectors corresponding to the entity information included in the first object-associated sub-graph is greater than a preset second similarity threshold; determines corresponding fourth entity information based on the obtained second graph entity feature vectors, and obtains a target object-associated sub-graph containing the fourth entity information from the knowledge graph database based on the fourth entity information.

[0105] In the embodiments of the present specification, the answer determination module 1204 includes: A conversion unit, which converts the target object-associated sub-graph into corresponding text data, and the text data is used to describe the entities in the target object-associated sub-graph and the association relationships between the entities; A prompt information generation unit, which generates classification prompt information based on the text data, the recognition element information, and the question data.

[0106] In the embodiments of the present specification, the target object is any commodity in the e-commerce field.

[0107] An embodiment of this specification provides a data processing device. By receiving problem data input by a user for classifying a target object, then, the problem data can be input into a large language model to obtain identification element information for the target object contained in the problem data. After that, based on the identification element information, a target object associated sub-graph matching the identification element information can be obtained from a preset knowledge graph database. Finally, classification prompt information can be generated based on the target object associated sub-graph, the identification element information, and the problem data, and the classification prompt information is input into the large language model to obtain answer data for the problem data. The answer data includes the category corresponding to the target object. In this way, due to the integration of the knowledge of the knowledge graph, the problem of no training samples for long-tail categories is well cold-started, thereby reducing or avoiding the occurrence of long-tail knowledge phenomena based on the knowledge graph. And through the RAG model, it is connected to the large model, and the large model makes a high-precision judgment on the classification of commodities, improving the recognition accuracy of object long-tail categories, and the accuracy of data retrieval can be improved through the RAG model.

[0108] The above is the data processing device provided by the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a data processing device, as Figure 13 shown.

[0109] The data processing device may be a terminal device or a server provided in the above embodiment, etc.

[0110] The data processing device may vary greatly due to configuration or performance differences, and may include one or more processors 1301 and a memory 1302. One or more application programs or data may be stored in the memory 1302. Among them, the memory 1302 may be short-term storage or persistent storage. The application programs stored in the memory 1302 may include one or more modules (not shown in the figure), and each module may include a series of computer-executable instructions in the data processing device. Further, the processor 1301 may be set to communicate with the memory 1302 and execute a series of computer-executable instructions in the memory 1302 on the data processing device. The data processing device may also include one or more power supplies 1303, one or more wired or wireless network interfaces 1304, one or more input / output interfaces 1305, and one or more keyboards 1306.

[0111] Specifically, in this embodiment, the data processing device includes a memory and one or more programs. One or more of the programs are stored in the memory, and one or more of the programs may include one or more modules. Each module may include a series of computer-executable instructions in the data processing device and is configured to be executed by one or more processors. The one or more programs include the following computer-executable instructions: Receive problem data input by the user for classifying a target object; Input the problem data into a large language model to obtain identification element information about the target object contained in the problem data; Based on the identification element information, obtain a target object associated subgraph that matches the identification element information from a preset knowledge graph database; Generate classification prompt information based on the target object associated subgraph, the identification element information, and the problem data, and input the classification prompt information into the large language model to obtain answer data for the problem data. The answer data includes the category corresponding to the target object.

[0112] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. The key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the data processing device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, reference can be made to the description of the method embodiment.

[0113] The embodiment of this specification provides a data processing device. By receiving problem data input by the user for classifying a target object, then, the problem data can be input into a large language model to obtain identification element information about the target object contained in the problem data. After that, based on the identification element information, a target object associated subgraph that matches the identification element information can be obtained from a preset knowledge graph database. Finally, classification prompt information can be generated based on the target object associated subgraph, the identification element information, and the problem data, and the classification prompt information can be input into the large language model to obtain answer data for the problem data. The answer data includes the category corresponding to the target object. In this way, due to the integration of the knowledge of the knowledge graph, the problem of no training samples for long-tail categories is well cold-started, thereby reducing or avoiding the occurrence of long-tail knowledge phenomena based on the knowledge graph. And through the RAG model, it is connected to the large model, and the large model is used to accurately judge the classification of commodities, improving the recognition accuracy of long-tail categories of objects. Moreover, the accuracy of data retrieval can be improved through the RAG model.

[0114] Further, based on the aboveFigures 1 to 11 One or more embodiments of this specification also provide a storage medium for storing computer-executable instruction information. In a specific embodiment, the storage medium can be a USB flash drive, an optical disc, a hard disk, etc. When the computer-executable instruction information stored in the storage medium is executed by a processor, the following processes can be implemented: Receive problem data input by the user for classifying a target object; Input the problem data into a large language model to obtain identification element information about the target object included in the problem data; Based on the identification element information, obtain a target object associated subgraph that matches the identification element information from a preset knowledge graph database; Generate classification prompt information based on the target object associated subgraph, the identification element information, and the problem data, and input the classification prompt information into the large language model to obtain answer data for the problem data, where the answer data includes the category corresponding to the target object.

[0115] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the related parts, reference can be made to the description of the method embodiment.

[0116] The embodiments of this specification provide a storage medium. By receiving problem data input by the user for classifying a target object, then, the problem data can be input into a large language model to obtain identification element information about the target object included in the problem data. After that, based on the identification element information, a target object associated subgraph that matches the identification element information can be obtained from a preset knowledge graph database. Finally, classification prompt information can be generated based on the target object associated subgraph, the identification element information, and the problem data, and the classification prompt information can be input into the large language model to obtain answer data for the problem data. The answer data includes the category corresponding to the target object. In this way, due to the integration of the knowledge of the knowledge graph, the problem of no training samples for long-tail categories is well cold-started, thereby reducing or avoiding the occurrence of long-tail knowledge phenomena based on the knowledge graph. And through the RAG model, it is connected to the large model, and the large model is used to accurately judge the classification of the commodity, improving the recognition accuracy of the object long-tail category, and moreover, the accuracy of data retrieval can be improved through the RAG model.

[0117] Further, based on the above Figures 1 to 11, one or more embodiments of this specification also provide a computer program product, including a computer program. When the computer program in this computer program product is executed by a processor, the following processes can be implemented: Receive problem data input by a user for classifying a target object; Input the problem data into a large language model to obtain identification element information about the target object contained in the problem data; Based on the identification element information, obtain a target object associated sub-graph that matches the identification element information from a preset knowledge graph database; Generate classification prompt information based on the target object associated sub-graph, the identification element information, and the problem data, and input the classification prompt information into the large language model to obtain answer data for the problem data, where the answer data includes the category corresponding to the target object.

[0118] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the above embodiment of a computer program product, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, reference can be made to the partial description of the method embodiment.

[0119] An embodiment of this specification provides a computer program product. By receiving problem data input by a user for classifying a target object, then, the problem data can be input into a large language model to obtain identification element information about the target object contained in the problem data. After that, based on the identification element information, a target object associated sub-graph that matches the identification element information can be obtained from a preset knowledge graph database. Finally, classification prompt information can be generated based on the target object associated sub-graph, the identification element information, and the problem data, and the classification prompt information can be input into the large language model to obtain answer data for the problem data. The answer data includes the category corresponding to the target object. In this way, due to the integration of the knowledge of the knowledge graph, the problem of no training samples for long-tail categories is well cold-started, thereby reducing or avoiding the occurrence of long-tail knowledge phenomena based on the knowledge graph. And through the RAG model, it is connected to the large model, and the large model is used to accurately judge the classification of commodities, improving the recognition accuracy of long-tail categories of objects. Moreover, the accuracy of data retrieval can be improved through the RAG model.

[0120] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0121] In the 1990s, it was obvious to distinguish whether an improvement to a technology was an improvement in hardware (e.g., improvement to the circuit structures such as diodes, transistors, switches, etc.) or an improvement in software (improvement to the method flow). However, with the development of technology, many improvements to method flows today can be regarded as direct improvements to hardware circuit structures. Almost all designers obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented with a hardware entity module. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. The designer can program by himself to "integrate" a digital system on a piece of PLD, without having to ask a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called a Hardware Description Language (HDL). And there is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones currently are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that by simply performing a little logical programming on the method flow with the above-mentioned several hardware description languages and programming it into the integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.

[0122] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that, in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded microcontrollers to achieve the same function. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or structures within the hardware component.

[0123] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0124] For the convenience of description, when describing the above devices, they are described separately as various units according to their functions. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0125] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.

[0126] Embodiments of this specification are described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable serial-parallel devices for fraud cases to generate a machine, such that the instructions executed by the processors of the computer or other programmable serial-parallel devices for fraud cases generate means for implementing the functions specified in the Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0127] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable serial-parallel device for fraud cases to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in the Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0128] These computer program instructions can also be loaded onto a computer or other programmable serial-parallel device for fraud cases, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0129] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.

[0130] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.

[0131] A computer-readable medium includes both permanent and non-permanent, removable and non-removable media and can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, 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 technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0132] It should also be noted that the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or also includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising the element.

[0133] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system or a computer program product. Therefore, one or more embodiments of this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0134] One or more embodiments of this specification can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0135] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the method embodiment.

[0136] The above description is only for the embodiments of this specification and is not intended to limit this document. For those skilled in the art, various modifications and changes can be made to this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included within the scope of the claims of this specification.

Claims

1. A data processing method, the method comprising: Receiving question data input by a user for classifying a target object; Inputting the question data into a large language model to obtain recognition element information for the target object included in the question data; Based on the recognition element information, obtaining a target object associated sub-graph that matches the recognition element information from a preset knowledge graph database; Generating classification prompt information based on the target object associated sub-graph, the recognition element information, and the question data, and inputting the classification prompt information into the large language model to obtain answer data for the question data, where the answer data includes the category corresponding to the target object.

2. The method according to claim 1, the method further comprising: Obtaining category tree structure data of an object related to the target object, where the category tree structure data includes information on different levels and the categories corresponding to each level, and the category corresponding to the lowest level is a leaf category, and the target object is any commodity in the e-commerce field; Constructing a first knowledge graph for the categories of the object based on the category tree structure data, and storing the first knowledge graph in the knowledge graph database.

3. The method according to claim 2, the method further comprising: Obtaining the attribute items corresponding to the categories of each level in the category tree structure data and the attribute values corresponding to the attribute items; Constructing a second knowledge graph for the attributes of the object based on the path information of different attribute items corresponding to the categories of each level and the path information of the attribute values corresponding to the different attribute items, and storing the second knowledge graph in the knowledge graph database.

4. The method according to claim 3, the constructing a second knowledge graph for the attributes of the object based on the path information of different attribute items corresponding to the categories of each level and the path information of the attribute values corresponding to the different attribute items, includes: Obtaining the path information of different attribute items corresponding to the categories of each level, the path information of the attribute values corresponding to the different attribute items, and the path information of the synonymous attribute values of the attribute values corresponding to the different attribute items; Constructing a second knowledge graph for the attributes of the object based on the path information of different attribute items corresponding to the categories of each level, the path information of the attribute values corresponding to the different attribute items, and the path information of the synonymous attribute values of the attribute values corresponding to the different attribute items.

5. The method according to any one of claims 1-4, the method further comprising: Obtaining application scenario information and / or synonyms of an object related to the target object; Constructing a third knowledge graph for other knowledge of the object based on the application scenario information and / or synonyms of the object related to the target object, and storing the third knowledge graph in the knowledge graph database.

6. The method according to claim 5, where the recognition element information includes first entity information, and the obtaining a target object associated sub-graph that matches the recognition element information from a preset knowledge graph database based on the recognition element information, includes: Obtaining a representation vector corresponding to the first entity information in the recognition element information; Based on the representation vector corresponding to the first entity information, obtain, from the knowledge graph database through a preset similarity algorithm, a first graph entity representation vector whose similarity to the representation vector corresponding to the first entity information is greater than a preset first similarity threshold; Determine corresponding second entity information based on the obtained first graph entity representation vector, and obtain, from the knowledge graph database based on the second entity information, a target object associated subgraph containing the second entity information.

7. The method according to claim 5, wherein the recognition element information includes one or more different keywords, and the obtaining, from a preset knowledge graph database, a target object associated subgraph that matches the recognition element information based on the recognition element information includes: Based on each keyword in the recognition element information, respectively obtain, from the knowledge graph database, third entity information that matches each keyword; Obtain, from the knowledge graph database based on the third entity information, a first object associated subgraph containing the third entity information; Based on the first object associated subgraph, determine the target object associated subgraph.

8. The method according to claim 7, wherein the determining the target object associated subgraph based on the first object associated subgraph includes: Based on the representation vectors corresponding to the entity information contained in the first object associated subgraph, obtain, from the knowledge graph database through a preset similarity algorithm, a second graph entity representation vector whose similarity to the representation vectors corresponding to the entity information contained in the first object associated subgraph is greater than a preset second similarity threshold; Determine corresponding fourth entity information based on the obtained second graph entity representation vector, and obtain, from the knowledge graph database based on the fourth entity information, a target object associated subgraph containing the fourth entity information.

9. A data processing device, the device includes: A problem receiving module, which receives problem data input by a user for classifying a target object; An element recognition module, which inputs the problem data into a large language model to obtain recognition element information about the target object contained in the problem data; A subgraph retrieval module, which, based on the recognition element information, obtains, from a preset knowledge graph database, a target object associated subgraph that matches the recognition element information; An answer determination module, which generates classification prompt information based on the target object associated subgraph, the recognition element information, and the problem data, inputs the classification prompt information into the large language model to obtain answer data for the problem data, and the answer data includes the category corresponding to the target object.

10. A data processing device, the data processing device includes: A processor; And A memory arranged to store computer-executable instructions, and when the executable instructions are executed, the processor: Receives problem data input by a user for classifying a target object; Inputs the problem data into a large language model to obtain recognition element information about the target object contained in the problem data; Based on the recognition element information, obtain a target object associated sub-graph that matches the recognition element information from a preset knowledge graph database; Generate classification prompt information based on the target object associated sub-graph, the recognition element information, and the question data, and input the classification prompt information into the large language model to obtain answer data for the question data, where the answer data includes the category corresponding to the target object.