Disclosure of Invention
In view of the above, the present invention provides a data processing method, an apparatus and an electronic device, so as to solve the problem of urgently needing a method for determining the accuracy of the intention identification service.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method of data processing, comprising:
obtaining a test case and a first intention recognition result which is marked in advance and corresponds to the test case;
calling a pre-obtained intention recognition program to perform intention recognition on the test case to obtain a second intention recognition result corresponding to the test case;
comparing the first intention identification result with the second intention identification result to obtain a first intention identification accuracy;
if the first intention identification accuracy rate is larger than a preset threshold value, determining an intention identification accuracy rate test result of the intention identification program;
and running the intention recognition software in a target running environment, and testing the intention recognition accuracy of the intention recognition program in the target running environment.
Optionally, the obtaining the test case includes:
acquiring a preset test case, and acquiring a user type and/or an application scene corresponding to the test case;
and classifying the test cases according to the user types and/or the application scenes.
Optionally, invoking a pre-obtained intention recognition program to perform intention recognition on the test case to obtain a second intention recognition result corresponding to the test case, where the method includes:
generating an intention recognition simulation environment matched with a target running environment of the intention recognition program;
and under the intention recognition simulation environment, performing intention recognition on the test case by using the intention recognition program to obtain a second intention recognition result corresponding to the test case.
Optionally, the comparing the first intention recognition result and the second intention recognition result to obtain a first intention recognition accuracy includes:
determining the number of test cases with the same corresponding first intention recognition result and second intention recognition result based on the first intention recognition result and the second intention recognition result corresponding to the test cases;
acquiring the total number of the test cases;
and calculating to obtain the first intention identification accuracy according to the number and the total number.
Optionally, testing the intention recognition accuracy of the intention recognition program in the target operating environment includes:
in the target operation environment, performing intention recognition on the test case by using the intention recognition program to obtain a third intention recognition result corresponding to the test case;
comparing the first intention identification result with the third intention identification result to obtain a second intention identification accuracy;
if the difference value between the first intention identification accuracy rate and the second intention identification accuracy rate is within a preset difference value range, determining that the on-line intention test accuracy rate corresponding to the intention identification program passes;
and if the difference value between the first intention identification accuracy rate and the second intention identification accuracy rate is not within a preset difference value range, determining that the on-line intention test accuracy rate corresponding to the intention identification program fails.
Optionally, the method further comprises:
if the first intention identification accuracy rate is not greater than a preset threshold value, the intention identification program is adjusted, so that the intention identification accuracy rate of the adjusted intention identification program is greater than the preset threshold value.
A data processing apparatus comprising:
the data acquisition module is used for acquiring a test case and a first intention recognition result corresponding to the pre-marked test case;
the intention identification module is used for calling a pre-acquired intention identification program to perform intention identification on the test case to obtain a second intention identification result corresponding to the test case;
the accuracy calculation module is used for comparing the first intention recognition result with the second intention recognition result to obtain a first intention recognition accuracy;
the test result determining module is used for determining an intention recognition accuracy test result of the intention recognition program if the first intention recognition accuracy is greater than a preset threshold;
and the online testing module is used for operating the intention recognition software in a target operating environment and testing the intention recognition accuracy of the intention recognition program in the target operating environment.
Optionally, when the data obtaining module is configured to obtain the test case, the data obtaining module is specifically configured to:
the method comprises the steps of obtaining a preset test case, obtaining a user type and/or an application scene corresponding to the test case, and classifying the test case according to the user type and/or the application scene.
Optionally, the intention identifying module is configured to call a pre-obtained intention identifying program to perform intention identification on the test case, and when a second intention identifying result corresponding to the test case is obtained, specifically configured to:
and generating an intention recognition simulation environment matched with a target operation environment of the intention recognition program, and performing intention recognition on the test case by using the intention recognition program under the intention recognition simulation environment to obtain a second intention recognition result corresponding to the test case.
Optionally, the accuracy calculation module includes:
the quantity determining submodule is used for determining the quantity of the test cases with the same corresponding first intention recognition result and second intention recognition result based on the first intention recognition result and the second intention recognition result corresponding to the test cases;
the quantity obtaining submodule is used for obtaining the total quantity of the test cases;
and the accuracy calculation submodule is used for calculating the first intention identification accuracy according to the number and the total number.
Optionally, the online test module includes:
the intention identification submodule is used for carrying out intention identification on the test case by using the intention identification program in the target operation environment to obtain a third intention identification result corresponding to the test case;
the data calculation submodule is used for comparing the first intention recognition result with the third intention recognition result to obtain a second intention recognition accuracy;
a first determining submodule, configured to determine that an online intent test accuracy corresponding to the intent recognition program passes if a difference between the first intent recognition accuracy and the second intent recognition accuracy is within a preset difference range;
and the second determination submodule is used for determining that the on-line intention test accuracy corresponding to the intention identification program fails if the difference value between the first intention identification accuracy and the second intention identification accuracy is not within a preset difference value range.
Optionally, the method further comprises:
and the service adjusting module is used for adjusting the intention identification program if the first intention identification accuracy is not greater than a preset threshold value, so that the intention identification accuracy of the adjusted intention identification program is greater than the preset threshold value.
An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used to:
obtaining a test case and a first intention recognition result which is marked in advance and corresponds to the test case;
calling a pre-obtained intention recognition program to perform intention recognition on the test case to obtain a second intention recognition result corresponding to the test case;
comparing the first intention identification result with the second intention identification result to obtain a first intention identification accuracy;
if the first intention identification accuracy rate is larger than a preset threshold value, determining an intention identification accuracy rate test result of the intention identification program;
and running the intention recognition software in a target running environment, and testing the intention recognition accuracy of the intention recognition program in the target running environment.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a data processing method, a data processing device and electronic equipment, wherein a test case and a pre-marked first intention recognition result corresponding to the test case are obtained; calling a pre-obtained intention recognition program to perform intention recognition on the test case to obtain a second intention recognition result corresponding to the test case; comparing the first intention identification result with the second intention identification result to obtain a first intention identification accuracy; and if the first intention identification accuracy is greater than a preset threshold value, determining an intention identification accuracy test result of the intention identification program. The invention can automatically calculate the intention recognition accuracy of the intention recognition program, and further can continuously optimize the performance of the intention recognition service according to the accuracy, so that the intention recognition program can serve the user faster and better.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The inventor finds that the accuracy of the intention recognition program (i.e., the intention recognition service) can be used for reflecting the performance of the intention recognition program, the intention recognition program has better performance when the accuracy is high, and the intention recognition program has poorer performance when the accuracy is low, so that a method for determining the accuracy of the intention recognition program is needed, and the performance of the intention recognition program can be continuously optimized according to the accuracy, so that the intention recognition program can be served to a user more quickly and better. Therefore, when the intention recognition accuracy of the intention recognition program is determined, the intention recognition accuracy can be calculated by adopting a manual marking mode, and therefore, the method needs to be executed to monitor the intention recognition accuracy of the newly online intention recognition program every time the intention recognition program is online after being updated. In order to solve the problem of manpower waste caused by a mode of manually calculating an intention recognition accuracy, an embodiment of the present invention sets up an automation engine for executing a data processing method, and with reference to fig. 1, the data processing method may include:
s11, obtaining the test case and a first intention recognition result corresponding to the pre-marked test case.
In practical application, a plurality of test cases need to be obtained first, and the test cases can be texts obtained by historical ASR recognition (speech recognition) (the call records of human-computer interaction are actually closer to the real scene of the test, and therefore are suitable for being used as test cases), and can also be some test cases added manually, such as manually written test cases. For example, the test case may be "do you like, ask you be xxx? That is, you are now recommending a financing APP for you, do you have an interest in understanding? Some, please say, this APP is mainly related to the periodic aspect … … ".
Wherein, the above-mentioned "do you ask you for xxx? "," now recommend a financing APP for you, do you have an interest in understanding? The intelligent robot is a preset dialect which can be used by the intelligent robot, and the dialect used by the intelligent robot is different under different application scenes. For example, "do you ask you for xxx? "yes, now recommend a financing APP for you, do you have an interest in understanding? "" some, please say "" this APP relates primarily to the periodic aspect … … ". Or, "do you ask you for xxx? "not, good, that disturbed".
In general, test cases may include:
specific names of test cases (e.g., sales cases), specific contents of test cases, user types (including age, gender, whether new users are), and so forth.
To facilitate management of the test cases, the test users may be classified so as to manage the test cases by classification, and specifically, step S11 may include:
the method comprises the steps of obtaining a preset test case and a user type and/or an application scene corresponding to the test case, and classifying the test case according to the user type and/or the application scene.
The preset test cases and the types of users have been described in the above embodiments, and referring to the above specific contents, the application scenarios may be e-selling scenarios, call-receiving scenarios, and the like.
After the user types are obtained, the test cases can be classified according to the user types, for example, the test cases of the same gender are classified into one type, in addition, the test cases can also be classified only according to application scenes, for example, the test cases in the electricity marketing scene are classified into one type, and the test cases in the collection-forcing scene are classified into one type. In addition, the user type and the application scenario can be used simultaneously to classify the test cases, that is, the test cases belonging to the same user type and the same application scenario are classified into one type. The intention recognition operation can be executed together at the later stage of the test cases which are classified into one type, so that the intention recognition accuracy test of the user type and/or the application scene is facilitated.
After the test cases are determined, manually labeling the first intention recognition results corresponding to the test cases in advance, namely manually determining the first intention recognition result of each test case, wherein the first intention recognition result is used for evaluating whether the recognition result of the intention recognition program is accurate or not.
And S12, calling a pre-acquired intention recognition program to perform intention recognition on the test case, and obtaining a second intention recognition result corresponding to the test case.
In this embodiment, in order to prevent a problem from occurring in an online calling environment after a test case sample set is updated or an intention diagram is newly added, in practical application, before the intention identification program is not online, a test environment (i.e., an intention identification simulation environment) matched with a target operating environment of the intention identification program is established, and before an intelligent robot updates online each time, the intention identification program is used in an automation engine to identify an intention of a test case to obtain a second intention identification result corresponding to the test case. The intention recognition program performs intention recognition by using a machine learning method.
And S13, comparing the first intention identification result and the second intention identification result to obtain a first intention identification accuracy. The method and the device can automatically calculate the intention recognition accuracy of the test case, avoid concept confusion of the intention recognition accuracy, and the offline test result is called the first intention recognition accuracy and the online test result is called the second intention recognition accuracy.
In practical applications, referring to fig. 2, the process of obtaining the first intention recognition accuracy may include:
s21, determining the number of test cases with the same corresponding first intention recognition result and second intention recognition result based on the first intention recognition result and the second intention recognition result corresponding to the test cases.
Specifically, the first intention recognition result and the second intention recognition result corresponding to each test case are sequentially compared, if the first intention recognition result and the second intention recognition result are the same, the intention recognition result of the intention recognition program is considered to be accurate, the accumulated number is increased by one, if the intention recognition result of the intention recognition program is not the same, the intention recognition result of the intention recognition program is considered to be inaccurate, the accumulated number is not increased by one, the accumulated number is accumulated from zero, and the finally accumulated number is the number counted in the step S21.
And S22, acquiring the total number of the test cases.
And S23, calculating to obtain the first intention identification accuracy according to the number and the total number.
In practical applications, for example, the total number may be 200, and the number of the recognition results that are intended to be accurate is 10, and the accuracy is 95%.
And S14, if the first intention identification accuracy is larger than a preset threshold value, determining an intention identification accuracy test result of the intention identification program. If the first intention identification accuracy is greater than a preset threshold (manually set according to a specific test scene), which indicates that the identification accuracy of the intention identification program is high, the intention identification program passes verification at this moment, and an intention identification accuracy test result is output, wherein the intention identification accuracy test result can be a sentence such as an intention identification accuracy test pass, a test pass, and the like. After the test of the intention identifying program is passed, the intention identifying program can be on-line, namely, operated in an on-line environment (target operation environment).
In practical application, a preset threshold value which passes the test verification is configured in advance, and if the first intention identification accuracy rate is lower than the preset threshold value, the intention identification program needs to be readjusted until the intention identification accuracy rate of the adjusted intention identification program is greater than the preset threshold value. The specific adjustment process may be to manually modify some parameter values in the intention identification program, then verify the intention identification accuracy of the intention identification program again, and if not, continue to modify some parameter values in the intention identification program.
And S15, operating the intention recognition software in a target operating environment, and testing the intention recognition accuracy of the intention recognition program in the target operating environment.
If the first intention recognition accuracy is above a preset threshold, the online is allowed, that is, the operation in the target operation environment (actual online environment) is allowed. After the intention identifying program is online, the intention identifying program also needs to be tested online, and specifically, referring to fig. 3, the online testing process may include:
and S31, in the target running environment, using the intention recognition program to perform intention recognition on the test case to obtain a third intention recognition result corresponding to the test case.
Step S31 is similar to step S12, with reference to step S12, except that one is off-line and one is on-line.
And S32, comparing the first intention identification result with the third intention identification result to obtain a second intention identification accuracy.
Step S32 is similar to step S13, and reference is made to step S13 for details.
S33, judging whether the difference value between the first intention identification accuracy rate and the second intention identification accuracy rate is within a preset difference value range or not; if yes, go to step S34; if not, go to step S35.
And S34, determining that the accuracy rate of the online intention test corresponding to the intention identification program passes.
And S35, determining that the accuracy rate of the online intention test corresponding to the intention identification program fails.
In practical application, the intention identification program is realized based on machine learning, and the process of the machine learning has uncertainty, so that the accuracy rates of the intention identification under the line and on the line which are possibly finally obtained are different for the same batch of test cases, but the accuracy difference is not too large, a preset difference range is set in the embodiment, and the preset difference range can be 2% -6%.
If the difference value is within the preset range, the intention recognition program is considered to pass the online intention test; if the difference is not within the preset range, the intention identification program is considered to fail the online intention test.
In this embodiment, after the intelligent robot provided with the intention recognition program is online, the automation engine performs regression verification again online for the online environment, and in the formal online environment, the automation engine is used to execute an automation monitoring sample, and if the obtained intention recognition accuracy is not much different from the test environment (at present), it is determined that there is no problem in the online environment. And then carrying out an outbound strategy. If the difference is more, alarm prompt and readjustment intention identification program can be carried out. After the intelligent robot is on line, manual work can still check the manual call records, and then the intelligent robot is added into an automation engine after being marked, so that the test case is continuously completed and supplemented.
In the embodiment, a test case and a pre-labeled first intention recognition result corresponding to the test case are obtained; calling a pre-obtained intention recognition program to perform intention recognition on the test case to obtain a second intention recognition result corresponding to the test case; comparing the first intention identification result with the second intention identification result to obtain a first intention identification accuracy; and if the first intention identification accuracy is greater than a preset threshold value, determining an intention identification accuracy test result of the intention identification program. The invention can automatically calculate the intention recognition accuracy of the intention recognition program, and further can continuously optimize the performance of the intention recognition service according to the accuracy, so that the intention recognition program can serve the user faster and better. By the method and the device, the intention identification accuracy of the test case can be automatically calculated, the intention identification accuracy of the test case does not need to be manually calculated, and manpower is saved.
In addition, the building of the automatic test engine can help to improve the test regression efficiency, and the whole solution of automatically acquiring the test case can save the development time of the monitoring sample and save a large amount of labor and time cost. The online monitoring system can realize full-automatic regression execution aiming at optimization online and online routine monitoring, improves the labor and time cost of regression, ensures the online stability, can efficiently and timely process found problems, reduces online problems and avoids damage to users.
Optionally, on the basis of the embodiment of the data processing method, another embodiment of the present invention provides a data processing apparatus, and with reference to fig. 4, the data processing apparatus may include:
the data acquisition module 11 is configured to acquire a test case and a pre-labeled first intention recognition result corresponding to the test case;
the intention identification module 12 is configured to call a pre-obtained intention identification program to perform intention identification on the test case, so as to obtain a second intention identification result corresponding to the test case;
an accuracy calculation module 13, configured to compare the first intention recognition result and the second intention recognition result to obtain a first intention recognition accuracy;
a test result determining module 14, configured to determine an intention recognition accuracy test result of the intention recognition program if the first intention recognition accuracy is greater than a preset threshold;
and the online testing module 15 is configured to operate the intention recognition software in a target operating environment, and test the intention recognition accuracy of the intention recognition program in the target operating environment.
Further, when the data obtaining module is used for obtaining the test case, the data obtaining module is specifically used for:
the method comprises the steps of obtaining a preset test case, obtaining a user type and/or an application scene corresponding to the test case, and classifying the test case according to the user type and/or the application scene.
Further, the intention identification module is configured to call a pre-obtained intention identification program to perform intention identification on the test case, and when a second intention identification result corresponding to the test case is obtained, specifically configured to:
and generating an intention recognition simulation environment matched with a target operation environment of the intention recognition program, and performing intention recognition on the test case by using the intention recognition program under the intention recognition simulation environment to obtain a second intention recognition result corresponding to the test case.
Further, the accuracy calculation module comprises:
the quantity determining submodule is used for determining the quantity of the test cases with the same corresponding first intention recognition result and second intention recognition result based on the first intention recognition result and the second intention recognition result corresponding to the test cases;
the quantity obtaining submodule is used for obtaining the total quantity of the test cases;
and the accuracy calculation submodule is used for calculating the first intention identification accuracy according to the number and the total number.
Further, the inline test module includes:
the intention identification submodule is used for carrying out intention identification on the test case by using the intention identification program in the target operation environment to obtain a third intention identification result corresponding to the test case;
the data calculation submodule is used for comparing the first intention recognition result with the third intention recognition result to obtain a second intention recognition accuracy;
a first determining submodule, configured to determine that an online intent test accuracy corresponding to the intent recognition program passes if a difference between the first intent recognition accuracy and the second intent recognition accuracy is within a preset difference range;
and the second determination submodule is used for determining that the on-line intention test accuracy corresponding to the intention identification program fails if the difference value between the first intention identification accuracy and the second intention identification accuracy is not within a preset difference value range.
Further, still include:
and the service adjusting module is used for adjusting the intention identification program if the first intention identification accuracy is not greater than a preset threshold value, so that the intention identification accuracy of the adjusted intention identification program is greater than the preset threshold value.
In the embodiment, a test case and a pre-labeled first intention recognition result corresponding to the test case are obtained; calling a pre-obtained intention recognition program to perform intention recognition on the test case to obtain a second intention recognition result corresponding to the test case; comparing the first intention identification result with the second intention identification result to obtain a first intention identification accuracy; and if the first intention identification accuracy is greater than a preset threshold value, determining an intention identification accuracy test result of the intention identification program. The invention can automatically calculate the intention recognition accuracy of the intention recognition program, and further can continuously optimize the performance of the intention recognition service according to the accuracy, so that the intention recognition program can serve the user faster and better. By the method and the device, the intention identification accuracy of the test case can be automatically calculated, the intention identification accuracy of the test case does not need to be manually calculated, and manpower is saved.
In addition, the building of the automatic test engine can help to improve the test regression efficiency, and the whole solution of automatically acquiring the test case can save the development time of the monitoring sample and save a large amount of labor and time cost. The online monitoring system can realize full-automatic regression execution aiming at optimization online and online routine monitoring, improves the labor and time cost of regression, ensures the online stability, can efficiently and timely process found problems, reduces online problems and avoids damage to users.
It should be noted that, for the working processes of each module and sub-module in this embodiment, please refer to the corresponding description in the above embodiments, which is not described herein again.
Optionally, on the basis of the embodiments of the data processing method and apparatus, another embodiment of the present invention provides an electronic device, including: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used to:
obtaining a test case and a first intention recognition result which is marked in advance and corresponds to the test case;
calling a pre-obtained intention recognition program to perform intention recognition on the test case to obtain a second intention recognition result corresponding to the test case;
comparing the first intention identification result with the second intention identification result to obtain a first intention identification accuracy;
if the first intention identification accuracy rate is larger than a preset threshold value, determining an intention identification accuracy rate test result of the intention identification program;
and running the intention recognition software in a target running environment, and testing the intention recognition accuracy of the intention recognition program in the target running environment.
In the embodiment, a test case and a pre-labeled first intention recognition result corresponding to the test case are obtained; calling a pre-obtained intention recognition program to perform intention recognition on the test case to obtain a second intention recognition result corresponding to the test case; comparing the first intention identification result with the second intention identification result to obtain a first intention identification accuracy; and if the first intention identification accuracy is greater than a preset threshold value, determining an intention identification accuracy test result of the intention identification program. The invention can automatically calculate the intention recognition accuracy of the intention recognition program, and further can continuously optimize the performance of the intention recognition service according to the accuracy, so that the intention recognition program can serve the user faster and better. By the method and the device, the intention identification accuracy of the test case can be automatically calculated, the intention identification accuracy of the test case does not need to be manually calculated, and manpower is saved.
In addition, the building of the automatic test engine can help to improve the test regression efficiency, and the whole solution of automatically acquiring the test case can save the development time of the monitoring sample and save a large amount of labor and time cost. The online monitoring system can realize full-automatic regression execution aiming at optimization online and online routine monitoring, improves the labor and time cost of regression, ensures the online stability, can efficiently and timely process found problems, reduces online problems and avoids damage to users.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.