Atlas construction method and device, electronic equipment and computer readable medium
By acquiring the target industry chain's graph construction request text, generating a complete graph using a large language model and text vector library, and providing an operation interface, the problem of time-consuming and poor coverage in existing graph construction technologies is solved, achieving broader graph coverage and a user-friendly operation experience.
Patent Information
- Application Number
- CN202510342728.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-03-21
AI Technical Summary
Existing model-based pre-training methods require a significant amount of time to label data when there is no readily available training data, and cannot further supplement the graph, resulting in poor graph coverage and an inability to perform related operations on the generated target business graph, such as deletion, scaling, and folding.
The request text is constructed by acquiring the target business map of the target industry chain, generating a basic target business map using a large language model, and generating a supplementary text set by combining a text vector library. Supplementary triples are extracted to generate a complete target business map, and an operation interface is provided on the associated display, including zooming, collapsing, and saving.
It simplifies the map construction process, eliminates the data annotation process, increases map coverage, and allows users to manipulate the map, thus improving the user experience.
Smart Images

Figure CN120218219B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this disclosure relate to the field of computer technology, and more specifically to map construction methods, apparatus, electronic devices, and computer-readable media. Background Technology
[0002] Knowledge graphs are a way to represent knowledge using a graph structure. They systematically present complex knowledge structures through nodes (entities) and edges (relationships). They not only effectively organize and utilize information but also provide powerful support for applications such as intelligent question answering, recommendation systems, and semantic search. Knowledge graphs also have wide and important applications in conventional business scenarios. Most business graphs can be built around core entities such as users, products, and related channels. By establishing relationships between users, products, and related channels, a knowledge network reflecting the overall picture of related businesses can be formed. Currently, most knowledge graph construction methods adopt a model-based pre-training approach. This method first trains the model to learn patterns and rules from large amounts of data, and then performs information extraction tasks to efficiently extract valuable entities and relationships from the raw data, constructing a complete knowledge graph.
[0003] However, when performing extraction tasks using the above method, the following technical problems often arise:
[0004] Model-based pre-training methods require a significant amount of time to label data when there is no readily available training data, and cannot further supplement the map, resulting in poor map coverage and the inability to perform related operations (such as deletion, scaling, and folding) on the generated target business map.
[0005] The information disclosed in this background section is only intended to enhance the understanding of the background of the present disclosure concept, and therefore may contain information that does not form prior art known to those skilled in the art. Summary of the Invention
[0006] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0007] Some embodiments of this disclosure provide map construction methods, apparatuses, electronic devices, and computer-readable media to address one or more of the technical problems mentioned in the background section above.
[0008] Firstly, some embodiments of this disclosure provide a graph construction method, which includes: responding to receiving a user's question, obtaining a target business graph construction request text for a target industry chain based on keywords extracted from the user's question, wherein the target industry chain includes a home furnishing industry chain, an automotive industry chain, and a logistics industry chain, and the business graph is a graph of various elements, relationships, and temporal processes in the industry chain presented graphically; performing format processing on the target business graph construction request text to obtain a processed graph construction request; generating a basic target business graph based on the processed graph construction request and a preset large language model; and using a text vector library... Based on the target business-related content and the aforementioned basic target business map, a supplementary text set for the basic target business map is generated. Supplementary triples are extracted from the supplementary text set. These supplementary triples are combined with the basic target business map to generate a complete target business map. In response to the generation of the complete target business map, it is sent to the user's associated display for display. In response to detecting that the associated display is in a display state, the user controls the associated display to overlay a preset operation interface onto the visualized complete target business map. The preset operation interface includes functions such as zoom, collapse, and save.
[0009] Secondly, some embodiments of this disclosure provide a graph construction apparatus, comprising: an acquisition unit configured to, in response to receiving a user's query, acquire a target business graph construction request text for a target industry chain based on keywords extracted from the user's query, wherein the target industry chain includes a home furnishing industry chain, an automotive industry chain, and a logistics industry chain, and the business graph is a graphical representation of various elements, relationships, and temporal processes within the industry chain; a format processing unit configured to perform format processing on the target business graph construction request text to obtain a processed graph construction request; a first generation unit configured to generate a basic target business graph based on the processed graph construction request and a preset large language model; and a second generation unit configured to generate a text-based... The vector library contains target service-related content, and the aforementioned basic target service map is used to generate a supplementary text set for the basic target service map. An extraction unit is configured to extract from this supplementary text set to obtain supplementary triples. A third generation unit is configured to combine the supplementary triples and the aforementioned basic target service map to generate a complete target service map. A sending unit is configured to send the complete target service map to the user's associated display for display in response to its generation. A control unit is configured to control the associated display to overlay a preset operation interface onto the visualized complete target service map in response to detecting that the associated display is in a display state. The preset operation interface includes functions such as zooming, collapsing, and saving.
[0010] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.
[0011] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
[0012] The above embodiments of this disclosure have the following beneficial effects: Through the graph construction method of this disclosure, the process of model labeling and training can be replaced by calling a large language model. The constructed knowledge graph can be further expanded by extracting from the text library, and combined with self-developed software to display and provide users with a corresponding operation interface for the complete graph. Therefore, the graph construction process can be simplified, the constructed graph can be further improved, and the user experience can be enhanced. Specifically, the reason for the poor user experience of most graph construction methods is that model-based pre-training methods require a lot of time to label data when there is no readily available training data, and cannot further supplement the graph, resulting in poor graph coverage and a poor user experience. Based on this, this disclosure discloses some embodiments of the graph construction method. First, in response to receiving a user's question, based on the keywords extracted from the user's question, a target business graph construction request text for the target industry chain is obtained. The target industry chain includes the home furnishing industry chain, the automotive industry chain, and the logistics industry chain. The business graph is a graph that graphically presents various elements, relationships, and temporal processes in the industry chain. Thus, the user's needs are obtained. Then, the target business graph construction request text is formatted to obtain a processed graph construction request. Thus, by processing the graph construction request using a template, user needs are better addressed by invoking the subsequent large language model. Then, based on the processed graph construction request and the preset large language model, a basic target business graph is generated. Thus, the user's required basic target business graph is generated by invoking the large language model. Then, based on the target business-related content in the text vector library and the aforementioned basic target business graph, a supplementary text set for the basic target business graph is generated. Thus, the constructed basic target business graph can be further improved by extracting from the text set. Then, supplementary triples are extracted from the supplementary text set of the basic target business graph. Then, combining the supplementary triples and the aforementioned basic target business graph, a complete target business graph is generated. Finally, in response to the generation of the complete target business graph, the complete target business graph is sent to the user's associated display for display. Then, in response to detecting that the aforementioned associated display is in a display state, the associated display is controlled to overlay a preset operation interface onto the visualized complete target service map. The preset operation interface includes functions such as zooming, collapsing, and saving. This allows the user to operate on the generated complete map. Consequently, the obtained supplementary triples can be added to the basic target service map, generating a map with broader coverage. On one hand, the map construction method eliminates the data annotation process by using a large language model. On the other hand, the map construction method can further supplement the constructed basic target service map, improving the coverage of the generated image.Therefore, while generating maps with broader coverage, the data annotation process is eliminated, and the generated complete maps can be further manipulated through associated devices, thus improving the user experience. Attached Figure Description
[0013] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0014] Figure 1 This is a flowchart of some embodiments of the map construction method according to this disclosure;
[0015] Figure 2 These are schematic diagrams of some embodiments of the atlas construction apparatus according to this disclosure;
[0016] Figure 3 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation
[0017] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0018] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0019] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0020] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0021] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0022] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0023] Figure 1 This is a flowchart 100 of some embodiments of the map construction method according to the present disclosure. The map construction method includes the following steps:
[0024] Step 101: In response to receiving a user's question, obtain the target business map construction request text for the target industry chain based on the keywords extracted from the user's question.
[0025] In some embodiments, in response to receiving a user's question, the executing entity obtains a target business graph construction request text for the target industry chain based on keywords extracted from the user's question. The target industry chain includes the home furnishing industry chain, the automotive industry chain, and the logistics industry chain. The business graph is a graphical representation of various elements, relationships, and temporal processes within the industry chain. The user's question can be a user-input image construction request, such as "How to construct a home furnishing knowledge graph?" The executing entity can extract keywords from the user's question using the TF-IDF algorithm. The executing entity for the graph construction method can be a computer device or an electronic device connected to a computer wirelessly or via a wired connection. It should be noted that the wireless connection method can include, but is not limited to, 3G / 4G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra-wideband) connections, and other currently known or future wireless connection methods. The target business graph construction request text can refer to explicit instructions or requirement descriptions submitted by the user or system for constructing a knowledge graph for a specific business domain. The aforementioned specific business areas may include, but are not limited to, industry chain graphs (such as furniture manufacturing and automobile production) and knowledge chain graphs (such as poetry, film, and painting). The methods for obtaining the request text for constructing the target business graph may include, but are not limited to, typing input and speech conversion.
[0026] Step 102: Process the target business graph construction request text to obtain the processed graph construction request.
[0027] In some embodiments, the aforementioned execution entity can process the format of the target business graph construction request text to obtain a processed graph construction request. This format processing can involve standardizing or normalizing the user-submitted graph construction request to conform to the system's internal processing requirements. In practice, the execution entity can unify the data format in the request. For example, it can unify the date format to the ISO standard format and the text encoding to UTF-8.
[0028] In some optional implementations of certain embodiments, the aforementioned execution entity may perform format processing on the target business graph construction request text through the following steps to obtain the processed graph construction request:
[0029] The first step is to determine the first project template corresponding to the aforementioned target business graph construction request text. This first project template can be a Prompt project template. The Prompt project template can be a pre-designed set of prompts that specifies how to input information into tools such as large language models in a suitable way to guide the generation of knowledge graph construction content that meets specific needs. In practice, the executing entity can identify the corresponding first project template by recognizing characters or words in the target business graph construction request text. Specifically, the overlap of keywords or words can be compared to confirm the corresponding first project template. For example, the target business graph construction request text is a request to build a "smart home industry knowledge graph." The system has a variety of Prompt project templates, such as "smart home industry knowledge graph construction template," "smart healthcare industry knowledge graph construction template," and "smart transportation industry knowledge graph construction template," etc. Based on the keyword "smart home industry" in the request, the system will accurately locate the "smart home industry knowledge graph construction template" from the template library and use it as the preferred Prompt project template.
[0030] The second step involves format conversion of the target business graph construction request text based on the first project template, resulting in a processed graph construction request. In practice, the executing entity will adjust and convert the original graph construction request according to the prompting methods and information organization requirements specified in the first project template. This may include restating key information in the request, supplementing necessary contextual information, and organizing data according to the template's format, to transform the request into a format suitable for input into a large language model. For example, suppose the first project template requires the specific name of the home product and the attribute type to be identified in the request. However, the target business graph construction request text simply mentions "building a smart home product knowledge graph." This is incorrect because the request text does not specify which smart home product (e.g., smart speaker, smart curtains, smart air conditioner) it refers to, nor does it specify the attributes to be identified (e.g., the sound quality characteristics and voice wake-up function of a smart speaker, the opening and closing method and energy efficiency rating of a smart curtain). In this step, the aforementioned implementing entity can further inquire with the user about the specific details of building smart home products, and organize the request according to the format required by the first project template. For example, "Based on the following smart home information: 'This smart home system includes smart lights, smart security cameras, and smart door locks. The smart lights can be remotely controlled via a mobile app to switch on / off and adjust brightness. The smart security cameras support 24-hour HD monitoring. The smart door locks have multiple unlocking methods such as fingerprint, password, and card swipe,' please identify the smart home device entities (smart lights, smart security cameras, smart door locks), device function entities (remote control on / off, brightness adjustment, 24-hour HD monitoring, fingerprint unlocking, password unlocking, card unlocking, etc.), control method entities (remote control via mobile app), and the relationships between them." This processed request better conforms to the requirements of the Prompt project template and can be directly input into the large language model to generate relevant information for knowledge graph construction.
[0031] Step 103: Based on the processed graph construction request and the preset large language model, generate a basic target business graph.
[0032] In some embodiments, the aforementioned execution entity can generate a basic target business graph based on the processed graph construction request and a preset large language model. The large language model can be chatGPTv3.5. In practice, the processed graph construction request can be directly sent to the large language model.
[0033] In some optional implementations of certain embodiments, the aforementioned execution entity can generate a basic target business graph based on the processed graph construction request and a preset large language model:
[0034] The first step is to input the processed graph construction request into the pre-defined large language model to obtain a triplet information set. In practice, the pre-defined large language model can identify the processed graph construction request, thereby obtaining the relevant entities and the relationships between them, and outputting them in the form of triples (entity 1, relation, entity 2). These triples constitute triplet information. The triplet information set can be the collection of all triplet information extracted by the large language model. For example, if the processed graph construction request is about the "smart home industry," sending a request to ChatGPTv3.5 will yield a triplet information set including (smart speaker, function, voice interaction), (smart curtains, control method, mobile APP control), (smart air conditioner, category, smart home device), (smart robot vacuum cleaner, cleaning mode, automatic path planning cleaning), (smart camera, application scenario, home security), etc.
[0035] The second step involves vectorizing each triple in the aforementioned triple information set to obtain a vectorized triple information set. This vectorization process can involve converting the text-based triple information into a numerical representation easily processed by a computer. In practice, the executing entity can use a deep learning model framework to vectorize each triple. This deep learning model framework can be a Transformer-based model (such as BERT (Bidirectional Encoder Representations from Transformers)), which maps each element of the triple to a high-dimensional vector space. For example, for the triple (smart speaker, function, voice interaction), the BERT model can be used to encode "smart speaker," "function," and "voice interaction" respectively, obtaining the corresponding vectors. Assuming the vector corresponding to "smart speaker" is [0.15, 0.22, ..., 0.48], the vector corresponding to "function" is [0.33, 0.41, ..., 0.62], and the vector corresponding to "voice interaction" is [0.21, 0.34, ..., 0.73], by performing this processing on all triples related to the knowledge graph of the smart home industry, we obtain the above-mentioned vectorized triple information set.
[0036] The third step involves constructing a graph based on the vectorized triple information to obtain the basic target business graph. This basic target business graph includes at least one triple. In practice, based on the vectorized triple information, graph construction algorithms (such as graph database-based methods) can be used to represent entities as nodes and relationships as edges, thus constructing a graphical knowledge structure, i.e., the basic target business graph. For example, based on the vectorized triple information set, entities such as "smart speaker," "smart curtains," "smart air conditioner," "voice interaction," and "mobile app control" can be represented as nodes, and relationships such as "function," "control method," and "category" can be represented as edges, constructing a simple basic target business graph that graphically presents the smart home industry and its related information.
[0037] In some optional implementations of certain embodiments, the execution entity can input the processed graph construction request into the preset large language model to obtain triple information:
[0038] The first step is to extract key information from the processed graph construction request. This key information can be extracted from a large amount of content, helping to quickly grasp the essential information. For example, "On March 15, 2025, Mr. Zhang, a well-known expert in the smart home industry, delivered a keynote speech on the future development trend of smart homes and showcased his latest smart home appliance control system at a smart home exhibition held at a city's international convention and exhibition center." Key information may include, but is not limited to: date (March 15, 2025), location (city's international convention and exhibition center), person (Mr. Zhang), event (delivering a keynote speech on the future development trend of smart homes and showcasing his latest smart home appliance control system), and industry (smart home industry). In practice, the executing entity can extract information from the processed graph construction request using a recognition model. This recognition model can be a BiLSTM-CRF model based on deep learning in Named Entity Recognition (NER) models. It can learn rich textual language features through pre-training on a large amount of text data, thereby enabling the extraction of key information from the text. For example, the processed knowledge graph construction request is: "Please construct a knowledge graph about smart home products, smart door locks, including information such as the product's brand, model, unlocking method, special features, and compatible door types." After information extraction by the BiLSTM-CRF model, the key information obtained can be "smart door lock," "brand," "model," "unlocking method," "special features," and "compatible door types."
[0039] The second step is to determine the key information knowledge set corresponding to the aforementioned key information based on the database of the large language model. The large language model has accumulated a vast amount of knowledge, which is stored in its database. In practice, the key information can be used to query and match within the database of the large language model to find the knowledge content related to each key piece of information. This collection of knowledge constitutes the key information knowledge set. For example, for the key information "smart home product smart door lock," the key information knowledge set found in the large language model database may include, but is not limited to: the smart door lock is a smart home product of a certain company, with multiple models such as Smart Door Lock Pro; unlocking methods include fingerprint unlocking, password unlocking, mobile NFC unlocking, and Bluetooth key unlocking; special features include real-time monitoring of door lock status, abnormal alarm notifications, and compatibility with door types such as wooden doors and security doors.
[0040] The third step involves extracting and processing the aforementioned key information knowledge set using a pre-defined entity recognition model to obtain an entity set. This entity recognition model can be a named entity recognition model based on Conditional Random Fields (CRF). CRF is a technique used to identify entities with specific meanings in text; common entity types include people, organizations, locations, times, and works. In practice, a pre-defined named entity algorithm can be used to process the key information knowledge set, identifying all entities and collecting them to form an entity set. For example, entity recognition of the key information knowledge set about "smart door locks" could result in an entity set including, but not limited to: "smart door lock" (smart home product entity), "fingerprint unlocking" (unlocking method entity), "password unlocking" (unlocking method entity), "mobile APP unlocking" (unlocking method entity), "real-time monitoring" (functional entity), "abnormal alarm" (functional entity), "wooden door" (adaptive door type entity), "metal door" (adaptive door type entity), and "lithium battery powered" (power supply method entity), etc.
[0041] The fourth step involves extracting relations for each entity in the aforementioned entity set to obtain a relation set. This relation extraction can involve identifying semantic relationships between entities from text. In practice, after obtaining the entity set, the associations between each entity and other entities can be analyzed. Using a pre-defined relation extraction algorithm (such as Naive Bayes), relationships between entities are extracted from the key information knowledge set, and these relationships are collected to form a relation set. These relationships can be semantic connections (such as hierarchical relationships and whole-part relationships), logical connections (such as causal relationships and associative relationships), and temporal connections (such as sequential relationships) between different entities in knowledge representation structures such as knowledge graphs. For example, for "smart door lock" and "fingerprint unlocking" in the entity set, the relation extraction reveals the relationship between them as "possible unlocking methods." For "smart door lock" and "real-time monitoring," the relationship is "possible functions." For "smart door lock" and "wooden door," the relationship is "compatible door type." For "smart door lock" and "lithium battery powered," the relationship is "power supply method used," and so on. These relationships constitute the aforementioned relation set.
[0042] The fifth step is to combine the aforementioned entity set and relation set to output triplet information. In practice, the entity set and relation set can be combined, and each entity and its associated relation can be organized according to the triplet format to output a series of triplet information. For example, based on the aforementioned entity set and relation set, the output triplet information may include, but is not limited to: (smart lock, unlocking method, fingerprint unlocking), (smart lock, functions, real-time monitoring), (smart lock, compatible door type, wooden door), (smart lock, power supply method, lithium battery powered), (smart lock, unlocking method, password unlocking), (smart lock, functions, abnormal alarm), etc.
[0043] Optionally, the aforementioned implementing entity may also perform the following steps:
[0044] The first step is to obtain unprocessed training data based on the user request category. This unprocessed training data consists of information related to the user request category. For example, if the user's request is to build a furniture industry chain map, the unprocessed training data could be a large amount of information about furniture manufacturing and sales companies collected from various websites. This relevant information may include, but is not limited to: basic company information (such as company name, establishment date, etc.), production-related information (such as raw material information, production processes and technologies, etc.), and product information (product types and series, etc.). In practice, raw data matching the specific category of the user request can be collected from data sources (such as databases, file systems, etc.).
[0045] The second step is to preprocess the unprocessed training data to obtain processed training data. This preprocessing can be a series of cleaning, transformation, and normalization operations performed on the unprocessed training data. These preprocessing steps may include, but are not limited to: removing noisy data (such as special characters and HTML tags in text), handling missing values, performing data standardization (such as normalization of numerical data), and word segmentation (for text data).
[0046] The third step is to determine the corresponding lightweight model based on the aforementioned pre-defined large language model. This lightweight model can include, but is not limited to, DistilGPT and ALBERT. In practice, the execution entity can automatically select the lightweight model. First, the execution entity can obtain task-related information, which may include, but is not limited to, task type, data characteristics, and resource conditions (such as computing power and storage capacity, converted into quantifiable indicators and parameters). Then, the task-related information is compared with the performance parameters and resource requirements of different lightweight models (e.g., setting weights for indicators such as accuracy and speed), generating a comprehensive score for each model (e.g., DistilGPT scores 83, ALBERT scores 60). Finally, the model with the highest score is determined, or the model that meets the conditions and has the best performance is selected based on resource constraints. For example, if the pre-defined large language model is GPT-3, for some simple text classification tasks, a lightweight model such as DistilBERT can be selected.
[0047] The fourth step involves initializing the lightweight model using a deep learning framework, resulting in an initialized lightweight model. This deep learning framework can include, but is not limited to, TensorFlow and PyTorch. In practice, for example, the DistilBERT model can be initialized using the PyTorch framework by defining the model's structure and parameters, and then calling the corresponding initialization function to complete the initialization operation.
[0048] The fifth step is to determine the knowledge distillation loss function based on the basic information of the large language model and the lightweight model. Knowledge distillation is a technique for transferring knowledge from a large model to a small model. The knowledge distillation loss function can be used to measure the difference between the output of the lightweight model and the output of the large language model. The basic information can include the structural features (e.g., architecture type, number of layers), parameter information (e.g., parameter distribution, total number of parameters, initialization method, and optimizer type), and output features (including the dimension and format of the output (e.g., length of the output vector, probability distribution)) of the large language model and the lightweight model. In practice, the executing entity can determine the knowledge distillation loss function (e.g., cross-entropy loss function, mean squared error loss function) by comparing the basic information of the large language model and the lightweight model. For example, suppose both the large language model and the lightweight model are based on the Transformer architecture, but the large model has 12 layers while the lightweight model only has 6 layers. Both have the same hidden layer dimension and attention mechanism type, and their outputs are both the Softmax probability distribution for classification tasks. Similarity is determined by comparing the following three aspects:
[0049] (1) Architectural similarity: Both are Transformer architectures with the same hidden layer dimension and attention mechanism, but different number of layers. Quantification (if the hidden layer dimension and attention mechanism are the same, the similarity increases by 50%; if the architecture is the same, it increases by 35%) yields a similarity of 85%.
[0050] (2) Parameter information: The large model has a large number of parameters, but the parameter distribution of the lightweight model is similar to that of the large model, resulting in a similarity of 70%.
[0051] (3) Output features: Both outputs are Softmax probability distributions with the same dimension (resulting in 100% similarity).
[0052] Based on the above parameter information, architectural similarity, and output features (such as the average of the three similarity values), if the combined similarity is higher than a preset threshold (such as a similarity of 80%), the above execution entity can choose the cross-entropy loss function as the knowledge distillation loss function; if it is lower than the preset threshold, the mean squared error loss function can be chosen.
[0053] Step 6: Based on the attribute information of the large language model mentioned above, load the large language model to obtain its interface instance. This attribute information may include, but is not limited to, interface address, access permissions, and runtime environment. The large language model typically exists in a pre-trained form. In practice, the execution entity can load the large language model into memory based on the attribute information. After loading, an interface instance can be created, providing an interface for interacting with the large language model, allowing input data to be passed to the model and its output to be retrieved. For example, if the large language model is a pre-trained model on Hugging Faces, the model can be loaded using the library provided by Hugging Faces, and a callable interface instance can be created.
[0054] Step 7: Input the processed training data into the large language model. Through the interface instance of the large language model, obtain the training data soft label set. In practice, the preprocessed training data can be sequentially input into the interface instance of the large language model. The large language model will process each input data and output the corresponding prediction results. These prediction results are usually presented in the form of probability distributions, called soft labels. Collecting the soft labels corresponding to all training data yields the training data soft label set. For example, for a user review analysis task of a furniture brand in the home furnishing industry chain, inputting the processed user review text about that brand's furniture into the large language model will output the probability distribution of each review belonging to different evaluation categories (such as high quality, exquisite design, high cost-performance ratio, inferior material, rough workmanship, and high price). These probability distributions can serve as soft labels.
[0055] Step 8: For the lightweight model, perform the following training steps:
[0056] The first sub-step involves dividing the processed training data into batches to obtain grouped training data. In practice, for example, the 1000 samples of the processed training data can be divided into 10 batches of 100 samples each to improve training efficiency and reduce memory usage.
[0057] The second sub-step involves inputting the grouped training data into the lightweight model in a preset order to obtain the training results. These training results may include, but are not limited to, updated model parameters, loss values and evaluation metrics (such as mean squared error, accuracy, recall, F1 score, etc.), and prediction results (which can be numerical values, class labels, or sequences). In practice, the grouped training data can be input into the initialized lightweight model sequentially according to a pre-defined order (such as random or sequential order). The lightweight model can perform forward propagation calculations on each batch of data, predicting the input data based on the current model parameters to obtain the corresponding training results. For example, if the first batch of 80 user reviews about smart sofas is input into the lightweight model, the model will output the classification prediction results of these 80 reviews regarding the smart sofa's functionality, comfort, and design, such as powerful, average, or lacking in functionality; high comfort, average, or poor comfort; exquisite, ordinary, or subpar appearance.
[0058] The third sub-step involves inputting the aforementioned training data soft-label set and training results into the knowledge distillation loss function to obtain the distillation loss value. In practice, the training data soft-label set generated by the large language model and the training results of the lightweight model can be simultaneously input into the knowledge distillation loss function. The knowledge distillation loss function calculates the difference between the two and outputs a scalar value, namely the distillation loss value. This distillation loss value reflects the gap between the output of the lightweight model and the output of the large language model.
[0059] The fourth sub-step involves updating the lightweight model based on the distillation loss value. In practice, backpropagation can be used to calculate the gradient of the model parameters based on the distillation loss value. Then, optimization algorithms (such as stochastic gradient descent, Adam, etc.) are used to update the parameters of the lightweight model based on the gradient to reduce the distillation loss value.
[0060] The fifth sub-step, in response to determining that the number of executions of the above training steps has reached the preset number of training iterations, identifies the updated lightweight model as the completed lightweight model. Here, the preset number of training iterations can be an integer (e.g., 100), representing the total number of training rounds required for the lightweight model. In practice, in each training round, the steps of batch processing, inputting data, calculating loss, and updating parameters can be executed sequentially. When the number of executions of the training steps reaches the preset number of training iterations, the lightweight model is considered to have completed training, and the updated model at this point is identified as the completed lightweight model.
[0061] The ninth step involves adjusting the trained lightweight model to obtain the adjusted lightweight model. In practice, after training, the lightweight model can be further adjusted and optimized. These adjustments and optimizations may include, but are not limited to: fine-tuning hyperparameters (such as learning rate, regularization coefficients, etc.), making simple modifications to the model structure (such as adding or deleting layers), and performing model fusion to further improve the model's performance and generalization ability.
[0062] The first to ninth steps and related content described above, as an inventive point of this disclosure, solve the technical problem of "slow speed in constructing knowledge graphs using large language models directly". Factors contributing to the slow speed of knowledge graph construction using large language models include: large language models typically have a large number of parameters, requiring powerful computing resources to run, thus resulting in slow runtime and impacting user experience. Solving these factors can improve the speed of knowledge graph construction. To achieve this, embodiments of this disclosure provide a training method for a lightweight model that works in conjunction with a large language model. This lightweight model has a simpler structure than the large language model and is trained using soft labels provided by the large language model. It involves fewer matrix operations and parameter updates during computation, resulting in faster inference and training speeds. Therefore, it can improve the speed of knowledge graph construction while maintaining the quality of the graph construction. This improves both the speed of knowledge graph construction and the user experience.
[0063] Step 104: Based on the target business-related content and basic target business map in the text vector library, generate a supplementary text set for the basic target business map.
[0064] In some embodiments, the aforementioned executing entity can generate a supplementary text set for the basic target business graph based on the target business-related content of the text vector library and the aforementioned basic target business graph. The text vector library can be a pre-built library containing a large number of vector representations of converted text. The target task-related content can be information that is content-related to the target business graph construction request text, and can be searched in the text vector library. For example, if it is related to the smart home industry chain, the relevant information may include, but is not limited to: smart home device-related text (such as product descriptions, user reviews, and product evaluations), upstream and downstream related text of the smart home industry chain (such as the relationship between suppliers and manufacturers), and smart home technology and application scenario-related text (such as technology applications and scenario descriptions). In practice, the most relevant text vectors can be selected and mapped to text by calculating the similarity between entity nodes and text vectors in the text vector library, ultimately forming the supplementary text set for the basic target business graph.
[0065] In some optional implementations of certain embodiments, the aforementioned execution entity can generate a supplementary text set for the basic target business map based on the target business-related content of the text vector library and the aforementioned basic target business map through the following steps:
[0066] The first step is to determine each triple in the aforementioned basic target business map, thus obtaining a triple set. In practice, all triples contained in the basic target business map can be extracted to form a set, i.e., a triple set. For example, the aforementioned basic target business map could be about smart home product knowledge, containing triples such as (smart robot vacuum cleaner, brand, brand A), (smart robot vacuum cleaner, cleaning mode, edge cleaning), (smart air purifier, filter type, HEPA filter), (smart air purifier, applicable area, 50 square meters), (smart door lock, unlocking method, fingerprint unlocking), (smart door lock, special features, remote doorbell), etc. Extracting all these triples yields the triple set.
[0067] The second step is to identify the entity node corresponding to each triple in the aforementioned triple set, thus obtaining the entity node set. In practice, the entity portion of each triple (i.e., entity 1 and entity 2 in the triple) can be extracted. The entities in all triples are then aggregated, and duplicates are removed to obtain a set containing all entities in the basic target business graph, i.e., the entity node set. For example, the entity node set extracted from the triple set of the smart home knowledge basic target business graph could include, but is not limited to: "smart robotic vacuum cleaner," "path planning function," "remote control via mobile APP," "smart camera," "infrared sensing function," and "voice control commands," etc.
[0068] Third, perform the following steps for each entity node in the above entity node set:
[0069] The first sub-step involves generating similarity scores between entity nodes and each text vector in the aforementioned text vector library, resulting in a similarity set. In practice, the entity nodes can be converted into vector form (using a pre-trained word vector model), and then the similarity score between this entity node vector and each text vector in the text vector library can be generated. The similarity calculation methods can include, but are not limited to, cosine similarity and Euclidean distance. All calculated similarity values are then collected to form a set, i.e., the aforementioned similarity set.
[0070] The second sub-step involves determining a preset number of text vectors with the highest similarity to the aforementioned entity nodes based on the similarity set, thus obtaining a supplementary text vector set. This preset number can be adjusted according to actual needs, for example, set to 5 or 10. In practice, these selected text vectors can be grouped into a single set, i.e., the supplementary text vector set. For example, with a preset number of 3, for the entity node "intelligent constant temperature air conditioner," the three text vectors with the highest similarity are selected from the similarity set, such as text vectors representing "Introduction to the energy-saving mode of intelligent constant temperature air conditioner," "Description of the remote control function of intelligent constant temperature air conditioner," and "Room area range suitable for intelligent constant temperature air conditioner," forming the supplementary text vector set.
[0071] The third sub-step involves mapping the text vectors in the aforementioned supplementary text vector set to their corresponding text, thus obtaining the supplementary text set corresponding to the aforementioned entity node. Here, the text vectors in the aforementioned text vector library are numerical representations of the text; each text vector in the supplementary text vector set needs to be restored to its corresponding original text. In practice, this conversion can be achieved using a pre-recorded mapping relationship between vectors and text in the text vector library. The converted texts are then collected to form a set, i.e., the supplementary text set corresponding to the entity node. For example, the vector [0.12, 0.23, ..., 0.47] can be mapped back to "smart air purifier".
[0072] The fourth step involves generating a supplementary text set for the basic target business graph based on the obtained supplementary text sets. This supplementary text set includes the supplementary text sets for each entity node. In practice, the supplementary text sets corresponding to each entity node in the above entity node set can be aggregated to form a collection containing the supplementary text information of all entity nodes, i.e., the supplementary text set for the basic target business graph.
[0073] Step 105: Extract the supplementary text set of the basic target business map to obtain supplementary triplets.
[0074] In some embodiments, the aforementioned execution entity can extract supplementary text sets from the aforementioned basic target business graph to obtain supplementary triples. In practice, the aforementioned large language model can still be used to extract the supplementary text sets from the aforementioned basic target business graph.
[0075] In some optional embodiments, the execution entity may extract the supplementary text set of the basic target business graph through the following steps to obtain supplementary triples:
[0076] The first step is to determine the corresponding second project template based on the supplementary text set of the aforementioned basic target business map. This second project template can also be a Prompt project template. In practice, the corresponding second project template can be found from the template library based on the content, theme, structure, and other characteristics of the supplementary text set of the aforementioned basic target business map. The principle for determining the corresponding second project template is the same as that for determining the corresponding first project template, and will not be repeated here.
[0077] The second step involves adjusting the format of the supplementary text set for the basic target business map based on the aforementioned second project template, resulting in the adjusted supplementary text set. In practice, for example, if the aforementioned second project template requires dates in the text to uniformly use the format "YYYY-MM-DD", while the dates in the supplementary text set for the basic target business map are expressed as "MM / DD / YYYY", then the date format needs to be converted.
[0078] Third, based on the aforementioned pre-defined large language model, supplement the text of each basic target business graph in the adjusted basic target business graph supplementary text set by performing the following steps:
[0079] The first sub-step involves extracting key information from the supplementary text of the aforementioned basic target business graph to obtain key text information. This key text information can be the most crucial part of the text. For example, in supplementary text about a smart home product, key information may include, but is not limited to: product name (e.g., smart air purifier), product model (e.g., Air Purifier Pro H), and main functions (e.g., formaldehyde removal, PM2.5 detection, negative ion purification, etc.). In practice, the aforementioned large language model can be used to identify the aforementioned key text information related to the construction of the target business graph from the adjusted supplementary text of the basic target business graph. This identification can also be achieved using the aforementioned CRF.
[0080] The second sub-step involves identifying supplementary entities in the supplementary text of the aforementioned basic target business map based on the key information in the text, thus obtaining a supplementary entity set. In practice, the aforementioned executing entity can identify supplementary entities as texts in the key information that explicitly refer to specific things, such as the name of a specific home appliance, "smart air purifier" or "Air Purifier ProH". Concepts associated with smart homes can also be supplementary entities, such as "formaldehyde", "PM2.5", and "negative ions" associated with "formaldehyde removal, PM2.5 detection, and negative ion purification". In conjunction with business scenarios, such as mentioning applicability to "bedrooms" or "living rooms", these scenarios are also supplementary entities. Content introduced by modifiers in the key information, such as "high-efficiency filter", can also be supplementary entities.
[0081] The fourth step involves determining the relationships between the supplementary entities based on the preset standards of the second engineering template, thus obtaining an entity relationship set. This entity relationship set may include, but is not limited to, semantic relationships (such as hierarchical relationships and whole-part relationships), logical relationships (such as causal relationships and associative relationships), and temporal relationships (such as sequential relationships) between different entities. In practice, the identified supplementary entities can be identified according to the preset standards in the second engineering template to obtain the relationships between them. These relationships are then organized into a set, i.e., the entity relationship set. For example, between the supplementary entities "smart camera" and "human detection function" related to smart homes, the template standards can determine that they have a relationship of "possessing certain functions."
[0082] The fifth step involves generating relationships between supplementary entities based on the aforementioned entity relationship set, resulting in supplementary triplet information. In practice, the relationships between entities are transformed into explicit relational expressions based on the aforementioned entity relationship set, and presented in the form of triples (entity 1, relation, entity 2). For example, based on the "possess" relationship between "intelligent sweeping robot" and "path planning function" determined by the aforementioned entity relationship set, supplementary triplet information (intelligent sweeping robot, possess, path planning function) can be generated.
[0083] The sixth step is to vectorize the above supplementary triplet information to obtain supplementary triplets. This vectorization process can be the conversion of non-vector data into vector form. For example, a supplementary triplet for the home furnishing industry chain might be ("Home Furnishing Brand A", "Cooperation Relationship", "Furniture Manufacturer B"). The vector for "Home Furnishing Brand A" could be [0.1, 0.2, 0.3, 0.4, 0.5], the vector for "Furniture Manufacturer B" could be [0.2, 0.3, 0.4, 0.5, 0.6], and the vector for "Cooperation Relationship" could be [0.3, 0.4, 0.5, 0.6, 0.7].
[0084] In some optional embodiments, the execution entity may determine the supplementary entities in the supplementary text of the basic target business graph based on the key text information, thereby obtaining a supplementary entity set:
[0085] The first step is to preprocess the key information in the text to obtain the preprocessed key text. This preprocessing may include word segmentation, stop word removal, and format conversion.
[0086] The second step involves inputting the preprocessed key text into the embedding layer of the entity extraction model to obtain vector representations of the key text. This entity extraction model includes an embedding layer, a first extraction layer, a staggered connection layer, a second extraction layer, and a labeling layer. The entity extraction model can be a neural network model that takes the preprocessed key text as input and outputs a supplementary entity set. The vector representations of the key text can be tensors of shape [sequence length, word vector dimension]. The embedding layer can be a layer in deep learning used to convert discrete, high-dimensional word indices into low-dimensional, dense vector representations. The first extraction layer can be a BiLSTM (Bidirectional LSTM). The residual connection layer can perform residual connections between the embedding layer and the first extraction layer. The second extraction layer can also be a BiLSTM (Bidirectional LSTM). The labeling layer can be a CRF (Conditional Random Field Layer).
[0087] The third step involves inputting the key text represented by the aforementioned vector into the first extraction layer to obtain the first feature tensor. This first feature tensor can be a tensor with a shape of [sequence length, hidden layer dimension * 2]. In practice, the execution entity can process the input sequence using BiLSTM to extract contextual information.
[0088] The fourth step involves concatenating the first feature tensor and the key text represented by the vectors using the staggered connection layer described above, resulting in a concatenated feature tensor. This concatenated feature tensor can have a shape of [sequence length, hidden layer dimension * 2 + word vector dimension]. In practice, the execution entity can concatenate or sum the output of the first BiLSTM layer with the output of the embedding layer.
[0089] Fifth, the concatenated feature tensor is input into the second extraction layer to obtain a higher-level feature tensor. This higher-level feature tensor can be a higher-level contextual feature. In practice, the execution entity can further extract higher-level contextual features using a second BiLSTM layer.
[0090] The sixth step involves inputting the high-level feature tensor into the annotation layer to obtain entity labels. These entity labels can be a sequence of entity labels corresponding to each word, such as "B-entity", "I-entity", "O", etc. In practice, the execution entity can use a CRF layer to globally annotate the feature sequence to obtain the optimal entity label sequence.
[0091] Step 7: Based on the entity tags mentioned above, extract entity words with specific tags from the preprocessed key text to generate the supplementary entity set. This supplementary entity set can be a collection of entities obtained through entity recognition and processing, containing various entities identified from the key information (such as organization names, product names, place names, etc.). In practice, the executing entity can extract entity words with specific tags from the preprocessed key text based on the tag sequence output by the CRF layer to form the supplementary entity set.
[0092] Step 8: Compress the aforementioned supplementary entity set to obtain a lightweight supplementary entity set. This lightweight supplementary entity set occupies less memory. In practice, the execution entity can use differential compression to compress the supplementary entity set to obtain the lightweight supplementary entity set.
[0093] The ninth step is to store the aforementioned lightweight supplementary entity set and control the associated display to show the supplementary entity set. In practice, the executing entity can store the aforementioned lightweight supplementary entity set in a graphics database.
[0094] The first to ninth steps and related content described above, as an inventive point of this disclosure, solve the technical problem of "poor quality of supplementary entity sets extracted by large language models." Factors leading to poor quality of supplementary entity sets extracted by large language models often include: the extraction of supplementary entities corresponding to large language models is often coarse and cannot adapt to various business needs. Solving these factors can improve the quality of the extracted supplementary entity sets. To achieve this effect, embodiments of this disclosure provide a new entity extraction model. This model can perform multiple and deep extractions of key text using multi-layer BiLSTM, improving text extraction quality and thus improving the quality of the output supplementary text set. Furthermore, a compression step is added to the process, allowing the extracted supplementary text set to occupy less memory and reducing storage pressure. Therefore, the quality of the extracted supplementary entity set is improved, and memory usage is reduced.
[0095] Step 106: Combine the supplementary triplet and the basic target business map to generate a complete target business map.
[0096] In some embodiments, the aforementioned execution entity can combine the aforementioned supplementary triples and the aforementioned basic target service graph to generate a complete target service graph. In practice, the aforementioned supplementary triples can be added to the aforementioned basic target service graph to generate a more comprehensive complete graph. This addition can be achieved through the following steps:
[0097] The first step is to search for entities in the supplementary triples in the above basic target business graph. For example, to supplement the triples (smart coffee table, equipped with wireless charging function), search for "smart coffee table" in the basic graph.
[0098] The second step is to confirm whether the entities in the supplementary triples mentioned above exist in the basic target business graph, and whether the corresponding relationships exist. For example, if the "smart coffee table" node does not exist, a new entity node and its corresponding relationship are created and connected. If the "smart coffee table" node exists, the search continues to check whether the "possesses" relationship and "wireless charging function" exist in the basic target business graph. If they do not exist, a new entity is created near the node. If they exist, the relevant information is checked to see if it needs to be updated.
[0099] Optionally, the aforementioned entities may also perform the following steps:
[0100] The first step is to visualize the complete target business graph described above. In practice, dedicated graph visualization tools such as Cytoscape, Gephi, and self-developed software can be used. These tools typically support importing graph data and offer rich visualization configuration options. Taking Cytoscape as an example, the complete graph data needs to be converted and imported according to its supported formats (such as CSV, JSON, GraphML, etc.). Then, the styles of nodes and edges, layout algorithms, etc., are set in the tool to finally generate a visualized graph interface.
[0101] The second step is to store the aforementioned set of triples and the supplementary triples into a graph database. The graph database can be a database used for storing and processing graph structure data, enabling efficient storage and querying of node and edge information. Such graph databases include, but are not limited to, Neo4j and Janus Graph. In practice, storing the set of triples and the supplementary triples into a graph database involves organizing and storing these triples in a format supported by the graph database to facilitate subsequent graph querying, updating, and analysis operations.
[0102] The third step is to store the attribute information of the aforementioned triple set and the attribute information of the supplementary triples in a structured database. The attribute information of the triples can refer to other relevant information besides the subject, relation, and object of the triple itself, such as entity attributes (e.g., name, age, date of birth) and relation attributes (e.g., relation strength, timestamp). The structured database can be a relational database (e.g., MySQL, Oracle), storing data in tabular form, which can handle structured data well. In practice, taking MySQL as an example, the corresponding database and tables can be created first, the table fields and data types defined, and then the attribute information of the triples can be converted into a suitable data format. The data can then be stored in the tables by executing SQL insert statements for easy data management and maintenance.
[0103] Step 107: In response to generating a complete target service map, the complete target service map is sent to the user's associated display for display.
[0104] In some embodiments, the executing entity may, in response to generating a complete target service map, send the complete target service map to the user's associated display for display. The associated display may be an external electronic device (such as a mobile phone) connected to the executing entity via wired or wireless means.
[0105] Step 108: In response to detecting that the associated display is in display state, control the associated display to overlay the preset operation interface on the visualized complete target business map.
[0106] In some embodiments, the execution entity may, in response to detecting that the associated display is in a display state, control the associated display to overlay a preset operation interface onto the visualized complete target service map. The operation functions of the preset operation interface include zooming, collapsing, and saving.
[0107] The above embodiments of this disclosure have the following beneficial effects: Through the graph construction method of this disclosure, the process of model labeling and training can be replaced by calling a large language model. The constructed knowledge graph can be further expanded by extracting from the text library, and combined with self-developed software to display and provide users with a corresponding operation interface for the complete graph. Therefore, the graph construction process can be simplified, the constructed graph can be further improved, and the user experience can be enhanced. Specifically, the reason for the poor user experience of most graph construction methods is that model-based pre-training methods require a lot of time to label data when there is no readily available training data, and cannot further supplement the graph, resulting in poor graph coverage and a poor user experience. Based on this, this disclosure discloses some embodiments of the graph construction method. First, in response to receiving a user's question, based on the keywords extracted from the user's question, a target business graph construction request text for the target industry chain is obtained. The target industry chain includes the home furnishing industry chain, the automotive industry chain, and the logistics industry chain. The business graph is a graph that graphically presents various elements, relationships, and temporal processes in the industry chain. Thus, the user's needs are obtained. Then, the target business graph construction request text is formatted to obtain a processed graph construction request. Thus, by processing the graph construction request using a template, user needs are better addressed by invoking the subsequent large language model. Then, based on the processed graph construction request and the preset large language model, a basic target business graph is generated. Thus, the user's required basic target business graph is generated by invoking the large language model. Then, based on the target business-related content in the text vector library and the aforementioned basic target business graph, a supplementary text set for the basic target business graph is generated. Thus, the constructed basic target business graph can be further improved by extracting from the text set. Then, supplementary triples are extracted from the supplementary text set of the basic target business graph. Then, combining the supplementary triples and the aforementioned basic target business graph, a complete target business graph is generated. Finally, in response to the generation of the complete target business graph, the complete target business graph is sent to the user's associated display for display. Then, in response to detecting that the aforementioned associated display is in a display state, the associated display is controlled to overlay a preset operation interface onto the visualized complete target service map. The preset operation interface includes functions such as zooming, collapsing, and saving. This allows the user to operate on the generated complete map. Consequently, the obtained supplementary triples can be added to the basic target service map, generating a map with broader coverage. On one hand, the map construction method eliminates the data annotation process by using a large language model. On the other hand, the map construction method can further supplement the constructed basic target service map, improving the coverage of the generated image.Therefore, while generating maps with broader coverage, the data annotation process is eliminated, and the generated complete maps can be further manipulated through associated devices, thus improving the user experience.
[0108] Further reference Figure 2 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a map construction apparatus, which are similar to... Figure 1 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0109] like Figure 2 As shown, the graph construction apparatus 200 in some embodiments includes: an acquisition unit 201, a format processing unit 202, a first generation unit 203, a second generation unit 204, an extraction unit 205, a third generation unit 206, and sending units 207 and 208. The acquisition unit 201 is configured to, in response to receiving a user's question, acquire a target business graph construction request text for a target industry chain based on keywords extracted from the user's question. The target industry chain includes a home furnishing industry chain, an automotive industry chain, and a logistics industry chain. The business graph is a graphical representation of various elements, relationships, and temporal processes within the industry chain. The format processing unit 202 is configured to process the target business graph construction request text to obtain a processed graph construction request. The first generation unit 203 is configured to generate a basic target business graph based on the processed graph construction request and a preset large language model. The second generation unit 204 is configured to generate a supplementary text set for the basic target business graph based on target business-related content from a text vector library and the basic target business graph. Extraction unit 205 is configured to extract supplementary text sets from the aforementioned basic target service graph to obtain supplementary triples. Third generation unit 206 is configured to combine the supplementary triples and the aforementioned basic target service graph to generate a complete target service graph. Sending unit 207 is configured to send the complete target service graph to the user's associated display for display in response to its generation. Control unit 208 is configured to control the associated display to overlay a preset operation interface onto the visualized complete target service graph in response to detecting that the associated display is in a display state. The preset operation interface includes functions such as zooming, collapsing, and saving.
[0110] It is understandable that the units described in the device 100 are related to the reference. Figure 1 The steps in the described method correspond to each other. Therefore, the operations, features, and beneficial effects described above for the method also apply to the device 100 and the units contained therein, and will not be repeated here.
[0111] The following is for reference. Figure 3 It illustrates electronic devices suitable for implementing some embodiments of the present disclosure (such as...). Figure 1 The diagram shows the structure of the computing device 101)300. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0112] like Figure 3 As shown, the electronic device 300 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device 300. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0113] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 300 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 3 Each box shown can represent a device or multiple devices as needed.
[0114] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 309, or installed from storage device 308, or installed from ROM 302. When the computer program is executed by processing device 301, it performs the functions defined in the methods of some embodiments of this disclosure.
[0115] It should be noted that, in some embodiments of this disclosure, the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0116] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0117] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: respond to receiving a user's query, obtain a target business graph construction request text for the target industry chain based on keywords extracted from the user's query, wherein the target industry chain includes the home furnishing industry chain, the automotive industry chain, and the logistics industry chain, and the business graph is a graphical representation of various elements, relationships, and temporal processes within the industry chain; perform format processing on the aforementioned target business graph construction request text to obtain a processed graph construction request; and generate a basic target business graph based on the processed graph construction request and a preset large language model. Based on the target business-related content of the text vector library and the aforementioned basic target business map, a supplementary text set for the basic target business map is generated; supplementary triples are extracted from the supplementary text set; combined with the supplementary triples and the aforementioned basic target business map, a complete target business map is generated; in response to the generation of the complete target business map, the complete target business map is sent to the associated display of the aforementioned user for display; in response to detecting that the associated display is in a display state, the associated display is controlled to overlay a preset operation interface on the visualized complete target business map, wherein the operation functions of the preset operation interface include zooming, collapsing, and saving.
[0118] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0120] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including an acquisition unit, a format processing unit, a first generation unit, a second generation unit, an extraction unit, a third generation unit, a sending unit, and a control unit. The names of these units do not necessarily limit the unit itself; for example, the acquisition unit may also be described as "a unit that, in response to receiving a user's query, acquires a request text for constructing a target business graph of a target industry chain based on keywords extracted from the user's query."
[0121] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0122] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A method for constructing a map, comprising: In response to receiving a user's question, based on the keywords extracted from the user's question, a request text for constructing a target business graph for the target industry chain is obtained. The target industry chain includes the home furnishing industry chain, the automotive industry chain, and the logistics industry chain. The business graph is a graphical representation of the various elements, relationships, and time-series processes in the industry chain. The target business graph construction request text is formatted to obtain the processed graph construction request; Based on the processed graph construction request and the preset large language model, a basic target business graph is generated. Based on the target business-related content of the text vector library and the basic target business map, a supplementary text set for the basic target business map is generated. Supplementary triples are obtained by extracting supplementary text sets from the basic target business map; By combining the supplementary triples and the basic target service map, a complete target service map is generated; In response to generating a complete target service map, the complete target service map is sent to the user's associated display for display. In response to detecting that the associated display is in a display state, the associated display is controlled to overlay a preset operation interface on the visualized complete target business map, wherein the operation functions of the preset operation interface include zooming, collapsing and saving; The step of generating a basic target business graph based on the processed graph construction request and the preset large language model includes: The processed graph construction request is input into the preset large language model to obtain a triplet information set; Each triplet information in the triplet information set is vectorized to obtain a vectorized triplet information set. A graph is constructed based on the vectorized triplet information to obtain a basic target service graph, wherein the basic target service graph includes at least one triplet. The step of inputting the processed graph construction request into the preset large language model to obtain triple information includes: Information is extracted from the processed map construction request to obtain key information; Based on the database of the large language model, the key information knowledge set corresponding to the key information is determined. The large language model has accumulated a large amount of knowledge, which is stored in the database of the large language model. Using the key information, queries and matching are performed in the database of the large language model to find the knowledge content related to each key information. The set of this knowledge is the key information knowledge set. The key information knowledge set is extracted and processed using a pre-defined entity recognition model to obtain an entity set. For each entity in the entity set, extract the relation to obtain the relation set; Combine the entity set and the relation set to output triple information.
2. The method according to claim 1, wherein, The step of formatting the target business graph construction request text to obtain the processed graph construction request includes: Determine the first project template corresponding to the target business graph construction request text; Based on the first project template, the target business graph construction request text is format-converted to obtain the processed graph construction request.
3. The method according to claim 1, wherein, Based on the target business-related content from the text vector library and the basic target business map, a supplementary text set for the basic target business map is generated, including: Based on the basic target service map, each triplet in the basic target service map is determined to obtain a triplet set; Determine the entity node corresponding to each triplet in the triplet set to obtain the entity node set; Perform the following steps for each entity node in the entity node set: Generate the similarity between entity nodes and each text vector in the text vector library to obtain a similarity set; Based on the similarity set, a preset number of text vectors with the highest similarity to the entity node are determined to obtain a supplementary text vector set; Map the text vectors in the supplementary text vector set to the corresponding text to obtain the supplementary text set corresponding to the entity node; Based on the obtained supplementary text sets, a supplementary text set for the basic target business graph is generated, wherein the supplementary text set for the basic target business graph includes the supplementary text set for each entity node.
4. The method according to claim 3, wherein, The method further includes: Store the set of triples and the supplementary triples in a graph database; The attribute information of the triple set and the attribute information of the supplementary triple are stored in a structured database.
5. The method according to claim 1, wherein, The extraction of supplementary text sets from the basic target business map yields supplementary triples, including: Based on the supplementary text set of the basic target business map, determine the corresponding second project template; Based on the second project template, the format of the supplementary text set of the basic target business map is adjusted to obtain the adjusted supplementary text set of the basic target business map. Based on the preset large language model, the following steps are performed on the supplementary text of each basic target business graph in the adjusted basic target business graph supplementary text set: Key information is extracted from the supplementary text of the basic target business map to obtain key text information. Based on the key information in the text, the supplementary entities in the supplementary text of the basic target business map are determined, and a supplementary entity set is obtained; Based on the preset standards of the second engineering template, the relationships between each supplementary entity are determined to obtain an entity relationship set; Based on the entity relationship set, the relationships between each supplementary entity are generated to obtain supplementary triplet information; The supplementary triplet information is vectorized to obtain the supplementary triplet.
6. A map construction apparatus, comprising: The acquisition unit is configured to, in response to receiving a user's question, acquire a target business graph construction request text for the target industry chain based on keywords extracted from the user's question. The target industry chain includes the home furnishing industry chain, the automotive industry chain, and the logistics industry chain. The business graph is a graphical representation of various elements, relationships, and time-series processes in the industry chain. The format processing unit is configured to process the target business graph construction request text to obtain the processed graph construction request. The first generation unit is configured to generate a basic target business graph based on the processed graph construction request and a preset large language model. The second generation unit is configured to generate a supplementary text set for the basic target business map based on the target business-related content of the text vector library and the basic target business map. The extraction unit is configured to extract supplementary text sets from the basic target service graph to obtain supplementary triples; The third generation unit is configured to combine the supplementary triplet and the basic target service map to generate a complete target service map. The sending unit is configured to send the complete target service map to the user's associated display for display in response to the generation of the complete target service map; The control unit is configured to, in response to detecting that the associated display is in a display state, control the associated display to overlay a preset operation interface on the visualized complete target business map, wherein the operation functions of the preset operation interface include zooming, collapsing and saving; The first generation unit is further configured to: The processed graph construction request is input into the preset large language model to obtain a triplet information set; Each triplet information in the triplet information set is vectorized to obtain a vectorized triplet information set. A graph is constructed based on the vectorized triplet information to obtain a basic target service graph, wherein the basic target service graph includes at least one triplet. The step of inputting the processed graph construction request into the preset large language model to obtain triple information includes: Information is extracted from the processed map construction request to obtain key information; Based on the database of the large language model, the key information knowledge set corresponding to the key information is determined. The large language model has accumulated a large amount of knowledge, which is stored in the database of the large language model. Using the key information, queries and matching are performed in the database of the large language model to find the knowledge content related to each key information. The set of this knowledge is the key information knowledge set. The key information knowledge set is extracted and processed using a pre-defined entity recognition model to obtain an entity set. For each entity in the entity set, extract the relation to obtain the relation set; Combine the entity set and the relation set to output triple information.
7. An electronic device, comprising: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 5.
8. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Graphic knowledge base-based question and answer method and device, storage medium, and apparatus
WO2021082982A1
Data processing method and related device
WO2024255755A1