Question answering method and device based on language large model and storage medium
Patent Information
- Application Number
- CN202411223409.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2044-09-02
AI Technical Summary
[0005]本申请提供了基于语言大模型的问题应答方法、装置及存储介质,以至少解决相关技术中在低算力平台部署的语言大模型的方式存在语言模型的匹配能力差的问题
[0010]在本申请实施例中,采用在将对象问题输入到语言大模型之前对对象问题进行预处理的方式,响应于输入对象输入的当前对象问题,通过预处理层对当前对象问题进行预处理,其中,预处理层包括反向对应层,反向对应层用于基于预设的指定领域的领域词语与通用领域的通用词语之间的对应关系,将当前对象问题中存在对应的领域词语的通用词语替换为对应的领域术语;在预处理后的当前对象问题为待解答的问题的情况下,将预处理后的当前对象问题输入到语言大模型中,得到与当前对象问题对应的回复内容;向输入对象展示与当前对象问题对应的回复内容,由于低算力平台是针对特定场景设计的,其部署语言模型的目的也是对特定场景的问题和咨询进行专业解答,这意味着低算力平台部署的语言大模型不需要很多通用的知识,因此,对对象问题进行一些预处理,包括通过反向对应层将通用词语替换为领域词语(专业词语),专业语言涉及的范围相当较小并且也不会有过多歧义,因此可以降低通用语言的处理算力开销,同时保证了大模型能得到开放范围相对较小的提问问题,从而更贴近对模型进行训练时的原始样本,降低了对语言大模型处理通用语言能力的需求,从而可以缩小语言大模型的模型规模,使得语言大模型可以适配低算力平台,且能够给出特定领域专业的回答;此外,相对于无限的通用词语,领域词语的数量有限,因此,通过领域词语去匹配对象问题中的专业词语,所需的运算量更小,从而更适配低算力平台,因此,可以解决相关技术中在低算力平台部署的语言大模型的方式存在语言模型的匹配能力差的问题,达到提高语言模型的匹配能力的技术效果。
Smart Images

Figure CN119202163B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a question-answering method, apparatus, and storage medium based on a large language model. Background Technology
[0002] Large Language Models (LLMs) are an artificial intelligence technique that uses deep learning to train on large-scale text data to understand and generate natural language text. To achieve better expressive power and more feature learning capabilities, LLMs are often expanded by stacking and adding layers. However, the more layers stacked, the greater the computational cost. Computational power and the capabilities of LLMs are usually positively correlated.
[0003] Low-computing-power platforms also have a need for targeted deployment of large language models, such as deploying question-answering robots. These platforms are typically embedded systems or other closed systems, where deploying large language models is extremely difficult or slow. To address this, model lightweighting can reduce computational overhead. Model lightweighting compresses the number of model layers as much as possible. However, compressing the number of model layers can lead to poor language model matching capabilities, resulting in irrelevant answers or unsatisfactory responses.
[0004] This shows that the approach of deploying large language models on low-computing-power platforms in related technologies suffers from poor language model matching capabilities. Summary of the Invention
[0005] This application provides a question-response method, apparatus, and storage medium based on a large language model, to at least solve the problem of poor language model matching ability in the related art when deploying large language models on low computing power platforms.
[0006] According to one aspect of the embodiments of this application, a question-response method based on a language big model is provided, comprising: responding to a current object question input by an input object, preprocessing the current object question through a preprocessing layer, wherein the preprocessing layer includes a reverse correspondence layer, the reverse correspondence layer being used to replace the general terms in the current object question that have corresponding domain terms with corresponding domain terms based on a preset correspondence between domain terms of a specified domain and general terms of a general domain; if the preprocessed current object question is a question to be answered, inputting the preprocessed current object question into the language big model to obtain the response content corresponding to the current object question; and displaying the response content corresponding to the current object question to the input object.
[0007] According to another aspect of the embodiments of this application, a question-response device based on a language big model is also provided, comprising: a preprocessing unit, configured to preprocess the current object question in response to an input object's input current object question through a preprocessing layer, wherein the preprocessing layer includes a reverse correspondence layer, the reverse correspondence layer being configured to replace the general words in the current object question that have corresponding domain words with corresponding domain terms based on a preset correspondence between domain words of a specified domain and general words of a general domain; an input unit, configured to input the preprocessed current object question into the language big model if the current object question is a question to be answered, to obtain the response content corresponding to the current object question; and a display unit, configured to display the response content corresponding to the current object question to the input object.
[0008] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, in which a computer program is stored, wherein when the computer program is executed by a processor, it implements the method steps in any of the above examples.
[0009] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method steps in any of the above examples.
[0010] In this embodiment, the object question is preprocessed before being input into the language model. Responding to the current object question input by the input object, a preprocessing layer is used to preprocess the current object question. This preprocessing layer includes a reverse mapping layer, which replaces common terms in the current object question with corresponding domain terms based on a preset correspondence between domain terms in a specified domain and general terms in a general domain. If the preprocessed current object question is still an unanswered question, it is input into the language model to obtain a response corresponding to the current object question. The response corresponding to the current object question is then displayed to the input object. Since the low-computing platform is designed for a specific scenario, and the purpose of deploying its language model is to provide professional answers to questions and inquiries in that specific scenario, this means that the language model deployed on the low-computing platform does not require much general knowledge. Preprocessing the object-oriented questions involves replacing general terms with domain-specific terms (technical terms) using a reverse mapping layer. Technical terms have a relatively narrow scope and are less ambiguous, thus reducing the computational cost of processing general language. This ensures the large model receives questions with a relatively narrow scope, closely resembling the original samples used for training. This reduces the need for the language model to handle general language, allowing for a smaller model size that is adaptable to low-computing platforms while still providing domain-specific professional answers. Furthermore, the limited number of domain-specific terms compared to an infinite number of general terms means that matching these terms with technical terms in the object-oriented questions requires less computation, making it more suitable for low-computing platforms. Therefore, this addresses the problem of poor matching ability in language models deployed on low-computing platforms in related technologies, effectively improving the matching capabilities of the language model. Attached Figure Description
[0011] Figure 1 This is a hardware structure block diagram of an optional server device according to an embodiment of this application;
[0012] Figure 2 This is a flowchart illustrating an optional question-and-answer method based on a large language model according to an embodiment of this application;
[0013] Figure 3 This is a schematic diagram of an optional reverse corresponding layer according to an embodiment of this application;
[0014] Figure 4 This is a schematic diagram of an optional correlation determination layer according to an embodiment of this application;
[0015] Figure 5This is a schematic diagram of an optional problem separation layer according to an embodiment of this application;
[0016] Figure 6 This is a schematic diagram of an optional question-and-response method based on a large language model according to an embodiment of this application;
[0017] Figure 7 This is a schematic diagram of another optional question-and-response method based on a large language model according to an embodiment of this application;
[0018] Figure 8 This is a structural block diagram of an optional question-and-response device based on a large language model according to an embodiment of this application;
[0019] Figure 9 This is a structural block diagram of a computer system for an optional electronic device according to an embodiment of this application. Detailed Implementation
[0020] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0022] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of an optional server device according to an embodiment of this application. For example... Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a processing device such as an MCU (Microcontroller Unit) or FPGA (Field-Programmable Gate Array)) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0023] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the language-based large model question-and-answer method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thus implementing the aforementioned method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to server devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0024] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a NIC (Network Interface Controller), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be an RF (Radio Frequency) module used for wireless communication with the Internet.
[0025] According to one aspect of the embodiments of this application, a question-response method based on a large language model is provided. Figure 2 This is a flowchart illustrating an optional question-and-response method based on a large language model according to an embodiment of this application, as shown below. Figure 2 As shown, the process includes the following steps:
[0026] Step S202: In response to the current object question input by the input object, the current object question is preprocessed through the preprocessing layer;
[0027] Step S204: If the preprocessed current object question is an unanswered question, input the preprocessed current object question into the language big model to obtain the response content corresponding to the current object question;
[0028] Step S206: Display the response content corresponding to the current object's question to the input object.
[0029] The question-answering method based on a large language model in this embodiment can be applied to scenarios where a large language model is used to answer questions input by users. A large language model is an artificial intelligence technique that uses deep learning to train on large-scale text data to understand and generate natural language text. These models are typically based on a Transformer architecture, which can handle long-range dependencies and performs well when processing sequential data. Currently, AI applications are widely deployed, and there is also a need for targeted deployment of large language models on low-computing-power platforms, such as deploying question-answering robots. Here, low-computing-power platforms typically refer to embedded systems or other closed systems, where the hardware is mostly integrated into the motherboard or non-replaceable, and often deployed within closed networks without internet connectivity. Deploying large language models on these systems is exceptionally difficult and slow.
[0030] Currently, low-computing-power platforms can only deploy lightweight models. Model lightweighting reduces computational overhead by compressing the number of model layers as much as possible, thereby lowering the computational demands of large language models. However, large language models are typically designed for better expressive power and more feature learning capabilities, often involving stacking and expanding the model's layers. But the more layers stacked, the greater the computational overhead; computational power and the capabilities of large language models are usually positively correlated. Therefore, compressing the model's layers can lead to poor language model matching ability, resulting in irrelevant answers or unsatisfactory responses.
[0031] Therefore, one approach is to upgrade computing power by upgrading hardware, specifically the processor or other external computing resources. However, low-computing-power platforms are typically dedicated devices, and other embedded systems are also generally designed for specific purposes. Therefore, upgrading hardware to improve computing power can lead to a surge in system hardware costs. Here, a low-computing-power platform refers to a computer system with limited processing capabilities, such as an embedded system. This embedded system could be a Baseboard Management Controller (BMC), various microcontroller systems, etc. Large-scale language models are an artificial intelligence technique that uses deep learning methods to train on large-scale text data to understand and generate natural language text.
[0032] In this embodiment, to at least partially solve the aforementioned technical problems, a preprocessing approach is adopted whereby the object question is preprocessed before being input into the language model. This preprocessing includes replacing general terms with domain-specific terms (professional terms) using a reverse mapping layer. Professional terms cover a relatively small scope and are less ambiguous, thus reducing the computational overhead of processing general language. Simultaneously, it ensures that the large model receives questions with a relatively narrow scope, thus more closely resembling the original samples used for model training. This reduces the demand on the language model's ability to process general language, thereby reducing its size and making it adaptable to low-computing platforms while still providing domain-specific professional answers. Furthermore, compared to the infinite number of general terms, the number of domain-specific terms is finite. Therefore, matching professional terms in the object question with domain-specific terms requires less computation, making it more adaptable to low-computing platforms. This improves the matching ability of the language model while reducing its size.
[0033] When a large language model deployed on a low-computing-power platform is needed for question answering, the user can input the question to be asked, i.e., the current object question. This current object question will be transmitted to the low-computing-power platform for answering. In response to the current object question, a preprocessing layer can be used to preprocess it. This preprocessing can include one or more preprocessing methods, with different preprocessing methods corresponding to different types of preprocessing layers. The preprocessing layer includes at least a reverse mapping layer. This reverse mapping layer is used to replace the general terms in the current object question that correspond to specific domain terms with the corresponding domain terms, based on a preset correspondence between domain terms in a specified domain and general terms in a general domain.
[0034] Low-computing-power platforms are typically designed for specific scenarios (specific domains, such as the aforementioned designated domain). The purpose of deploying language models on these platforms is to provide professional answers to questions and inquiries specific to these scenarios. This means that deploying large language models on low-computing-power platforms does not require much general knowledge, nor does it necessitate mapping general languages to domain-specific languages. However, the scope of general languages is too large, and understanding these languages directly would require enormous computational overhead. Therefore, a reverse mapping approach can be adopted, mapping specialized languages to general languages to understand user questions. Specialized languages within this system have a relatively small scope and few ambiguities. By using a reverse mapping layer to map specialized languages to general languages and generating parsings of specialized languages, the computational overhead of processing general languages can be significantly reduced. Simultaneously, this ensures that the large model receives questions with a relatively narrow scope, and these questions are closer to the original samples used for model training. Therefore, the requirement for the language model's ability to understand questions (mainly general languages) is greatly reduced, thereby reducing the model size (since it doesn't need to understand complex questions, the requirement for the number of model layers is reduced) and improving the model's ability to respond to domain-specific questions.
[0035] The reverse mapping layer can replace general terms in the current object problem with corresponding domain terms based on a preset correspondence between domain terms in a specified domain and general terms in a general domain. It can be the first preprocessing layer or any other preprocessing layer besides the first. One or more preprocessing layers, such as a validity judgment layer, can be included before the reverse mapping layer to filter short input questions that are irrelevant to the specified domain. In this implementation, the number of preprocessing layers and the order of connections between different layers are not limited, as long as the reverse mapping layer is included and used to replace general terms in the current object problem with domain terms.
[0036] After processing by the preprocessing layer, the current object question may be updated. For example, generic terms may be replaced with domain-specific terms, invalid terms may be removed, and the question may be split. It may also be determined that the question does not meet the response criteria and therefore rejected. If the preprocessed current object question is still an unanswered question, it can be input into the language model to obtain the corresponding response content. This response content can be one or more responses matching the preprocessed current object question, a fused response obtained by combining one or more responses matching the preprocessed current object question, or response content obtained through other means; this embodiment does not limit this.
[0037] The current question can be a question entered by the user using an input tool in the question interface, such as a mouse, keyboard, voice capture tool, or touchscreen. After receiving the response content corresponding to the current question, the response content can be displayed in the question interface. For example, the response content can be displayed in a designated response area, in a new interface, or in other display methods.
[0038] Optionally, after displaying the response content corresponding to the current object question to the input object, it is also possible to obtain the input object question input by the input object. The new object question can be processed in a similar manner as described above. Alternatively, the response content corresponding to the new object question can be generated by combining the processed historical object questions, and the response content corresponding to the new object question can be displayed to the input object. In this embodiment, the processing method for object questions input at different times is not limited.
[0039] Through the above steps, in response to the current object question input by the input object, the current object question is preprocessed by a preprocessing layer. This preprocessing layer includes a reverse mapping layer, which replaces the corresponding domain terms in the current object question with the corresponding domain terms based on the pre-defined correspondence between domain terms in a specified domain and general terms in a general domain. If the preprocessed current object question is still an unanswerable question, it is input into the language model to obtain the corresponding response. The response is then displayed to the input object. This approach addresses the problem of poor language model matching ability in language models deployed on low-computing-power platforms in related technologies, thus improving the matching capability of the language model.
[0040] In one exemplary embodiment, in response to the current object question input by the input object, the current object question is preprocessed by a preprocessing layer, including:
[0041] S11, in response to the current object question of the input object, the current object question is input to the reverse correspondence layer, so that the reverse correspondence layer performs the following word substitution operation on the current object question:
[0042] Iterate through each domain word in the preset specified domain, and compare it with the general words corresponding to the traversed domain words and the words that have not been replaced in the current object problem;
[0043] If a generic term that matches the target term that has not been replaced in the current object problem exists among the generic terms corresponding to the traversed domain terms, then the target term in the current object problem is replaced with the traversed domain term.
[0044] In this embodiment, domain-specific terms (also known as professional terms or technical terms, corresponding to the specialized language of a particular field) and one or more general terms corresponding to the domain-specific terms can be preset. The correspondence between the domain-specific terms and general terms can be as follows: Figure 3 As shown, domain term 1 corresponds to general terms a, b, and c; domain term 2 corresponds to general terms d, e, and f; and domain term 3 corresponds to general terms g, h, and i. (By...) Figure 3 It can be seen that there are usually fewer domain-specific terms. Compared with the number of general terms, the number of domain-specific terms is usually smaller. Therefore, it takes less time to match domain-specific terms with general terms.
[0045] When processing the current object problem using the reverse mapping layer, the current object problem can be input into the reverse mapping layer. For the input current object problem, the reverse mapping layer can make judgments for each word individually. That is, it performs the following word replacement operation on the current object problem: it iterates through each domain word in the preset specified domain and compares it with the general words corresponding to the iterated domain words and the unreplaced words in the current object problem. Here, to avoid conflicts, a general word can correspond to only one domain word, and a domain word can correspond to multiple general words. If there is a general word among the general words corresponding to the iterated domain words that is consistent with the unreplaced target word in the current object problem, then the target word in the current object problem can be replaced with the iterated domain word. The above word consistency can mean that the words are completely identical or that the words are semantically consistent. To reduce the processing capacity requirements of the reverse mapping layer, variations of the general words can also be included when setting the general words corresponding to the domain words.
[0046] The word replacement operation is complete when the last domain term is traversed or all candidate terms in the current object problem have been replaced. Here, candidate terms in the current object problem can be any term in the current object problem, or the remaining terms after removing some common terms that do not have corresponding domain terms. By specifying some terms that do not have corresponding domain terms, the number of domain terms that need to be traversed can be reduced, improving the efficiency of word traversal.
[0047] For example, the professional term SEL (System Event Log) in the field of server management corresponds to a limited set of general-purpose terms (i.e., common words) such as system log, system event log, system fault log, BMC log, event log, and diagnostic log. By reverse-matching SEL to these limited sets of general-purpose terms, if a match is found, it is saved as a professional term and passed to the next level. For example, the question "I want to see the server system event log" becomes, after the reverse-matching and replacement at the next level, the relatively professional expression "I want to see S EL".
[0048] It should be noted that the reverse mapping layer has a relatively independent function. For system developers, they can write a mapping table program to handle it, or they can directly use some simple models or algorithms trained for this function to implement this layer. This layer can be deployed to the front end (using the computing power of the client's machine for mapping), or it can be integrated into the system or a separate processing core.
[0049] In this embodiment, by sequentially traversing each set domain term and its matching general term through the reverse correspondence layer, and replacing the successfully matched general term with the traversed domain term based on the consistency of the terms, the success rate of term matching can be improved, thereby reducing the amount of computation in subsequent steps.
[0050] In an exemplary embodiment, the preprocessing layer further includes a relevance judgment layer, wherein the relevance judgment layer is used to determine the relevance of the input object question to a specified domain. The purpose of the relevance judgment layer is to determine whether the user's question exceeds the system's answer range, avoiding the output of questions with little or no business relevance to the current system to the next layer. Questions with weak or no relevance may cause the language model to maximize computation, thus increasing the system's computational burden. Furthermore, even if such questions can be answered successfully by the dedicated language model, the probability of hitting the answer the customer wants is extremely low. Therefore, filtering object questions through the relevance judgment layer not only reduces the computational burden on the language model but also improves the response efficiency of object questions.
[0051] The relevance judgment layer can be located after the reverse correspondence layer. Correspondingly, in response to the current object question input by the input object, the current object question is preprocessed by the preprocessing layer, and also includes:
[0052] S21, the current object problem after the word replacement operation is performed is input as the current problem to be judged to the relevance judgment layer, so that the relevance judgment layer can perform a relevance judgment operation on the current object problem after the word replacement operation is performed.
[0053] Here, the relevance assessment operation includes: determining the relevance and executing corresponding actions based on the determined relevance. The relevance assessment criterion can be the ratio between the number of domain terms contained in the current problem to be assessed and the total number of terms contained in the current problem. Compared to assessing the relevance between the object problem and a specified domain using a model, the assessment method in this embodiment has better assessment efficiency, consumes fewer computing resources, and is more adaptable to low-computing-power platforms.
[0054] For the current problem to be judged, the number of domain-specific terms among the words contained in the current problem to be judged can be determined, thus obtaining the number of domain-specific terms. In this embodiment, the number of domain-specific terms can be determined by sequentially judging whether each word in the current problem to be judged is a domain-specific term, or it can be determined by combining the processing results in the reverse correspondence layer, or it can be determined by other methods. After determining the number of domain-specific terms, the ratio between the number of domain-specific terms and the total number of words contained in the current problem to be judged can be determined as the relevance reference value corresponding to the current problem to be judged.
[0055] For example, such as Figure 4 As shown, the total number of input terms in the object problem is 10, of which 3 are domain terms. The relevance reference value is calculated as the number of domain terms / the total number of input terms × 100%. Therefore, the relevance reference value for this object problem is 30%.
[0056] Based on the obtained relevance reference value, it can be determined whether the current question to be judged meets the relevance condition, which is that the corresponding relevance reference value is greater than or equal to a preset relevance threshold. If the current question to be judged does not meet the relevance condition, it can be intercepted. The intercepted question is not the question to be answered. If the current question to be judged meets the relevance condition, it is output to the next layer after the relevance judgment layer. The next layer after the relevance judgment layer can be a preprocessing layer or the input layer of a large language model.
[0057] For example, the relevance judgment layer can calculate the relevance between the current question and the system (language big model), and then intercept questions with no or low relevance based on a preset threshold. If the effective keywords are less than 3%, the question is considered too low in relevance and will not be answered. The relevance judgment layer will output that the question is beyond the processing range and will directly refuse to answer it, thus avoiding the problem of excessively long model calculation time and excessively biased results due to low relevance.
[0058] Optionally, if the current question to be judged does not meet the relevance condition, in addition to blocking the current question, a question prompt can be displayed to the input object. This prompt indicates that the current object's question has been blocked, and the reason for the blocking, such as being blocked due to low matching degree with the language model. Furthermore, the prompt can also suggest questions that are compatible with the language model, such as the technical field and keywords of the questions that the language model is compatible with.
[0059] After displaying the question prompt information to the input object, if a new object question is obtained from the input object, the new object question can be processed as a separate question, or it can be merged with the historical object questions. For example, based on the missing grammatical components (such as subject, predicate, etc.) of the new object question, the required grammatical components can be parsed from the historical object questions and merged with the new object question. The merged object question can then be used for subsequent processing, such as inputting it to the reverse corresponding layer. As has been explained, this embodiment does not limit this.
[0060] In this embodiment, the relevance of the input object question to the language model is judged by the relevance judgment layer, and the object question is directly intercepted when the relevance is weak. This can avoid the problem of excessively long model calculation time and excessive result deviation caused by low relevance, and improve the efficiency of question response.
[0061] In one exemplary embodiment, after replacing the target words in the current object problem with the traversed domain words, the above method further includes:
[0062] S31, add domain markers to the domain terms traversed in the current object problem. The domain markers are used to mark the corresponding terms as domain terms. The number of domain terms is determined based on the number of terms with domain markers added to the current problem to be judged.
[0063] Considering that the reverse mapping layer replaces general terms in the object problem with domain terms, a domain term determination has already been performed in the reverse mapping layer. To improve the efficiency of domain term determination, in this embodiment, after replacing the target terms in the current object problem with the traversed domain terms, a domain marker is added to the traversed domain terms in the current object problem. The domain marker can be a single bit used to identify whether the corresponding term is a domain term, and the number of domain terms is determined based on the number of terms with added domain markers in the current problem to be determined.
[0064] Besides the domain terms used for replacement, the original terms in the current object problem may also contain domain terms. Therefore, when performing judgments at the reverse correspondence layer, in addition to comparing the terms in the current object problem with the general terms corresponding to the domain terms, we can first compare the traversed domain terms with the terms in the current object problem, and add domain markers to the terms that match the traversed domain terms. Correspondingly, when comparing with the traversed domain terms or the general terms corresponding to the traversed domain terms, terms with added domain markers will no longer be compared.
[0065] For example, the relevance judgment layer can be judged based on the information input from the reverse correspondence layer. The relevance judgment layer can implement a relevance threshold judgment. The algorithm is set to the ratio of the number of professional words in the input words of the previous layer to the total number of words. For example, if the number of input words is 10, and after the first layer processing there is one professional word (i.e., domain term), then the relevance is 10%.
[0066] In this embodiment, by adding domain tags to domain terms in the object problem in the reverse correspondence layer, it is possible to facilitate relevance judgment, improve the speed of relevance judgment, and reduce the consumption of computing resources for relevance judgment.
[0067] In one exemplary embodiment, considering the significant computational demands of a large language model when handling continuous and multiple questions at once, the object question can be split into multiple questions before being input into the large language model. These split questions are then input into the large language model as individual questions, reducing the computational requirements. The splitting of object questions can be performed by a question separation layer. The preprocessing layer also includes a question separation layer, which separates the input object question into multiple individual object questions when it contains multiple object questions. The design of the question separation layer prevents multiple questions from being directly input into the system (large language model).
[0068] Correspondingly, for the current object problem, in response to the current object problem input by the input object, the current object problem is preprocessed through the preprocessing layer, which also includes:
[0069] S41, the current object question after the word replacement operation is performed is input as the current question to be separated into the question separation layer, so that the question separation layer can perform the question separation operation on the current object question after the word replacement operation is performed. The question separation operation is used to separate the questions, which can separate multiple questions at once. The separated questions are then input into the language big model in sequence for answer calculation.
[0070] When performing a problem segmentation operation, the segmentation position in the current problem to be segmented can be determined first. If a segmentation position exists, the current problem to be segmented can be segmented based on the determined segmentation position, and each segmented object problem becomes a separate problem. There are several ways to determine the segmentation position in the current problem to be segmented, including but not limited to determining the segmentation position based on the number of domain terms of a specified domain contained in the current problem to be segmented, or determining the segmentation position in the current problem to be segmented through semantic parsing.
[0071] As an optional implementation, the number of domain terms in the specified domain contained in the current problem to be separated can be determined; if the number of domain terms in the specified domain contained in the current problem to be separated is greater than or equal to two, then the current problem to be separated is parsed based on the domain terms in the specified domain contained in the current problem to be separated, the separation position of the current problem to be separated is determined, and the number of domain terms in the specified domain contained in the separated object problem is one.
[0072] Here, the way to parse the current problem to be separated based on the domain terms of the specified domain contained in the current problem to be separated can be as follows: based on the part of speech and the correlation between words, determine the words associated with a certain domain term, divide the words associated with a certain domain term into an object problem, and determine the separation position based on the division result of the object problem.
[0073] As an alternative implementation, a semantic parsing model can be used to perform semantic parsing on the current question to be separated, and the separation position can be determined based on the semantic parsing result. The operation of determining the separation position can also be performed by the semantic parsing model. Compared to using a semantic parsing model to determine the separation position, determining the separation position based on the number of domain terms requires less computational power and is more suitable for question-and-response scenarios (considering that when asking a question, it usually contains only one domain term).
[0074] Therefore, determining the separation position based on the number of domain terms can also ensure the accuracy of the separation.
[0075] Optionally, the question separation layer can be the first preprocessing layer (for scenarios where the separation position is determined using a semantic parsing model), or it can be a preprocessing layer following the reverse correspondence layer. For example, the question separation layer can be a preprocessing layer after the reverse correspondence layer or after the relevance judgment layer. The reverse correspondence layer, relevance judgment layer, and question separation layer can be configured as needed. One optional configuration is: reverse correspondence layer - relevance judgment layer - question separation layer. In this case, it can perform further processing based on the object question transmitted by the relevance judgment layer.
[0076] For example, such as Figure 5 As shown, for a three-question input problem (the question interval is...), Figure 5 The question shown by the dashed line is divided into three separate questions, namely, Question 1, Question 2, and Question 3, through a question separation layer. The separated Questions 1, 2, and 3 can be input into the language model in sequence, and the language model will respond to them sequentially.
[0077] In this embodiment, multiple questions asked at once are separated into individual questions by a question separation layer, and then the language big model responds to the separated questions. This prevents consecutive questions from being directly input into the language big model and reduces the computational power requirements of the language big model.
[0078] In an exemplary embodiment, if the preprocessed current object question is an unanswered question, the preprocessed current object question is input into the language big model to obtain the response content corresponding to the current object question, including:
[0079] S51, if the preprocessed current object question is a question to be answered, and the preprocessed current object question contains multiple object questions that have been separated, then each object question in the multiple object questions is input into the language big model to obtain the response content corresponding to each object question;
[0080] S52, integrate the response content corresponding to each object question into the response content corresponding to the current object question.
[0081] In this embodiment, if the preprocessed current object question is an unanswered question, and the preprocessed current object question contains multiple object questions that have been separated (the separation method can be any of the methods described in the previous embodiments), each of the multiple object questions can be input into the language big model to obtain the response content corresponding to each object question. The language big model responds to the input object questions, and the method for generating the corresponding response content can refer to relevant technologies, which will not be elaborated here. After the above-mentioned various levels of processing, the entire system can provide accurate and effective answers to the user's input questions with relatively low computing power consumption.
[0082] The responses corresponding to each object question can be displayed separately to the input object. However, considering that multiple object questions are input at once, displaying them as multiple responses might require users to analyze the relationship between the responses and the object questions, leading to low information retrieval efficiency.
[0083] In this embodiment, the response content corresponding to each object's question can be integrated into the response content corresponding to the current object's question, and then the integrated response content can be displayed to the input object. This integration can be performed by the integration output layer. The language model can answer questions in batches according to the questions separated by the question separation layer, and the integration output layer is responsible for connecting the answers and final outputting the results.
[0084] For example, such as Figure 6 As shown, the separated questions can be sequentially input into the language model for reasoning to obtain answer 1, answer 2, and answer 3 (i.e., the corresponding response content); then, the integration output layer integrates answer 1, answer 2, and answer 3 to obtain the integrated answer.
[0085] In this embodiment, reasoning is performed on the separated questions using a large language model to obtain the corresponding response content. After integrating the response content, the output is generated, which can improve the efficiency of information acquisition.
[0086] In an exemplary embodiment, if the preprocessed current object question is an unanswered question, the preprocessed current object question is input into the language big model to obtain the response content corresponding to the current object question, including:
[0087] S61, if the preprocessed current object question is an unanswered question, input the preprocessed current object question into the language big model deployed on the baseboard management controller to obtain the response content corresponding to the current object question.
[0088] In this embodiment, the low-computing-power platform is the server BMC. When the preprocessed current object question is an unanswered question, the preprocessed current object question can be input into the language big model deployed on the baseboard management controller to obtain the response content corresponding to the current object question.
[0089] Here, BMC refers to the management of servers or computer systems. When establishing the correspondence between domain terms and general terms in the reverse mapping layer, considering that the role of the server BMC is to manage various components on the server, and that the main purpose of its deployment language model is to answer questions related to server operation and maintenance knowledge and common sense about server usage, domain terms can be set based on server operation and maintenance knowledge and common sense about server usage.
[0090] This embodiment deploys a large language model on the baseboard management controller, which can answer questions about server operation and maintenance knowledge and common sense about server usage, thereby improving the convenience of server operation and maintenance and use.
[0091] The question-response method based on a large language model in this application embodiment will be explained below with reference to an optional example. In this optional example, the low-computing-power platform is BMC.
[0092] This optional example provides a simplified computation scheme for deploying large-scale language models on low-computing-power platforms. By integrating the large-scale language model into the low-computing-power platform and adding preprocessing layers (filtering systems), the computational power required for model inference when deploying large-scale language models on low-computing-power platforms is reduced, while also reducing the number of training samples and deployment requirements. Simultaneously, it ensures good accuracy, preventing irrelevant answers. Furthermore, for other specific application scenarios, preprocessing at different levels can be performed to eliminate interference, thereby reducing the processing difficulty of the main process or task.
[0093] Low-computing-power platforms are typically deployed for specific purposes. Their primary use of large-scale language models is to provide specialized language responses tailored to the system's characteristics, unlike general-purpose large-scale language models which organize and analyze information across the entire network to answer questions. If a low-computing-power platform directly integrates a general-purpose large-scale language model, the large-scale language model incurs additional computational overhead for analyzing, transforming, and ultimately calculating the answer to the question. While this approach is general, it is extremely wasteful of computing power for systems with specific applications.
[0094] For the BMC server, the large language model deployed on the BMC can be an AI (Artificial Intelligence) assistant system integrated within the BMC. After deploying the AI assistant system, the BMC experiences insufficient computing power and response delays. To address this, a filtering system preprocesses the large language model for specific purposes: a reverse mapping layer is added to reverse-map user-initiated server-related questions and outputs relatively specialized vocabulary questions to the next layer; a relevance judgment layer effectively rejects questions from non-server domains, and a question separation layer reduces the length of the large model's input tokens, while also preventing excessively long tokens from causing excessively long inference times. Through this multi-layered filtering system and task allocation, the execution time and computing power consumption of the model within the BMC are significantly improved.
[0095] Figure 7 This is a schematic diagram of another optional question-response method based on a large language model according to an embodiment of this application, such as... Figure 7As shown, when a user asks a question, the user's input question (i.e., the object question) can be passed to a low-computing-power platform (low-computing-power computer system), and preprocessed by passing through a reverse correspondence layer, a relevance judgment layer, and a question separation layer. The preprocessed question is then input into the language big model for reasoning. If it is separated into multiple questions, the answers to the different questions will be input into the integration output layer for integration and output. Finally, the question answer is displayed to the user who asked the question.
[0096] This optional example improves both the processing time and response accuracy of the large language model. Furthermore, due to the presence of the inverse correspondence layer, the requirement for the number of training samples for the large model is significantly reduced, thereby decreasing the training time and shortening the training duration.
[0097] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0098] According to another aspect of the embodiments of this application, a question-response apparatus based on a large language model is also provided. This apparatus is used to implement the question-response method based on a large language model provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0099] Figure 8 This is a structural block diagram of an optional question-and-response device based on a large language model according to an embodiment of this application, such as... Figure 8 As shown, the device includes:
[0100] The preprocessing unit 802 is used to preprocess the current object question in response to the input object input by the input object through the preprocessing layer. The preprocessing layer includes a reverse correspondence layer, which is used to replace the general words in the current object question that have corresponding domain words with corresponding domain terms based on the correspondence between the domain words of a preset specified domain and the general words of a general domain.
[0101] Input unit 804 is used to input the preprocessed current object question into the language big model when the current object question is a question to be answered, so as to obtain the response content corresponding to the current object question;
[0102] Display unit 806 is used to display the response content corresponding to the current object's question to the input object.
[0103] It should be noted that the joining unit 802 in this embodiment can be used to perform the above step S202, the acquiring unit 804 in this embodiment can be used to perform the above step S204, and the first sending unit 806 in this embodiment can be used to perform the above step S206.
[0104] According to the embodiments provided in this application, in response to the current object question input by the input object, the current object question is preprocessed by a preprocessing layer. The preprocessing layer includes a reverse correspondence layer, which replaces the general words in the current object question that have corresponding domain words with corresponding domain terms based on the correspondence between domain words in a preset specified domain and general words in a general domain. If the preprocessed current object question is still an unanswered question, the preprocessed current object question is input into a language big model to obtain the response content corresponding to the current object question. The response content corresponding to the current object question is displayed to the input object, thereby reducing the computing power required for the language big model, and reducing the number of samples and deployment requirements for training the language big model. This solves the problem of poor matching ability of language models deployed on low computing power platforms in related technologies.
[0105] In an exemplary embodiment, the preprocessing unit includes: a first input module, configured to, in response to the current object question of the input object, input the current object question to a reverse correspondence layer, so that the reverse correspondence layer performs the following word replacement operation on the current object question: sequentially traversing each domain word of a preset specified domain, and comparing the general words corresponding to the traversed domain words with the unreplaced words in the current object question; if there is a general word in the general words corresponding to the traversed domain words that is consistent with the unreplaced target word in the current object question, replacing the target word in the current object question with the traversed domain word.
[0106] In an exemplary embodiment, the preprocessing layer further includes a relevance judgment layer, wherein the relevance judgment layer is used to determine the relevance between the input object question and a specified domain. The preprocessing unit further includes a second input module, used to input the current object question after the word substitution operation is performed as the current question to be judged into the relevance judgment layer, so that the relevance judgment layer performs the following relevance judgment operation on the current object question after the word substitution operation is performed: determining the number of domain words belonging to the specified domain among the words contained in the current question to be judged, obtaining the number of domain words, and determining the ratio between the number of domain words and the total number of words contained in the current question to be judged as the relevance reference value corresponding to the current question to be judged; based on the relevance reference value corresponding to the current question to be judged, determining whether the current question to be judged meets a relevance condition, wherein the relevance condition is that the corresponding relevance reference value is greater than or equal to a preset relevance threshold; if the current question to be judged does not meet the relevance condition, intercepting the current question to be judged, wherein the intercepted current question to be judged is not a question to be answered; if the current question to be judged meets the relevance condition, outputting the current question to be judged to the next layer of the relevance judgment layer.
[0107] In an exemplary embodiment, the above apparatus further includes: an adding unit, configured to add domain markers to the domain words traversed in the current object problem after replacing the target words in the current object problem with the traversed domain words, wherein the domain markers are used to mark the corresponding words as domain words, and the number of domain words is determined based on the number of words with added domain markers in the current problem to be judged.
[0108] In one exemplary embodiment, the preprocessing layer further includes a question segmentation layer, wherein the question segmentation layer is used to segment the input object question into multiple individual object questions when the input object question contains multiple object questions. The preprocessing unit further includes a third input module, used to input the current object question after the word substitution operation is performed as the current question to be segmented into the question segmentation layer, so that the question segmentation layer performs the following question segmentation operation on the current object question after the word substitution operation is performed: determining the number of domain words of a specified domain contained in the current question to be segmented; if the number of domain words of a specified domain contained in the current question to be segmented is greater than or equal to two, parsing the current question to be segmented based on the domain words of the specified domain contained in the current question to be segmented, determining the segmentation position of the current question to be segmented, and segmenting the current question to be segmented based on the determined segmentation position, wherein the number of domain words of a specified domain contained in the segmented object question is one.
[0109] In an exemplary embodiment, the input unit includes: a first execution module, configured to input each of the multiple object questions into the language big model to obtain the response content corresponding to each object question when the preprocessed current object question is a question to be answered and the preprocessed current object question contains multiple object questions that have been separated; and an integration module, configured to integrate the response content corresponding to each object question into the response content corresponding to the current object question.
[0110] In one exemplary embodiment, the input unit further includes a second execution module, configured to input the preprocessed current object question into a language big model deployed on the baseboard management controller, if the preprocessed current object question is a question to be answered, to obtain a response content corresponding to the current object question.
[0111] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0112] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein the program executes the steps in any of the above method embodiments when it is run.
[0113] In one exemplary embodiment, the computer-readable storage medium may include, but is not limited to, at least one of the following: a USB flash drive, RAM (Random Access Memory), ROM (Read-Only Memory), a portable hard disk, a magnetic disk, or an optical disk, and other media capable of storing computer programs.
[0114] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to perform the steps of any of the above method embodiments through the computer program.
[0115] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0116] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0117] According to another aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program / instructions comprising program code for performing the method shown in the flowchart. In such an embodiment, reference is made to... Figure 9 The computer program can be downloaded and installed from a network via the communication section 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit 901, it performs various functions provided in the embodiments of this application. The sequence numbers of the embodiments of this application above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0118] refer to Figure 9 , Figure 9 This is a structural block diagram of a computer system for an optional electronic device according to an embodiment of this application. Figure 9 A schematic block diagram of a computer system architecture for implementing embodiments of the present application is shown. Figure 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 902 or programs loaded from storage section 908 into random access memory (RAM) 903. The RAM 903 also stores various programs and data required for system operation. The CPU 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output interface 905 (I / O interface) is also connected to the bus 904.
[0119] The following components are connected to the input / output interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a local area network card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.
[0120] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application 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 section 909, and / or installed from removable medium 911. When the computer program is executed by central processing unit 901, it performs various functions defined in the system of this application.
[0121] It should be noted that, Figure 9 The computer system 900 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0122] Obviously, those skilled in the art should understand that the modules or steps of the embodiments of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of this application are not limited to any particular combination of hardware and software.
[0123] The above are merely preferred embodiments of this application and are not intended to limit the embodiments of this application. For those skilled in the art, various modifications and variations can be made to the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the embodiments of this application should be included within the protection scope of the embodiments of this application.
Claims
1. A question-response method based on a large language model, characterized in that, include: In response to the current object question input by the input object, a preprocessing layer preprocesses the current object question. This preprocessing layer includes a reverse correspondence layer, which replaces common terms in the current object question with corresponding domain terms based on a preset correspondence between domain terms in a specified domain and general terms in a general domain. The preprocessing layer also includes a question segmentation layer, which segments the input object question into multiple individual object questions if the input object question contains multiple object questions. Finally, the preprocessing layer includes a relevance judgment layer, which assesses the relevance between the input object question and the specified domain. If the preprocessed current object question is an unanswered question, the preprocessed current object question is input into the language big model to obtain the response content corresponding to the current object question; Display the response content corresponding to the current object's question to the input object; The preprocessing of the current object question in response to the input object, through a preprocessing layer, further includes: inputting the current object question after word replacement as the current question to be separated into the question separation layer, so that the question separation layer performs the following question separation operation on the current object question after word replacement: determining the number of domain words of the specified domain contained in the current question to be separated; if the number of domain words of the specified domain contained in the current question to be separated is greater than or equal to two, parsing the current question to be separated based on the domain words of the specified domain contained in the current question to be separated, determining the separation position of the current question to be separated, and separating the current question to be separated based on the determined separation position, wherein the number of domain words of the specified domain contained in the separated object question is one; the method of parsing the current question to be separated based on the domain words of the specified domain contained in the current question to be separated is: based on part of speech and the correlation between words, determining the words associated with any domain word, and classifying the words associated with any domain word into one object question, and determining the separation position based on the classification result of the object question; The preprocessing of the current object question in response to input object input, through a preprocessing layer, further includes: inputting the current object question after word replacement operation as the current question to be judged into the relevance judgment layer, so that the relevance judgment layer performs the following relevance judgment operation on the current object question after word replacement operation: determining the number of domain words belonging to the specified domain among the words contained in the current question to be judged, obtaining the number of domain words, and determining the ratio between the number of domain words and the total number of words contained in the current question to be judged as the relevance reference value corresponding to the current question to be judged; judging whether the current question to be judged meets the relevance condition based on the relevance reference value corresponding to the current question to be judged, wherein the relevance condition is that the corresponding relevance reference value is greater than or equal to a preset relevance threshold; if the current question to be judged does not meet the relevance condition, intercepting the current question to be judged, wherein the intercepted current question to be judged is not a question to be answered; if the current question to be judged meets the relevance condition, outputting the current question to be judged to the next layer of the relevance judgment layer.
2. The method according to claim 1, characterized in that, The current object question in response to input object input is preprocessed by a preprocessing layer, including: In response to the current object question of the input object, the current object question is input to the reverse correspondence layer, so that the reverse correspondence layer performs the following word replacement operation on the current object question: Iterate through each domain word in the preset specified domain, and compare it with the general words corresponding to the traversed domain words and the words that have not been replaced in the current object problem; If there is a common word in the general words corresponding to the traversed domain words that is consistent with the target word in the current object problem that has not been replaced, then the target word in the current object problem is replaced with the traversed domain words.
3. The method according to claim 2, characterized in that, After replacing the target term in the current object problem with the traversed domain term, the method further includes: Add domain markers to the domain terms traversed in the current object problem, wherein the domain markers are used to mark the corresponding terms as domain terms, and the number of domain terms is determined based on the number of terms with domain markers added to the current problem to be judged.
4. The method according to claim 1, characterized in that, If the preprocessed current object question is an unanswered question, the preprocessed current object question is input into the language model to obtain the response content corresponding to the current object question, including: If the preprocessed current object question is an unanswered question, and the preprocessed current object question contains multiple object questions that have been separated, then each of the multiple object questions is input into the language big model to obtain the response content corresponding to each object question. The response content corresponding to each object question is integrated into the response content corresponding to the current object question.
5. The method according to any one of claims 1 to 4, characterized in that, If the preprocessed current object question is an unanswered question, the preprocessed current object question is input into the language model to obtain the response content corresponding to the current object question, including: If the preprocessed current object question is an unanswered question, the preprocessed current object question is input into the language big model deployed on the baseboard management controller to obtain the response content corresponding to the current object question.
6. A question-response device based on a large language model, characterized in that, include: A preprocessing unit is configured to preprocess the current object question input by an input object through a preprocessing layer. The preprocessing layer includes a reverse correspondence layer, which replaces common words in the current object question with corresponding domain terms based on a preset correspondence between domain terms in a specified domain and common terms in a general domain. The preprocessing layer also includes a question segmentation layer, which segments the input object question into multiple individual object questions when the input object question contains multiple object questions. The preprocessing layer further includes a relevance judgment layer, which assesses the relevance between the input object question and the specified domain. The preprocessing unit also includes a third input module, which inputs the current object question after the word replacement operation as the current question to be segmented into the preprocessing unit. The question segmentation layer performs the following question segmentation operation on the current object question after the word replacement operation: determining the number of domain terms in the specified domain contained in the current question to be segmented; if the number of domain terms in the specified domain contained in the current question to be segmented is greater than or equal to two, parsing the current question to be segmented based on the domain terms in the specified domain contained in the current question to be segmented, determining the segmentation position of the current question to be segmented, and segmenting the current question to be segmented based on the determined segmentation position, wherein the number of domain terms in the segmented object question is one; wherein, based on part-of-speech and the correlation between words, words associated with any domain term are determined, and words associated with any domain term are assigned to one object question; based on the segmentation result of the object question, the segmentation position is determined; The preprocessing unit further includes: a second input module, used to input the current object question after the word replacement operation is performed as the current question to be judged into the relevance judgment layer, so that the relevance judgment layer performs the following relevance judgment operation on the current object question after the word replacement operation is performed: determining the number of domain words belonging to the specified domain among the words contained in the current question to be judged, obtaining the number of domain words, and determining the ratio between the number of domain words and the total number of words contained in the current question to be judged as the relevance reference value corresponding to the current question to be judged; judging whether the current question to be judged meets the relevance condition based on the relevance reference value corresponding to the current question to be judged, wherein the relevance condition is that the corresponding relevance reference value is greater than or equal to a preset relevance threshold; if the current question to be judged does not meet the relevance condition, intercepting the current question to be judged, wherein the intercepted current question to be judged is not a question to be answered; if the current question to be judged meets the relevance condition, outputting the current question to be judged to the next layer of the relevance judgment layer; The input unit is used to input the preprocessed current object question into the language big model when the current object question is a question to be answered, so as to obtain the response content corresponding to the current object question; The display unit is used to display the response content corresponding to the current object's question to the input object.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 5.
8. An electronic device 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, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Question and answer method and device, equipment and medium
CN117236340A