Artificial intelligence-based query processing method and device, computer equipment and medium
By preprocessing and multi-level processing of the query text information entered by the user, including text rewriting, fragment extraction, fact verification, and illegal detection, the problem of inaccurate answers in the existing Q&A system is solved, ensuring the accuracy of the answers and authenticity improves user experience.
Patent Information
- Application Number
- CN202411157067.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-31
AI Technical Summary
The existing question and answer system based on large language models is prone to generate content that is contrary to the facts when outputting answers, and cannot guarantee the accuracy and authenticity of the answers.
Using the query processing method based on artificial intelligence, the query text information entered by the user is pre-processed, and the text rewriting plug-in module is used for rewriting and optimization processing. The fragment extraction plug-in module is used for document fragment extraction, and the fact verification plug-in module is used for answer verification. , and use the violation detection model to detect the violation of answers. The answer will only be sent to the user if the detection result is no violation.
It effectively ensures the accuracy and authenticity of the generated answers, avoids replying to illegal answers, improves the intelligence and accuracy of query response processing, and improves the user experience.
Smart Images

Figure CN119226433A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence development technology and the field of financial technology, and in particular to artificial intelligence-based query processing methods, devices, computer equipment and storage media. Background Art
[0002] With the rapid development of financial technology and artificial intelligence technology, financial enterprises have an increasing demand for efficient and accurate customer service. In order to improve user experience, reduce manual customer service costs, and quickly respond to customer inquiries, financial enterprises widely use question-answering systems based on large language models to achieve intelligent answers to financial questions.
[0003] However, the question-answering systems based on large language models used by existing financial companies are prone to hallucinations when outputting answers corresponding to customer queries, that is, generating answers that are contrary to the facts, and cannot guarantee the accuracy and authenticity of the generated answers. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose a query processing method, apparatus, computer equipment and storage medium based on artificial intelligence to solve the technical problem that the question-answering system based on a large language model adopted by existing financial enterprises is prone to generating answers that are inconsistent with the facts when outputting answers corresponding to customer queries, and the accuracy and authenticity of the generated answers cannot be guaranteed.
[0005] In order to solve the above technical problems, the embodiment of the present application provides a query processing method based on artificial intelligence, which adopts the following technical solution:
[0006] Acquire query text information input by a user, and preprocess the query text information to obtain corresponding first text information;
[0007] Rewrite and optimize the first text information based on the text rewriting plug-in module in the preset target large language model to obtain corresponding second text information;
[0008] Retrieve the second text information based on a preset information retrieval system to obtain corresponding related documents; wherein the number of the related documents includes multiple;
[0009] Performing segment extraction processing on the relevant documents based on the segment extraction plug-in module in the target large language model to obtain corresponding target segments;
[0010] Performing reasoning processing on the second text information and the target segment based on the target large language model to obtain a corresponding answer;
[0011] Performing fact-checking processing on the answer based on the fact-checking plug-in module in the target large language model to obtain a corresponding target answer;
[0012] Performing violation detection processing on the target answer based on a preset violation detection model to obtain a corresponding violation detection result;
[0013] If the violation detection result is that there is no violation, the target answer is sent to the user.
[0014] Furthermore, the step of rewriting and optimizing the first text information based on the text rewriting plug-in module in the preset target large language model to obtain the corresponding second text information specifically includes:
[0015] Performing grammar correction processing on the first text information based on the text rewriting plug-in module to obtain a corresponding first designated text;
[0016] Performing information supplementation processing on the first designated text to obtain a corresponding second designated text;
[0017] Performing expression optimization processing on the second designated text to obtain a corresponding third designated text;
[0018] The third designated text is used as the second text information.
[0019] Furthermore, the step of performing segment extraction processing on the relevant documents based on the segment extraction plug-in module in the target large language model to obtain the corresponding target segment specifically includes:
[0020] Performing intent analysis on the second text information to obtain a corresponding query intent;
[0021] Performing a relevance evaluation on the query intent and each of the related documents to obtain a corresponding relevance evaluation result;
[0022] Filtering candidate documents from all the relevant documents based on the relevance evaluation result; wherein the number of the candidate documents includes multiple;
[0023] Based on the segment extraction plug-in module, the candidate document is divided into corresponding segments using a preset text segmentation technology;
[0024] Calculating semantic similarity between the query intent and each of the fragments respectively to obtain corresponding semantic similarity;
[0025] Filter out designated segments whose semantic similarity is greater than a preset similarity threshold from all the segments;
[0026] Add all the specified segments to the preset set to obtain a corresponding segment set;
[0027] The target segment is generated based on the segment set.
[0028] Furthermore, the step of performing fact-checking processing on the answer based on the fact-checking plug-in module in the target large language model to obtain the corresponding target answer specifically includes:
[0029] Extracting factual information to be verified from the answer based on the fact-checking plug-in module;
[0030] Obtain a preset trusted database;
[0031] Retrieving relevant information corresponding to the factual information from the trusted database;
[0032] Determining whether the relevant information is consistent with the factual information;
[0033] If the relevant information is consistent with the factual information, it is determined that the answer has passed the fact check, and the answer is used as the target answer;
[0034] If the relevant information is inconsistent with the factual information, the factual information in the answer is corrected based on the relevant information to obtain a processed answer, and the processed answer is used as the target answer.
[0035] Furthermore, the step of preprocessing the query text information to obtain the corresponding first text information specifically includes:
[0036] Get the preset non-text information type;
[0037] Deleting the non-text content in the query text information based on the non-text information type to obtain a corresponding fourth specified text;
[0038] Get the preset font conversion rules;
[0039] Convert the fourth designated text based on the font conversion rule to obtain a corresponding fifth designated text;
[0040] The fifth designated text is used as the first text information.
[0041] Furthermore, before the step of performing violation detection processing on the target answer based on the preset violation detection model to obtain the corresponding violation detection result, the method further includes:
[0042] Obtain violation data from multiple pre-defined data sources;
[0043] Performing labeling processing on the illegal behavior data to obtain labeled illegal behavior data;
[0044] Performing data preprocessing on the illegal behavior data to obtain corresponding sample data;
[0045] Obtain a preset initial detection model;
[0046] Based on the sample data, the initial detection model is trained and evaluated to obtain a specified detection model that meets the preset construction requirements;
[0047] The designated detection model is used as the violation detection model.
[0048] Furthermore, after the step of performing violation detection processing on the target answer based on the preset violation detection model to obtain the corresponding violation detection result, the method further includes:
[0049] If the violation detection result is that there is a violation, obtaining the specified content corresponding to the violation detection result;
[0050] Generate corresponding query information to be processed based on the second text information, the violation detection result and the specified content;
[0051] Sending the pending query information to the corresponding target customer service;
[0052] receiving a designated answer returned by the target customer service corresponding to the second text message;
[0053] The specified answer is sent to the user.
[0054] In order to solve the above technical problems, the embodiment of the present application further provides a query processing device based on artificial intelligence, which adopts the following technical solution:
[0055] A first acquisition module, used to acquire query text information input by a user, and pre-process the query text information to obtain corresponding first text information;
[0056] A rewriting module, configured to rewrite and optimize the first text information based on a text rewriting plug-in module in a preset target large language model to obtain corresponding second text information;
[0057] A retrieval module, configured to retrieve the second text information based on a preset information retrieval system to obtain corresponding related documents; wherein the number of the related documents includes a plurality;
[0058] An extraction module, configured to perform segment extraction processing on the relevant document based on the segment extraction plug-in module in the target large language model to obtain a corresponding target segment;
[0059] An inference module, configured to perform inference processing on the second text information and the target segment based on the target large language model to obtain a corresponding answer;
[0060] A verification module, configured to perform fact verification processing on the answer based on the fact verification plug-in module in the target large language model to obtain a corresponding target answer;
[0061] A detection module, used to perform violation detection processing on the target answer based on a preset violation detection model to obtain a corresponding violation detection result;
[0062] The first sending module is used to send the target answer to the user if the violation detection result is that there is no violation.
[0063] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0064] Acquire query text information input by a user, and preprocess the query text information to obtain corresponding first text information;
[0065] Rewrite and optimize the first text information based on the text rewriting plug-in module in the preset target large language model to obtain corresponding second text information;
[0066] Retrieve the second text information based on a preset information retrieval system to obtain corresponding related documents; wherein the number of the related documents includes multiple;
[0067] Performing segment extraction processing on the relevant documents based on the segment extraction plug-in module in the target large language model to obtain corresponding target segments;
[0068] Performing reasoning processing on the second text information and the target segment based on the target large language model to obtain a corresponding answer;
[0069] Performing fact-checking processing on the answer based on the fact-checking plug-in module in the target large language model to obtain a corresponding target answer;
[0070] Performing violation detection processing on the target answer based on a preset violation detection model to obtain a corresponding violation detection result;
[0071] If the violation detection result is that there is no violation, the target answer is sent to the user.
[0072] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0073] Acquire query text information input by a user, and preprocess the query text information to obtain corresponding first text information;
[0074] Rewrite and optimize the first text information based on the text rewriting plug-in module in the preset target large language model to obtain corresponding second text information;
[0075] Retrieve the second text information based on a preset information retrieval system to obtain corresponding related documents; wherein the number of the related documents includes multiple;
[0076] Performing segment extraction processing on the relevant documents based on the segment extraction plug-in module in the target large language model to obtain corresponding target segments;
[0077] Performing reasoning processing on the second text information and the target segment based on the target large language model to obtain a corresponding answer;
[0078] Performing fact-checking processing on the answer based on the fact-checking plug-in module in the target large language model to obtain a corresponding target answer;
[0079] Performing violation detection processing on the target answer based on a preset violation detection model to obtain a corresponding violation detection result;
[0080] If the violation detection result is that there is no violation, the target answer is sent to the user.
[0081] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0082] After preprocessing the query text information input by the user to obtain the first text information, the present application rewrites and optimizes the first text information based on the text rewriting plug-in module in the target large language model, performs fragment extraction on the relevant documents retrieved and output by the information retrieval system based on the fragment extraction plug-in module, and performs fact verification on the answer output by reasoning of the target large language model based on the fact verification plug-in module to obtain the corresponding target answer, and then uses the violation detection model to perform violation detection on the target answer. Only when it is ensured that the violation detection result is that there is no violation, the target answer is sent to the user, which effectively ensures the accuracy and authenticity of the generated target answer, and can avoid replying to the user with a violation answer that violates the law, thereby improving the intelligence and accuracy of the query reply processing and improving the user's experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0084] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0085] Figure 2 A flowchart of an embodiment of an artificial intelligence-based query processing method according to the present application;
[0086] Figure 3 is a structural schematic diagram of an embodiment of an artificial intelligence-based query processing device according to the present application;
[0087] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0088] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0089] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0090] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0091] like Figure 1As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0092] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0093] The terminal devices 101, 102, and 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0094] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0095] It should be noted that the artificial intelligence-based query processing method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the artificial intelligence-based query processing device is generally arranged in the server / terminal device.
[0096] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0097] Continue to refer Figure 2, showing a flow chart of an embodiment of an artificial intelligence-based query processing method according to the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The artificial intelligence-based query processing method provided in the embodiment of the present application can be applied to any scenario where query processing is required, and the artificial intelligence-based query processing method can be applied to products in these scenarios, for example, query processing in the financial insurance field. The artificial intelligence-based query processing method comprises the following steps:
[0098] Step S201: Acquire query text information input by a user, and pre-process the query text information to obtain corresponding first text information.
[0099] In this embodiment, the query processing method based on artificial intelligence is executed on the electronic device (eg Figure 1 The server / terminal device shown in the figure) can obtain the query text information through a wired connection or a wireless connection. It should be pointed out that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, Wi-Fi connection, Bluetooth connection, Wi MAX connection, Zigbee connection, UWB (Ultra Wi DeBand) connection, and other wireless connection methods currently known or to be developed in the future. The present application can be applied to the business scenario of the search function of a financial enterprise, or it can also be applied to the business scenario of question retrieval for financial services. The above-mentioned query text information may be a question of the user's text input behavior. The above-mentioned financial services may include insurance services, claims services, financial management services, and the like. Among them, the above-mentioned specific implementation process of preprocessing the query text information to obtain the corresponding first text information will be further described in detail in the present application in subsequent specific embodiments, and will not be elaborated on here.
[0100] Step S202: rewrite and optimize the first text information based on the text rewriting plug-in module in the preset target large language model to obtain corresponding second text information.
[0101] In the present embodiment, the above-mentioned target large language model can specifically adopt a retrieval-enhanced large language model LLMs. LLMs can retrieve relevant content from an external repository (knowledge base) and generate text based on these contents. In addition, the present application adds three optional Agents (plug-in modules) on the basis of the two basic modules of LLMs, namely the document retrieval module and the answer generation module, specifically including a text rewriting plug-in module, a fragment extraction plug-in module and a fact-checking plug-in module. Among them, the above-mentioned text rewriting plug-in module based on the preset target large language model rewrites and optimizes the first text information to obtain the specific implementation process of the corresponding second text information. The present application will further describe this in detail in the subsequent specific embodiments, and will not be elaborated on here.
[0102] Step S203: searching the second text information based on a preset information retrieval system to obtain corresponding related documents; wherein the number of the related documents includes multiple.
[0103] In this embodiment, the document retrieval module in the target large language model can be used to call the information retrieval system to perform retrieval processing on the second text information to retrieve documents that are relevant to the second text information, namely the above-mentioned relevant documents.
[0104] Step S204: performing segment extraction processing on the relevant documents based on the segment extraction plug-in module in the target large language model to obtain corresponding target segments.
[0105] In this embodiment, the above-mentioned specific implementation process of performing fragment extraction processing on the relevant documents based on the fragment extraction plug-in module in the target large language model to obtain the corresponding target fragments will be further described in detail in the subsequent specific embodiments of this application and will not be elaborated in detail here.
[0106] Step S205: performing inference processing on the second text information and the target segment based on the target large language model to obtain a corresponding answer.
[0107] In this embodiment, the answer generation module in the target large language model can be used to perform reasoning processing on the second text information and the target segment to output a corresponding answer. In addition, the generated answer can also be optimized by grammar checking, sentence structure adjustment, etc. to ensure the accuracy and readability of the answer.
[0108] Step S206: performing fact-checking processing on the answer based on the fact-checking plug-in module in the target large language model to obtain a corresponding target answer.
[0109] In this embodiment, the specific implementation process of performing fact-checking processing on the answer based on the fact-checking plug-in module in the target large language model to obtain the corresponding target answer will be further described in detail in subsequent specific embodiments of the present application and will not be elaborated on here.
[0110] Step S207, performing violation detection processing on the target answer based on a preset violation detection model to obtain a corresponding violation detection result.
[0111] In this embodiment, the target answer is input into the violation detection model, so that the target answer is detected and processed by the violation detection model and the corresponding violation detection result is output. Among them, the violation detection result includes the absence of violation or the presence of violation. Among them, if the violation detection result is the presence of violation, the violation type, violation score, and violation basis (related fragments or text) can also be output. Violation type: clearly indicate whether the customer service behavior is in violation and the type of violation. Violation score: quantify the degree of violation. Violation basis: provide specific text or fragments as evidence of violation. In addition, previous violation examples can also be output: provide historical cases of similar violations for reference and learning.
[0112] Step S208: If the violation detection result is that there is no violation, the target answer is sent to the user.
[0113] In this embodiment, if the violation detection result is that there is no violation, it is determined that the above target answer has passed the quality inspection process of the violation detection model, and then the target answer is directly sent to the user to complete the reply processing of the query text information entered by the user, thereby improving the standardization of the reply processing.
[0114] After preprocessing the query text information input by the user to obtain the first text information, the present application rewrites and optimizes the first text information based on the text rewriting plug-in module in the target large language model, performs fragment extraction on the relevant documents retrieved and output by the information retrieval system based on the fragment extraction plug-in module, and performs fact verification on the answer output by reasoning of the target large language model based on the fact verification plug-in module to obtain the corresponding target answer, and then uses the violation detection model to perform violation detection on the target answer. Only when it is ensured that the violation detection result is that there is no violation, the target answer is sent to the user, which effectively ensures the accuracy and authenticity of the generated target answer, and can avoid replying to the user with a violation answer that violates the law, thereby improving the intelligence and accuracy of the query reply processing and improving the user's experience.
[0115] In some optional implementations, step S202 includes the following steps:
[0116] Based on the text rewriting plug-in module, grammar correction processing is performed on the first text information to obtain a corresponding first designated text.
[0117] In this embodiment, the text rewriting plug-in module is a new Agent added to the target large language model, which is used to make the user's current query more complete and clear. Among them, by performing a grammar check on the first text information, possible grammatical errors are discovered and corrected. Specifically, the grammar checking tool in the natural language processing library is used to parse the text, and the grammatical errors in the sentence are identified, and then corrected according to the correct expression in the grammar rule library or the reference database. The above-mentioned natural language processing library can adopt NLTK, spaCy, etc. The above-mentioned grammatical errors may include, for example, inconsistency between subject and predicate, lack of punctuation, etc. The above-mentioned reference database contains a high-quality text data set, which serves as a reference or template for rewriting, and may specifically include standard customer service words, standardized expressions and other data.
[0118] The first designated text is processed with information supplementation to obtain a corresponding second designated text.
[0119] In this embodiment, it is possible to check whether important information is missing from the first designated text and supplement it according to the context and reference database. Specifically, by analyzing the text context, key information points (such as time, place, key figures, etc.) that may be missing are identified. Then the reference database is queried to find a standard expression or template related to the current text. Based on the above standard expression or template, the missing information is supplemented to the first designated text in a standard or standardized manner to obtain the corresponding second designated text.
[0120] The second designated text is subjected to expression optimization processing to obtain a corresponding third designated text.
[0121] In this embodiment, the second designated text is optimized to ensure that the expression intention is clear and unambiguous to avoid ambiguity. Specifically, the main intention and key information in the second designated text are identified by using semantic analysis technology. Then, according to the standard expression in the reference database, the expression of the text is adjusted to make it more direct and clear. And for vague or ambiguous expressions, clarification or concretization is performed.
[0122] The third designated text is used as the second text information.
[0123] In this embodiment, after obtaining the third designated text, natural language generation (NLG) technology may be further introduced to generate a more natural and fluent expression to obtain the corresponding second text information.
[0124] The present application uses a text rewriting plug-in module to perform grammatical correction, information supplementation and expression optimization processing on the first text information, so as to quickly and accurately complete the rewriting and optimization processing of the first text information, making the user's query more complete and clear, and based on the obtained second text information, it can ensure a more accurate understanding of user needs, thereby improving the accuracy of retrieval and generated answers.
[0125] In some optional implementations of this embodiment, step S204 includes the following steps:
[0126] Perform intent analysis on the second text information to obtain corresponding query intent.
[0127] In this embodiment, the second text information can be parsed by using natural language processing (NLP) technology, such as named entity recognition (NER), dependency parsing or semantic role labeling (SRL), and keywords, key phrases or sentences in the second text information can be extracted as representations of the query intent.
[0128] A relevance evaluation is performed on the query intent and each of the related documents to obtain a corresponding relevance evaluation result.
[0129] In this embodiment, the above-mentioned relevance evaluation refers to calculating the similarity between the query intent and each of the related documents by using algorithms such as vector space model (VSM), TF-IDF, BM25, etc., and taking it as the corresponding relevance evaluation result.
[0130] Based on the relevance evaluation result, candidate documents are screened out from all the relevant documents, wherein the number of the candidate documents includes a plurality.
[0131] In this embodiment, all relevant documents are sorted according to the similarity score, and documents with similarity scores greater than a preset score threshold are selected as candidate documents for further processing. There is no specific limitation on the value of the score threshold, which can be set according to actual evaluation requirements.
[0132] Based on the segment extraction plug-in module, the candidate document is divided into corresponding segments using a preset text segmentation technology.
[0133] In this embodiment, the above-mentioned fragment extraction plug-in module is an agent newly added to the target large language model to extract relevant fragments from the retrieved document content. For each candidate document, text segmentation technology (such as sentence segmentation, paragraph segmentation) is used to divide it into smaller fragments. A fragment can be one or more sentences, phrases or words.
[0134] Semantic similarity is calculated for the query intent and each of the fragments respectively to obtain corresponding semantic similarity.
[0135] In this embodiment, the semantic similarity of each segment can be calculated by using a semantic dictionary-based method or a statistical method to evaluate its relevance to the query intent and obtain the corresponding semantic similarity. Among them, the semantic dictionary-based method includes: using a semantic dictionary with a hierarchical relationship (such as WordNet, HowNet, etc.) to calculate the semantic similarity between the intent and the vocabulary in the segment. This method relies on the upper and lower relationships, synonymous relationships, etc. between the words defined in the dictionary. The similarity between the intent and the vocabulary in the segment is evaluated by calculating indicators such as the path length of the semantic dictionary and the amount of information of the common ancestor node. The statistical method includes: using a large-scale corpus and statistical model to calculate the semantic similarity between the intent and the segment. Common methods include vector space model (VSM), word embedding (such as Word2Vec, G l oVe), etc. These methods represent text as vectors and evaluate the semantic similarity between texts by calculating the similarity between vectors (such as cosine similarity).
[0136] Filter out designated segments whose semantic similarity is greater than a preset similarity threshold from all the segments.
[0137] In this embodiment, there is no limitation on the value of the similarity threshold, which can be set according to actual evaluation requirements. The specified segment with semantic similarity greater than the similarity threshold refers to the segment that is highly relevant to the query intent among all segments.
[0138] All the specified segments are added to the preset set to obtain a corresponding segment set.
[0139] In this embodiment, the above-mentioned preset set may be a preset set for storing segments.
[0140] The target segment is generated based on the segment set.
[0141] In this embodiment, after obtaining the segment set, a deduplication algorithm is used to remove duplicate segments. The segments are screened according to their content and quality, and segments that are not directly related to the query intent or have low information content are removed, thereby obtaining the final target segment. The deduplication algorithm may use a hash table, set, or other algorithm.
[0142] The present application obtains the query intent by performing intent analysis on the second text information, and evaluates the relevance between the query intent and each of the related documents to screen out candidate documents from all the related documents, and then based on the use of a fragment extraction plug-in module, first divides the candidate documents into corresponding fragments, and then respectively calculates the semantic similarity between the query intent and each of the fragments to obtain the corresponding semantic similarity, then screens out specified fragments whose semantic similarity is greater than a preset similarity threshold from all the fragments, and adds the specified fragments to a preset collection to generate corresponding target fragments, thereby effectively realizing the rapid and accurate extraction of fragments that are highly relevant to the query intent from relevant documents, helping to reduce the interference of irrelevant information, and making the subsequently generated answers corresponding to the query text information input by the user more refined and relevant.
[0143] In some optional implementations, step S206 includes the following steps:
[0144] The factual information to be verified is extracted from the answer based on the fact-checking plug-in module.
[0145] In this embodiment, named entity recognition (NER) and relationship extraction techniques can be used to identify entities (such as names of people, places, and institutions) in the answers and the relationships between them. Specific numerical values, time, proportions, statistical data, and other information that may involve factual verification are extracted as the above-mentioned factual information to be verified.
[0146] Get the preset trusted database.
[0147] In this embodiment, the above-mentioned trusted database is a pre-built database for fact checking. By connecting to the trusted database, data tables or records related to the information to be checked can be obtained.
[0148] Relevant information corresponding to the factual information is retrieved from the trusted database.
[0149] In this embodiment, for each factual information that needs to be verified, relevant information is retrieved from the trusted database by writing a query statement or calling an API interface.
[0150] Determine whether the relevant information is consistent with the factual information.
[0151] In this embodiment, the retrieved information is compared with the information to be verified to determine whether they are consistent, including details such as values, units, and timestamps.
[0152] If the relevant information is consistent with the factual information, the answer is determined to have passed the fact check and the answer is used as the target answer.
[0153] If the relevant information is inconsistent with the factual information, the factual information in the answer is corrected based on the relevant information to obtain a processed answer, and the processed answer is used as the target answer.
[0154] In this embodiment, if the relevant information is inconsistent with the factual information, the erroneous factual information is marked, and the erroneous part of the factual information in the above answer is automatically modified according to the correct information in the trusted database to obtain a processed answer, and the processed answer is used as the target answer.
[0155] The present application first extracts the factual information to be verified from the answer based on the fact-checking plug-in module, and then retrieves the relevant information corresponding to the factual information based on the use of a trusted database. If the relevant information is detected to be consistent with the factual information, the answer is determined to have passed the fact-checking, and the answer is used as the target answer. If the relevant information is detected to be inconsistent with the factual information, the factual information in the answer is corrected based on the relevant information to obtain a processed answer, and the processed answer is used as the target answer, thereby achieving intelligent and accurate completion of the fact-checking processing of the answer. By using the fact-checking plug-in module to fact-check the generated answer, the accuracy and authenticity of the output target answer can be effectively ensured.
[0156] In some optional implementations, the preprocessing of the query text information to obtain the corresponding first text information in step S201 includes the following steps:
[0157] Gets the default non-text information type.
[0158] In this embodiment, the above non-text information types may specifically include special characters, HTML tags, URL links and other non-text content types.
[0159] The non-text content in the query text information is deleted based on the non-text information type to obtain a corresponding fourth specified text.
[0160] In this embodiment, matching non-text content, ie, special characters, HTML tags, and URL links, is screened out from the query text information based on the non-text information type, and then the non-text content is deleted to obtain the corresponding fourth designated text.
[0161] Get the preset font conversion rules.
[0162] In this embodiment, the above-mentioned font conversion rules may specifically include traditional and simplified Chinese conversion to ensure text consistency.
[0163] The fourth designated text is converted based on the font conversion rule to obtain a corresponding fifth designated text.
[0164] In this embodiment, the fourth designated text is converted between traditional and simplified Chinese characters based on the use of the font conversion rule, thereby obtaining the corresponding fifth designated text.
[0165] The fifth designated text is used as the first text information.
[0166] The present application deletes and converts the non-text content of the query text information based on the use of non-text information types and font conversion rules, thereby quickly and accurately completing the preprocessing of the query text information and ensuring the accuracy of the content of the obtained first text information.
[0167] In some optional implementations of this embodiment, before step S207, the electronic device may further perform the following steps:
[0168] Obtain violation data from a variety of pre-defined data sources.
[0169] In this embodiment, the data sources may include multiple channels such as public data sets, social media, e-commerce platforms, government regulatory agencies, etc. The illegal behavior data may include fraud, violence, false propaganda, etc. data collected from various data sources.
[0170] The illegal behavior data is labeled to obtain labeled illegal behavior data.
[0171] In this embodiment, the collected violation data is manually labeled to clarify whether each data is a violation and the specific type of violation. The labeling work can be completed by a professional labeling team or volunteers to ensure the accuracy and consistency of the labeling. In addition, the labeling process of the violation data can also be completed by machine automatic labeling.
[0172] The illegal behavior data is preprocessed to obtain corresponding sample data.
[0173] In this embodiment, the above-mentioned data preprocessing may include cleaning, word segmentation and vectorization, and data enhancement processing. Among them, cleaning includes: removing noise, redundant information and irrelevant content in the data, such as HTML tags, special characters, garbled characters, etc. Word segmentation and vectorization include: for text data, word segmentation processing is required to split the sentence into vocabulary or sub-word units. Then, word embedding technology (such as Word2Vec, GloVe, BERT, etc.) is used to convert the vocabulary into a numerical vector for model processing. Data enhancement includes: transforming the original data by adding noise, changing the font size, rotating the image, etc. to increase the generalization ability of the model.
[0174] Get the preset initial detection model.
[0175] In this embodiment, there is no specific limitation on the selection of the above-mentioned initial detection model, and a model based on deep learning can be selected, such as a convolutional neural network (CNN), a recurrent neural network (RNN), a long short-term memory network (LSTM), a Transformer, etc. In addition, a suitable model architecture can be designed or selected for the initial detection model, including an input layer, a hidden layer, and an output layer. In the hidden layer, structures such as attention mechanisms and residual connections can be introduced to improve the performance of the model.
[0176] The initial detection model is trained and evaluated based on the sample data to obtain a specified detection model that meets the preset construction requirements.
[0177] In this embodiment, the process of training and evaluating the initial detection model based on the sample data includes: Model training includes: Parameter initialization: Initialize the model parameters using random initialization or pre-trained weights. Loss function: Select a suitable loss function according to the task requirements, such as cross entropy loss function, mean square error loss function, etc. Optimization algorithm: Select an appropriate optimization algorithm (such as SGD, Adam, RMSprop, etc.) to update the model parameters to minimize the loss function. Training process: Divide the pre-processed sample data into a training set and a validation set, use the training set to train the model, and evaluate the performance of the model on the validation set. Adjust the model parameters, optimization algorithm or model architecture according to the evaluation results to improve the model's accuracy, recall rate, F1 score and other indicators. Hyperparameter tuning: Tune the model's hyperparameters (such as learning rate, batch size, number of iterations, etc.) through methods such as grid search, random search or Bayesian optimization to further improve the performance of the model. Model evaluation and optimization: Evaluation indicators: Use evaluation indicators such as accuracy, recall rate, F1 score, ROC curve, AUC value, etc. to evaluate the performance of the model. Error analysis: Analyze the samples where the model predicts errors, find out the causes of the errors, and improve the model accordingly. Model optimization: Based on the error analysis results and evaluation indicators, further optimize the model, such as increasing the amount of data, improving the model architecture, adjusting hyperparameters, etc., until a specified detection model that meets the construction requirements is obtained.
[0178] The designated detection model is used as the violation detection model.
[0179] This application obtains sample data by annotating and preprocessing the acquired violation data, and then trains and evaluates the initial detection model based on the sample data to quickly and intelligently construct a corresponding violation detection model, thereby improving the construction efficiency of the violation detection model and ensuring the detection effect of the obtained violation detection model.
[0180] In some optional implementations of this embodiment, after step S207, the electronic device may further perform the following steps:
[0181] If the violation detection result is that a violation exists, then the specified content corresponding to the violation detection result is obtained.
[0182] In this embodiment, the relevant segments that lead to behavior prediction can be extracted from the target segments to serve as the specified content. Specifically, the keywords, phrases, or sentences that are focused on during model prediction are analyzed. The attention mechanism is used to identify the text parts that contribute most to the prediction results. These key text parts are extracted as violation evidence to obtain the specified content.
[0183] Generate corresponding query information to be processed based on the second text information, the violation detection result and the specified content.
[0184] In this embodiment, the query information to be processed may be obtained by integrating the second text information, the violation detection result and the designated content.
[0185] The query information to be processed is sent to the corresponding target customer service.
[0186] In this embodiment, the target customer service may be a customer service representative who is responsible for manually correcting answers that contain violations.
[0187] Receive a specified answer returned by the target customer service corresponding to the second text message.
[0188] In this embodiment, after consulting the above query information to be processed, the target customer service can generate a specified answer that matches the query input by the user based on his / her own work experience.
[0189] The specified answer is sent to the user.
[0190] In this embodiment, the communication address of the user can be obtained, and the designated answer can be sent to the communication terminal corresponding to the user according to the communication address, so as to successfully complete the reply processing for the query raised by the user.
[0191] When the present application detects that the violation detection result output by the violation detection model for the target answer is that there is a violation, the application will intelligently obtain the specified content corresponding to the violation detection result, and generate corresponding query information to be processed based on the second text information, the violation detection result and the specified content, and then send the query information to be processed to the corresponding target customer service, so that the query information to be processed is manually processed by the target customer service, and the specified answer corresponding to the second text information returned by the target customer service is sent to the user, thereby smoothly completing the reply processing for the query raised by the user, improving the intelligence of the query reply processing, avoiding replying to the user with a violation answer that violates the law, improving the accuracy of the query reply, and improving the user experience.
[0192] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0193] It should be emphasized that in order to further ensure the privacy and security of the above target answer, the above target answer can also be stored in a node of a blockchain.
[0194] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0195] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0196] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0197] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a query processing device based on artificial intelligence, and the embodiment of the device is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0198] like Figure 3 As shown, the artificial intelligence-based query processing device 300 described in this embodiment includes: a first acquisition module 301, a rewriting module 302, a retrieval module 303, an extraction module 304, a reasoning module 305, a verification module 306, a detection module 307 and a first sending module 308. Among them:
[0199] The first acquisition module 301 is used to acquire the query text information input by the user, and pre-process the query text information to obtain the corresponding first text information;
[0200] A rewriting module 302 is used to rewrite and optimize the first text information based on a text rewriting plug-in module in a preset target large language model to obtain corresponding second text information;
[0201] A retrieval module 303 is used to retrieve the second text information based on a preset information retrieval system to obtain corresponding related documents; wherein the number of the related documents includes multiple;
[0202] An extraction module 304 is used to perform segment extraction processing on the relevant documents based on the segment extraction plug-in module in the target large language model to obtain corresponding target segments;
[0203] An inference module 305 is used to perform inference processing on the second text information and the target segment based on the target large language model to obtain a corresponding answer;
[0204] A verification module 306, configured to perform fact verification processing on the answer based on the fact verification plug-in module in the target large language model to obtain a corresponding target answer;
[0205] A detection module 307, configured to perform violation detection processing on the target answer based on a preset violation detection model to obtain a corresponding violation detection result;
[0206] The first sending module 308 is configured to send the target answer to the user if the violation detection result is that there is no violation.
[0207] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based query processing method in the aforementioned implementation mode, and are not described in detail here.
[0208] In some optional implementations of this embodiment, the rewriting module 302 includes:
[0209] A first processing submodule, configured to perform grammar correction processing on the first text information based on the text rewriting plug-in module to obtain a corresponding first designated text;
[0210] A second processing submodule is used to perform information supplementation processing on the first designated text to obtain a corresponding second designated text;
[0211] A third processing submodule is used to perform expression optimization processing on the second designated text to obtain a corresponding third designated text;
[0212] The first determining submodule is configured to use the third designated text as the second text information.
[0213] In some optional implementations of this embodiment, the extraction module 304 includes:
[0214] An analysis submodule, configured to perform intent analysis on the second text information to obtain a corresponding query intent;
[0215] An evaluation submodule is used to evaluate the relevance between the query intent and each of the related documents to obtain a corresponding relevance evaluation result;
[0216] A first screening submodule, configured to screen candidate documents from all the relevant documents based on the relevance evaluation result; wherein the number of the candidate documents includes a plurality;
[0217] A segmentation submodule, used for segmenting the candidate document into corresponding segments using a preset text segmentation technology based on the segment extraction plug-in module;
[0218] A calculation submodule, used to calculate the semantic similarity between the query intent and each of the segments respectively, to obtain the corresponding semantic similarity;
[0219] A second screening submodule, used to screen out designated segments whose semantic similarity is greater than a preset similarity threshold from all the segments;
[0220] An adding submodule, used for adding all the specified segments to a preset set to obtain a corresponding segment set;
[0221] A generating submodule is used to generate the target segment based on the segment set.
[0222] In some optional implementations of this embodiment, the verification module 306 includes:
[0223] An extraction submodule, configured to extract factual information to be verified from the answer based on the fact-checking plug-in module;
[0224] The acquisition submodule is used to obtain the preset trusted database;
[0225] A retrieval submodule, configured to retrieve relevant information corresponding to the factual information from the trusted database;
[0226] A judgment submodule, used to judge whether the relevant information is consistent with the factual information;
[0227] A second determination submodule is configured to determine that the answer has passed the fact check if the relevant information is consistent with the factual information, and use the answer as the target answer;
[0228] The third determination submodule is used to correct the factual information in the answer based on the relevant information to obtain a processed answer if the relevant information is inconsistent with the factual information, and use the processed answer as the target answer.
[0229] In some optional implementations of this embodiment, the first acquisition module 301 includes:
[0230] The second acquisition submodule is used to acquire a preset non-text information type;
[0231] A deletion submodule, configured to delete the non-text content in the query text information based on the non-text information type to obtain a corresponding fourth specified text;
[0232] The third acquisition submodule is used to acquire a preset font conversion rule;
[0233] A conversion submodule, configured to convert the fourth designated text based on the font conversion rule to obtain a corresponding fifth designated text;
[0234] The fourth determining submodule is configured to use the fifth designated text as the first text information.
[0235] In some optional implementations of this embodiment, the query processing device based on artificial intelligence further includes:
[0236] A second acquisition module is used to acquire violation behavior data from a plurality of preset data sources;
[0237] A labeling module, used to label the violation behavior data to obtain the labeled violation behavior data;
[0238] A preprocessing module, used to perform data preprocessing on the violation data to obtain corresponding sample data;
[0239] A third acquisition module is used to acquire a preset initial detection model;
[0240] A construction module, used to train and evaluate the initial detection model based on the sample data to obtain a specified detection model that meets the preset construction requirements;
[0241] A determination module is used to use the specified detection model as the violation detection model.
[0242] In some optional implementations of this embodiment, the query processing device based on artificial intelligence further includes:
[0243] A fourth acquisition module, configured to acquire specified content corresponding to the violation detection result if the violation detection result indicates that a violation exists;
[0244] A generating module, configured to generate corresponding query information to be processed based on the second text information, the violation detection result and the specified content;
[0245] A second sending module, used to send the query information to be processed to the corresponding target customer service;
[0246] A receiving module, configured to receive a designated answer returned by the target customer service corresponding to the second text message;
[0247] The third sending module is used to send the specified answer to the user.
[0248] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based query processing method in the aforementioned implementation mode, and are not described in detail here.
[0249] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0250] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.
[0251] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0252] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the query processing method based on artificial intelligence, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0253] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as running the computer-readable instructions of the artificial intelligence-based query processing method.
[0254] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0255] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned artificial intelligence-based query processing method.
[0256] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A query processing method based on artificial intelligence, characterized in that: The steps include: Acquire query text information input by a user, and preprocess the query text information to obtain corresponding first text information; Rewrite and optimize the first text information based on the text rewriting plug-in module in the preset target large language model to obtain corresponding second text information; Retrieve the second text information based on a preset information retrieval system to obtain corresponding related documents; wherein the number of the related documents includes multiple; Performing segment extraction processing on the relevant documents based on the segment extraction plug-in module in the target large language model to obtain corresponding target segments; Performing reasoning processing on the second text information and the target segment based on the target large language model to obtain a corresponding answer; Performing fact-checking processing on the answer based on the fact-checking plug-in module in the target large language model to obtain a corresponding target answer; Performing violation detection processing on the target answer based on a preset violation detection model to obtain a corresponding violation detection result; If the violation detection result is that there is no violation, the target answer is sent to the user.
2. The query processing method based on artificial intelligence according to claim 1, characterized in that: The step of rewriting and optimizing the first text information based on the text rewriting plug-in module in the preset target large language model to obtain the corresponding second text information specifically includes: Performing grammar correction processing on the first text information based on the text rewriting plug-in module to obtain a corresponding first designated text; Performing information supplementation processing on the first designated text to obtain a corresponding second designated text; Performing expression optimization processing on the second designated text to obtain a corresponding third designated text; The third designated text is used as the second text information.
3. The query processing method based on artificial intelligence according to claim 1, characterized in that: The step of performing segment extraction processing on the relevant documents based on the segment extraction plug-in module in the target large language model to obtain the corresponding target segment specifically includes: Performing intent analysis on the second text information to obtain a corresponding query intent; Performing a relevance evaluation on the query intent and each of the related documents to obtain a corresponding relevance evaluation result; Filtering candidate documents from all the relevant documents based on the relevance evaluation result; wherein the number of the candidate documents includes multiple; Based on the segment extraction plug-in module, the candidate document is divided into corresponding segments using a preset text segmentation technology; Calculating semantic similarity between the query intent and each of the fragments respectively to obtain corresponding semantic similarity; Filter out designated segments whose semantic similarity is greater than a preset similarity threshold from all the segments; Add all the specified segments to the preset set to obtain a corresponding segment set; The target segment is generated based on the segment set.
4. The query processing method based on artificial intelligence according to claim 1, characterized in that: The step of performing fact-checking processing on the answer based on the fact-checking plug-in module in the target large language model to obtain the corresponding target answer specifically includes: Extracting factual information to be verified from the answer based on the fact-checking plug-in module; Obtain a preset trusted database; Retrieving relevant information corresponding to the factual information from the trusted database; Determining whether the relevant information is consistent with the factual information; If the relevant information is consistent with the factual information, it is determined that the answer has passed the fact check, and the answer is used as the target answer; If the relevant information is inconsistent with the factual information, the factual information in the answer is corrected based on the relevant information to obtain a processed answer, and the processed answer is used as the target answer.
5. The query processing method based on artificial intelligence according to claim 1, characterized in that: The step of preprocessing the query text information to obtain the corresponding first text information specifically includes: Get the preset non-text information type; Deleting the non-text content in the query text information based on the non-text information type to obtain a corresponding fourth specified text; Get the preset font conversion rules; Convert the fourth designated text based on the font conversion rule to obtain a corresponding fifth designated text; The fifth designated text is used as the first text information.
6. The query processing method based on artificial intelligence according to claim 1, characterized in that: Before the step of performing violation detection processing on the target answer based on the preset violation detection model to obtain the corresponding violation detection result, the method further includes: Obtain violation data from multiple pre-defined data sources; Performing labeling processing on the illegal behavior data to obtain labeled illegal behavior data; Performing data preprocessing on the illegal behavior data to obtain corresponding sample data; Obtain a preset initial detection model; Based on the sample data, the initial detection model is trained and evaluated to obtain a specified detection model that meets the preset construction requirements; The designated detection model is used as the violation detection model.
7. The query processing method based on artificial intelligence according to claim 1, characterized in that: After the step of performing violation detection processing on the target answer based on the preset violation detection model to obtain the corresponding violation detection result, the method further includes: If the violation detection result is that there is a violation, obtaining the specified content corresponding to the violation detection result; Generate corresponding query information to be processed based on the second text information, the violation detection result and the specified content; Sending the pending query information to the corresponding target customer service; receiving a specified answer returned by the target customer service corresponding to the second text message; The specified answer is sent to the user.
8. A query processing device based on artificial intelligence, characterized in that: include: A first acquisition module, used to acquire query text information input by a user, and pre-process the query text information to obtain corresponding first text information; A rewriting module, configured to rewrite and optimize the first text information based on a text rewriting plug-in module in a preset target large language model to obtain corresponding second text information; A retrieval module, configured to retrieve the second text information based on a preset information retrieval system to obtain corresponding related documents; wherein the number of the related documents includes a plurality; An extraction module, configured to perform segment extraction processing on the relevant document based on the segment extraction plug-in module in the target large language model to obtain a corresponding target segment; An inference module, configured to perform inference processing on the second text information and the target segment based on the target large language model to obtain a corresponding answer; A verification module, configured to perform fact verification processing on the answer based on the fact verification plug-in module in the target large language model to obtain a corresponding target answer; A detection module, used to perform violation detection processing on the target answer based on a preset violation detection model to obtain a corresponding violation detection result; The first sending module is used to send the target answer to the user if the violation detection result is that there is no violation.
9. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the query processing method based on artificial intelligence as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the artificial intelligence-based query processing method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Information processing device, method, and program
JP7824476B1