Data processing method and device in medical question and answer scene, electronic equipment and storage medium
Through the text preprocessing and problem splitting model of the medical question-and-answer system, the problem of inaccurate data processing results is solved, more efficient and accurate data processing is achieved, and the dependence on BI products is reduced.
Patent Information
- Application Number
- CN202510026998.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-05-06
AI Technical Summary
In the medical Q&A scenario, the existing intelligent Q&A system has problems such as inaccurate data processing results and excessive dependence on BI products, which leads to the inability to fully meet the user's answers to the questions.
By preprocessing the text to be processed, including terminological update, text reconstruction and standardization, the pre-constructed processing model is used to split problem and generate DSL statements, the target DSL statements of the sub-problem text are determined, and the accurate data processing results are finally generated.
It realizes more fine-grained processing of to-process text in medical Q&A scenarios, improves the accuracy and independence of data processing, and reduces dependence on BI products.
Smart Images

Figure CN119938847A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device, electronic device and storage medium in a medical question and answer scenario. Background Art
[0002] Intelligent question-and-answer systems usually provide personalized information services to users in the form of questions and answers, and provide users with data analysis, data insights, data visualization and other functions through natural language understanding and knowledge graphs. They aim to help users find data quickly and easily, interpret data simply and intuitively, and mine data intelligently and deeply, so that everyone has their own exclusive data analyst, improving the efficiency and quality of data query and analysis.
[0003] At present, the intelligent question-answering systems used in different application scenarios or enterprises are trained by fine-tuning mature intelligent question-answering assistants to produce data models to support the data processing logic of the corresponding business data. The intelligent question-answering systems obtained in this way need to be deeply bound to the BI (Business Intelligence) of the provider of the intelligent question-answering assistant. This makes the intelligent question-answering system overly dependent on the binding products given by the provider in the question-answering process, and can only conduct conversational question-answering on the data maintained on the specific BI product. In addition, there is also the problem that the answers to the questions fed back to the user do not fully meet the corresponding questions, resulting in poor accuracy of the data processing results. Summary of the invention
[0004] The present invention provides a data processing method, device, electronic device and storage medium in a medical question-and-answer scenario to solve the problems of inaccurate data processing results and over-reliance on BI products.
[0005] According to one aspect of the present invention, a data processing method in a medical question-and-answer scenario is provided, comprising:
[0006] Obtain the text to be processed, preprocess the text to be processed, and obtain the target question text corresponding to the text to be processed;
[0007] Performing question splitting processing on the target question text based on the pre-built first processing model to determine the question splitting result of the target question text, wherein the question splitting result includes at least one sub-question text;
[0008] For each sub-question text, the sub-question text is processed based on the pre-built second processing model to determine a target DSL sentence of the sub-question text;
[0009] The processing result corresponding to the text to be processed is determined based on the target DSL statement of each sub-question text.
[0010] Optionally, the text to be processed is preprocessed, including one or more of the following: performing terminology update on the text to be processed to obtain an updated text to be processed, wherein the field content in the updated text to be processed satisfies the business terminology; performing text reconstruction on the text to be processed to obtain a problem reconstructed text corresponding to the text to be processed, wherein the problem reconstructed text satisfies the model language logic; performing text normalization on the text to be processed to obtain a normalized text, wherein the field content in the normalized text meets preset standard conditions.
[0011] Optionally, before preprocessing the text to be processed, it also includes: performing intent recognition on the text to be processed to obtain the intent recognition result of the text to be processed; if the intent recognition result is an intent recognition mark, continuing to preprocess the text to be processed; if the intent recognition result is not an intent mark, stopping the preprocessing of the text to be processed and returning a preset exception prompt message.
[0012] Optionally, question splitting processing is performed on the target question text based on a pre-constructed first processing model to determine the question splitting result of the target question text, including: performing a mixed search in a preset question splitting knowledge base based on the target question text to determine a question splitting example for the target question text; obtaining preset question splitting element information, and constructing a question splitting prompt model for the target question text based on the question splitting example and the preset question splitting element information; and determining the question splitting result of the target question text based on the question splitting prompt model and the pre-constructed first processing model.
[0013] Optionally, the sub-question text is processed based on a pre-constructed second processing model to determine a target DSL sentence of the sub-question text, including: performing a mixed search in a preset DSL knowledge base based on the sub-question text to determine a DSL sentence example of the sub-question text; obtaining preset sentence generation element information, and constructing a sentence generation prompt model for the sub-question text based on the DSL sentence example and the preset sentence generation element information; and determining the target DSL sentence of the sub-question text based on the sentence generation prompt model and the pre-constructed second processing model.
[0014] Optionally, the processing result corresponding to the text to be processed is determined based on the target DSL statement of each sub-question text, including: transmitting the target DSL statement of each sub-question text to the target server, performing permission filtering processing on the target DSL statement of each sub-question text by the target server, converting the filtered target DSL statement into a corresponding SQL statement, executing the SQL statement and returning the SQL statement execution result; receiving the execution result corresponding to the target DSL statement of each sub-question text, and forming the processing result corresponding to the text to be processed based on the execution result corresponding to each sub-question text.
[0015] Optionally, before determining the processing result corresponding to the text to be processed based on the target DSL statement of each sub-problem text, it also includes: for the target DSL statement of each sub-problem text, searching the target DSL statement in a preset data table knowledge base to determine the recall information of key information in the target DSL statement, wherein the key information includes one or more of the business name, indicator name, table name and operation type; and updating the corresponding key information in the target DSL statement based on the recall information to obtain an updated target DSL statement.
[0016] According to another aspect of the present invention, a data processing device in a medical question-and-answer scenario is provided, comprising:
[0017] A target question text determination module is used to obtain the text to be processed, pre-process the text to be processed, and obtain the target question text corresponding to the text to be processed;
[0018] A question splitting result determination module is used to perform question splitting processing on the target question text based on the pre-built first processing model, and determine the question splitting result of the target question text, wherein the question splitting result includes at least one sub-question text;
[0019] A target DSL sentence determination module is used to process each sub-question text based on a pre-built second processing model to determine a target DSL sentence of the sub-question text;
[0020] The processing result determination module is used to determine the processing result corresponding to the to-be-processed text based on the target DSL sentence of each sub-question text.
[0021] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0022] at least one processor; and
[0023] a memory communicatively connected to at least one processor; wherein,
[0024] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the data processing method in the medical question and answer scenario of any embodiment of the present invention.
[0025] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a processor to implement the data processing method in a medical question and answer scenario of any embodiment of the present invention when executed.
[0026] The technical solution of the embodiment of the present invention obtains the text to be processed, pre-processes the text to be processed, and obtains the target question text corresponding to the text to be processed; performs problem splitting processing on the target question text based on the pre-constructed first processing model to determine the problem splitting result of the target question text, wherein the problem splitting result includes at least one sub-question text; for each sub-question text, processes the sub-question text based on the pre-constructed second processing model to determine the target DSL sentence of the sub-question text; and determines the processing result corresponding to the text to be processed based on the target DSL sentence of each sub-question text. This solution performs pre-processing and problem splitting processing on the text to be processed to obtain at least one sub-question corresponding to the text to be processed, and then determines the target DSL sentence of each sub-question, and obtains the corresponding data processing result according to the target DSL sentence, thereby realizing more fine-grained processing of the text to be processed, so as to obtain the data processing result corresponding to the text to be processed according to the data processing result corresponding to each sub-question, without relying on other products, and can effectively improve the accuracy and independence of processing the text to be processed.
[0027] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0029] Figure 1 is a flow chart of a data processing method in a medical question-and-answer scenario provided by Embodiment 1 of the present invention;
[0030] Figure 2 is a flow chart of a data processing method in a medical question-and-answer scenario provided by Embodiment 2 of the present invention;
[0031] Figure 3 is a flow chart of a data processing method in a medical question-and-answer scenario provided by Embodiment 3 of the present invention;
[0032] Figure 4 It is a structural schematic diagram of a data processing device in a medical question-and-answer scenario provided by a fourth embodiment of the present invention;
[0033] Figure 5 It is a structural schematic diagram of an electronic device for implementing the data processing method in a medical question-and-answer scenario according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] Embodiment 1
[0037] Figure 1 This is a flowchart of a data processing method in a medical question-and-answer scenario provided by Embodiment 1 of the present invention. This embodiment is applicable to the case where data processing is performed on the text to be processed. The method can be executed by a data processing device in a medical question-and-answer scenario. The data processing device in the medical question-and-answer scenario can be implemented in the form of hardware and / or software. The data processing device in the medical question-and-answer scenario can be configured in electronic devices such as computers and servers. Figure 1 As shown, the method includes:
[0038] S110, obtaining the text to be processed, preprocessing the text to be processed, and obtaining the target question text corresponding to the text to be processed.
[0039] The text to be processed can be specifically understood as the question text raised by the user to be processed. The user can input the question text through an external access device, or input voice information through an external access device, and convert the voice information into the corresponding question text. Preprocessing specifically refers to the processing set for the original text input by the user to ensure that the text quality meets the subsequent data processing requirements, that is, the obtained question text can be recognized and processed by the subsequent processing model. Preprocessing includes but is not limited to business terminology processing of the text to be processed, text reconstruction processing of the text to be processed, and normalization processing of the text to be processed. Among them, business terminology processing specifically refers to converting the field information in the text to be processed into corresponding business terms, which is used to unify the description of the text to be processed, ensure the accuracy of the subsequent determination of the target problem text and the corresponding processing results, and can be processed by a pre-built business terminology processing method; text reconstruction processing specifically refers to reconstructing the text to be processed so that the text structure of the reconstructed text to be processed is more consistent with the problem text structure that the model can process, and can be processed by a pre-built text reconstruction processing method; normalization processing refers to normalizing the fields in the text to be processed according to the field description information in the corresponding database, ensuring that the corresponding DSL (Domain Specific Language) statements can be obtained quickly and accurately in the future, and can be processed by a pre-built normalization processing method. The target problem text specifically represents the professional problem description text corresponding to the text to be processed, and the professional problem description text represents the problem description text that conforms to the corresponding field specifications and also conforms to the text structure processed by the large language model.
[0040] Specifically, the text to be processed input by the user through an external input device can be received in real time. When the text to be processed is obtained, one or more processing methods in the preset preprocessing methods are called to process the text to be processed, so as to finally obtain the target question text corresponding to the text to be processed.
[0041] In this embodiment, by preprocessing the text to be processed to obtain the target problem text, the problem of inaccurate processing results caused by unclear text description of the problem can be reduced, so that the subsequent processing model can quickly identify the target problem processing to quickly obtain the corresponding processing results, thereby improving the efficiency of data processing of the text to be processed.
[0042] Optionally, the text to be processed is preprocessed, including one or more of the following: performing terminology update on the text to be processed to obtain an updated text to be processed, wherein the field content in the updated text to be processed satisfies the business terminology; performing text reconstruction on the text to be processed to obtain a problem reconstructed text corresponding to the text to be processed, wherein the problem reconstructed text satisfies the model language logic; performing text normalization on the text to be processed to obtain a normalized text, wherein the field content in the normalized text meets preset standard conditions.
[0043] Among them, the preset standard conditions can be specifically understood as conditions set for normative restrictions on the expression of field content. In this embodiment, the preset standard conditions refer to that the description of the field content in the text to be processed needs to comply with the specifications of the database field content description. Exemplarily, the preset standard conditions for field content with statistical requirements such as characterizing trends, sorting and proportions are: extract_require_example_keywords = {'ranking': ['ranking', 'list'], 'proportion': ['proportion', 'proportion', 'percentage'], 'trend': ['trend', 'improvement', 'improvement', 'change'], 'attribution': ['attribution', 'analysis', 'cause', 'interpretation', 'normal'],}, if the content in the square brackets of the above set appears in the text to be processed, the corresponding field content is updated to the text description before the corresponding square brackets. For example, if 'ranking' or 'list' appears in the text to be processed, the corresponding normalized text is 'ranking', which helps to more accurately determine the DSL statement corresponding to the text to be processed later.
[0044] Specifically, the preprocessing may execute any of the following items to perform terminology update on the text to be processed, specifically by obtaining a pre-built business terminology knowledge base, performing word segmentation on the text to be processed, obtaining the word segmentation result of the text to be processed, and then searching the business terminology knowledge base according to the content of each word segmentation in the word segmentation result. If a record matching the word segmentation is retrieved, the business term corresponding to the word segmentation in the record is obtained, and the corresponding word segmentation in the text to be processed is replaced according to the obtained business term to obtain an updated text to be processed, that is, the field content in the updated text to be processed all satisfies the business terminology. The text to be processed is reconstructed, specifically by performing word segmentation processing on the text to be processed, obtaining the word segmentation result corresponding to the text to be processed, and sorting the words in the word segmentation result according to a preset sentence sequence, wherein the preset sentence sequence corresponds to the model language logic, so as to obtain the problem reconstructed text corresponding to the text to be processed, that is, the problem reconstructed text satisfies the model language logic, so that the subsequent processing model can quickly and accurately identify and process the reconstructed text; the text to be processed is normalized, specifically by obtaining a preset text standard knowledge base, searching the field content in the text to be processed in the preset text standard knowledge base, so as to obtain the normalized content corresponding to the field content, and replace the corresponding field content based on the normalized content, so as to make the normalized text meet the preset standard conditions.
[0045] In this embodiment, the preprocessing can also perform two processes on the processed text, and the processed text can be subjected to terminology update processing and text reconstruction processing. Preferably, after the processed text is subjected to terminology processing and updating, the updated processed text is obtained, and then the updated processed text is subjected to text reconstruction processing to obtain the problem reconstruction text. It can be understood that the field contents in the problem reconstruction text obtained here all meet the business terms. The processed text can also be subjected to terminology update processing and text normalization processing. Preferably, after the processed text is subjected to terminology update processing, the updated processed text is obtained, and then the updated processed text is subjected to text normalization processing, so that the obtained normalized text is more accurate. The processed text can also be subjected to text reconstruction and text normalization processing. Preferably, after the processed text is subjected to text reconstruction, the obtained problem reconstruction text satisfies the model language logic. On the basis that the problem reconstruction text satisfies the model language logic, the problem reconstruction text is subjected to text normalization processing, so that the obtained text can satisfy both the model language logic and the preset standard conditions, which helps to improve the accuracy of the processing result corresponding to the processed text.
[0046] In this embodiment, the preprocessing can also perform three processes on the text to be processed, namely, terminology update processing, text reconstruction processing and text normalization processing on the text to be processed. Preferably, the text to be processed is firstly subjected to terminology update processing to obtain a text to be processed whose field contents all satisfy the business terms, and then the text to be processed that all satisfy the business terms is subjected to text reconstruction processing to obtain a problem reconstructed text that satisfies the model language logic, and further, the problem reconstructed text is subjected to text normalization processing to obtain a normalized text corresponding to the text to be processed.
[0047] Optionally, before preprocessing the text to be processed, it also includes: performing intent recognition on the text to be processed to obtain the intent recognition result of the text to be processed; if the intent recognition result is an intent recognition mark, continuing to preprocess the text to be processed; if the intent recognition result is not an intent mark, stopping the preprocessing of the text to be processed and returning a preset exception prompt message.
[0048] Specifically, intent recognition can be understood as identifying the service types present in the text to be processed, including but not limited to data query service, data display service, data analysis service, data ranking service, report query service, report analysis service, report display service, status query service and other intents. A corresponding intent identifier can be set for each service type, and a non-intent identifier can be set for other intents. The intent recognition result of each text to be processed includes an intent identifier or a non-intent identifier.
[0049] Specifically, a pre-built intention knowledge base is obtained, and the text to be processed is searched in the intention knowledge base to obtain positive examples and negative examples corresponding to the text to be processed. The positive example represents at least one intention identifier that is most similar to the intention of the text to be processed, and the negative example represents at least one intention identifier that is least similar to the intention of the text to be processed. Based on the obtained positive examples and negative examples corresponding to the text to be processed and the text to be processed, an intention recognition prompt model is constructed, and the intention recognition prompt model is input into the pre-built processing model to obtain the intention recognition result corresponding to the text to be processed. Then, it is determined whether the intention recognition result is an intention recognition identifier. If the intention recognition result is an intention recognition identifier, it indicates that the text to be processed meets the data processing requirements, and the preprocessing of the text to be processed can continue to be performed; if the intention recognition result is a non-intention identifier, it indicates that the text to be processed does not meet the data processing requirements, that is, it indicates that the text to be processed cannot be further processed or the processing result obtained is also inaccurate, and the preprocessing of the text to be processed can be stopped and the preset abnormal prompt information is returned. It should be noted that the intent recognition of the text to be processed and the determination of whether to continue with the subsequent steps based on the intent recognition results can be set before any preprocessing and can be set according to actual conditions, and are not limited here.
[0050] S120. Perform question splitting processing on the target question text based on the pre-constructed first processing model to determine the question splitting result of the target question text, wherein the question splitting result includes at least one sub-question text.
[0051] It should be noted that in the actual application process, the text to be processed may be a long text containing multiple sentences, so there will be multiple sub-problems in the text to be processed. It is necessary to split the text to be processed to obtain multiple sub-problems, so that the data processing results corresponding to the text to be processed can be obtained more accurately. Correspondingly, the target question text corresponding to the text to be processed will also include one or more sub-problems. In order to be able to answer the target question text more accurately, it is necessary to perform more fine-grained analysis and splitting of the target question text corresponding to the text to be processed to obtain at least one sub-problem text corresponding to the text to be processed. Among them, the pre-constructed first processing model specifically represents a large language model for determining the problem splitting results of the target question text. The large language model includes but is not limited to LLaMA, ChatGLM and BLOOM. Specifically, the large language model is fine-tuned to obtain a processing model that can split the target question text and obtain the problem splitting results.
[0052] Specifically, the pre-built first processing model is called, the target question text is input into the first processing model as an input parameter, and the first processing model processes the target question text to obtain at least one sub-question text corresponding to the target question text.
[0053] In this embodiment, the target question text is split into questions through a pre-constructed first processing model to obtain at least one sub-question text corresponding to the target question text, thereby achieving fine-grained splitting of the target question text, making it possible to more clearly identify the sub-questions to be asked by the target question text, thereby helping to obtain a more accurate answer corresponding to the target question text.
[0054] S130 . For each sub-question text, process the sub-question text based on the pre-built second processing model to determine a target DSL sentence of the sub-question text.
[0055] The pre-built second processing model specifically represents a large model for determining the target DSL sentence of the sub-question text, and specifically, the large model is fine-tuned to obtain a processing model that can process the sub-question text and obtain the target DSL sentence. DSL (Domain Specific Language) is a computer programming language with limited expressiveness for a certain domain, and is composed of two types of clauses: leaf query clauses and compound query clauses. Exemplarily, DSL sentences specifically include select...where... clauses, filter clauses, order by clauses, and limit clauses.
[0056] Specifically, for each sub-question text, the sub-question text is input as an input parameter into the second processing model, and the second processing model processes the sub-question text to output a target DSL sentence corresponding to the sub-question text. In this embodiment, each sub-question text can be processed simultaneously in a parallel processing manner to obtain a target DSL sentence corresponding to each sub-question text, so as to improve the speed of obtaining the target DSL sentence of each sub-question text, thereby improving the speed of determining the processing result corresponding to the text to be processed.
[0057] It should be noted that the first processing model and the second processing model can be the same processing model or different processing models. However, the first processing model and the second processing model are both large language models. When the first processing model and the second processing model are the same processing model, a corresponding prompt model is set to be combined with the processing model to implement the processing task to be implemented by the prompt model; when the first processing model and the second processing model are not the same processing model, the first processing model and the second processing model can be trained separately to obtain a pre-trained first processing model and a pre-trained second processing model to complete the corresponding data processing task.
[0058] S140 , determining the processing result corresponding to the text to be processed based on the target DSL sentence of each sub-question text.
[0059] Specifically, when the target DSL statement of each sub-question text is obtained, the target DSL text needs to be converted into a corresponding SQL statement (Structured Query Language), and then the SQL statement is executed to obtain the data query result corresponding to each sub-question text. The data query result corresponding to each sub-question text is then used to form the processing result of the text to be processed, that is, the reply content corresponding to the text to be processed is obtained.
[0060] Optionally, the processing result corresponding to the text to be processed is determined based on the target DSL statement of each sub-question text, including: transmitting the target DSL statement of each sub-question text to the target server, performing permission filtering processing on the target DSL statement of each sub-question text by the target server, converting the filtered target DSL statement into a corresponding SQL statement, executing the SQL statement and returning the SQL statement execution result; receiving the execution result corresponding to the target DSL statement of each sub-question text, and forming the processing result corresponding to the text to be processed based on the execution result corresponding to each sub-question text.
[0061] Specifically, when the target DSL statements of each sub-problem text are obtained, the target DSL statements of each sub-problem text are transmitted to the target server, and the target server screens the target DSL statements of each sub-problem text according to the permissions of the users corresponding to the target DSL statements of each sub-problem text, determines whether each target DSL statement is executable, and filters out the non-executable target DSL statements, calls the statement conversion method, converts the obtained filtered target DSL statements into SQL statements through the statement conversion method, executes each SQL statement on the server side, and returns the execution results of each SQL statement, and forms the processing results corresponding to the to-be-processed text by the execution results corresponding to each sub-problem text, and the visualization page of the client receives the processing results corresponding to the to-be-processed text, and displays the processing results on the visualization page, thereby filtering the target DSL statements of each problem text of different users through permission setting, so that each user can only receive the data that can be queried within the scope of permission, which can not only realize the fault-tolerant processing of the program, but also avoid data leakage and improve data security.
[0062] Optionally, before determining the processing result corresponding to the text to be processed based on the target DSL statement of each sub-problem text, it also includes: for the target DSL statement of each sub-problem text, searching the target DSL statement in a preset data table knowledge base to determine the recall information of key information in the target DSL statement, wherein the key information includes one or more of the business name, indicator name, table name and operation type; and updating the corresponding key information in the target DSL statement based on the recall information to obtain an updated target DSL statement.
[0063] Among them, the recall information can be specifically understood as triggering as many correct results as possible from the full information set, and returning the results to the "rank". The recall methods include but are not limited to collaborative filtering, topic models, content recall and hot spot recall, and "ranking" is to score and sort all recalled content, and select the results with the highest scores and meeting the preset number as recall information. In this embodiment, the recall information of key information specifically refers to the most relevant standard name of the key information retrieved from the preset data table knowledge base. Key information includes but is not limited to business name, indicator name, table name and operation type, where the operation type includes but is not limited to sorting operations and grouping operations.
[0064] Specifically, before determining the processing result corresponding to the to-be-processed text based on the target DSL statement of each sub-problem text, for the target DSL statement of each sub-problem text, the target DSL statement is recalled based on the preset data table knowledge base, and the recall information of the key information in the target DSL statement is obtained by retrieving the key information in the target DSL statement in the preset data table knowledge base, wherein the key information includes but is not limited to the business name, indicator name, table name and operation type; further, the corresponding key information in the target DSL statement is updated according to the extracted recall information to obtain the updated target DSL statement, so that the business name, indicator name, table name and operation type in the target DSL statement are recalled to the corresponding standard name, thereby obtaining a standardized target DSL statement, so that the table name of the target database to be queried can be clearly known, so as to determine whether the query is a statistical table or a detailed table of the database, and it is also helpful to improve the success rate of converting the DSL statement into the corresponding SQL statement, and improve the execution success rate of the SQL statement.
[0065] The technical solution of this embodiment obtains the text to be processed, pre-processes the text to be processed, and obtains the target question text corresponding to the text to be processed; performs question splitting processing on the target question text based on the pre-constructed first processing model, and determines the question splitting result of the target question text, wherein the question splitting result includes at least one sub-question text; for each sub-question text, processes the sub-question text based on the pre-constructed second processing model, and determines the target DSL sentence of the sub-question text; and determines the processing result corresponding to the text to be processed based on the target DSL sentence of each sub-question text. This solution performs pre-processing and question splitting processing on the text to be processed to obtain at least one sub-question corresponding to the text to be processed, and then determines the target DSL sentence of each sub-question, and obtains the corresponding data processing result according to the target DSL sentence, thereby realizing more fine-grained processing of the text to be processed, so as to obtain the data processing result corresponding to the text to be processed according to the data processing result corresponding to each sub-question, and effectively improves the accuracy of processing the text to be processed.
[0066] Embodiment 2
[0067] Figure 2 This is a flowchart of a data processing method in a medical question-answering scenario provided by the second embodiment of the present invention. This embodiment is a further optimization of the method of the above embodiment. Optionally, a mixed search is performed in a preset question splitting knowledge base based on the target question text to determine a question splitting example for the target question text; preset question splitting element information is obtained, and a question splitting prompt model for the target question text is constructed based on the question splitting example and the preset question splitting element information; and the question splitting result of the target question text is determined based on the question splitting prompt model and the pre-constructed first processing model. Figure 2 As shown, the method includes:
[0068] S210, obtaining the text to be processed, preprocessing the text to be processed, and obtaining the target question text corresponding to the text to be processed.
[0069] S220: Perform a mixed search in a preset question splitting knowledge base based on the target question text to determine a question splitting example for the target question text.
[0070] Among them, the preset question splitting knowledge base is specifically a knowledge base constructed for splitting questions, and the preset question splitting knowledge base includes but is not limited to user question text, keywords in user question text, and splitting positive examples and splitting negative examples corresponding to user question text, wherein the splitting positive example includes at least one sub-question obtained by correctly splitting the user question, and the splitting negative example includes at least one sub-question obtained by incorrectly splitting the user question and the corresponding reason for the incorrect splitting. Hybrid retrieval specifically refers to a retrieval method that combines keyword retrieval with text vector retrieval, which is used to retrieve the question splitting examples that are most relevant to the target question text in the preset question splitting knowledge base. Question splitting examples include splitting positive examples and splitting negative examples of the target question text.
[0071] Specifically, the target question text can be processed by word segmentation to obtain the word segmentation results in the target question text, and the obtained word segmentation results can be vectorized to obtain the word segmentation vectors corresponding to each word segmentation information, and each word segmentation vector is used as a keyword vector, and then the keyword vector is used to perform keyword search in a preset question splitting knowledge base, and the question splitting examples that meet the preset similarity threshold are screened out by similarity. Further, the target question text is vectorized to obtain a text vector corresponding to the target question text, and then the text vector is used to perform text vector search in the results retrieved by the keyword, and the question splitting examples that meet the preset number of examples are screened out by similarity from high to low. It should be noted that if the number of question splitting examples retrieved by the text vector corresponding to the target question text does not meet the preset number of examples, the text vector corresponding to the target question text is used to perform a supplementary search in the entire preset question splitting knowledge base, and the question splitting examples are screened from high to low according to the similarity, so that the question splitting examples of the target question text finally obtained meet the preset number of examples.
[0072] In this embodiment, a problem splitting example of a target problem text is determined by a preset problem splitting knowledge base, which is used for a subsequent auxiliary processing model to perform problem splitting on the target problem text, guide the processing model to perform problem splitting, and improve the accuracy of problem splitting on the target problem text.
[0073] S230: Obtain preset question splitting element information, and build a question splitting prompt model for the target question text based on the question splitting example and the preset question splitting element information.
[0074] Among them, the preset problem splitting element information can be specifically understood as the element information required to build a problem splitting prompt model. The preset problem splitting element information includes but is not limited to roles, goals, constraints, historical problem splitting data, data table structure and model output format. Role refers to the role used to set the model in the problem splitting process, which helps to better define the behavior of the large model and ensure that the problem splitting results are more in line with user expectations. For example, the role can be set in the following ways: #your role# You play the role of a data analyst and SQL consultant; the goal represents the task that the model is clearly required to complete. For example, the goal can be set in the following ways: #your goal# You must accurately identify the scenarios of splitting and merging queries; the constraints represent the constraints set for the large model in the problem splitting process. For example: the constraints can be set in the following ways: #your constraints# Disassembly The questions that come out need to contain the keywords of the user's questions, and be directly extracted from the user's questions to maintain the consistency of the user's questions; the data table structure represents the table structure of the data table involved in the problem splitting process. For example, the data table structure can be set in the following ways: #Table name, table field information#"tableName":"Business statistics table","fields":["Number of service hospitals"……]; the model output format specifically represents the output content and the format of the output content used to limit the model. For example, the model output format can be set in the following ways: #Output format#Only return all the questions after decomposition, and the format of each question is used 包裹,问题内容。预设问题拆分要素信息可以预先根据问题拆分需求而设置的要素信息,在进行问题拆分提示模型构建的时候,可以直接调用。
[0075] 具体的,在得到目标问题文本的问题拆分示例的情况下,从配置信息中获取预设问题拆分要素信息,将问题拆分示例添加至提示模型中的输入要素,进而结合预设问题拆分要素信息构建目标问题文本的问题拆分提示模型。需要说明的是,可以根据实际情况调整预设问题拆分要素信息。示例性的,问题拆分提示模型的样例如下:
[0076] #你的角色#
[0077] 你充当一个数据分析与SQL顾问的角色。
[0078] #你的目标#
[0079] 1.必须准确识别出拆分与合并查询的场景,我愿意支付100元的小费以获得更好的完成。
[0080] 2.避免对未提及信息作任何假设,也不允许做出任何合理的推断。
[0081] #你的限制#
[0082] 1.拆解出来的问题需要包含用户提问的关键字,从用户提问中直接提取,保持用户提问的一致性。
[0083] 2.避免引入未经用户提问提及的假设或信息。
[0084] #下面3个点是表名、表字段信息#
[0085] ```
[0086] "tableName":"业务统计表",
[0087] "fields":["服务医院数量"...........]
[0088] ```
[0089] #下面3个点是正例#
[0090] ```
[0091] 输入:查询线下用户今日访问量是多少,并给出近一年的变化趋势?
[0092] 思考:今日日期是XXXX年XX月XX日,今日代表该日期,近一年代表去年XX月到今年XX月
[0093] 回答:查询XXXX年XX月XX日线下用户访问量查询XXXX年XX月至XXXX年XX月线下用户访问量的趋势图
[0094] ```
[0095] #下面3个点是反例#
[0096] ```
[0097] 输入:查询线上用户今日访问量是多少,并给出近一年的变化趋势?;
[0098] 答:查询XXXX年XX月XX日线上用户访问量查询XXXX年XX月至XXXX年XX月线上用户访问量的趋势图< / ;
[0099] 错误原因:每一个子问题,都需要用""进行闭合包裹;
[0100] 改进回答:查询XXXX年XX月XX日线上用户访问量查询XXXX年XX月至XXXX年XX月线上用户访问量的趋势图;
[0101] #输出格式,必须满足,否则你将会受到惩罚#
[0102] 1.仅返回分解后的所有问题,每个问题的格式用包裹,
[0103] 问题内容。
[0104] 在本实施例中,通过问题拆分示例和预设问题拆分要素信息构建目标问题文本的问题拆分提示模型,将问题拆分示例也融入到问题拆分提示模型,使得能够更好地引导大模型进行正确的问题拆分,以及避免错误的问题拆分,有助于提高对目标问题文本进行问题拆分的准确性。
[0105] S240、基于问题拆分提示模型和预构建的第一处理模型确定目标问题文本的问题拆分结果。
[0106] 具体的,在得到问题拆分提示模型的情况下,将问题拆分提示模型输入至预构建的第一处理模型,由预构建的第一处理模型根据问题拆分提示模型对目标问题文本进行问题拆分,以得到目标问题文本的问题拆分结果。
[0107] 在本实施例中,通过引入目标问题拆分的正反例,用于构建问题拆分提示模型,引导预构建的第一处理模型对目标问题文本进行问题拆分,使得处理模型能够更明确地知道问题拆分方向,从而得到与待处理文本更相符的问题拆分结果,提高了问题拆分结果的准确性,有助于提高后续确定DSL语句的准确性,进而提高待处理文本对应的处理结果。
[0108] S250、对于每一子问题文本,基于预构建的第二处理模型对子问题文本进行处理,确定子问题文本的目标DSL语句。
[0109] S260、基于各子问题文本的目标DSL语句确定待处理文本对应的处理结果。
[0110] 本实施例的技术方案,通过获取待处理文本,对待处理文本进行预处理,得到待处理文本对应的目标问题文本;基于目标问题文本在预设问题拆分知识库中进行混合检索,确定目标问题文本的问题拆分示例;获取预设问题拆分要素信息,基于问题拆分示例和预设问题拆分要素信息构建目标问题文本的问题拆分提示模型;基于问题拆分提示模型和预构建的第一处理模型确定目标问题文本的问题拆分结果;对于每一子问题文本,基于预构建的第二处理模型对子问题文本进行处理,确定子问题文本的目标DSL语句;基于各子问题文本的目标DSL语句确定待处理文本对应的处理结果。本方案通过对待处理文本进行预处理得到目标问题文本,结合预设问题拆分知识库确定正反例,用于构建问题拆分提示模型,根据问题拆分提示模型和预构建的第一处理模型确定目标问题文本的问题拆分结果,得到待处理文本对应的至少一个子问题,进而确定各子问题的目标DSL语句,根据目标DSL语句得到对应的数据处理结果,实现了结合知识库和大模型对待处理文本的目标问题文本进行更细粒度的问题拆分处理,提高了确定问题拆分结果的准确性,进而使得确定的目标DSL语句更加准确,极大地提高了对待处理文本进行处理的准确性。
[0111] 实施例三
[0112] 图3是本发明实施例三提供的一种医疗问答场景下的数据处理方法的流程图,本实施例是上述实施例的方法的进一步优化,可选的,对于每一子问题文本,基于子问题文本在预设DSL知识库中进行混合检索,确定子问题文本的DSL语句示例;获取预设语句生成要素信息,基于DSL语句示例和预设语句生成要素信息构建子问题文本的语句生成提示模型;基于语句生成提示模型和预构建的第二处理模型确定子问题文本的目标DSL语句。如图3所示,该方法包括:
[0113] S310、获取待处理文本,对待处理文本进行预处理,得到待处理文本对应的目标问题文本。
[0114] S320、基于预构建的第一处理模型对目标问题文本进行问题拆分处理,确定目标问题文本的问题拆分结果,其中,问题拆分结果包括至少一个子问题文本。
[0115] S330、对于每一子问题文本,基于子问题文本在预设DSL知识库中进行混合检索,确定子问题文本的DSL语句示例。
[0116] 其中,预设DSL知识库具体是用于确定问题文本对应的DSL语句构建的知识库,预设DSL知识库包括特定领域中的大量问题文本向量、大量问题文本中的关键字向量及对应的DSL语句向量。
[0117] 具体的,对于每一子问题文本,可以对子问题文本进行分词处理,得到子问题文本的分词结果,将得到的分词结果进行向量化处理,得到各分词信息对应的分词向量,将各分词向量作为关键字向量,进而通过关键字向量在预设DSL知识库进行关键字检索,通过相似度筛选出满足预设相似度阈值的DSL语句示例,进一步地,对子问题文本进行向量化处理,得到子问题文本对应的文本向量,进而通过文本向量在通过关键字检索到的结果中进行文本向量检索,通过相似度由高到低筛选出满足预设示例数量的DSL语句示例,需要说明的是,如果通过子问题文本对应的文本向量检索到的DSL语句示例的数量不满足预设示例数量,则通过子问题文本对应的文本向量在整个预设DSL知识库进行补充检索,并根据相似度由高到低筛选DSL语句示例,使得最终得到的子问题文本的DSL语句示例满足预设示例数量。
[0118] 在本实施例中,通过预设DSL知识库确定子问题文本的DSL语句示例,用于后续辅助处理模型确定子问题文本的DSL语句示例,提高确定子问题文本的DSL语句示例的准确性。
[0119] S340、获取预设语句生成要素信息,基于DSL语句示例和预设语句生成要素信息构建子问题文本的语句生成提示模型。
[0120] 其中,预设语句生成要素信息具体可以理解为构建语句生成提示模型所需要的要素信息,在本实施例中,语句生成提示模型具体指DSL语句生成模型,预设语句生成要素信息包含但不限于角色、目标、技能、限制条件、历史生成DSL语句数据、查询要素和模型输出格式。角色指的是用于设置模型在语句生成过程中所承担的角色,有助于更好地定义大模型的行为,确保语句生成结果更符合用户预期,示例性的,角色可以通过以下方式进行设置:#你的角色#你充当一个资深数据查询专家与JSON模版数据填充专家;目标表征的是用于明确处理模型要完成的任务,示例性的,目标可以通过以下方式进行设置:#你的目标#1.从用户提问中准确无遗漏地识别到所有查询要素;技能表征的是明确处理模型所擅长的技能,技能可以通过以下方式进行设置:#你的技能#1.擅长精准识别数据查询要素;限制条件表征的是对大模型在确定子问题文本对应的DSL语句过程而设置的限制条件,示例性的:限制条件可以通过以下方式进行设置:#你的限制#1.不改变JSON模板的结构和顺序;历史生成DSL语句数据可以从数据库中提取预设数量的历史数据。查询要素包含但不限于"Select":指标元素、"Date":条件元素,代表时间条件、"Area":条件元素,代表地区条件、"Hospital":条件元素,代表医院条件、"Group":分组元素、"Filter":筛选、过滤元素、"Limit":限制元素和"Order by":排序元素。示例性的,输出格式可以通过以下方式进行设置:#输出格式#1.返回填充之后的JSON模版。
[0121] 具体的,在得到子问题文本的DSL语句示例的情况下,从配置信息中获取预设语句生成要素信息,将DSL语句示例添加至提示模型中的输入要素,进而结合预设语句生成要素信息构建子问题文本的语句生成提示模型。需要说明的是,可以根据实际情况调整预设语句生成要素信息。示例性的,语句生成提示模型的样例如下:
[0122] #你的角色#
[0123] 你充当一个资深数据查询专家与JSON模版数据填充专家
[0124] #下面3个点是数据查询要素结构参考#
[0125] ```
[0126] "Select":指标元素
[0127] "Date":条件元素,代表时间条件
[0128] "Area":条件元素,代表地区条件
[0129] "Hospital":条件元素,代表医院条件
[0130] "Group":分组元素
[0131] "Filter":筛选、过滤元素
[0132] "Limit":限制元素
[0133] "Order by":排序元素
[0134] ```
[0135] #下面3个点是JSON模版#
[0136] ```
[0137] JSON:"[{"name":"select","desc":"提取指标元素","type":"array","value":[]},{"name":"group","desc":"提取分组元素","type":"array","value":[]},{"name":"date","desc":"只提取时间查询条件元素","type":"array","value":[]}}]"
[0138] ```
[0139] #你的目标#
[0140] 1.从用户提问中准确无遗漏地识别到所有查询要素。
[0141] 2.并将提取到的查询要素准确的填充到JSON模版中,需要严格遵守JSON模版的格式。
[0142] #你的技能#
[0143] 1.擅长精准识别数据查询要素。
[0144] 2.擅长数据映射至JSON模板对应的value值。
[0145] #你的限制#
[0146] 1.不改变JSON模板的结构和顺序。
[0147] 2.避免对未提及信息作任何假设以及提取。
[0148] 3.必须保持输出JSON格式的要求。
[0149] #输出格式#
[0150] 1.返回填充之后的JSON模版。
[0151] 2.保持JSON格式完整。
[0152] #下面3个点是正例:
[0153] ```
[0154] 用户提问:查询XXXX年X月XX市A医院资金总量
[0155] 答:[{"name":"date","value":"XXXX年X月"},
[0156] {"name":"area","value":["XX市"]},
[0157] {"name":"hospital","value":["A医院"]},
[0158] {"name":"select","value":["资金总量"]}]
[0159] 错误原因:'XXXXXX'是一家医院名称,XXX不是市辖区名称,市辖区名称只能从市辖区集合中选择。
[0160] 改进回答:[{"name":"date","value":XXXX年X月"},
[0161] {"name":"hospital","value":["XXXX"]},{"name":"indicators","value":["结余率"]}]
[0162] ```
[0163] #下面3个点是反例:
[0164] ```
[0165] 用户提问:查询XXXX年X月XX市XX区A医院资金总量
[0166] 答:[{"name":"date","value":"XXXX月"},
[0167] {"name":"area","value":["XXXXXX"]},
[0168] {"name":"hospital","value":["A医院"]},
[0169] {"name":"select","value":["XXXX"]}]
[0170] 错误原因XX市、XX区是城市与地区的2个查询地区条件元素。
[0171] 改进回答:[{"name":"date","value":"XXXX年X月"},
[0172] {"name":"area","value":["XX市","XX区"]},
[0173] {"name":"hospital","value":["A医院"]},
[0174] {"name":"select","value":["资金总量"]}]
[0175] ```
[0176] 在本实施例中,通过DSL语句示例和预设语句生成要素信息构建子问题文本的语句生成提示模型,将DSL语句示例也融入到语句生成提示模型,使得能够更好地引导大模型确定DSL语句,以及避免得到错误的DSL语句,有助于提高确定DSL语句的准确性。
[0177] S350、基于语句生成提示模型和预构建的第二处理模型确定子问题文本的目标DSL语句。
[0178] 具体的,在得到语句生成提示模型,将语句生成提示模型输入至预构建的第二处理模型,由预构建的第二处理模型根据语句生成提示模型确定子问题文本对应的目标DSL语句。
[0179] 在本实施例中,通过引入DSL语句的正反例构建语句生成提示模型,引导预构建的第二处理模型确定子问题文本的DSL语句,使得处理模型能够更明确地知道生成DSL语句的方向,从而得到与子问题文本更相符的目标DSL语句,有助于提高确定目标DSL语句的准确性。
[0180] S360、基于各子问题文本的目标DSL语句确定待处理文本对应的处理结果。
[0181] 本实施例的技术方案,通过获取待处理文本,对待处理文本进行预处理,得到待处理文本对应的目标问题文本;基于预构建的第一处理模型对目标问题文本进行问题拆分处理,确定目标问题文本的问题拆分结果,其中,问题拆分结果包括至少一个子问题文本;对于每一子问题文本,基于子问题文本在预设DSL知识库中进行混合检索,确定子问题文本的DSL语句示例;获取预设语句生成要素信息,基于DSL语句示例和预设语句生成要素信息构建子问题文本的语句生成提示模型;基于语句生成提示模型和预构建的第二处理模型确定子问题文本的目标DSL语句;基于各子问题文本的目标DSL语句确定待处理文本对应的处理结果。本方案通过对待处理文本进行预处理和问题拆分处理,以得到待处理文本对应的至少一个子问题,结合预设DSL知识库确定DSL语句的正反例,用于构建语句生成提示模型,根据语句生成提示模型和预构建的第二处理模型确定子问题文本的目标DSL语句,根据目标DSL语句得到对应的数据处理结果,实现了结合知识库和大模型确定各子问题对应的目标DSL语句,使得确定的目标DSL语句更加准确,极大地提高了确定待处理文本对应的数据处理结果的准确性,确保得到的数据处理结果更符合目标问题文本。
[0182] 实施例四
[0183] 图4是本发明实施例四提供的一种医疗问答场景下的数据处理装置的结构示意图。如图4所示,该装置包括:
[0184] 目标问题文本确定模块410,用于获取待处理文本,对待处理文本进行预处理,得到待处理文本对应的目标问题文本;
[0185] 问题拆分结果确定模块420,用于基于预构建的第一处理模型对目标问题文本进行问题拆分处理,确定目标问题文本的问题拆分结果,其中,问题拆分结果包括至少一个子问题文本;
[0186] 目标DSL语句确定模块430,用于对于每一子问题文本,基于预构建的第二处理模型对子问题文本进行处理,确定子问题文本的目标DSL语句;
[0187] 处理结果确定模块440,用于基于各子问题文本的目标DSL语句确定待处理文本对应的处理结果。
[0188] 本实施例的技术方案,通过目标问题文本确定模块获取待处理文本,对待处理文本进行预处理,得到待处理文本对应的目标问题文本;问题拆分结果确定模块基于预构建的第一处理模型对目标问题文本进行问题拆分处理,确定目标问题文本的问题拆分结果,其中,问题拆分结果包括至少一个子问题文本;目标DSL语句确定模块对于每一子问题文本,基于预构建的第二处理模型对子问题文本进行处理,确定子问题文本的目标DSL语句;处理结果确定模块基于各子问题文本的目标DSL语句确定待处理文本对应的处理结果。本方案通过对待处理文本进行预处理和问题拆分处理,以得到待处理文本对应的至少一个子问题,进而确定各子问题的目标DSL语句,根据目标DSL语句得到对应的数据处理结果,实现了对待处理文本进行更细粒度的处理,以根据每一子问题对应的数据处理结果得到待处理文本对应的数据处理结果,有效地提高了对待处理文本进行处理的准确性。
[0189] 在上述实施例的基础上,可选的,目标问题文本确定模块410,包括数据预处理单元,预处理单元执行如下的一项或多项:对待处理文本进行术语化更新,得到更新后的待处理文本,其中,更新后的待处理文本中的字段内容满足业务术语;对待处理文本进行文本重构,得到待处理文本对应的问题重构文本,其中,问题重构文本满足模型语言逻辑;对待处理文本进行文本规范化处理,得到规范化文本,规范化文本中的字段内容符合预设规范条件。
[0190] 可选的,在对待处理文本进行预处理之前,装置还具体用于:对待处理文本进行意图识别,得到待处理文本的意图识别结果;如果意图识别结果为意图识别标识,则继续执行对待处理文本进行预处理;如果意图识别结果为非意图标识,则停止执行对待处理文本进行预处理并返回预设异常提示信息。
[0191] 可选的,问题拆分结果确定模块420,具体用于基于目标问题文本在预设问题拆分知识库中进行混合检索,确定目标问题文本的问题拆分示例;获取预设语句生成要素信息,基于问题拆分示例和预设语句生成要素信息构建目标问题文本的问题拆分提示模型;基于问题拆分提示模型和预构建的第一处理模型确定目标问题文本的问题拆分结果。
[0192] 可选的,目标DSL语句确定模块430,具体用于基于子问题文本在预设DSL知识库中进行混合检索,确定子问题文本的DSL语句示例;获取预设语句生成要素信息,基于DSL语句示例和预设语句生成要素信息构建子问题文本的语句生成提示模型;基于语句生成提示模型和预构建的第二处理模型确定子问题文本的目标DSL语句。
[0193] 可选的,处理结果确定模块440,具体用于将各子问题文本的目标DSL语句传输至目标服务器,通过目标服务器对各子问题文本的目标DSL语句进行权限过滤处理,将过滤后的目标DSL语句转换为对应的SQL语句,执行SQL语句并返回SQL语句执行结果;接收各子问题文本的目标DSL语句对应的执行结果,基于各子问题文本对应的执行结果形成待处理文本对应的处理结果。
[0194] 可选的,在基于各子问题文本的目标DSL语句确定待处理文本对应的处理结果之前,装置还具体用于:对于每一子问题文本的目标DSL语句,将目标DSL语句在预设数据表知识库中进行检索,确定目标DSL语句中的关键信息的召回信息,其中,关键信息包括业务名称、指标名称、表名称和操作类型中的一项或多项;基于召回信息更新目标DSL语句中的对应关键信息,得到更新后的目标DSL语句。
[0195] 本发明实施例所提供的医疗问答场景下的数据处理装置可执行本发明任意实施例所提供的医疗问答场景下的数据处理方法,具备执行方法相应的功能模块和有益效果。
[0196] 实施例五
[0197] 图5是本发明实施例五提供的一种电子设备的结构示意图。电子设备10旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备(如头盔、眼镜、手表等)和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和 / 或者要求的本发明的实现。
[0198] 如图5所示,电子设备10包括至少一个处理器11,以及与至少一个处理器11通信连接的存储器,如只读存储器(ROM)12、随机访问存储器(RAM)13等,其中,存储器存储有可被至少一个处理器执行的计算机程序,处理器11可以根据存储在只读存储器(ROM)12中的计算机程序或者从存储单元18加载到随机访问存储器(RAM)13中的计算机程序,来执行各种适当的动作和处理。在RAM 13中,还可存储电子设备10操作所需的各种程序和数据。处理器11、ROM 12以及RAM 13通过总线14彼此相连。输入 / 输出(I / O)接口15也连接至总线14。
[0199] 电子设备10中的多个部件连接至I / O接口15,包括:输入单元16,例如键盘、鼠标等;输出单元17,例如各种类型的显示器、扬声器等;存储单元18,例如磁盘、光盘等;以及通信单元19,例如网卡、调制解调器、无线通信收发机等。通信单元19允许电子设备10通过诸如因特网的计算机网络和 / 或各种电信网络与其他设备交换信息 / 数据。
[0200] 处理器11可以是各种具有处理和计算能力的通用和 / 或专用处理组件。处理器11的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的处理器、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。处理器11执行上文所描述的各个方法和处理,例如医疗问答场景下的数据处理方法。
[0201] 在一些实施例中,医疗问答场景下的数据处理方法可被实现为计算机程序,其被有形地包含于计算机可读存储介质,例如存储单元18。在一些实施例中,计算机程序的部分或者全部可以经由ROM 12和 / 或通信单元19而被载入和 / 或安装到电子设备10上。当计算机程序加载到RAM 13并由处理器11执行时,可以执行上文描述的医疗问答场景下的数据处理方法的一个或多个步骤。备选地,在其他实施例中,处理器11可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行医疗问答场景下的数据处理方法。
[0202] 本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和 / 或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和 / 或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。
[0203] 用于实施本发明的医疗问答场景下的数据处理方法的计算机程序可以采用一个或多个编程语言的任何组合来编写。这些计算机程序可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器,使得计算机程序当由处理器执行时使流程图和 / 或框图中所规定的功能 / 操作被实施。计算机程序可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。
[0204] 实施例六
[0205] 本发明实施例六还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机指令,计算机指令用于使处理器执行一种医疗问答场景下的数据处理方法,该方法包括:
[0206] 获取待处理文本,对待处理文本进行预处理,得到待处理文本对应的目标问题文本;
[0207] 基于预构建的第一处理模型对目标问题文本进行问题拆分处理,确定目标问题文本的问题拆分结果,其中,问题拆分结果包括至少一个子问题文本;
[0208] 对于每一子问题文本,基于预构建的第二处理模型对子问题文本进行处理,确定子问题文本的目标DSL语句;
[0209] 基于各子问题文本的目标DSL语句确定待处理文本对应的处理结果。
[0210] 在本发明的上下文中,计算机可读存储介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的计算机程序。计算机可读存储介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。备选地,计算机可读存储介质可以是机器可读信号介质。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
[0211] 为了提供与用户的交互,可以在电子设备上实施此处描述的系统和技术,该电子设备具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给电子设备。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。
[0212] 可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)、区块链网络和互联网。
[0213] 计算系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与VPS服务中,存在的管理难度大,业务扩展性弱的缺陷。
[0214] 应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发明中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本发明的技术方案所期望的结果,本文在此不进行限制。
[0215] 上述具体实施方式,并不构成对本发明保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明保护范围之内。
Claims
1. A data processing method in a medical question-and-answer scenario, characterized in that: include: Acquire a text to be processed, preprocess the text to be processed, and obtain a target question text corresponding to the text to be processed; Performing question splitting processing on the target question text based on the pre-built first processing model to determine the question splitting result of the target question text, wherein the question splitting result includes at least one sub-question text; For each of the sub-question texts, the sub-question text is processed based on a pre-built second processing model to determine a target DSL sentence of the sub-question text; The processing result corresponding to the to-be-processed text is determined based on the target DSL sentence of each of the sub-question texts.
2. The method according to claim 1, characterized in that The preprocessing of the to-be-processed text includes one or more of the following: Performing terminology update on the text to be processed to obtain an updated text to be processed, wherein the field content in the updated text to be processed satisfies the business terminology; Reconstructing the text to be processed to obtain a problem reconstructed text corresponding to the text to be processed, wherein the problem reconstructed text satisfies the model language logic; The text to be processed is subjected to text normalization processing to obtain a normalized text, wherein the field content in the normalized text meets the preset normalization conditions.
3. The method according to claim 1, characterized in that Before the preprocessing of the to-be-processed text, the method further includes: Performing intent recognition on the text to be processed to obtain an intent recognition result of the text to be processed; If the intention recognition result is an intention recognition mark, then continue to perform preprocessing on the text to be processed; if the intention recognition result is a non-intention mark, then stop performing preprocessing on the text to be processed and return preset abnormal prompt information.
4. The method according to claim 1, characterized in that: The step of performing question splitting processing on the target question text based on the pre-built first processing model to determine the question splitting result of the target question text includes: Performing a mixed search in a preset question splitting knowledge base based on the target question text to determine a question splitting example of the target question text; Acquire preset question splitting element information, and construct a question splitting prompt model for the target question text based on the question splitting example and the preset question splitting element information; The question splitting result of the target question text is determined based on the question splitting prompt model and the pre-built first processing model.
5. The method according to claim 1, characterized in that The processing of the sub-question text based on the pre-built second processing model to determine the target DSL sentence of the sub-question text includes: Performing a mixed search in a preset DSL knowledge base based on the sub-question text to determine a DSL sentence example of the sub-question text; Acquire preset sentence generation element information, and construct a sentence generation prompt model for the sub-question text based on the DSL sentence example and the preset sentence generation element information; A target DSL sentence of the sub-question text is determined based on the sentence generation prompt model and the pre-built second processing model.
6. The method according to claim 1, characterized in that The determining the processing result corresponding to the to-be-processed text based on the target DSL statement of each of the sub-question texts includes: The target DSL statement of each sub-question text is transmitted to the target server, and the target DSL statement of each sub-question text is subjected to permission filtering by the target server, and the filtered target DSL statement is converted into a corresponding SQL statement, and the SQL statement is executed and the SQL statement execution result is returned; Receive the execution result corresponding to the target DSL statement of each of the sub-question texts, and form the processing result corresponding to the to-be-processed text based on the execution result corresponding to each of the sub-question texts.
7. The method according to claim 1, characterized in that Before determining the processing result corresponding to the to-be-processed text based on the target DSL sentence of each of the sub-question texts, the method further includes: For each target DSL sentence of the sub-question text, the target DSL sentence is searched in a preset data table knowledge base to determine the recall information of key information in the target DSL sentence, wherein the key information includes one or more of a business name, an indicator name, a table name, and an operation type; The corresponding key information in the target DSL sentence is updated based on the recalled information to obtain an updated target DSL sentence.
8. A data processing device in a medical question-and-answer scenario, characterized in that: include: A target question text determination module is used to obtain a text to be processed, pre-process the text to be processed, and obtain a target question text corresponding to the text to be processed; A question splitting result determination module is used to perform question splitting processing on the target question text based on a pre-built first processing model to determine a question splitting result of the target question text, wherein the question splitting result includes at least one sub-question text; a target DSL sentence determination module, configured to process each of the sub-question texts based on a pre-built second processing model to determine a target DSL sentence of the sub-question text; The processing result determination module is used to determine the processing result corresponding to the to-be-processed text based on the target DSL sentence of each of the sub-question texts.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data processing method in the medical question and answer scenario described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data processing method in the medical question-and-answer scenario according to any one of claims 1 to 7 when executed.