A mineral processing query method and system based on retrieval enhancement generation and large language model
Through searching and enhancing generation and large-language model ore dressing query methods, the problems of difficulty in obtaining knowledge and poor adaptability of traditional ore dressing systems are solved, a comprehensive ore dressing knowledge base is built, the accuracy and robustness of ore dressing decisions are improved, and intelligence is realized Efficient support for ore dressing.
Patent Information
- Application Number
- CN202411230554.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-09-04
AI Technical Summary
Traditional ore dressing systems have problems such as difficulty in obtaining knowledge, poor adaptability and low decision-making accuracy, resulting in low efficiency and insufficient robustness.
The ore dressing query method of search enhanced generation and large language models is adopted. By converting ore dressing problems into text content, semantic representation and comparison are performed using word embedding models and encoder layers of large language models, a knowledge base is constructed and a Milvus vector database is used for Efficient search, combined with the search enhancement framework and multi-layer vector query mechanism, realize automatic acquisition and continuous learning of knowledge.
A comprehensive mineral processing knowledge base has been built, which improves the quality of word vectors and query accuracy, enhances the robustness and adaptability of the system, provides accurate and reliable Q&A reply and knowledge traceability, and supports intelligent mineral processing decisions.
Smart Images

Figure CN118733636B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent metallurgical technology, and in particular to a mineral processing query method and system for retrieval enhancement generation and large language model. Background Art
[0002] Traditional mineral processing systems are based on models and rely on rules, cases, fuzzy reasoning and other methods for knowledge expression and reasoning. They have the following limitations:
[0003] (1) Difficulty in knowledge acquisition: Traditional systems need to acquire knowledge from domain experts, which is a time-consuming and labor-intensive process with low knowledge acquisition efficiency. At the same time, the knowledge representation capability is limited, making it difficult to fully express complex mineral processing domain knowledge.
[0004] (2) Poor adaptability: Traditional methods are usually based on fixed rules and knowledge bases, which make it difficult to continuously learn new knowledge and adapt to changes in mineral processing scenarios, resulting in a lack of robustness and generalization capabilities in the system;
[0005] (3) Low decision accuracy: Due to the limitations of knowledge representation and reasoning capabilities, traditional systems are unable to fully consider relevant factors and uncertainties when dealing with complex mineral processing problems, leading to incorrect decisions.
[0006] The above limitations lead to the problems of low efficiency, low precision and poor adaptability in traditional mineral processing systems, and it is urgent to develop a new intelligent mineral processing system to solve these problems. Summary of the invention
[0007] The present invention provides a mineral processing query method and system of retrieval enhancement generation and large language model to solve the problems of low efficiency, low precision and poor adaptability of existing mineral processing methods.
[0008] In order to achieve the above object, the present invention is implemented by the following technical solutions:
[0009] In a first aspect, the present invention provides a mineral processing query method for retrieval enhancement generation and large language model, comprising the following steps:
[0010] The mineral processing problems at the mineral processing site are converted into text content, the text content is preprocessed, and the preprocessed text content is input into the mineral processing language model. The mineral processing language model as a whole adopts the encoder layer of the retrieval enhancement framework and the large language model to obtain the semantic content of the text content, and then the word vector representation method of the word embedding model is used to output the word vector corresponding to the semantic content. Based on the word vector, a comparison is performed in the constructed knowledge base to obtain the retrieval results corresponding to the mineral processing problems, and the mineral processing is completed according to the retrieval results.
[0011] Among them, the word embedding model can automatically acquire a large amount of mineral processing knowledge, greatly reducing the cost of building an artificial knowledge base. The large language model can continuously learn and update from this knowledge, and the encoder of the large language model and the word embedding model's word vector representation method can better express complex mineral processing expertise and semantic relationships;
[0012] The retrieval-enhanced generation framework of the word embedding model can also enable large language models to learn and adapt to mineral processing domain knowledge more efficiently, thereby improving the robustness and adaptability of the mineral processing language model.
[0013] Furthermore, the knowledge base is constructed based on the mineral processing knowledge document, and the construction of the knowledge base includes the following steps:
[0014] The prepared mineral processing knowledge document is parsed, the text content of the mineral processing knowledge document is extracted, the text content is preprocessed, the preprocessed text content is converted into a word vector through a mineral processing language model, the word vector is stored in the knowledge base, and the construction of the knowledge base is completed.
[0015] Furthermore, storing the word vector in the knowledge base includes: storing the word vector in a storage system according to a specific data structure;
[0016] The specific data structures include: KD tree, hash table, inverted index, B tree, B+ tree, dictionary tree, Bloom filter, IVF_FLAT, HNSW.
[0017] Further, the storage system includes a Milvus vector database;
[0018] The word vectors are stored in the Milvus vector database according to the data structures of IVF_FLAT and HNSW.
[0019] Through the above design, a hybrid indexing strategy combining IVF_FLAT and HNSW is adopted to effectively balance the retrieval speed and accuracy. The Milvus vector database is a high-performance and scalable vector database that can efficiently support the massive data support of the mineral processing expert system.
[0020] Furthermore, the mineral processing knowledge document includes: mineral properties, mineral processing methods, mineral processing equipment, mineral processing process flow, mineral processing effect evaluation, mineral processing environmental protection and safety, and mineral processing reagents.
[0021] Further, the mineral processing language model includes multiple word embedding models and multiple encoder layers of large language models;
[0022] The mineral processing language model is expressed as:
[0023] ;
[0024] in, Represents the beneficiation language model; Representing the word embedding model framework The number of Representing a large language model encoder layer the number of and They are all weight parameters; Represents the text content of the input; Represents word vectors; for In the context of for context.
[0025] Further, the comparison in the constructed knowledge base includes: comparing the similarity between the word vector corresponding to the mineral processing problem and the stored word vector in the knowledge base;
[0026] It can be expressed as:
[0027] ;
[0028] in, represents the weight, Represents the word vector corresponding to the mineral processing problem, Represents the stored word vector, represents the dot product of vectors, Represents the norm of Vector2.
[0029] Further, the preprocessing includes: text information processing and text slicing;
[0030] The text information processing includes: text cleaning, word segmentation, part-of-speech tagging and named entity recognition.
[0031] Furthermore, the retrieval results corresponding to the mineral processing problem specifically include:
[0032] The mineral processing language model compares the constructed knowledge base based on the retrieval enhancement generation framework, generates the retrieval results corresponding to the mineral processing questions, reviews the retrieval results, and saves the sources of key knowledge in the retrieval results.
[0033] In a second aspect, the present invention provides a mineral processing system based on retrieval enhanced generation and a large language model, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above methods when executing the computer program.
[0034] Beneficial effects:
[0035] The present invention provides a method and system for mineral processing query with enhanced retrieval generation and large language model:
[0036] 1. Build a comprehensive mineral processing knowledge base, covering comprehensive information such as mineral properties, mineral processing methods, equipment, process flow, effect evaluation, environmental protection and safety, mineral processing reagents, etc., to provide a knowledge base for the intelligent mineral processing system.
[0037] 2. We propose a beneficiation language model that integrates multiple large language model encoders and traditional word embedding technology, which can more effectively represent text semantics and contextual dependencies and improve the quality of word vectors.
[0038] 3. Design a multi-layer vector query mechanism to perform queries by calculating the similarity between the query vector and the knowledge base document vector, and introduce a method to adjust the similarity calculation based on user feedback to improve the accuracy of the query.
[0039] 4. Questions and answers generated based on the retrieval enhancement framework and large language model provide accurate and reliable responses, and use prompt words to guide generation to make it more consistent with user intent.
[0040] 5. Establish a review and knowledge traceability mechanism to ensure the accuracy, reliability and interpretability of generated content, and record key knowledge sources for subsequent optimization.
[0041] 6. It covers the entire process of text processing, including collection, loading, preprocessing, vectorization, query, generation and other links. It is a complete intelligent mineral processing solution.
[0042] 7. Integrate multiple artificial intelligence technologies such as large-scale language models, information retrieval, and generative question answering to achieve human-machine collaborative intelligent decision support in the mineral processing field. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A flowchart of a mineral processing query method for retrieval enhancement generation and large language model according to an embodiment of the present invention;
[0044] Figure 2 This is a general framework flow chart of an embodiment of the present invention based on retrieval enhancement generation and a large language model;
[0045] Figure 3 The present invention is a schematic diagram of the structure of a mineral processing query method of retrieval enhancement generation and large language model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the usual meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "one" do not indicate quantity restrictions, but indicate the existence of at least one. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.
[0048] See also Figure 1-2 , the embodiment of the present application provides a mineral processing query method for retrieval enhancement generation and large language model, comprising the following steps:
[0049] Step 1: Convert the mineral processing questions to be asked into text content and pre-process the text content;
[0050] During the mineral processing process, the grinding mill was stuck and could not continue to perform the mineral processing task and complete the mineral processing. At this time, the problem was converted into text content and the text content was preprocessed;
[0051] That is, if the beneficiation problem is "grinding mill stuck", the corresponding converted text content is also "grinding mill stuck";
[0052] After the mineral processing questions to be asked are converted into text content, these texts need to be further processed for subsequent operations, which includes text cleaning (such as removing punctuation marks, numbers, etc.), word segmentation, part-of-speech tagging, and named entity recognition in this application. These steps are crucial for understanding and classifying information such as the properties of ore, mineral processing methods, mineral processing equipment, and process flow. Through such processing, text data can be understood and parsed more accurately, thereby providing more accurate mineral processing suggestions and predictions. This also helps to improve mineral processing efficiency and effectiveness.
[0053] In order to facilitate the subsequent vectorization operation, the text content needs to be divided into segments. These segments can be sentences, paragraphs, or other suitable text units. These segments will serve as the basic units for understanding and processing text data. In this way, the information in the text can be analyzed and understood more effectively, so as to more accurately extract key information related to mineral processing.
[0054] Step 2: Input the preprocessed text content into the mineral processing language model. The mineral processing language model as a whole adopts the encoder layer of the retrieval enhancement framework and the large language model to obtain the semantic content of the text content, and output the word vector corresponding to the semantic content in the word vector representation of the word embedding model;
[0055] Among them, the overall ore dressing language model adopts a retrieval enhancement framework, and includes multiple word embedding model frameworks and multiple encoder layers of large language models;
[0056] The ore dressing language model is expressed as:
[0057] ;
[0058] in, Represents the beneficiation language model; Representing the word embedding model framework The number of Represents a large language model encoder layer the number of and They are all weight parameters; Represents the text content of the input; Represents word vectors; for In the context of for context.
[0059] in, and As a weight parameter, it is used to control the weight between the outputs of different models. The weight parameter can be learned through training data. For the beneficiation language model, a large language model can choose a model with smaller parameters. For example, a model with a size of less than 35B can be selected. Please refer to Figure 3 In this embodiment, the mineral processing language model replaces the encoder layer of the word embedding model by the encoder layer of Qianwen 7b, Qianwen 14b, Qianwen 32b, lama3 7b, and lama3 14b models, so that the model can run below 24G, among which Qianwen 7b, Qianwen 14b, Qianwen 32b, lama3 7b and lama3 14b are all large language models.
[0060] The retrieval enhancement framework can automatically acquire massive mineral processing knowledge, greatly reducing the cost of building an artificial knowledge base. The large language model can continuously learn and update from this knowledge; the integration of large language model encoders and word embedding technology can better express complex mineral processing expertise and semantic relationships; the large language model can be continuously trained and adjusted according to new data, and the retrieval enhancement framework enables the large language model to learn and adapt to mineral processing field knowledge more efficiently, thereby improving the robustness and adaptability of the system; the knowledge retrieval of the retrieval enhancement framework and the generative reasoning ability of the large language model are fully utilized to obtain high-quality responses, providing strong support for decision-making.
[0061] Step 3: Based on the word vector, compare it in the constructed knowledge base to obtain the search results corresponding to the mineral processing problem, and complete the mineral processing according to the search results;
[0062] The comparison in the constructed knowledge base includes: comparing the similarity between the word vector corresponding to the mineral processing problem and the stored word vector in the knowledge base;
[0063] It can be expressed as:
[0064] ;
[0065] in, represents the weight, Represents the word vector corresponding to the mineral processing problem, Represents the stored word vector, represents the dot product of vectors, Represents the norm of Vector2.
[0066] The knowledge base is pre-built and is built based on the mineral processing knowledge document. The mineral processing knowledge required to be covered by the mineral processing knowledge document includes mineral properties, mineral processing methods, mineral processing equipment, mineral processing process, mineral processing effect evaluation, mineral processing environmental protection and safety, and mineral processing reagents.
[0067] Specifically, mineral properties include basic information such as the chemical composition, physical properties, and ore type of the mineral. Ore dressing methods include various methods used for lead-zinc ore dressing, such as flotation, gravity separation, magnetic separation, etc., as well as the working principles, operating steps, advantages and disadvantages of these methods. Ore dressing equipment includes various equipment used for lead-zinc ore dressing, such as crushers, grinders, flotation machines, etc., as well as the working principles, operating methods, maintenance, etc. of these equipment. Ore dressing process flow includes typical process flow of lead-zinc ore dressing, such as crushing-grinding-classification-flotation-dehydration, etc., as well as the design principles, operating skills, and effect evaluation of these processes. Ore dressing effect evaluation includes various indicators used to evaluate the effect of ore dressing, such as recovery rate, grade, flotation index, etc., as well as the calculation methods, meaning interpretation, and optimization strategies of these indicators. Ore dressing environmental protection and safety include environmental protection and safety issues in the ore dressing process, such as wastewater treatment, tailings utilization, operational safety, etc., as well as solutions to these problems, regulatory requirements, best practices, etc. Ore dressing reagents include the following categories:
[0068] Collector: Collectors make the surface of useful mineral particles hydrophobic, allowing them to adhere to bubbles and float to the surface of the water with the bubbles, thereby being recovered. Commonly used collectors include xanthate, black medicine, butyl xanthate, sodium dodecyl sulfate, etc.
[0069] Inhibitors: Inhibitors make the surface of useless mineral particles hydrophilic, so that they cannot adhere to bubbles, and thus sink into the water and are not recovered. Commonly used inhibitors include sodium cyanide, lime, zinc sulfate, water glass, etc.
[0070] Frothing agent: Frothing agent generates and stabilizes bubbles, providing an interface for the contact between collector and mineral particles. Commonly used foaming agents include pine oil, methyl isobutyl ketone, Cresol, No. 3 mineral oil, etc.
[0071] Adjuster: The adjuster adjusts the pH value of the slurry so that the collector and inhibitor can play a better role. Commonly used adjusters include lime, soda, sulfuric acid, hydrochloric acid, etc.
[0072] Diluent: Diluent reduces the concentration of slurry, allowing mineral particles to be fully dispersed, which is beneficial to the effect of collectors and inhibitors. Commonly used diluents include water, tailings water, etc.
[0073] Polymerization agent: Polymerization agent aggregates fine mineral particles into agglomerates, which is beneficial to flotation. Commonly used polymerization agents include acrylamide, polyacrylamide, polyethyleneimine, etc.
[0074] Dispersant: Dispersant prevents the agglomeration of fine mineral particles and is beneficial to flotation. Commonly used dispersants include sodium hexametaphosphate, water glass, sodium citrate, etc.
[0075] The construction of knowledge base from mineral processing knowledge documents includes the following steps:
[0076] Parse the prepared mineral processing knowledge document, extract the text content of the mineral processing knowledge document, preprocess the text content, perform word embedding processing on the preprocessed text content through the mineral processing language model, convert the text content into word vectors, store the word vectors in the knowledge base, and complete the construction of the knowledge base.
[0077] In this embodiment, the word vector is stored in the Milvus vector database according to the data structure of IVF_FLAT and HNSW.
[0078] IVF_FLAT index is an index structure used for efficient similarity search, especially suitable for fast nearest neighbor search of large-scale vector data sets. It combines the characteristics of inverted file (IVF) and FLAT index.
[0079] IVF_FLAT index mainly includes inverted file (IVF) and flat index (Flat Index);
[0080] Inverted Index File (IVF): The dataset is divided into multiple clusters, each with a center vector; the query vector is first assigned to one or more of the nearest clusters, and then the search is performed only within these clusters; this reduces the number of vectors that need to be checked, thereby speeding up the search;
[0081] Flat Index: In each cluster, vector data is stored as a flat index, that is, the vector is directly stored in an array. When querying, a linear scan is performed in the flat index to calculate the distance between the query vector and all vectors in the cluster.
[0082] The HNSW (Hierarchical Navigable Small World) index achieves efficient approximate nearest neighbor search by constructing a hierarchical small world graph.
[0083] Milvus is a high-performance, scalable vector database designed specifically for the storage and retrieval of large-scale vector data. It can efficiently support the massive data retrieval requirements for mineral processing related issues. The extracted semantic feature representation is converted into vector form and stored in Milvus. The efficient vector retrieval capability of Milvus can be used to quickly retrieve documents related to the query.
[0084] In other embodiments, data structures such as KD tree, hash table, inverted index, B tree, B+ tree, dictionary tree, and Bloom filter may also be used.
[0085] Finally, the mineral processing language model generates prompt words based on the word embedding model framework retrieval, combines the large language model query context, generates retrieval results corresponding to the mineral processing questions, and reviews the retrieval results to save the source of key knowledge in the retrieval results.
[0086] The final search results obtained are:
[0087] 1. Overfeeding: The ore feed exceeds the mill’s processing capacity, causing blockage inside the mill.
[0088] 2. Wear of steel balls or liner: Severe wear of steel balls or liner will affect the grinding effect and may cause ore accumulation.
[0089] 3. Insufficient water: Insufficient grinding medium (water) will affect the fluidity of the slurry and increase the risk of sticking.
[0090] 4. Improper mill speed: Too low a speed may result in the ore not being effectively ground and discharged.
[0091] 5. Blockage of the discharge port: Blockage of the discharge port will prevent the slurry from being discharged smoothly, causing accumulation.
[0092] 6. Large pieces of ore: Large pieces of ore that have not been fully crushed entering the mill may cause jamming.
[0093] 7. Improper mill maintenance: Long-term lack of maintenance may lead to performance degradation of various components and increase the risk of jamming.
[0094] 8. Problems that may result from improper adjustment of the hydrocyclone:
[0095] If the cutting particle size of the cyclone is adjusted too fine, a large amount of material that should have been discharged will return to the mill, increasing the mill load.
[0096] If the feed concentration, pressure or flow rate of the cyclone is not adjusted properly, the classification effect will be affected, which may cause too much coarse material to return to the mill.
[0097] Impact on the mill:
[0098] In this case, the material circulation load in the mill will increase significantly, which may cause the mill to overload and eventually cause it to jam.
[0099] Solution:
[0100] Regularly check and adjust the operating parameters of the hydrocyclone, such as feed pressure, concentration, etc.
[0101] Make sure the cyclone's wear parts, such as the cyclone lining, are in good condition.
[0102] Monitor and optimize classification efficiency to ensure the right cut size.
[0103] Association with other factors:
[0104] Problems with hydrocyclones can interact with the other factors mentioned above. For example, if the feed ore is too large or the water supply is insufficient, the hydrocyclone will not function properly.
[0105] Adjustments were made at the mineral processing site based on the search results to resolve the mill jam problem.
[0106] Users can also evaluate the search results, and then adjust the weight of the similarity between the word vector corresponding to the mineral processing problem and the stored word vector in the knowledge base to improve the search accuracy of the mineral processing language model.
[0107] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A mineral processing query method with retrieval enhancement generation and large language model, characterized in that: The steps include: The mineral processing problems at the mineral processing site are converted into text content, the text content is preprocessed, and the preprocessed text content is input into the mineral processing language model. The mineral processing language model as a whole adopts the encoder layer of the retrieval enhancement framework and the large language model, and thereby obtains the semantic content of the text content, and then uses the word vector representation method of the word embedding model to output the word vector corresponding to the semantic content, and based on the word vector, compares it in the constructed knowledge base to obtain the retrieval results corresponding to the mineral processing problems, and completes the mineral processing according to the retrieval results; The beneficiation language model includes multiple word embedding models and multiple encoder layers of large language models; The mineral processing language model is expressed as: ; in, Represents the beneficiation language model; Representing the word embedding model framework The number of Represents a large language model encoder layer the number of and They are all weight parameters; Represents the text content of the input; Represents word vectors; for In the context of for context.
2. The method for mineral processing query based on retrieval enhancement generation and large language model according to claim 1 is characterized in that: The knowledge base is constructed based on mineral processing knowledge documents, and the construction of the knowledge base includes the following steps: The prepared mineral processing knowledge document is parsed, the text content of the mineral processing knowledge document is extracted, the text content is preprocessed, the preprocessed text content is converted into a word vector through a mineral processing language model, the word vector is stored in the knowledge base, and the construction of the knowledge base is completed.
3. The retrieval enhancement generation and large language model beneficiation query method according to claim 2 is characterized in that: The storing the word vector into the knowledge base includes: storing the word vector into a storage system according to a specific data structure; The specific data structures include: KD tree, hash table, inverted index, B tree, B+ tree, dictionary tree, Bloom filter, IVF_FLAT, HNSW.
4. The method for mineral processing query based on retrieval enhancement generation and large language model according to claim 3 is characterized in that: The storage system includes a Milvus vector database; The word vectors are stored in the Milvus vector database according to the data structures of IVF_FLAT and HNSW.
5. The method for mineral processing query based on retrieval enhancement generation and large language model according to claim 2 is characterized in that: The mineral processing knowledge documents include: mineral properties, mineral processing methods, mineral processing equipment, mineral processing process flow, mineral processing effect evaluation, mineral processing environmental protection and safety, and mineral processing reagents.
6. The retrieval enhancement generation and large language model beneficiation query method according to claim 1 or 2, characterized in that: The comparison in the constructed knowledge base includes: comparing the similarity between the word vector corresponding to the mineral processing problem and the stored word vector in the knowledge base; It is expressed as: ; in, represents the weight, Represents the word vector corresponding to the mineral processing problem, Represents the stored word vector, represents the dot product of vectors, Represents the norm of Vector2.
7. The retrieval enhancement generation and large language model beneficiation query method according to claim 1 or 2, characterized in that: The preprocessing includes: text information processing and text slicing; The text information processing includes: text cleaning, word segmentation, part-of-speech tagging and named entity recognition.
8. The method for mineral processing query based on retrieval enhancement generation and large language model according to claim 1, characterized in that: The retrieval results corresponding to the mineral processing problem specifically include: The mineral processing language model compares the constructed knowledge base based on the retrieval enhancement generation framework, generates the retrieval results corresponding to the mineral processing questions, reviews the retrieval results, and saves the sources of key knowledge in the retrieval results.
9. A mineral processing query system with retrieval enhancement generation and large language model, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 8 are implemented.
