Disclosure of Invention
In view of the above, it is necessary to provide a method, a device, an electronic device and a storage medium for testing an AI customer service model, which can test the AI customer service model purposefully based on a semantic similarity algorithm, and the coverage of a test sample is more comprehensive, so that the problem of insufficient test data is effectively solved, and the rapid automatic test of the AI customer service model is realized based on an artificial intelligence means.
An AI customer service model test method, comprising:
when a test instruction for an AI customer service model to be tested is received, obtaining a pre-configured standard corpus from a corpus, wherein the standard corpus comprises an input standard corpus and an output standard corpus;
performing similarity analysis on the standard corpus based on a semantic similarity algorithm to obtain a classified corpus;
Expanding the classified corpus based on a preset word stock to generate a test sample, wherein the test sample comprises input data corresponding to the input standard corpus and expected data corresponding to the output standard corpus;
inputting the input data into the AI customer service model to be tested to obtain output data;
and calling the output data and the expected data by using a configuration script, and outputting a test result of the AI customer service model to be tested.
According to a preferred embodiment of the present invention, the performing similarity analysis on the standard corpus based on the semantic similarity algorithm, to obtain the classified corpus includes:
converting the standard corpus into semantic vectors based on natural language processing;
calculating cosine distances among word vectors in the semantic vectors by adopting a cosine similarity algorithm;
and classifying each word vector according to the cosine distance to obtain the classified corpus.
According to a preferred embodiment of the present invention, the expanding the classified corpus based on a preset word stock includes:
for each target word vector in the classified corpus, calculating the similarity between the target word vector and the word vector in the preset word stock;
Acquiring a word vector with the similarity larger than or equal to the preset similarity with the target word vector from the preset word stock as an expanded word vector of the target word vector;
and adding the expanded word vector of each target word vector to the classified corpus to obtain the test sample.
According to a preferred embodiment of the present invention, the invoking the output data and the expected data with a configuration script, and outputting the test result of the AI customer service model to be tested includes:
writing the output data and the expected data into Excel by adopting POI to generate an Excel file;
determining the file name of the excel file and specifying interface parameters of an interface;
modifying the configuration script with the file name and the interface parameter;
and calling the excel file by using the modified configuration script, and outputting a test result of the AI customer service model to be tested.
According to a preferred embodiment of the present invention, the test result includes an accuracy rate, and the AI customer service model test method further includes:
acquiring a first number of data in the output data, wherein the similarity between the data and the expected data is greater than or equal to a first similarity;
determining a second amount of the output data;
Calculating a quotient of the first number and the second number as the accuracy.
According to a preferred embodiment of the present invention, the test result further includes a recall rate, and the AI customer service model test method further includes:
for first output data under any category, determining first expected data corresponding to the first output data;
acquiring a third number of data in the first output data, wherein the similarity between the data and the first expected data is greater than or equal to a second similarity;
determining a fourth amount of the first output data;
and calculating the quotient of the third quantity and the fourth quantity as the recall rate under the arbitrary category.
According to a preferred embodiment of the present invention, the AI customer service model test method further includes:
and when the AI customer service model to be detected is detected to be updated, the detection of the AI customer service model to be detected is re-executed.
An AI customer service model test apparatus, the AI customer service model test apparatus comprising:
the acquisition unit is used for acquiring a pre-configured standard corpus from a corpus when a test instruction of an AI customer service model to be tested is received, wherein the standard corpus comprises an input standard corpus and an output standard corpus;
The analysis unit is used for carrying out similarity analysis on the standard corpus based on a semantic similarity algorithm to obtain a classified corpus;
the expansion unit is used for expanding the classified corpus based on a preset word stock to generate a test sample, wherein the test sample comprises input data corresponding to the input standard corpus and expected data corresponding to the output standard corpus;
the input unit is used for inputting the input data into the AI customer service model to be tested to obtain output data;
and the test unit is used for calling the output data and the expected data by using a configuration script and outputting a test result of the AI customer service model to be tested.
According to a preferred embodiment of the invention, the analysis unit is specifically adapted to:
converting the standard corpus into semantic vectors based on natural language processing;
calculating cosine distances among word vectors in the semantic vectors by adopting a cosine similarity algorithm;
and classifying each word vector according to the cosine distance to obtain the classified corpus.
According to a preferred embodiment of the invention, the expansion unit is specifically configured to:
for each target word vector in the classified corpus, calculating the similarity between the target word vector and the word vector in the preset word stock;
Acquiring a word vector with the similarity larger than or equal to the preset similarity with the target word vector from the preset word stock as an expanded word vector of the target word vector;
and adding the expanded word vector of each target word vector to the classified corpus to obtain the test sample.
According to a preferred embodiment of the invention, the test unit is specifically adapted to:
writing the output data and the expected data into Excel by adopting POI to generate an Excel file;
determining the file name of the excel file and specifying interface parameters of an interface;
modifying the configuration script with the file name and the interface parameter;
and calling the excel file by using the modified configuration script, and outputting a test result of the AI customer service model to be tested.
According to a preferred embodiment of the present invention, the test result includes an accuracy rate, and the obtaining unit is further configured to obtain a first number of data having a similarity with the expected data greater than or equal to a first similarity in the output data;
the AI customer service model test device further comprises:
a determining unit configured to determine a second number of the output data;
and the calculating unit is used for calculating the quotient of the first quantity and the second quantity as the accuracy rate.
According to a preferred embodiment of the present invention, the test result further includes a recall rate, and the determining unit is configured to determine, for first output data under any category, first expected data corresponding to the first output data;
the acquiring unit is further configured to acquire a third number of data in the first output data, where the similarity with the first expected data is greater than or equal to a second similarity;
the determining unit is further configured to determine a fourth amount of the first output data;
the calculating unit is further configured to calculate a quotient of the third number and the fourth number as a recall rate under the arbitrary category.
According to a preferred embodiment of the present invention, the test unit is further configured to re-execute the detection of the AI customer service model to be tested when it is detected that the AI customer service model to be tested is updated.
An electronic device, the electronic device comprising:
a memory storing at least one instruction; and
And the processor executes the instructions stored in the memory to realize the AI customer service model test method.
A computer-readable storage medium having stored therein at least one instruction that is executed by a processor in an electronic device to implement the AI customer service model test method.
According to the technical scheme, when a test instruction for the AI customer service model to be tested is received, the pre-configured standard corpus is obtained from the corpus, the standard corpus comprises the input standard corpus and the output standard corpus, similarity analysis is carried out on the standard corpus based on a semantic similarity algorithm to obtain the classified corpus, subsequent tests are more targeted, the classified corpus is further expanded based on a preset word stock to generate a test sample, the test sample comprises input data corresponding to the input standard corpus and expected data corresponding to the output standard corpus, the coverage of the generated test sample is more comprehensive, the problem of insufficient test data can be effectively solved, the input data is input into the AI customer service model to be tested, the output data and the expected data are called by a configuration script, the test result of the AI customer service model to be tested is output, and further the AI customer service model to be tested is rapidly and automatically tested.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of a preferred embodiment of the AI customer service model test method of the invention. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
The AI customer service model test method is applied to one or more electronic devices, wherein the electronic devices are devices capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware comprises, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device and the like.
The electronic device may be any electronic product that can interact with a user in a human-computer manner, such as a personal computer, tablet computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game console, interactive internet protocol television (Internet Protocol Television, IPTV), smart wearable device, etc.
The electronic device may also include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network server, a server group composed of a plurality of network servers, or a Cloud based Cloud Computing (Cloud Computing) composed of a large number of hosts or network servers.
The network in which the electronic device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.
S10, when a test instruction of the AI customer service model to be tested is received, a pre-configured standard corpus is obtained from a corpus.
In at least one embodiment of the present invention, the test instruction of the AI customer service model to be tested may be triggered by related staff, or may be automatically triggered according to a preset test time according to actual use.
In at least one embodiment of the present invention, the corpus may be a preconfigured database having a plurality of corpora.
In at least one embodiment of the present invention, the standard corpus includes an input standard corpus and an output standard corpus.
The AI (Artificial Intelligence ) customer service model to be tested is used for automatically solving questions of customers.
In practical applications, questions of users are various, and taking a loan scenario as an example, the users may ask questions of various links involved in loan, for example: interest rate problems, pay-out problems, repayment problems, etc., and may even include various tune-up statements, etc.
For various scenes classified in this way, firstly, during initial modeling, classifying each scene, collecting real questions of a user, and using standard answers of the model to ensure that the answers meet the company's unified telephone operation, have no legal risk and the like, and enter a testing stage after modeling is completed.
Specifically, the AI customer service model can give automatic solutions to the user questions under different scenes, so that the accuracy of the AI customer service model solutions is particularly important, and the AI customer service model needs to be tested.
In at least one embodiment of the present invention, the input standard corpus refers to a collected standardized corpus input by a user.
In at least one embodiment of the present invention, the output standard corpus refers to a standard answer corpus to the input standard corpus.
S11, carrying out similarity analysis on the standard corpus based on a semantic similarity algorithm to obtain a classified corpus.
Specifically, the similarity analysis is performed on the standard corpus based on the semantic similarity algorithm, and obtaining the classified corpus includes:
converting the standard corpus into semantic vectors based on natural language processing;
further adopting a cosine similarity algorithm to calculate cosine distances among word vectors in the semantic vectors;
and the electronic equipment classifies each word vector according to the cosine distance to obtain the classified corpus.
Through the implementation mode, the standard corpus can be classified, so that the subsequent test is more targeted.
S12, expanding the classified corpus based on a preset word stock to generate a test sample, wherein the test sample comprises input data corresponding to the input standard corpus and expected data corresponding to the output standard corpus.
Specifically, the electronic device expands the classified corpus based on a preset word stock, and generating a test sample includes:
for each target word vector in the classified corpus, the electronic equipment calculates the similarity between the target word vector and the word vector in the preset word stock;
acquiring a word vector with the similarity larger than or equal to the preset similarity with the target word vector from the preset word stock as an expanded word vector of the target word vector;
And adding the expanded word vector of each target word vector to the classified corpus to obtain the test sample.
For example: for the corpus "how much your company interest," the corpus includes word vectors corresponding to the following words: "your", "company", "interest" and "how much", wherein the word vector "company" and the word vector "interest" are keywords, the electronic device can select the "unit" of the close meaning word of "company" and the like, and the "like" of interest "and" interest rate ", and the like, through similarity calculation, and then the corpus" how much you company interest "can include the expansion corpus" how much you unit interest rate ", and the like.
Through the implementation mode, the electronic equipment can enable the coverage of the generated test sample to be more comprehensive by expanding the classification corpus, and further can realize more accurate test of the AI customer service model to be tested.
In addition, the existing corpus is mainly based on production data, the data size is limited, and the problem of insufficient test data can be effectively solved by the embodiment.
S13, inputting the input data into the AI customer service model to be tested to obtain output data.
In this embodiment, the AI customer service model to be tested can respond to the input data to output voice.
The output data is an output result obtained by the AI customer service model to be tested responding to the input data, and belongs to automatic solutions of the models.
For example: when the input data is 'how much the income of the loan is', the output data 'how much the income of the loan is 50 ten thousand' is obtained through the automatic processing such as the analysis and the matching of the AI customer service model to be tested.
S14, calling the output data and the expected data by using a configuration script, and outputting a test result of the AI customer service model to be tested.
Specifically, the invoking the output data and the expected data with the configuration script, and outputting the test result of the AI customer service model to be tested includes:
the electronic equipment writes the output data and the expected data into Excel by adopting POI to generate an Excel file;
further, the electronic device determines the file name of the excel file and interface parameters of a designated interface;
further, the electronic device modifies the configuration script with the file name and the interface parameter;
And calling the excel file by using the modified configuration script, and outputting a test result of the AI customer service model to be tested.
Wherein the interface parameters may include, but are not limited to: server IP (Internet Protocol ), port, test URI (Uniform Resource Identifier ), etc.
POIs are tools for reading and writing documents of office, and components (such as HSSF and XSS) in POIs can read and write excel.
The configuration script can be preconfigured so as to be convenient for directly calling after modifying related parameters, thereby improving the operation efficiency and simplifying the development flow.
Through the embodiment, the excel file is generated by combining with the POI technology, and the generated excel file is further called by the modified configuration script, so that the test result of the AI customer service model to be tested is output, and the rapid automatic test can be realized.
In at least one embodiment of the present invention, the test results include an accuracy rate, the method further comprising:
acquiring a first number of data in the output data, wherein the similarity between the data and the expected data is greater than or equal to a first similarity;
determining a second amount of the output data;
Further, the electronic device calculates a quotient of the first number and the second number as the accuracy.
For example: there are 10000 test samples for a test, 5000 correct output data, and accuracy rate=5000/10000=50%.
In at least one embodiment of the invention, the test results further comprise a recall, the method further comprising:
for first output data under any category, determining first expected data corresponding to the first output data;
acquiring a third number of data in the first output data, wherein the similarity between the data and the first expected data is greater than or equal to a second similarity;
determining a fourth amount of the first output data;
and further calculating the quotient of the third quantity and the fourth quantity as the recall rate under the arbitrary category.
Through the implementation mode, the accuracy and recall rate of the AI customer service model to be detected can be calculated, so that the AI customer service model to be detected can be effectively detected.
In at least one embodiment of the present invention, the AI customer service model test method further includes:
and when the AI customer service model to be detected is detected to be updated, the detection of the AI customer service model to be detected is re-executed.
Because the adjustment of the threshold value can affect the conditions of each classification in the optimization process of the model, such as the improvement of the accuracy rate of interest problems, the accuracy rate of user operation types can be reduced, but the accuracy rate of high-frequency problems of users needs to be in an ascending trend, the AI customer service model to be detected needs to be re-detected, so that the AI customer service model to be detected can be guaranteed to respond optimally to the questions of the users.
It should be noted that, in order to improve the security and privacy of data, the test results may be stored in the blockchain.
According to the technical scheme, when a test instruction for the AI customer service model to be tested is received, the pre-configured standard corpus is obtained from the corpus, the standard corpus comprises the input standard corpus and the output standard corpus, similarity analysis is carried out on the standard corpus based on a semantic similarity algorithm to obtain the classified corpus, subsequent tests are more targeted, the classified corpus is further expanded based on a preset word stock to generate a test sample, the test sample comprises input data corresponding to the input standard corpus and expected data corresponding to the output standard corpus, the coverage of the generated test sample is more comprehensive, the problem of insufficient test data can be effectively solved, the input data is input into the AI customer service model to be tested, the output data and the expected data are called by a configuration script, the test result of the AI customer service model to be tested is output, and further the AI customer service model to be tested is rapidly and automatically tested.
FIG. 2 is a functional block diagram of the AI customer service model test apparatus of a preferred embodiment of the invention. The AI customer service model test device 11 includes an acquisition unit 110, an analysis unit 111, an expansion unit 112, an input unit 113, a test unit 114, a determination unit 115, and a calculation unit 116. The module/unit referred to in the present invention refers to a series of computer program segments capable of being executed by the processor 13 and of performing a fixed function, which are stored in the memory 12. In the present embodiment, the functions of the respective modules/units will be described in detail in the following embodiments.
When receiving a test instruction for the AI customer service model to be tested, the obtaining unit 110 obtains a pre-configured standard corpus from the corpus.
In at least one embodiment of the present invention, the test instruction of the AI customer service model to be tested may be triggered by related staff, or may be automatically triggered according to a preset test time according to actual use.
In at least one embodiment of the present invention, the corpus may be a preconfigured database having a plurality of corpora.
In at least one embodiment of the present invention, the standard corpus includes an input standard corpus and an output standard corpus.
The AI (Artificial Intelligence ) customer service model to be tested is used for automatically solving questions of customers.
In practical applications, questions of users are various, and taking a loan scenario as an example, the users may ask questions of various links involved in loan, for example: interest rate problems, pay-out problems, repayment problems, etc., and may even include various tune-up statements, etc.
For various scenes classified in this way, firstly, during initial modeling, classifying each scene, collecting real questions of a user, and using standard answers of the model to ensure that the answers meet the company's unified telephone operation, have no legal risk and the like, and enter a testing stage after modeling is completed.
Specifically, the AI customer service model can give automatic solutions to the user questions under different scenes, so that the accuracy of the AI customer service model solutions is particularly important, and the AI customer service model needs to be tested.
In at least one embodiment of the present invention, the input standard corpus refers to a collected standardized corpus input by a user.
In at least one embodiment of the present invention, the output standard corpus refers to a standard answer corpus to the input standard corpus.
The analysis unit 111 performs similarity analysis on the standard corpus based on a semantic similarity algorithm to obtain a classified corpus.
Specifically, the analyzing unit 111 performs similarity analysis on the standard corpus based on a semantic similarity algorithm, and the obtaining the classified corpus includes:
converting the standard corpus into semantic vectors based on natural language processing;
further adopting a cosine similarity algorithm to calculate cosine distances among word vectors in the semantic vectors;
the analysis unit 111 classifies each word vector according to the cosine distance to obtain the classified corpus.
Through the implementation mode, the standard corpus can be classified, so that the subsequent test is more targeted.
Further, the expansion unit 112 expands the classified corpus based on a preset word stock to generate a test sample.
The test sample comprises input data corresponding to the input standard corpus and expected data corresponding to the output standard corpus.
Specifically, the expanding unit 112 expands the classified corpus based on a preset word stock, and generating the test sample includes:
for each target word vector in the classified corpus, the expansion unit 112 calculates the similarity between the target word vector and the word vector in the preset word stock;
Acquiring a word vector with the similarity larger than or equal to the preset similarity with the target word vector from the preset word stock as an expanded word vector of the target word vector;
and adding the expanded word vector of each target word vector to the classified corpus to obtain the test sample.
For example: for the corpus "how much your company interest," the corpus includes word vectors corresponding to the following words: "your", "company", "interest" and "how much", wherein the word vector "company" and the word vector "interest" are keywords, the expansion unit 112 may select the "unit" of the close meaning word of "company" and so on, and the "income", "interest rate" of the similar word of "interest" and so on through similarity calculation, and then the corpus "how much" of interest of your company may include the expansion corpus "how much" of your unit interest, and so on.
Through the above embodiment, the expansion unit 112 may enable the coverage of the generated test sample to be more comprehensive by expanding the classification corpus, so as to implement more accurate test of the AI customer service model to be tested.
In addition, the existing corpus is mainly based on production data, the data size is limited, and the problem of insufficient test data can be effectively solved by the embodiment.
The input unit 113 inputs the input data into the AI customer service model to be tested, and obtains output data.
In this embodiment, the AI customer service model to be tested can respond to the input data to output voice.
The output data is an output result obtained by the AI customer service model to be tested responding to the input data, and belongs to automatic solutions of the models.
For example: when the input data is 'how much the income of the loan is', the output data 'how much the income of the loan is 50 ten thousand' is obtained through the automatic processing such as the analysis and the matching of the AI customer service model to be tested.
Specifically, the test unit 114 invokes the output data and the expected data with a configuration script, and outputs a test result of the AI customer service model to be tested.
The test unit 114 invokes the output data and the expected data with a configuration script, and outputs a test result of the AI customer service model to be tested, including:
the test unit 114 writes the output data and the expected data into Excel by using POI to generate an Excel file;
further, the test unit 114 determines the file name of the excel file and the interface parameter of the designated interface;
Still further, the test unit 114 modifies the configuration script with the file name and the interface parameters;
and calling the excel file by using the modified configuration script, and outputting a test result of the AI customer service model to be tested.
Wherein the interface parameters may include, but are not limited to: server IP (Internet Protocol ), port, test URI (Uniform Resource Identifier ), etc.
POIs are tools for reading and writing documents of office, and components (such as HSSF and XSS) in POIs can read and write excel.
The configuration script can be preconfigured so as to be convenient for directly calling after modifying related parameters, thereby improving the operation efficiency and simplifying the development flow.
Through the embodiment, the excel file is generated by combining with the POI technology, and the generated excel file is further called by the modified configuration script, so that the test result of the AI customer service model to be tested is output, and the rapid automatic test can be realized.
In at least one embodiment of the present invention, the test result includes an accuracy rate, and the obtaining unit 110 obtains a first number of data having a similarity with the expected data greater than or equal to a first similarity in the output data;
The determining unit 115 determines a second amount of the output data;
further, the calculation unit 116 calculates a quotient of the first number and the second number as the accuracy.
For example: there are 10000 test samples for a test, 5000 correct output data, and accuracy rate=5000/10000=50%.
In at least one embodiment of the present invention, the test result further includes a recall rate, and for the first output data under any category, the determining unit 115 determines first expected data corresponding to the first output data;
the acquiring unit 110 acquires a third number of data having a similarity with the first desired data greater than or equal to a second similarity in the first output data;
the determining unit 115 determines a fourth number of the first output data;
the calculation unit 116 further calculates the quotient of the third number and the fourth number as the recall under the arbitrary category.
Through the implementation mode, the accuracy and recall rate of the AI customer service model to be detected can be calculated, so that the AI customer service model to be detected can be effectively detected.
In at least one embodiment of the present invention, the test unit 114 re-performs the detection of the AI customer service model under test when it detects that there is an update to the AI customer service model under test.
Because the adjustment of the threshold value can affect the conditions of each classification in the optimization process of the model, such as the improvement of the accuracy rate of interest problems, the accuracy rate of user operation types can be reduced, but the accuracy rate of high-frequency problems of users needs to be in an ascending trend, the AI customer service model to be detected needs to be re-detected, so that the AI customer service model to be detected can be guaranteed to respond optimally to the questions of the users.
It should be noted that, in order to improve the security and privacy of data, the test results may be stored in the blockchain.
According to the technical scheme, when a test instruction for the AI customer service model to be tested is received, the pre-configured standard corpus is obtained from the corpus, the standard corpus comprises the input standard corpus and the output standard corpus, similarity analysis is carried out on the standard corpus based on a semantic similarity algorithm to obtain the classified corpus, subsequent tests are more targeted, the classified corpus is further expanded based on a preset word stock to generate a test sample, the test sample comprises input data corresponding to the input standard corpus and expected data corresponding to the output standard corpus, the coverage of the generated test sample is more comprehensive, the problem of insufficient test data can be effectively solved, the input data is input into the AI customer service model to be tested, the output data and the expected data are called by a configuration script, the test result of the AI customer service model to be tested is output, and further the AI customer service model to be tested is rapidly and automatically tested.
Fig. 3 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention for implementing the AI customer service model test method.
The electronic device 1 may comprise a memory 12, a processor 13 and a bus, and may further comprise a computer program, such as an AI customer service model test program, stored in the memory 12 and executable on the processor 13.
It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation of the electronic device 1, the electronic device 1 may be a bus type structure, a star type structure, the electronic device 1 may further comprise more or less other hardware or software than illustrated, or a different arrangement of components, for example, the electronic device 1 may further comprise an input-output device, a network access device, etc.
It should be noted that the electronic device 1 is only used as an example, and other electronic products that may be present in the present invention or may be present in the future are also included in the scope of the present invention by way of reference.
The memory 12 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 12 may in some embodiments be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. The memory 12 may in other embodiments also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 1. Further, the memory 12 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 12 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of AI customer service model test programs, but also for temporarily storing data that has been output or is to be output.
The processor 13 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, a combination of various control chips, and the like. The processor 13 is a Control Unit (Control Unit) of the electronic device 1, connects the respective components of the entire electronic device 1 using various interfaces and lines, executes or executes programs or modules (for example, executes AI customer service model test programs or the like) stored in the memory 12, and invokes data stored in the memory 12 to perform various functions of the electronic device 1 and process data.
The processor 13 executes the operating system of the electronic device 1 and various types of applications installed. The processor 13 executes the application program to implement the steps in the above-described embodiments of the AI customer service model test method, for example, the steps shown in fig. 1: s10, S11, S12, S13, S14.
Alternatively, the processor 13 may implement the functions of the modules/units in the above-described device embodiments when executing the computer program, for example:
When a test instruction for an AI customer service model to be tested is received, obtaining a pre-configured standard corpus from a corpus, wherein the standard corpus comprises an input standard corpus and an output standard corpus;
performing similarity analysis on the standard corpus based on a semantic similarity algorithm to obtain a classified corpus;
expanding the classified corpus based on a preset word stock to generate a test sample, wherein the test sample comprises input data corresponding to the input standard corpus and expected data corresponding to the output standard corpus;
inputting the input data into the AI customer service model to be tested to obtain output data;
and calling the output data and the expected data by using a configuration script, and outputting a test result of the AI customer service model to be tested.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules/units may be a series of instruction segments of a computer program capable of performing a specific function for describing the execution of the computer program in the electronic device 1. For example, the computer program may be divided into an acquisition unit 110, an analysis unit 111, an expansion unit 112, an input unit 113, a test unit 114, a determination unit 115, a calculation unit 116.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional module is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a computer device, or a network device, etc.) or a processor (processor) to execute the AI customer service model test method according to the embodiments of the present invention.
The integrated modules/units of the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on this understanding, the present invention may also be implemented by a computer program for instructing a relevant hardware device to implement all or part of the procedures of the above-mentioned embodiment method, where the computer program may be stored in a computer readable storage medium and the computer program may be executed by a processor to implement the steps of each of the above-mentioned method embodiments.
Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one arrow is shown in FIG. 3, but only one bus or one type of bus is not shown. The bus is arranged to enable a connection communication between the memory 12 and at least one processor 13 or the like.
Although not shown, the electronic device 1 may further comprise a power source (such as a battery) for powering the various components, which may preferably be logically connected to the at least one processor 13 via a power management means, so as to perform functions such as charge management, discharge management, and power consumption management via the power management means. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
Further, the electronic device 1 may also comprise a network interface, optionally the network interface may comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the electronic device 1 and other electronic devices.
The electronic device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (organic light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
Fig. 3 shows only an electronic device 1 with components 12-13, it being understood by a person skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or a different arrangement of components.
In connection with fig. 1, the memory 12 in the electronic device 1 stores a plurality of instructions to implement an AI customer service model test method, which are executable by the processor 13 to implement:
when a test instruction for an AI customer service model to be tested is received, obtaining a pre-configured standard corpus from a corpus, wherein the standard corpus comprises an input standard corpus and an output standard corpus;
performing similarity analysis on the standard corpus based on a semantic similarity algorithm to obtain a classified corpus;
expanding the classified corpus based on a preset word stock to generate a test sample, wherein the test sample comprises input data corresponding to the input standard corpus and expected data corresponding to the output standard corpus;
inputting the input data into the AI customer service model to be tested to obtain output data;
And calling the output data and the expected data by using a configuration script, and outputting a test result of the AI customer service model to be tested.
Specifically, the specific implementation method of the above instructions by the processor 13 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.