[go: up one dir, main page]

CN114519005A - Method, device and equipment for testing response text and storage medium - Google Patents

Method, device and equipment for testing response text and storage medium Download PDF

Info

Publication number
CN114519005A
CN114519005A CN202210140524.5A CN202210140524A CN114519005A CN 114519005 A CN114519005 A CN 114519005A CN 202210140524 A CN202210140524 A CN 202210140524A CN 114519005 A CN114519005 A CN 114519005A
Authority
CN
China
Prior art keywords
test
intention
scene
event information
response text
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210140524.5A
Other languages
Chinese (zh)
Inventor
代琳妮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202210140524.5A priority Critical patent/CN114519005A/en
Publication of CN114519005A publication Critical patent/CN114519005A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3698Environments for analysis, debugging or testing of software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Machine Translation (AREA)

Abstract

The invention relates to an artificial intelligence technology, and discloses a method for testing a response text, which comprises the following steps: acquiring test event information set based on an actual service scene; based on a full combination algorithm, carrying out permutation and combination on the intention dictionary corresponding to the dialogue model, and splicing the test event information and the result of the permutation and combination to obtain a test intention scene table; selecting the test intention data in the test intention scene table one by one as a current test scene according to the sequence, and calling a dialogue model through an interface to generate a response text and configuration parameters; and carrying out verification analysis on the response text and the configuration parameters based on a text similarity algorithm to obtain a test result. In addition, the invention also relates to a block chain technology, and the test scene diagram can be stored in the node of the block chain. The invention also provides a test device, electronic equipment and a storage medium for the answer operation. The invention can solve the problems of low test efficiency and incomplete test scene of the response text.

Description

应答文本的测试方法、装置、设备及存储介质Test method, device, equipment and storage medium for response text

技术领域technical field

本发明涉及人工智能技术领域,尤其涉及一种应答文本的测试方法、装置、电子设备及计算机可读存储介质。The present invention relates to the technical field of artificial intelligence, and in particular, to a test method, device, electronic device and computer-readable storage medium for answering text.

背景技术Background technique

随着人工智能技术的不断发展,智能对话系统得到了广泛的应用,越来越多的场景将拟人AI客服代替人工客服来进行对话来收集客户信息和解答客户疑问。With the continuous development of artificial intelligence technology, intelligent dialogue systems have been widely used, and more and more scenarios will use anthropomorphic AI customer service instead of human customer service to conduct dialogues to collect customer information and answer customer questions.

但对于目前的对话系统中应答文本的测试,往往使用手工测试,而由于对话的多轮次导致分支节点多,且不同父节点下的断句时长和静默时长的差异性,导致测试工作量比较庞大,测试时间较长,且容易出现测试场景不全的情况,因此,需要一种提高效率,并保证测试场景全面性的测试方法。However, for the test of response text in the current dialogue system, manual testing is often used. Due to the multiple rounds of dialogue, there are many branch nodes, and the differences in the length of sentence segmentation and silence under different parent nodes lead to a large amount of testing workload. , the test time is long, and the test scene is prone to be incomplete. Therefore, a test method that improves the efficiency and ensures the comprehensiveness of the test scene is required.

发明内容SUMMARY OF THE INVENTION

本发明提供一种应答文本的测试方法、装置及计算机可读存储介质,其主要目的在于解决应答文本的测试效率较低及测试场景不全的问题。The present invention provides a method, device and computer-readable storage medium for testing response text, the main purpose of which is to solve the problems of low testing efficiency and incomplete testing scenarios of response text.

为实现上述目的,本发明提供的一种应答文本的测试方法,包括:To achieve the above object, a kind of test method of response text provided by the present invention comprises:

获取基于实际业务场景设置的测试事件信息,其中,所述测试事件信息包括对话模型名称;Obtain test event information set based on an actual business scenario, wherein the test event information includes a dialog model name;

基于全组合算法对所述对话模型名称对应的意图字典进行排列组合,将所述测试事件信息与所述排列组合的结果进行拼接得到测试意图场景表;Arrange and combine the intent dictionary corresponding to the dialog model name based on the full combination algorithm, and splicing the test event information with the result of the arrangement and combination to obtain a test intent scene table;

按照顺序逐一选择所述测试意图场景表中的测试意图数据为当前测试场景,并通过接口调用与所述对话模型名称对应的对话模型生成所述当前测试场景的应答文本和配置参数;Select the test intent data in the test intent scene table one by one as the current test scene in sequence, and call the dialog model corresponding to the dialog model name through the interface to generate the response text and configuration parameters of the current test scene;

基于文本相似算法对所述应答文本和配置参数进行校验分析,得到测试结果。The response text and configuration parameters are verified and analyzed based on a text similarity algorithm to obtain a test result.

可选地,所述获取基于实际业务场景设置的测试事件信息,包括:Optionally, the acquiring test event information set based on an actual business scenario includes:

获取根据实际业务场景预设的置测试事件表;Obtain the set test event table preset according to the actual business scenario;

根据对话系统的业务功能设置测试数据并填充至所述测试事件表中,得到测试事件信息。Set test data according to the business function of the dialogue system and fill in the test event table to obtain test event information.

可选地,所述基于全组合算法对所述对话模型名称对应的意图字典进行排列组合,将所述测试事件信息与所述排列组合的结果进行拼接得到测试意图场景表,包括:Optionally, the intent dictionary corresponding to the dialog model name is arranged and combined based on the full combination algorithm, and the test event information is spliced with the result of the arrangement and combination to obtain a test intent scene table, including:

根据所述对话模型名称获取对应的意图字典;Obtain a corresponding intent dictionary according to the dialog model name;

利用全组合算法根据所述测试事件信息中的对话轮询次数将所述意图字典的意图进行排列组合;Using a full combination algorithm to arrange and combine the intents of the intent dictionary according to the number of dialogue polls in the test event information;

利用数据操作工具将所述排列组合的结果中每个组合与所述测试事件信息拼接,得到测试意图场景表。Using a data manipulation tool, each combination in the result of the arrangement and combination is spliced with the test event information to obtain a test intent scene table.

可选地,所述利用全组合算法根据所述测试事件信息中的对话轮询次数将所述意图字典的意图总数进行排列组合,包括:Optionally, the use of a full combination algorithm to arrange and combine the total number of intents of the intent dictionary according to the number of dialogue polls in the test event information, including:

获取所述测试事件信息中的对话轮询次数和所述意图字典的意图总数;Obtain the number of dialog polls in the test event information and the total number of intents in the intent dictionary;

将所述意图字典的所有意图作为每论对话的候选意图;Use all intents of the intent dictionary as candidate intents for each dialogue;

每次选择与所述对话轮询次数相同个数的意图组合,其中,在每个组合中依次在每个轮次的候选意图中选择一个意图,并按照所述对话轮询次数递归进行排列组合,得到排列组合的结果。Selecting the same number of intent combinations as the number of dialogue polling times each time, wherein, in each combination, one intent is selected from the candidate intents of each round in turn, and recursively arranging and combining according to the number of dialogue polling times , get the result of permutation and combination.

可选地,所述通过接口连接所述对话模型生成所述当前测试场景的应答文本和配置参数,包括:Optionally, generating the response text and configuration parameters of the current test scenario by connecting the dialogue model through an interface, including:

基于request生成所述当前测试场景对应的对话请求;Generate a dialog request corresponding to the current test scenario based on the request;

根据所述对话请求通过接口连接对话系统,并调用所述对话系统中与所述对话模型名称的对话模型;Connect the dialogue system through the interface according to the dialogue request, and call the dialogue model with the dialogue model name in the dialogue system;

根据所述对话请求将所述当前测试场景中的测试数据传入所述对话模型并获取所述对话模型生成的应答文本;According to the dialog request, the test data in the current test scene is transferred to the dialog model and the response text generated by the dialog model is obtained;

获取所述对话系统当前的配置参数,将所述配置参数与所述应答文本通过所述接口返回给测试人员。Acquire the current configuration parameters of the dialogue system, and return the configuration parameters and the response text to the tester through the interface.

可选地,所述基于文本相似算法对所述应答文本和配置参数进行校验分析,得到测试结果,包括:Optionally, the response text and configuration parameters are verified and analyzed based on the text similarity algorithm to obtain a test result, including:

将所述应答文本和配置参数与所述当前测试场景在测试意图场景表中对应字段的数据进行对比;Compare the response text and configuration parameters with the data of the corresponding field in the test intent scene table of the current test scene;

若对比不一致,则表示校验失败,利用所述数据操作将不一致的内容写入所述在测试意图场景表中;If the comparison is inconsistent, it means that the verification fails, and the inconsistent content is written into the test intent scene table by using the data operation;

连接数据库获取预设的落表记录,并在所述落表记录中查找与所述当前测试场景对应的实际落库意图;Connecting to the database to obtain a preset drop-off record, and looking up the actual drop-off intention corresponding to the current test scene in the drop-off record;

基于文本相似算法检测所述实际落库意图与所述当前测试场景的预设意图的一致性,若不一致则表示当前测试场景异常;Detecting the consistency between the actual drop-off intention and the preset intention of the current test scene based on a text similarity algorithm, and if they are inconsistent, it means that the current test scene is abnormal;

在所述测试场景表中将所述校验失败和所述异常作为测试结果拼接在所述测试场景表中对应测试场景后,并将其余测试场景的测试结果记为正常,得到所述测试场景表的完整测试结果。After splicing the verification failure and the abnormality as test results in the test scene table corresponding to the test scenes in the test scene table, and recording the test results of the remaining test scenes as normal, the test scene is obtained Table of full test results.

可选地,所述基于文本相似算法检测所述实际落库意图与所述当前测试场景的预设意图的一致性,包括:Optionally, the detection of the consistency between the actual deposit intention and the preset intention of the current test scene based on the text similarity algorithm includes:

用分词器对所述实际落库意图和所述预设意图分别进行分词,得到所述实际分词序列和预设分词序列;Using a tokenizer to segment the actual storage intention and the preset intention, respectively, to obtain the actual segmentation sequence and the preset segmentation sequence;

根据所述实际分词序列和所述预设分词序列计算字符串相似度;Calculate the string similarity according to the actual word segmentation sequence and the preset word segmentation sequence;

当所述字符串相似度大于或等于预设阈值时,判断所述实际落库意图与所述当前测试场景的预设意图一致;When the string similarity is greater than or equal to a preset threshold, judging that the actual storage intention is consistent with the preset intention of the current test scene;

当所述字符串相似度小于预设阈值时,判断所述实际落库意图与所述当前测试场景的预设意图不一致。When the string similarity is less than a preset threshold, it is determined that the actual drop-in intention is inconsistent with the preset intention of the current test scene.

为了解决上述问题,本发明还提供一种应答文本的测试装置,所述装置包括:In order to solve the above problems, the present invention also provides a test device for answering text, the device comprising:

事件信息获取模块,用于获取基于实际业务场景设置的测试事件信息,其中,所述测试事件信息包括对话模型名称;an event information acquisition module, configured to acquire test event information set based on an actual business scenario, wherein the test event information includes a dialog model name;

测试场景获取模块,用于基于全组合算法对所述对话模型名称对应的意图字典进行排列组合,将所述测试事件信息与所述排列组合的结果进行拼接得到测试意图场景表;A test scene acquisition module, used for arranging and combining the intent dictionary corresponding to the dialogue model name based on a full combination algorithm, and splicing the test event information and the result of the permutation and combination to obtain a test intent scene table;

应答生成模块,用于按照顺序逐一选择所述测试意图场景表中的测试意图数据为当前测试场景,并通过接口调用与所述对话模型名称对应的对话模型生成所述当前测试场景的应答文本和配置参数;The response generation module is used to select the test intent data in the test intent scene table as the current test scene one by one in sequence, and generate the response text and configuration parameters;

校验分析模块,用于基于文本相似算法对所述应答文本和配置参数进行校验分析,得到测试结果。The verification and analysis module is configured to perform verification and analysis on the response text and configuration parameters based on a text similarity algorithm to obtain a test result.

为了解决上述问题,本发明还提供一种电子设备,所述电子设备包括:In order to solve the above problems, the present invention also provides an electronic device, the electronic device includes:

至少一个处理器;以及,at least one processor; and,

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述所述的应答文本的测试方法。The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the above-mentioned method for testing response texts .

为了解决上述问题,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个计算机程序,所述至少一个计算机程序被电子设备中的处理器执行以实现上述所述的应答文本的测试方法。In order to solve the above problems, the present invention also provides a computer-readable storage medium, where at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is executed by a processor in an electronic device to realize the above-mentioned The test method for the response text described above.

本发明实施例基于基于全组合算法对所述对话模型名称对应的意图字典进行排列组合,将所述测试事件信息与所述排列组合的结果进行拼接得到测试意图场景表,所述意图场景表是全量组合得到,保证了测试场景的全面性;同时,通过调用接口将测试场景与对话系统连接,并用测试场景模拟为输入用户问答文本来获取对话系统的应答和相关配置参数信息,通过校验应答文本及相关配置参数的正确性来校验对话系统的节点流转是否正确,并增加节点模型的意图输出结果校验,如有异常能直观的看出是对话系统问题还是模型意图输出问题,提高测试结果的准确性,并实现对话系统的自动化测试,提高效率。因此本发明提出的应答文本的测试方法、装置、电子设备及计算机可读存储介质,可以解决应答文本的测试效率较低及测试场景不全的问题。The embodiment of the present invention is based on arranging and combining the intent dictionaries corresponding to the dialogue model names based on the full combination algorithm, and splicing the test event information and the result of the permutation and combination to obtain a test intent scene table, where the intent scene table is The full combination is obtained, which ensures the comprehensiveness of the test scene; at the same time, the test scene is connected to the dialogue system by calling the interface, and the test scene is simulated as the input user question and answer text to obtain the response of the dialogue system and related configuration parameter information, and the response is verified by verifying the response. The correctness of the text and related configuration parameters is used to verify whether the node flow of the dialogue system is correct, and the verification of the intent output result of the node model is added. The accuracy of the results, and automated testing of the dialogue system to improve efficiency. Therefore, the test method, device, electronic device and computer-readable storage medium of the response text proposed by the present invention can solve the problems of low test efficiency and incomplete test scenarios of the response text.

附图说明Description of drawings

图1为本发明一实施例提供的应答文本的测试方法的流程示意图;1 is a schematic flowchart of a method for testing a response text provided by an embodiment of the present invention;

图2为本发明一实施例提供的测试场景生成的流程示意图;2 is a schematic flowchart of a test scenario generation provided by an embodiment of the present invention;

图3为本发明一实施例提供的应答文本的测试装置的功能模块图;3 is a functional block diagram of a device for testing response text provided by an embodiment of the present invention;

图4为本发明一实施例提供的实现所述应答文本的测试方法的电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device implementing the method for testing the response text according to an embodiment of the present invention.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments.

具体实施方式Detailed ways

应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.

本申请实施例提供一种应答文本的测试方法。所述应答文本的测试方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述应答文本的测试方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。所述服务器可以是独立的服务器,也可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(ContentDelivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。The embodiment of the present application provides a method for testing response text. The execution subject of the response text testing method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal. In other words, the test method of the response text can be executed by software or hardware installed in the terminal device or the server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server can be an independent server, or can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (Content Delivery Network) , CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.

参照图1所示,为本发明一实施例提供的应答文本的测试方法的流程示意图。在本实施例中,所述应答文本的测试方法包括:Referring to FIG. 1 , it is a schematic flowchart of a method for testing response text according to an embodiment of the present invention. In this embodiment, the test method of the response text includes:

S1、获取基于实际业务场景设置的测试事件信息,其中,所述测试事件信息包括对话模型名称。S1. Acquire test event information set based on an actual business scenario, where the test event information includes a dialog model name.

本发明实施例所述测试事件信息是根据实际业务场景设置的能够引起对话系统进行对话回复的数据信息,包括但不限于驱动事件、话术文本、对话轮询次数、对话模型名称、断句时长、静默时长。The test event information in this embodiment of the present invention is data information that is set according to actual business scenarios and can cause the dialogue system to respond to dialogue, including but not limited to driving events, vocabulary text, dialogue polling times, dialogue model name, sentence segmentation duration, Silence time.

详细地,所述获取基于实际业务场景设置的测试事件信息,包括:In detail, the acquisition of test event information set based on actual business scenarios includes:

获取根据实际业务场景预设的置测试事件表;Obtain the set test event table preset according to the actual business scenario;

根据对话系统的业务功能设置测试数据并填充至所述测试事件表中,得到测试事件信息。Set test data according to the business function of the dialogue system and fill in the test event table to obtain test event information.

其中,所述测试事件表是驱动对话系统的事件信息以及对应的配置信息,所述事件信息包含的字段有驱动事件、事件话术文本、对话轮询次数和对话模型名称;所述配置信息包含的字段有断句时长、静默时长。Wherein, the test event table is the event information of the driving dialogue system and the corresponding configuration information, and the fields contained in the event information include the driving event, the event language text, the number of dialogue polling times and the dialogue model name; the configuration information includes The fields include segment duration and silence duration.

AI对话系统在使用时,在得到对话模型的应答文本时,还需要通知语音系统需播报的AI话术、挂断标志、转人工标志、及收音的断句时长和静默时长配置等信息,以便语音系统将对应的应答文本转为语音,再传输给用户,可以提高用户体验感。When the AI dialogue system is in use, when the response text of the dialogue model is obtained, it is also necessary to inform the voice system of the AI phrases, hang-up signs, manual transfer signs, and the configuration of the segment duration and silence duration to be broadcast, so that the voice can be heard. The system converts the corresponding response text into voice, and then transmits it to the user, which can improve the user experience.

S2、基于全组合算法对所述对话模型名称对应的意图字典进行排列组合,将所述测试事件信息与所述排列组合的结果进行拼接得到测试意图场景表。S2. Arrange and combine the intent dictionaries corresponding to the dialog model names based on the full combination algorithm, and splicing the test event information and the result of the arrangement and combination to obtain a test intent scene table.

由于一个测试场景中对话可能有多个轮次,每个轮次的用户意图具有多种可能,为了保证测试结果的完整性,需要将对话轮次与对应模型的多个意图进行全量组合,得到一个全覆盖的测试意图场景表。Since there may be multiple rounds of dialogue in a test scenario, and the user intentions of each round may have multiple possibilities, in order to ensure the integrity of the test results, it is necessary to fully combine the dialogue rounds with the multiple intentions of the corresponding model to obtain A full coverage test intent scenario table.

详细地,参照图2所示,所述S2,包括:In detail, as shown in FIG. 2 , the S2 includes:

S21、根据所述对话模型名称获取对应的意图字典;S21, obtaining a corresponding intent dictionary according to the dialog model name;

S22、利用全组合算法根据所述测试事件信息中的对话轮询次数将所述意图字典的意图进行排列组合;S22, using a full combination algorithm to arrange and combine the intents of the intent dictionary according to the number of dialogue polls in the test event information;

S23、利用数据操作工具将所述排列组合的结果中每个组合与所述测试事件信息拼接,得到测试意图场景表。S23. Use a data manipulation tool to splicing each combination in the result of the arrangement and combination with the test event information to obtain a test intent scene table.

其中,所述意图字典是将对话系统的识别模型可以识别的意图与对应的语料进行组合的意图集合。The intent dictionary is an intent set that combines intents that can be recognized by the recognition model of the dialogue system with corresponding corpus.

本发明实施例中所述数据操作工具是一种数据工具,能够高效地操作大型数据集,如pandas。在对多轮对话系统的全覆盖测试模式下,数据规模也会剧增,变得特别大,因此需要专门的数据工具来对数据集进行操作,如读写操作等,可以有效提高工作效率。The data manipulation tool described in the embodiment of the present invention is a data tool that can efficiently manipulate a large data set, such as pandas. In the full coverage test mode of the multi-round dialogue system, the data scale will also increase sharply and become particularly large. Therefore, special data tools are required to operate the data set, such as read and write operations, which can effectively improve work efficiency.

可选地,为进一步提高所述测试意图场景表的存储规模和处理效率,所述测试意图场景表还可以存储于一区块链的节点中。Optionally, in order to further improve the storage scale and processing efficiency of the test intent scenario table, the test intent scenario table may also be stored in a node of a blockchain.

进一步地,所述利用全组合算法根据所述测试事件信息中的对话轮询次数将所述意图字典的意图总数进行排列组合,包括:Further, the full combination algorithm is used to arrange and combine the total number of intents of the intent dictionary according to the number of dialogue polls in the test event information, including:

获取所述测试事件信息中的对话轮询次数和所述意图字典的意图总数;Obtain the number of dialog polls in the test event information and the total number of intents in the intent dictionary;

将所述意图字典的所有意图作为每轮对话的候选意图;Use all intents of the intent dictionary as candidate intents for each round of dialogue;

每次选择与所述对话轮询次数相同个数的意图组合,其中,在每个组合中依次在每个轮次的候选意图中选择一个意图,并按照所述对话轮询次数递归进行排列组合,得到排列组合的结果。Selecting the same number of intent combinations as the number of dialogue polling times each time, wherein, in each combination, one intent is selected from the candidate intents of each round in turn, and recursively arranging and combining according to the number of dialogue polling times , get the result of permutation and combination.

如轮次为m及意图总数为n,则组合结果为:If the number of rounds is m and the total number of intentions is n, the combined result is:

第1次:回答组合{意图1,意图1,…,意图1(第m轮回答意图)}1st round: answer combination {intent 1, intent 1, ..., intent 1 (mth round of answer intent)}

第2次:回答组合{意图1,意图1,…,意图2(第m轮回答意图)}2nd round: answer combination {intent 1, intent 1, ..., intent 2 (the mth round of answering intent)}

第n次:回答组合{意图1,意图1,…,意图n(第m轮回答意图)}nth round: answer combinations {intent 1, intent 1, ..., intent n (mth round answer intent)}

第n+1次:回答组合{意图2,意图1,…,意图1(第m轮回答意图)}n+1th round: answer combination {intent 2, intent 1, ..., intent 1 (mth round of answering intent)}

第2n次:回答组合{意图2,意图1,…,意图n(第m轮回答意图)}2nth round: answer combination {intent 2, intent 1, ..., intent n (mth round answer intent)}

第mn次:回答组合{意图n,意图n,…,意图n(第m轮回答意图)}mnth round: answer combination {intent n, intent n, ..., intent n (mth round answer intent)}

S3、按照顺序逐一选择所述测试意图场景表中的测试意图数据为当前测试场景,并通过接口调用与所述对话模型名称对应的对话模型生成所述当前测试场景的应答文本和配置参数。S3. Select the test intent data in the test intent scene table as the current test scene one by one in sequence, and invoke the dialog model corresponding to the dialog model name through the interface to generate the response text and configuration parameters of the current test scene.

详细地,所述通过接口调用与所述对话模型名称对应的所述对话模型生成所述当前测试场景的应答文本和配置参数,包括:Specifically, invoking the dialogue model corresponding to the dialogue model name through the interface to generate the response text and configuration parameters of the current test scenario includes:

基于request生成所述当前测试场景对应的对话请求;Generate a dialog request corresponding to the current test scenario based on the request;

根据所述对话请求通过接口连接对话系统,并调用所述对话系统中与所述对话模型名称的对话模型;Connect the dialogue system through the interface according to the dialogue request, and call the dialogue model with the dialogue model name in the dialogue system;

根据所述对话请求将所述当前测试场景中的测试数据传入所述对话模型并获取所述对话模型生成的应答文本;According to the dialog request, the test data in the current test scene is transferred to the dialog model and the response text generated by the dialog model is obtained;

获取所述对话系统当前的配置参数,将所述配置参数与所述应答文本通过所述接口返回给测试人员。Acquire the current configuration parameters of the dialogue system, and return the configuration parameters and the response text to the tester through the interface.

本发明实施例将测试意图场景表中的数据作为当前测试场景,并通过调用接口连接到对话系统,从而将当前测试场景模拟成用户输入回答文本使对话系统调用对话模型生成对应的回复,使用request(即request请求)来实现对话系统接口调用并获取接口的返回结果,即应答文本及配置参数。In this embodiment of the present invention, the data in the test intent scene table is used as the current test scene, and is connected to the dialog system through the calling interface, so that the current test scene is simulated as the user inputting answer text, so that the dialog system calls the dialog model to generate the corresponding reply, and uses the request (ie request request) to implement the dialog system interface call and obtain the return result of the interface, that is, the response text and configuration parameters.

S4、基于文本相似算法对所述应答文本和配置参数进行校验分析,得到测试结果。S4. Verify and analyze the response text and configuration parameters based on a text similarity algorithm to obtain a test result.

本发明实施例通过将所述应答文本和配置参数与预计的对话系统的回复(即应答文本和配置参数)进行比较,测试对话系统的应答是否正确,并将应答文本与预先存储的所述对话模型的意图输出进行一致性检验,进一步分析是对话系统的问题还是对话模型的问题。This embodiment of the present invention tests whether the response of the dialogue system is correct by comparing the response text and configuration parameters with the expected response of the dialogue system (that is, the response text and configuration parameters), and compares the response text with the pre-stored dialogue system The intention output of the model is checked for consistency, and it is further analyzed whether it is the problem of the dialogue system or the problem of the dialogue model.

所述测试结果是指基于校验分析判别所述测试场景表中的各个测试场景的预设回复与所述应答文本和配置参数是否一致的结果。The test result refers to a result of judging whether the preset reply of each test scene in the test scene table is consistent with the reply text and configuration parameters based on the verification analysis.

详细地,所述基于文本相似算法对所述应答文本和配置参数进行校验分析,得到测试结果,包括:In detail, the text-based similarity algorithm performs verification and analysis on the response text and configuration parameters to obtain test results, including:

将所述应答文本和配置参数与所述当前测试场景在测试意图场景表中对应字段的数据进行对比;Compare the response text and configuration parameters with the data of the corresponding field in the test intent scene table of the current test scene;

若对比不一致,则表示校验失败,利用所述数据操作将不一致的内容写入所述在测试意图场景表中;If the comparison is inconsistent, it means that the verification fails, and the inconsistent content is written into the test intent scene table by using the data operation;

连接数据库获取预设的落表记录,并在所述落表记录中查找与所述当前测试场景对应的实际落库意图;Connecting to the database to obtain a preset drop-off record, and looking up the actual drop-off intention corresponding to the current test scene in the drop-off record;

基于文本相似算法检测所述实际落库意图与所述当前测试场景的预设意图的一致性,若不一致则将表示当前测试场景为异常;Detecting the consistency between the actual drop-off intention and the preset intention of the current test scene based on a text similarity algorithm, and if they are inconsistent, it means that the current test scene is abnormal;

在所述测试场景表中将所述校验失败和所述异常作为测试结果拼接在所述测试场景表中对应测试场景后,并将其余测试场景的测试结果记为正常,得到所述测试场景表的完整测试结果。After splicing the verification failure and the abnormality as test results in the test scene table corresponding to the test scenes in the test scene table, and recording the test results of the remaining test scenes as normal, the test scene is obtained Table of full test results.

其中,所述落表记录是指在经过实际语料在对话系统中识别出对应意图。所述当前测试场景的预设意图是测试使用语料的对应意图,即意图字典中的意图。Wherein, the drop-list record refers to identifying the corresponding intention in the dialogue system through the actual corpus. The preset intent of the current test scene is the corresponding intent of the test corpus, that is, the intent in the intent dictionary.

进一步地,所述基于文本相似算法检测所述实际落库意图与所述当前测试场景的预设意图的一致性,包括:Further, the detection of the consistency of the actual deposit intention and the preset intention of the current test scene based on the text similarity algorithm includes:

用分词器对所述实际落库意图和所述预设意图分别进行分词,得到所述实际分词序列和预设分词序列;Using a tokenizer to segment the actual storage intention and the preset intention, respectively, to obtain the actual segmentation sequence and the preset segmentation sequence;

根据所述实际分词序列和所述预设分词序列计算字符串相似度;Calculate the string similarity according to the actual word segmentation sequence and the preset word segmentation sequence;

当所述字符串相似度大于或等于预设阈值时,判断所述实际落库意图与所述当前测试场景的预设意图一致;When the string similarity is greater than or equal to a preset threshold, judging that the actual storage intention is consistent with the preset intention of the current test scene;

当所述字符串相似度小于预设阈值时,判断所述实际落库意图与所述当前测试场景的预设意图不一致。When the string similarity is less than a preset threshold, it is determined that the actual drop-in intention is inconsistent with the preset intention of the current test scene.

本发明实施例通过校验应答文本及相关配置参数的正确性来校验对话系统的节点流转是否正确,同时增加了模型结果校验,如有异常能直观的看出是对话系统问题还是对话模型的意图输出问题,例如,当测试结果为校验失败时表示对话系统有问题,当测试结果为异常时表示对话模型的意图输出有问题。This embodiment of the present invention verifies whether the node flow of the dialogue system is correct by verifying the correctness of the response text and related configuration parameters. At the same time, model result verification is added. If there is an abnormality, it can be intuitively seen whether it is a dialogue system problem or a dialogue model For example, when the test result is a verification failure, it means that there is a problem with the dialogue system, and when the test result is abnormal, it means that there is a problem with the intention output of the dialogue model.

本发明实施例基于基于全组合算法对所述对话模型名称对应的意图字典进行排列组合,将所述测试事件信息与所述排列组合的结果进行拼接得到测试意图场景表,所述意图场景表是全量组合得到,保证了测试场景的全面性;同时,通过调用接口将测试场景与对话系统连接,并用测试场景模拟输入用户问答文本来获取对话系统的应答和相关配置参数信息,,通过校验应答文本及相关配置参数的正确性来校验对话系统的节点流转是否正确,并增加节点模型的意图输出结果校验,如有异常能直观的看出是对话系统问题还是模型意图输出问题,提高测试结果的准确性,并实现对话系统的自动化测试,提高效率。因此本发明提出的应答文本的测试方法、装置、电子设备及计算机可读存储介质,可以解决应答文本的测试效率较低及测试场景不全的问题。The embodiment of the present invention is based on arranging and combining the intent dictionaries corresponding to the dialogue model names based on the full combination algorithm, and splicing the test event information and the result of the permutation and combination to obtain a test intent scene table, where the intent scene table is The full combination is obtained to ensure the comprehensiveness of the test scene; at the same time, the test scene is connected to the dialogue system by calling the interface, and the user's question and answer text is simulated by the test scene to obtain the dialogue system's response and related configuration parameter information, and the response is verified by verifying the response. The correctness of the text and related configuration parameters is used to verify whether the node flow of the dialogue system is correct, and the verification of the intent output result of the node model is added. The accuracy of the results, and automated testing of the dialogue system to improve efficiency. Therefore, the test method, device, electronic device and computer-readable storage medium of the response text proposed by the present invention can solve the problems of low test efficiency and incomplete test scenarios of the response text.

如图3所示,是本发明一实施例提供的应答文本的测试装置的功能模块图。As shown in FIG. 3 , it is a functional block diagram of an apparatus for testing response text provided by an embodiment of the present invention.

本发明所述应答文本的测试装置100可以安装于电子设备中。根据实现的功能,所述应答文本的测试装置100可以包括事件信息获取模块101、测试场景获取模块102、应答生成模块103及校验分析模块104。本发明所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The test device 100 for answering text according to the present invention can be installed in an electronic device. According to the implemented functions, the response text testing apparatus 100 may include an event information acquisition module 101 , a test scene acquisition module 102 , a response generation module 103 and a verification analysis module 104 . The modules in the present invention can also be called units, which refer to a series of computer program segments that can be executed by the electronic device processor and can perform fixed functions, and are stored in the memory of the electronic device.

在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:

所述事件信息获取模块101,用于获取基于实际业务场景设置的测试事件信息,其中,所述测试事件信息包括对话模型名称;The event information acquisition module 101 is configured to acquire test event information set based on an actual business scenario, wherein the test event information includes a dialog model name;

所述测试场景获取模块102,用于基于全组合算法对所述对话模型名称对应的意图字典进行排列组合,将所述测试事件信息与所述排列组合的结果进行拼接得到测试意图场景表;The test scene acquisition module 102 is configured to arrange and combine the intent dictionaries corresponding to the dialogue model names based on a full combination algorithm, and splicing the test event information and the result of the arrangement and combination to obtain a test intent scene table;

所述应答生成模块103,用于按照顺序逐一选择所述测试意图场景表中的测试意图数据为当前测试场景,并通过接口调用与所述对话模型名称对应的对话模型生成所述当前测试场景的应答文本和配置参数;The response generation module 103 is configured to select the test intent data in the test intent scene table as the current test scene one by one in sequence, and generate the current test scene by invoking the dialog model corresponding to the dialog model name through the interface. Response text and configuration parameters;

所述校验分析模块104,用于基于文本相似算法对所述应答文本和配置参数进行校验分析,得到测试结果。The verification and analysis module 104 is configured to perform verification and analysis on the response text and configuration parameters based on a text similarity algorithm to obtain a test result.

详细地,本发明实施例中所述应答文本的测试装置100中所述的各模块在使用时采用与上述图1至图2中所述的应答文本的测试方法一样的技术手段,并能够产生相同的技术效果,这里不再赘述。In detail, each module described in the device 100 for testing the response text in the embodiment of the present invention adopts the same technical means as the testing method for the response text described in FIG. 1 to FIG. 2, and can generate The same technical effect will not be repeated here.

如图4所示,是本发明一实施例提供的实现应答文本的测试方法的电子设备的结构示意图。As shown in FIG. 4 , it is a schematic structural diagram of an electronic device implementing a method for testing response text provided by an embodiment of the present invention.

所述电子设备1可以包括处理器10、存储器11、通信总线12以及通信接口13,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如应答文本的测试程序。The electronic device 1 may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an answer text test program.

其中,所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(ControlUnit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行应答文本的测试程序等),以及调用存储在所述存储器11内的数据,以执行电子设备的各种功能和处理数据。The processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or A combination of multiple central processing units (Central Processing Units, CPUs), microprocessors, digital processing chips, graphics processors, and various control chips, etc. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and by running or executing the program or module stored in the memory 11 (for example, executing the response) Text test program, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device and process data.

所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备的内部存储单元,例如该电子设备的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备的外部存储设备,例如电子设备上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备的应用软件及各类数据,例如应答文本的测试程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。The storage 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, removable hard disk, multimedia card, card-type storage (for example: SD or DX storage, etc.), magnetic storage, magnetic disk, optical disk, etc. . In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of the electronic device, for example, a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the electronic device. ) card, flash memory card (Flash Card) and so on. Further, the memory 11 may also include both an internal storage unit of an electronic device and an external storage device. The memory 11 can not only be used to store application software installed in the electronic device and various types of data, such as the code of the test program in response to the text, etc., but also can be used to temporarily store the data that has been output or will be output.

所述通信总线12可以是外设部件互连标准(peripheral componentinterconnect,简称PCI)总线或扩展工业标准结构(extended industry standardarchitecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The communication bus 12 may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to enable connection communication between the memory 11 and at least one processor 10 and the like.

所述通信接口13用于上述电子设备与其他设备之间的通信,包括网络接口和用户接口。可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备与其他电子设备之间建立通信连接。所述用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备中处理的信息以及用于显示可视化的用户界面。The communication interface 13 is used for communication between the above electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (eg, a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, 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, organic light-emitting diode) touch device, and the like. The display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device and for displaying a visual user interface.

图4仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图4示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 4 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 4 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the drawings. components, or a combination of certain components, or a different arrangement of components.

例如,尽管未示出,所述电子设备还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device may also include a power source (such as a battery) for powering the various components, preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power source can be logically connected through the power management device. Implement functions such as charge management, discharge management, and power management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only used for illustration, and are not limited by this structure in the scope of the patent application.

所述电子设备1中的所述存储器11存储的应答文本的测试程序是多个指令的组合,在所述处理器10中运行时,可以实现:The test program of the response text stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:

获取基于实际业务场景设置的测试事件信息,其中,所述测试事件信息包括对话模型名称;Obtain test event information set based on an actual business scenario, wherein the test event information includes a dialog model name;

基于全组合算法对所述对话模型名称对应的意图字典进行排列组合,将所述测试事件信息与所述排列组合的结果进行拼接得到测试意图场景表;Arrange and combine the intent dictionary corresponding to the dialog model name based on the full combination algorithm, and splicing the test event information with the result of the arrangement and combination to obtain a test intent scene table;

按照顺序逐一选择所述测试意图场景表中的测试意图数据为当前测试场景,并通过接口调用与所述对话模型名称对应的对话模型生成所述当前测试场景的应答文本和配置参数;Select the test intent data in the test intent scene table one by one as the current test scene in sequence, and call the dialog model corresponding to the dialog model name through the interface to generate the response text and configuration parameters of the current test scene;

基于文本相似算法对所述应答文本和配置参数进行校验分析,得到测试结果。The response text and configuration parameters are verified and analyzed based on a text similarity algorithm to obtain a test result.

具体地,所述处理器10对上述指令的具体实现方法可参考附图对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the above-mentioned instruction by the processor 10, reference may be made to the description of the relevant steps in the embodiment corresponding to the accompanying drawings, which will not be repeated here.

进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的。例如,所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the modules/units integrated in the electronic device 1 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. The computer-readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only). Memory).

本发明还提供一种计算机可读存储介质,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设备的处理器所执行时,可以实现:The present invention also provides a computer-readable storage medium, where the readable storage medium stores a computer program, and when executed by a processor of an electronic device, the computer program can realize:

获取基于实际业务场景设置的测试事件信息,其中,所述测试事件信息包括对话模型名称;Obtain test event information set based on an actual business scenario, wherein the test event information includes a dialog model name;

基于全组合算法对所述对话模型名称对应的意图字典进行排列组合,将所述测试事件信息与所述排列组合的结果进行拼接得到测试意图场景表;Arrange and combine the intent dictionary corresponding to the dialog model name based on the full combination algorithm, and splicing the test event information with the result of the arrangement and combination to obtain a test intent scene table;

按照顺序逐一选择所述测试意图场景表中的测试意图数据为当前测试场景,并通过接口调用与所述对话模型名称对应的对话模型生成所述当前测试场景的应答文本和配置参数;Select the test intent data in the test intent scene table one by one as the current test scene in sequence, and call the dialog model corresponding to the dialog model name through the interface to generate the response text and configuration parameters of the current test scene;

基于文本相似算法对所述应答文本和配置参数进行校验分析,得到测试结果。The response text and configuration parameters are verified and analyzed based on a text similarity algorithm to obtain a test result.

在本发明所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division manners in actual implementation.

所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本发明各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.

对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。It will be apparent to those skilled in the art that the present invention is not limited to the details of the above-described exemplary embodiments, but that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics of the invention.

因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Therefore, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the invention is to be defined by the appended claims rather than the foregoing description, which are therefore intended to fall within the scope of the claims. All changes within the meaning and range of the equivalents of , are included in the present invention. Any reference signs in the claims shall not be construed as limiting the involved claim.

本发明所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in the present invention is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

本申请实施例可以基于人工智能技术对相关的数据进行获取和处理。其中,人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。The embodiments of the present application may acquire and process related data based on artificial intelligence technology. Among them, artificial intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. .

此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一、第二等词语用来表示名称,而并不表示任何特定的顺序。Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. Several units or means recited in the system claims can also be realized by one unit or means by means of software or hardware. The words first, second, etc. are used to denote names and do not denote any particular order.

最后应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或等同替换,而不脱离本发明技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for testing response text, the method comprising:
Acquiring test event information set based on an actual service scene, wherein the test event information comprises a conversation model name;
based on a full combination algorithm, carrying out permutation and combination on the intention dictionary corresponding to the conversation model name, and splicing the test event information and the result of the permutation and combination to obtain a test intention scene table;
selecting the test intention data in the test intention scene table as a current test scene one by one according to the sequence, and calling a dialogue model corresponding to the dialogue model name through an interface to generate a response text and configuration parameters of the current test scene;
and carrying out verification analysis on the response text and the configuration parameters based on a text similarity algorithm to obtain a test result.
2. The method for testing response text according to claim 1, wherein the obtaining of the test event information set based on the actual service scenario comprises:
acquiring a test event table preset according to an actual service scene;
and setting test data according to the service function of the dialog system and filling the test data into the test event table to obtain test event information.
3. The method for testing response text according to claim 1, wherein the ranking and combining the intention dictionaries corresponding to the dialogue model names based on a full-combination algorithm, and the splicing the test event information and the results of the ranking and combining to obtain a test intention scenario table comprises:
Acquiring a corresponding intention dictionary according to the conversation model name;
utilizing a full combination algorithm to arrange and combine the intentions of the intention dictionary according to the number of dialog polling times in the test event information;
and splicing each combination in the results of the permutation and combination with the test event information by using a data operation tool to obtain a test intention scene table.
4. The method for testing answer text according to claim 3, wherein the ranking and combining the total number of intentions of the intention dictionary according to the number of dialog polls in the test event information by using a full combination algorithm comprises:
acquiring the number of dialog polling times in the test event information and the total number of intentions of the intention dictionary;
all intentions of the intention dictionary are used as candidate intentions of each dialog;
and selecting the intention combinations with the same number as the number of times of the dialogue polling each time, wherein one intention is selected from the candidate intentions of each turn in each combination in sequence, and carrying out permutation and combination according to the number of times of the dialogue polling in a recursion manner to obtain a permutation and combination result.
5. The method for testing the response text according to claim 1, wherein the interfacing the dialog model to generate the response text and the configuration parameters of the current test scenario comprises:
Generating a dialogue request corresponding to the current test scene based on the request;
connecting a dialog system through an interface according to the dialog request, and calling a dialog model with the name of the dialog model in the dialog system;
transmitting test data in the current test scene into the dialogue model according to the dialogue request and acquiring a response text generated by the dialogue model;
and acquiring the current configuration parameters of the dialog system, and returning the configuration parameters and the response text to a tester through the interface.
6. The method for testing response text according to any one of claims 1 to 5, wherein the verification analysis of the response text and the configuration parameters based on the text similarity algorithm to obtain the test result comprises:
comparing the response text and the configuration parameters with the data of the corresponding field of the current test scene in the test intention scene table;
if the comparison is inconsistent, the verification is failed, and inconsistent contents are written into the test intention scene table by utilizing the data operation;
connecting a database to obtain a preset drop record, and searching an actual drop intention corresponding to the current test scene in the drop record;
Detecting the consistency of the actual database falling intention and the preset intention of the current test scene based on a text similarity algorithm, and if the actual database falling intention and the preset intention of the current test scene are inconsistent, indicating that the current test scene is abnormal;
and splicing the verification failure and the abnormity serving as test results in the test scene table in a corresponding test scene, and recording the test results of the other test scenes as normal to obtain the complete test result of the test scene table.
7. The method for testing the answer text according to claim 6, wherein the detecting the consistency of the actual landing intent and the preset intent of the current test scenario based on the text similarity algorithm comprises:
respectively segmenting the actual database falling intention and the preset intention by using a word segmentation device to obtain an actual word segmentation sequence and a preset word segmentation sequence;
calculating the similarity of character strings according to the actual word segmentation sequence and the preset word segmentation sequence;
when the similarity of the character strings is larger than or equal to a preset threshold value, judging that the actual library falling intention is consistent with the preset intention of the current test scene;
and when the similarity of the character strings is smaller than a preset threshold value, judging that the actual library falling intention is inconsistent with the preset intention of the current test scene.
8. A test apparatus for response text, the apparatus comprising:
the system comprises an event information acquisition module, a conversion module and a conversion module, wherein the event information acquisition module is used for acquiring test event information set based on an actual service scene, and the test event information comprises a conversation model name;
the test scenario acquisition module is used for carrying out permutation and combination on the intention dictionary corresponding to the conversation model name based on a full combination algorithm, and splicing the test event information and the result of the permutation and combination to obtain a test intention scenario table;
the response generation module is used for selecting the test intention data in the test intention scene table as the current test scene one by one according to the sequence, and calling the dialogue model corresponding to the dialogue model name through an interface to generate a response text and configuration parameters of the current test scene;
and the verification analysis module is used for verifying and analyzing the response text and the configuration parameters based on a text similarity algorithm to obtain a test result.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform a method of testing a response text according to any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out a method for testing a response document according to any one of claims 1 to 7.
CN202210140524.5A 2022-02-16 2022-02-16 Method, device and equipment for testing response text and storage medium Pending CN114519005A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210140524.5A CN114519005A (en) 2022-02-16 2022-02-16 Method, device and equipment for testing response text and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210140524.5A CN114519005A (en) 2022-02-16 2022-02-16 Method, device and equipment for testing response text and storage medium

Publications (1)

Publication Number Publication Date
CN114519005A true CN114519005A (en) 2022-05-20

Family

ID=81600010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210140524.5A Pending CN114519005A (en) 2022-02-16 2022-02-16 Method, device and equipment for testing response text and storage medium

Country Status (1)

Country Link
CN (1) CN114519005A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710941A (en) * 2018-12-29 2019-05-03 上海点融信息科技有限责任公司 User's intension recognizing method and device based on artificial intelligence
US20190228069A1 (en) * 2017-08-04 2019-07-25 Ping An Technology (Shenzhen) Co., Ltd. Intention acquisition method, electronic device and computer-readable storage medium
CN112487140A (en) * 2020-11-27 2021-03-12 平安科技(深圳)有限公司 Question-answer dialogue evaluating method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190228069A1 (en) * 2017-08-04 2019-07-25 Ping An Technology (Shenzhen) Co., Ltd. Intention acquisition method, electronic device and computer-readable storage medium
CN109710941A (en) * 2018-12-29 2019-05-03 上海点融信息科技有限责任公司 User's intension recognizing method and device based on artificial intelligence
CN112487140A (en) * 2020-11-27 2021-03-12 平安科技(深圳)有限公司 Question-answer dialogue evaluating method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113961584B (en) Field lineage analysis method, device, electronic device and storage medium
CN109726136A (en) Test method, device, equipment and the storage medium of database
CN114461777B (en) Intelligent question-answering method, device, equipment and storage medium
CN112732567B (en) Mock data testing method and device based on ip, electronic equipment and storage medium
CN114398282A (en) Test script generation method, device, device and storage medium
CN117707922A (en) Method and device for generating test case, terminal equipment and readable storage medium
CN114781402A (en) Method and device for identifying inquiry intention, electronic equipment and readable storage medium
CN114185797A (en) Front-end code checking method and device, electronic equipment and readable storage medium
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN113282854A (en) Data request response method and device, electronic equipment and storage medium
CN113887941A (en) Business process generation method and device, electronic equipment and medium
CN113032256B (en) Automated testing method, apparatus, computer system, and readable storage medium
CN114461717A (en) Automatic data comparison method, device, electronic device and storage medium
CN114385497A (en) Test environment generation method and device, electronic equipment and storage medium
CN115964307B (en) Automatic test method, device, equipment and medium for transaction data
CN112527655B (en) Software version quality abnormality detection method and device, electronic equipment and storage medium
CN111859985B (en) AI customer service model test method and device, electronic equipment and storage medium
CN112182562A (en) Data auditing method and system in sandbox environment, electronic equipment and medium
CN115033489A (en) Code resource detection method and device, electronic equipment and storage medium
CN112667244B (en) Data verification method, device, electronic equipment and computer readable storage medium
CN114968816A (en) Strategy testing method, device, equipment and storage medium based on data simulation
CN112597171B (en) Table relation visualization method and device, electronic equipment and storage medium
CN114138243A (en) Function calling method, device, equipment and storage medium based on development platform
CN113704405B (en) Quality inspection scoring method, device, equipment and storage medium based on recorded content
CN114519005A (en) Method, device and equipment for testing response text and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination