Text testing method and device, computer device and readable storage medium
Patent Information
- Application Number
- CN202610980112.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-02
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]然而,为保证测试结果的准确性,测试文本通常会内容较丰富,而在对测试文本进行特征提取时可能出现特征丢失或者特征缺失的情况,导致文本测试准确性较低
[0051] Regarding the beneficial effects of any of the technical solutions in the second to fifth aspects mentioned above, refer to the beneficial effects of the corresponding technical solutions in the first aspect; repeated examples will not be listed here.
Smart Images

Figure CN122927281A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a text testing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] With the development of artificial intelligence technology, artificial intelligence models have also been widely used, for example, for testing vehicle systems in different application scenarios.
[0003] In traditional technology, test results are generated by acquiring test texts from the vehicle's infotainment system under different application scenarios and then using an artificial intelligence model to extract and map features from the test texts.
[0004] However, to ensure the accuracy of test results, test texts are usually quite rich in content. When extracting features from the test text, feature loss or missing features may occur, resulting in low accuracy of text testing. Summary of the Invention
[0005] Based on this, this application addresses the aforementioned technical problems by providing a text testing method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the accuracy of text testing.
[0006] Firstly, this application provides a text testing method, including:
[0007] Obtain a test text set, and divide the test text set into a first type of text and a second type of text, wherein the text field length of the first type of text is greater than the text field length of the second type of text;
[0008] Based on the word features corresponding to each word in the first type of text, the complexity information of the first type of text is generated;
[0009] Based on the complexity information, multi-level feature extraction is performed on the first type of text to obtain multi-level text features;
[0010] Based on the multi-level text features and the second type of text, text testing is performed to obtain the text test results corresponding to the test text set.
[0011] Thus, by dividing the test text set into two categories, for the first category of texts which are more prone to feature loss or missing features during feature extraction, complexity information is specifically determined. Considering that the first category of texts contains more content, multi-level feature extraction is performed on the first category of texts based on the complexity information. This ensures that the extracted multi-level text features retain both certain features and features of multiple dimensions. Then, based on the multi-level text features and the second category of texts, text test results are generated, improving the accuracy of sample testing.
[0012] In an optional embodiment of the first aspect, the word features include word form features and word phase features; the step of generating complexity information of the first type of text based on the word features corresponding to each word in the first type of text includes:
[0013] Based on the lexical features of each word in the first type of text, the complexity of the field content of the first type of text is detected;
[0014] Based on the word-related features between words in the first type of text, word correlation detection is performed on each word in the first type of text to obtain word-related information;
[0015] The complexity of the field content and the word-related information are combined to form the complexity information of the first type of text.
[0016] Thus, based on the morphological features of each word in the first type of text, the complexity of the field content is detected; and based on the word-related features between each word in the first type of text, word-related information is detected. The complexity information is quantified from two dimensions: field content and word relevance, thereby improving the accuracy of generating the complexity information of the field.
[0017] In an optional embodiment of the first aspect, detecting the field content complexity of the first type of text based on the lexical features of each word in the first type of text includes:
[0018] Based on the morphological features of each word in the first type of text, the degree of diversity among each word in the first type of text is detected to obtain the morphological diversity information of the first type of text;
[0019] The first type of text is divided into multiple tuples, and the diversity degree between each tuple is detected based on the word form features of each word in the first type of text, so as to obtain the tuple diversity information of the multiple tuples obtained by division.
[0020] The first type of text is divided into multiple sentence texts, and the word overlap between the sentence texts is detected based on the word form features of each word in the first type of text, so as to obtain the word form feature overlap information of adjacent sentences in the multiple sentence texts.
[0021] The word form diversity information, the tuple diversity information, and the word form feature overlap information are fused together to form the field content complexity of the first type of text.
[0022] Thus, based on the morphological features of each word in the first type of text, the morphological diversity information, the diversity information of the resulting tuples, and the overlapping information of the morphological features of adjacent sentences are determined. The complexity of the field content is quantified from three dimensions: each word itself, the tuples, and adjacent sentences, thereby improving the accuracy of the generation of the field content complexity.
[0023] In an optional embodiment of the first aspect, the word-phase features include word vector distance; the step of performing word correlation detection on each word in the first type of text based on the word-phase features between each word in the first type of text to obtain word-related information includes:
[0024] If the number of words in the first type of text is within a certain range, and the number of words in the first type of text is greater than a preset threshold, then the first type of text is sampled to obtain a sampling field. Based on the word vector distance between each word in the sampling field, word relevance detection is performed on each word in the sampling field to obtain word-related information of the first type of text. If the number of words in the first type of text is not greater than the preset threshold, then based on the word vector distance between each word in the first type of text, word relevance detection is performed on the first type of text to obtain word-related information of the first type of text.
[0025] If the number of words in the first type of text is within the second range, then the word-related information of historical texts belonging to the same type as the first type of text is determined as the word-related information of the first type of text.
[0026] Wherein, the minimum value within the first quantity range is greater than the maximum value within the second quantity range.
[0027] Thus, considering that the number of words in the first type of text may fall within different ranges, when the number of words in the first type of text is within the first range (i.e., when the number of words in the first type of text is relatively large), it is further subdivided into cases where the number of words is greater than a preset threshold and cases where the number of words is not greater than a preset threshold. In the case where the number of words is greater than the preset threshold, to ensure the efficiency of word-related information generation, the first type of text is sampled before the word-related information is determined. When the number of words in the first type of text is within the second range (i.e., when the number of words in the first type of text is relatively small), the information in the first type of text itself is not rich enough, indicating that the word-related information of the first type of text determined based on the word vector distance between words in the current first type of text is inaccurate. Therefore, word-related information from historical fields belonging to the same type as the first type of text is determined as the word-related information of the first type of text, ensuring that the determination is based on sufficiently rich word-related information from historical fields belonging to the same type as the first type of text. In summary, this improves the accuracy of word-related information determination.
[0028] In an optional embodiment of the first aspect, the step of performing multi-level feature extraction on the first type of text based on the complexity information to obtain multi-level text features includes:
[0029] The first type of text is encoded in multiple levels to obtain multi-level encoded features;
[0030] Based on the complexity information, the multi-level encoded features are decoded in multiple levels to obtain multi-level text features.
[0031] Thus, by performing multi-level encoding on the first type of text, the resulting multi-level encoded features contain more layers of information. When performing multi-level decoding on the multi-level encoded features, complexity information is used as a basis, which can supplement the information lost during the encoding process. Therefore, the feature extraction accuracy of multi-level text features is improved.
[0032] In an optional embodiment of the first aspect, the step of performing multi-level decoding on the multi-level encoded features based on the complexity information to obtain multi-level text features includes:
[0033] The complexity information is mapped and processed through a fully connected layer to obtain multiple complexity score information;
[0034] Multiple gated vectors are obtained by mapping the multiple complexity score information through activation functions;
[0035] Based on the multiple gated vectors, the multi-level encoded features are decoded in multiple levels to obtain multi-level text features.
[0036] Thus, by using complexity information as input to the fully connected layer, multiple complexity scores are obtained. Each complexity score can correspond to different levels and dimensions. By mapping multiple complexity scores through activation functions, a unified range of description for multiple complexity scores is achieved. Based on multiple gating vectors, the decision-making basis for complexity information to participate in multi-level coding is realized, thereby improving the accuracy of multi-level coding.
[0037] In an optional embodiment of the first aspect, the step of performing text testing based on the multi-level text features and the second type of text to obtain the text test results corresponding to the test text set includes:
[0038] Global max pooling and fully connected mapping are performed on the multi-level text features and the second type of text respectively to obtain multiple field representation vectors.
[0039] Based on the vector weights corresponding to the multiple field representation vectors, the multiple field representation vectors are weighted and fused to obtain a global representation vector;
[0040] Based on the global representation vector, text testing is performed to obtain the text test results corresponding to the test text set.
[0041] Thus, by sequentially performing global max pooling and fully connected mapping on multi-level text features of different dimensions and second-type text, a unified dimensional transformation of features of different dimensions is achieved. This allows for the weighted fusion of field representation vectors with corresponding vector weights, enabling different field representation vectors to participate in the generation of the global representation vector according to their importance and with different decision proportions. Consequently, the global representation vector serves as the basis for generating text test results, thereby improving the accuracy of text testing.
[0042] Secondly, this application also provides a text testing device, comprising:
[0043] The text acquisition module is used to acquire the test text set;
[0044] The text segmentation module is used to classify the test text to obtain a first type of text and a second type of text, wherein the field length of the first type of text is greater than the field length of the second type of text.
[0045] The complexity determination module is used to determine the complexity information of the first type of text;
[0046] The feature extraction module is used to perform multi-level feature extraction on the first type of text based on the complexity information to obtain multi-level text features;
[0047] The text testing module is used to perform text testing based on the multi-level text features and the second type of text, and obtain the text test results corresponding to the test text set.
[0048] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0049] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0050] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the above aspects.
[0051] Regarding the beneficial effects of any of the technical solutions in the second to fifth aspects mentioned above, refer to the beneficial effects of the corresponding technical solutions in the first aspect; repeated examples will not be listed here. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 This is a schematic diagram illustrating an optional application environment for a text testing method in one embodiment.
[0054] Figure 2 This is a schematic diagram of an optional flowchart of a text testing method in one embodiment;
[0055] Figure 3 This is an optional flowchart illustrating a step in generating complexity information of a first type of text based on the word features corresponding to each word in the first type of text, as described in one embodiment.
[0056] Figure 4 This is a schematic diagram of an optional process for extracting multi-level features from the first type of text based on complexity information in one embodiment.
[0057] Figure 5 This is a schematic diagram of an optional structure of a text testing device in one embodiment;
[0058] Figure 6 This is a schematic diagram of an optional internal structure of a computer device in one embodiment. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0060] The terms “in,” “comprising,” and “having,” as used herein, and any variations thereof, are intended to cover non-exclusive inclusion. The term “multiple” as used herein refers to two or more. The term “at least one” as used herein refers to one or more. The term “one” as used herein refers to any one of the foregoing.
[0061] The text testing method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Server 104 obtains a test text set and classifies the test text into a first type of text and a second type of text, where the field length of the first type of text is greater than the field length of the second type of text; it determines the complexity information of the first type of text; based on the complexity information, it performs multi-level feature extraction on the first type of text to obtain multi-level text features; based on the multi-level text features and the second type of text, it performs text testing to obtain the text test results corresponding to the test text set. Server 104 pushes the test results to terminal 102, where terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Headset devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0062] In one exemplary embodiment, such as Figure 2 As shown, a text testing method is provided, which can be applied to... Figure 1Taking server 104 as an example, the explanation includes the following steps 201 to 204. Wherein:
[0063] Step 201: Obtain the test text set and divide the test text set into a first type of text and a second type of text, wherein the text field length of the first type of text is greater than the text field length of the second type of text.
[0064] In step 201, the test text set is a multi-dimensional text waiting to be tested. The test text set can be set by the user as needed. For example, in response to a text test command initiated by the user, the text test command carries the test text set. The test text set can be identified text that meets preset test conditions. For example, the preset test conditions are text generated by a specified vehicle-mounted device. The test text set includes at least one of the following: test object information, test condition information, test operation information, and expected test information; the test object information includes at least one of the following: test object type, test object version, and test remarks information. The test object type is used to characterize at least one of the following: test equipment type, test environment type, and test platform type. The test object version is used to characterize at least one of the following: ECU (Electronic Control Unit) version, vehicle software version, and application version. The test remarks information is used to characterize at least one of the following: test fault code, test log, test engineer information, and test screenshot description; the test condition information is used to characterize at least one of the following: test speed range, test battery SOC (State of Charge) range, vehicle configuration condition information, and vehicle version condition information; the test operation information is used to characterize the execution steps during the test; and the expected test information is used to characterize the expected test performance when the test is passed.
[0065] As an example, the test text set is classified into a first type of text and a second type of text. This includes: for each type of text field in the test text set, if the text length of the text field is greater than a preset length threshold, the text field is classified into the first type of text; if the text length of the text field is not greater than the preset length threshold, the text field is classified into the second type of text.
[0066] As another embodiment, the test text set is classified into a first type of text and a second type of text. This includes: for each type of text field in the test text set, if the number of words in the text field is within a third range, the text field is classified into the second type of text; if the number of words in the text field is not within the third range, the text field is classified into the first type of text.
[0067] The maximum value in the third range is less than the minimum value in the second range. For example, the third range is set to [1,6], the second range is set to [6,9], and the first range is set to [10,∞].
[0068] As another embodiment, the test text set is classified into a first type of text and a second type of text, including: classifying text fields in the test text set that belong to test object information or test condition information into the second type of text, and classifying text fields in the test text set that belong to test operation information or expected test information into the first type of text.
[0069] Therefore, considering that text fields belonging to test object information or test condition information usually have less content, they are classified as second-class text; text fields belonging to test operation information or expected test information usually have more content, so they are classified as first-class text.
[0070] Step 202: Generate the complexity information of the first type of text based on the word features corresponding to each word in the first type of text.
[0071] In step 202, the word features include at least one of word form features and word phase features. Word form features are used to characterize the shape of a word, and word phase features are used to characterize a word vector.
[0072] As an example, step 202 includes: generating the field content complexity of the first type of text based on the lexical features of each word in the first type of text; and determining the field content complexity as the complexity information of the first type of text.
[0073] As another embodiment, step 202 includes: generating word-related information of the first type of text based on the word-related features between words in the first type of text; and determining the word-related information as the complexity information of the first type of text.
[0074] As another embodiment, step 202 includes: generating complexity information of the first type of text based on the word form features of each word in the first type of text and the word-related features between each word in the first type of text.
[0075] Step 203: Based on the complexity information, perform multi-level feature extraction on the first type of text to obtain multi-level text features.
[0076] As an example, based on complexity information, the first type of text is subjected to multi-level encoding and decoding to obtain multi-level text features.
[0077] Step 204: Based on the multi-level text features and the second type of text, conduct text testing to obtain the text test results corresponding to the test text set.
[0078] The test results in step 204 are used to characterize at least one of the test domain types and test types. The test domain types include at least one of the following: intelligent driving perception and recognition test type, intelligent driving decision and control test type, parking and low-speed assistance test type, body control test type, entry and start-up and anti-theft test type, lighting, wiper and rearview mirror test type, door lock, window, sunroof and tailgate test type, cockpit interaction and central control display test type, instrument, warning and driver information display test type, voice, audio and multimedia test type, air conditioning and cabin thermal comfort test type, thermal management and temperature control system test type, power drive test type, braking system test type, steering, suspension and chassis stability control test type, battery management and high voltage safety test type, charging and replenishment test type, network connectivity and remote service test type, vehicle communication network test type, diagnostics, flashing and OTA (Over-The-Air technology) test type, and vehicle integration and cross-domain linkage test type.
[0079] The test types include one of the following: test pass, test failure, and test malfunction. Test malfunction types include at least one of the following: function not triggered, function failed to trigger, function result deviation, partial function failure, state switching anomaly, timing logic anomaly, boundary condition anomaly, security protection or degradation strategy anomaly, unresponsive interactive commands, abnormal interface display, abnormal text or alarm prompts, abnormal sound, light, or other feedback, data display or data reporting errors, abnormal signals or inconsistent data, communication interruption or message anomaly, abnormal parameter configuration, version mismatch, abnormal flashing or upgrade, abnormal fault codes, abnormal logs or captured information, performance lag or response timeout, lag or resource usage anomaly, system crash, restart, or crash, intermittent anomaly or unstable reproducibility, unmet preconditions, abnormal test environment, abnormal test equipment, abnormal dependent systems, incomplete data records, and insufficient or undeterminable information.
[0080] For example, step 204 includes: mapping multi-level text features and second-class texts using a pre-trained text testing model to obtain the text test results corresponding to the test text set.
[0081] Furthermore, as an embodiment, a pre-trained text testing model is used to map multi-level text features and second-class text to obtain text test results corresponding to the test text set. This includes: performing global max pooling and fully connected mapping on the multi-level text features and second-class text respectively to obtain multiple field representation vectors; weighting and fusing the multiple field representation vectors according to their respective vector weights to obtain a global representation vector; and generating text test results corresponding to the test text set based on the global representation vector.
[0082] As one embodiment, the multi-level text features are sequentially subjected to global max pooling and fully connected mapping to obtain the field representation content corresponding to the multi-level text features. This includes: performing global max pooling on the multi-level text features to obtain a first field summary vector; concatenating the first field summary vector with complexity information to obtain a concatenated vector; and performing fully connected mapping on the concatenated vector to obtain the field representation content corresponding to the multi-level text features.
[0083] As one embodiment, the second type of text is subjected to global max pooling and fully connected mapping in sequence to obtain the field representation vector corresponding to the second type of text, including: performing global max pooling on the second type of text to obtain the second field summary vector, and performing fully connected mapping on the second field summary vector to obtain the field representation content corresponding to the second type of text.
[0084] Thus, for the second type of text with shorter field lengths, since it involves less content, there is no need to supplement additional dimensional features. Therefore, instead of multi-level feature extraction, global max pooling and fully connected mapping are directly performed, which improves the processing efficiency of the second type of text, and thus improves the efficiency of text testing.
[0085] As one embodiment, generating text test results corresponding to the test text set based on the global representation vector includes: mapping the global representation vector to the text test results corresponding to the test text set through a classification head.
[0086] Thus, by sequentially performing global max pooling and fully connected mapping on multi-level text features of different dimensions and second-type text, a unified dimensional transformation of features of different dimensions is achieved. This allows for the weighted fusion of field representation vectors with corresponding vector weights, enabling different field representation vectors to participate in the generation of the global representation vector according to their importance and with different decision proportions. Consequently, the global representation vector serves as the basis for generating text test results, thereby improving the accuracy of text testing.
[0087] As described above, the text testing process is implemented by a pre-trained text testing model, which is trained using training samples. The input feature data of the training samples can be obtained by referring to the test text set, and the true labels of the training samples can be set according to the content contained in the test results. The text testing model includes multiple encoding layers, multiple decoding layers, a global max pooling layer, a fully connected layer, and a classification head.
[0088] In the above text testing method, the test text set is divided into two categories: Category I text and Category II text. For Category I text, which is more prone to feature loss or missing features during feature extraction, complexity information is specifically determined. Considering that Category I text has more content, multi-level feature extraction is performed on Category I text based on the complexity information. This ensures that the extracted multi-level text features retain both certain features and multi-dimensional features. Then, based on the multi-level text features and Category II text, text test results are generated, improving the accuracy of sample testing.
[0089] Understandably, to ensure the completeness of complexity information, multiple dimensions of information describing complexity can be used in the decision-making process for complexity information.
[0090] In one exemplary embodiment, such as Figure 3 As shown, step 202 includes steps 301 to 303. Wherein:
[0091] Step 301: Detect the complexity of the field content of the first type of text based on the lexical features of each word in the first type of text.
[0092] In step 301, the field content complexity refers to the diversity information evaluation obtained by dividing the first type of text into various fields (including but not limited to sentence text, tuples and words as described below).
[0093] As an embodiment, step 301 includes: detecting the degree of diversity among words in the first type of text based on the morphological features of each word in the first type of text, and obtaining morphological diversity information of the first type of text; dividing the first type of text into multiple tuples, and detecting the degree of diversity among each tuple based on the morphological features of each word in the first type of text, and obtaining tuple diversity information of the multiple tuples; dividing the first type of text into multiple sentence texts, and detecting the degree of word overlap among each sentence text based on the morphological features of each word in the first type of text, and obtaining morphological feature overlap information of adjacent sentences in the multiple sentence texts; and fusing at least one of the morphological diversity information, tuple diversity information, and morphological feature overlap information into the field content complexity of the first type of text.
[0094] As an example, based on the morphological features of each word in the first type of text, the degree of diversity among the words in the first type of text is detected to obtain the morphological diversity information of the first type of text, including: determining the ratio between the number of non-repeating morphological features in the first type of text and the total number of words as the morphological diversity information of the first type of text.
[0095] For example, if the first type of text includes (a, b, d, b, d, e), then the number of unique word forms is 4, the total number of words is 6, and the word form diversity information of the first type of text is 4 / 6.
[0096] In this context, "multi" in a tuple can be any integer greater than or equal to 2. The diversity information of a tuple can include the diversity information corresponding to a tuple. Here, we take the more common binary and triplet tuples as examples for explanation.
[0097] As an example, the first type of text is divided into multiple tuples, including: dividing the first type of text into multiple tuples in the order of word arrangement according to the number of elements corresponding to the tuples, wherein there are no missing words in the tuples.
[0098] For example, if the first type of text includes (a, b, d, b, d, e), then when performing binary partitioning, we can obtain the following binary pairs: (a, b), (b, d), (d, b), (b, d), and (d, e); when performing triple partitioning, we can obtain the following triple pairs: (a, b, d), (b, d, b), (d, b, d), and (b, d, e).
[0099] As an example, based on the word form features of each word in the first type of text, the degree of diversity among each tuple is detected to obtain the tuple diversity information of the divided tuples, including: determining the ratio between the number of non-repeating word form features of the tuples and the total number of tuples as the tuple diversity information.
[0100] For example, if the first type of text includes (a, b, b, d, d, e), then when performing binary segmentation, the following binary pairs can be obtained: (a, b), (b, b), (b, d), (d, d), and (d, e); the number of unique word form features of the binary pairs is 3, and the total number of binary pairs is 5, so the diversity information of the binary pairs is 3 / 5.
[0101] As an example, at least one of the word form diversity information, tuple diversity information, and word form feature overlap information is fused into the field content complexity of the first type of text, including: concatenating the word form diversity information, tuple diversity information, and word form feature overlap information to obtain the field content complexity of the first type of text.
[0102] As one embodiment, dividing the first type of text into multiple sentence texts includes: identifying sentence segmentation marks in the first type of text, and dividing the first type of text into multiple sentence texts based on the sentence segmentation marks in the first type of text, wherein the sentence segmentation marks include at least one of commas, periods, semicolons, and line breaks.
[0103] As an example, based on the word form features of each word in the first type of text, the overlapping information of word form features of adjacent sentences in the multiple sentence texts obtained by segmentation is determined, including: determining the ratio between the total number of overlapping word form features between adjacent sentences in the multiple sentence texts and the total number of words in the first type of text as the overlapping information of word form features of adjacent sentences in the multiple sentence texts.
[0104] For example, if the first type of text includes (abd, bd, e), then when performing sentence segmentation, we can obtain the following sentences: abd, bd, and e. The total number of overlapping lexical features between adjacent sentences in multiple sentence texts is 2. The total number of words in the first type of text is 6. Therefore, the overlapping information of lexical features between adjacent sentences in multiple sentence texts is 2 / 6.
[0105] Thus, based on the morphological features of each word in the first type of text, the morphological diversity information, the diversity information of the resulting tuples, and the overlapping information of the morphological features of adjacent sentences are determined. The complexity of the field content is quantified from three dimensions: each word itself, the tuples, and adjacent sentences, thereby improving the accuracy of the generation of the field content complexity.
[0106] Step 302: Based on the word-related features between words in the first type of text, perform word correlation detection on each word in the first type of text to obtain word-related information.
[0107] In step 302, the word-related information is used to characterize the degree of correlation between words in the first type of text.
[0108] As an embodiment, step 302 includes: if the number of words in the first type of text is within a first quantity range, and if the number of words in the first type of text is greater than a preset quantity threshold, then the first type of text is sampled to obtain a sampling field; based on the word vector distance between each word in the sampling field, word correlation detection is performed on each word in the sampling field to obtain word-related information of the first type of text; if the number of words in the first type of text is not greater than the preset quantity threshold, then based on the word vector distance between each word in the first type of text, word correlation detection is performed on the first type of text to obtain word-related information of the first type of text; if the number of words in the first type of text is within a second quantity range, then the word-related information of historical texts belonging to the same type as the first type of text is determined as the word-related information of the first type of text; wherein, the minimum value within the first quantity range is greater than the maximum value within the second quantity range.
[0109] Therefore, considering that the number of words in the first type of text may fall within different ranges, when the number of words in the first type of text is within the first range (i.e., when the number of words in the first type of text is relatively large), it is further subdivided into cases where the number of words is greater than a preset threshold and cases where the number of words is not greater than a preset threshold. In the case where the number of words is greater than the preset threshold, to ensure the efficiency of generating word-related information, the first type of text is sampled before determining the word-related information. When the number of words in the first type of text is within the second range (i.e., when the number of words in the first type of text is relatively small), the information in the first type of text itself is not rich enough, indicating that the word-related information of the first type of text determined based on the word vector distance between words in the current first type of text is inaccurate. Therefore, word-related information from historical fields belonging to the same type as the first type of text is determined as the word-related information of the first type of text, ensuring that the determination is based on sufficiently rich word-related information from historical fields belonging to the same type as the first type of text. In summary, this improves the accuracy of determining word-related information.
[0110] The preset quantity threshold can be set by the user as needed. It can be an empirical value, such as 64, or it can correspond to the processing power of the text testing model. Specifically, the preset quantity threshold is positively correlated with the processing power of the text testing model. The degree of correlation represented by word-related information is inversely correlated with the word vector distance between words in the first type of text.
[0111] The sampling methods include, but are not limited to, random sampling and sampling at preset intervals, and are not restricted here.
[0112] It is understandable that when quantifying the distance between words, each word needs to be converted into a word vector. However, after the word vector conversion, the distance between the word vectors of different words is likely to differ significantly, resulting in a large amount of word-related information in the generated words.
[0113] Optionally, as an embodiment, before performing word correlation detection on each word in the first type of text based on the word-related features between each word in the first type of text to obtain word-related information, the above method further includes: converting each word in the first type of text into a word vector, and normalizing each word vector obtained by conversion.
[0114] Furthermore, the word vectors obtained from the transformation are normalized, including: for each word vector, the difference between the word vector and the mean vector of each word vector is determined as the mean processing vector, and the mean processing vector is normalized using the L2 norm.
[0115] As an example, the word vector distance between words in the sampling field includes the Euclidean distance between each pair of word vectors in the sampling field; based on the word vector distance between words in the sampling field, word relevance detection is performed on each word in the sampling field to obtain word-related information of the first type of text, including: for each word vector in the sampling field, sorting the Euclidean distance between the word vector and each other word vector to obtain a distance sorting result, wherein the distance sorting result is sorted from smallest to largest; selecting the top k Euclidean distances from the distance sorting result, dividing the kth Euclidean distance by the previous k-1 Euclidean distances to obtain k-1 distance ratios, taking the logarithm of each of the k-1 distance ratios to obtain k-1 logarithmic results, and then averaging the k-1 logarithmic results to obtain the local distance statistics of the word vector; the reciprocal of the average of the local distance statistics of each word vector in the sampling field is determined as the word-related information of the first type of text.
[0116] Optionally, the specific implementation steps for performing word correlation detection on the first type of text based on the word vector distance between each word in the first type of text to obtain the word-related information of the first type of text can refer to the specific implementation content of the steps for performing word correlation detection on each word in the sampling field based on the word vector distance between each word in the sampling field to obtain the word-related information of the first type of text, which will not be repeated here.
[0117] It should be noted that when the number of words in the first type of text is within the second range, the specific method for identifying the same type can be to determine that texts with the same descriptive dimension belong to the same type of text; the definition of the descriptive dimension can be based on the granularity of the descriptive dimension, specifically by comparing the corresponding descriptive dimensions from fine to coarse granularity.
[0118] For example, if the first type of text includes the test device type, then the descriptive dimensions of the first type of text, from detailed to coarse, include: test device type, test object type, and test object information. Given that the number of words related to the test device type is within the second range, the system first searches for historical texts with the same test device type. If such texts exist, they are identified as historical texts belonging to the same type as the test device type. If not, the system searches for historical texts with the same test object type. If such texts exist, they are identified as historical texts belonging to the same type as the test device type. If not, the system searches for historical texts with the same test object information. If such texts exist, they are identified as historical texts belonging to the same type as the test device type.
[0119] Step 303: Combine the field content complexity and word-related information into the complexity information of the first type of text.
[0120] For example, step 303 includes: concatenating the field content complexity and word-related information to obtain the complexity information of the first type of text.
[0121] In this embodiment, the complexity of the field content of the first type of text is detected based on the lexical features of each word in the first type of text; word relevance detection is performed on each word in the first type of text based on the word phase features between each word in the first type of text to obtain word-related information; the complexity of the field content and word-related information are fused into the complexity information of the first type of text. Based on the lexical features of each word in the first type of text, the detection of the complexity of the field content is realized, and based on the word phase features between each word in the first type of text, the detection of word-related information is realized. The complexity information is quantified from two dimensions: field content and word relevance, which improves the accuracy of the generation of the complexity information of the field.
[0122] Understandably, in order to ensure that complexity information can accurately supplement information, it is necessary to provide a way for complexity information to accurately participate in the feature extraction process.
[0123] In one exemplary embodiment, such as Figure 4 As shown, step 203 includes steps 401 to 402. Wherein:
[0124] Step 401: Perform multi-level encoding on the first type of text to obtain multi-level encoding features.
[0125] In step 401, the encoding process is performed by the encoder in the pre-trained text test model. The encoder includes multiple convolutional encoding layers, each of which is used to perform convolution processing, linear correction and max pooling operations in sequence. The settings of the convolutional encoding layers can be empirical values, for example, the convolution kernel width is fixed at 3, the convolution stride is fixed at 1, the max pooling window is fixed at 2, and the max pooling stride is fixed at 2.
[0126] As an example, taking a convolutional coding layer with 5 layers as an example, step 401 includes: encoding the first type of text through a first convolutional coding layer to obtain a first coding feature (taking the above convolutional coding layer settings as an example, the number of channels is 256); encoding the first coding feature through a second convolutional coding layer to obtain a second coding feature (taking the above convolutional coding layer settings as an example, the number of channels is 512); encoding the second coding feature through a third convolutional coding layer to obtain a third coding feature (taking the above convolutional coding layer settings as an example, the number of channels is 1024); encoding the third coding feature through a fourth convolutional coding layer to obtain a fourth coding feature (taking the above convolutional coding layer settings as an example, the number of channels is 2048); and encoding the fourth coding feature through a fifth convolutional coding layer to obtain a multi-level coding feature (taking the above convolutional coding layer settings as an example, the number of channels is 4096).
[0127] Step 402: Based on the complexity information, perform multi-level decoding on the multi-level encoded features to obtain multi-level text features.
[0128] In step 402, the decoding process is performed by the decoder in the pre-trained text test model. The decoder includes multiple convolutional decoding layers. Each convolutional encoding layer is used to perform upsampling, gating, feature concatenation and convolution processing in sequence. The settings of the convolutional decoding layer can be empirical values. For example, the convolutional kernel width is fixed at 3 and the convolutional stride is fixed at 1.
[0129] For example, step 402 includes: mapping the complexity information through a fully connected layer to obtain multiple complexity score information; mapping the multiple complexity score information through activation functions to obtain multiple gate vectors; and performing multi-level decoding on the multi-level encoded features based on the multiple gate vectors to obtain multi-level text features.
[0130] The number of complexity score information is consistent with the number of convolutional decoding layers.
[0131] As an example, taking a convolutional decoding layer with 4 layers as an example, multi-level decoding is performed on multi-level encoded features based on multiple gate vectors to obtain multi-level text features, including: sampling the multi-level encoded features through the first convolutional decoding layer until they are consistent with the encoded features of the first convolutional decoding layer, to obtain a first sampled feature; performing scalar multiplication of the first gate vector with the encoded features of the first convolutional decoding layer to obtain a first gated encoded feature; concatenating the first sampled feature and the first gated encoded feature to obtain a first concatenated feature; performing convolution processing on the first concatenated feature to obtain a first decoded feature; sampling the first decoded feature until it is consistent with the encoded features of the second convolutional decoding layer, to obtain a second sampled feature; performing scalar multiplication of the second gate vector with the encoded features of the second convolutional decoding layer to obtain a second gated encoded feature; and concatenating the second sampled feature and the second gated encoded feature. Next, the second concatenated feature is obtained; the second concatenated feature is convolved to obtain the second decoded feature; the second decoded feature is sampled to be consistent with the encoded feature of the third convolutional decoding layer to obtain the third sampled feature; the third gated vector is multiplied by the encoded feature of the third convolutional decoding layer to obtain the third gated encoded feature; the third sampled feature and the third gated encoded feature are concatenated to obtain the third concatenated feature; the third concatenated feature is convolved to obtain the third decoded feature; the third decoded feature is sampled to be consistent with the encoded feature of the fourth convolutional decoding layer to obtain the fourth sampled feature; the fourth gated vector is multiplied by the encoded feature of the fourth convolutional decoding layer to obtain the fourth gated encoded feature; the fourth sampled feature and the fourth gated encoded feature are concatenated to obtain the fourth concatenated feature; the fourth concatenated feature is convolved to obtain the multi-level text feature.
[0132] In this embodiment, multi-level encoding is performed on the first type of text to obtain multi-level encoded features; based on complexity information, multi-level decoding is performed on the multi-level encoded features to obtain multi-level text features. By performing multi-level encoding on the first type of text, the multi-level encoded features obtained contain more layers of information. When performing multi-level decoding on the multi-level encoded features, complexity information is used as a basis, which can be used as supplementary information to make up for the information lost during the encoding process. Therefore, the feature extraction accuracy of multi-level text features is improved.
[0133] In a detailed embodiment, a test text set is obtained, which includes test object information, test condition information, test operation information, and expected test information. Text fields belonging to test object information or test condition information are classified into a second type of text, and text fields belonging to test operation information or expected test information are classified into a first type of text. The field length of the first type of text is greater than that of the second type of text. The ratio between the number of unique word forms in the first type of text and the total number of words is determined as the lexical diversity information of the first type of text. The first type of text is divided into multiple bigrams, and the bigram diversity information of the resulting bigrams is determined based on the lexical features of each word in the first type of text. The first type of text is divided into multiple triples, and the triple diversity information of the resulting triples is determined based on the lexical features of each word in the first type of text. The first type of text is divided into multiple sentence texts, and the sentence diversity information is determined based on the lexical features of each word in the first type of text. The text is divided into multiple sentences. The overlapping information of lexical features of adjacent sentences is determined. If the number of words in the first type of text is within a first range, and the number of words in the first type of text is greater than a preset threshold, then the first type of text is sampled to obtain sampled fields. The word-related information of the first type of text is determined using a proximity algorithm based on the distance between words in the sampled fields. If the number of words in the first type of text is not greater than the preset threshold, then the word-related information of the first type of text is determined using a proximity algorithm based on the distance between words in the first type of text. If the number of words in the first type of text is within a second range, then the word-related information of historical fields belonging to the same type as the first type of text is determined as the word-related information of the first type of text. The minimum value within the first range is greater than the maximum value within the second range. The word-related information, lexical diversity information, bigram diversity information, triplet diversity information, and overlapping lexical feature information are concatenated to obtain the field content complexity of the first type of text.
[0134] Furthermore, the first type of text is encoded through a first convolutional coding layer to obtain a first encoded feature (taking the above convolutional coding layer settings as an example, the number of channels is 256 at this time); the first encoded feature is encoded through a second convolutional coding layer to obtain a second encoded feature (taking the above convolutional coding layer settings as an example, the number of channels is 512 at this time); the second encoded feature is encoded through a third convolutional coding layer to obtain a third encoded feature (taking the above convolutional coding layer settings as an example, the number of channels is 1024 at this time); the third encoded feature is encoded through a fourth convolutional coding layer to obtain a fourth encoded feature (taking the above convolutional coding layer settings as an example, the number of channels is 1024 at this time); Taking the number of channels as an example (2048 channels), the fourth coding feature is encoded through the fifth convolutional coding layer to obtain multi-level coding features (taking the above convolutional coding layer settings as an example, the number of channels is 4096). The complexity information is mapped through a fully connected layer to obtain four complexity score information. Multiple complexity score information are mapped through activation functions to obtain four gate vectors. The multi-level coding features are sampled through the first convolutional decoding layer to be consistent with the coding features of the first convolutional decoding layer to obtain the first sampled features. The first gate vector is multiplied by the coding features of the first convolutional decoding layer to obtain the first gated feature. The code features are obtained by concatenating the first sampling feature and the first gated coding feature to obtain the first concatenated feature; convolution processing is performed on the first concatenated feature to obtain the first decoded feature; the first decoded feature is sampled to match the coding feature of the second convolutional decoding layer to obtain the second sampling feature; the second gated vector is multiplied by the coding feature of the second convolutional decoding layer to obtain the second gated coding feature; the second sampling feature and the second gated coding feature are concatenated to obtain the second concatenated feature; convolution processing is performed on the second concatenated feature to obtain the second decoded feature; the second decoded feature is sampled to match the coding feature of the third convolutional decoding layer to obtain the third sampling feature; the code features are then concatenated. The third gating vector is multiplied by the encoded features of the third convolutional decoding layer to obtain the third gating encoded features. The third sampling features and the third gating encoded features are concatenated to obtain the third concatenated features. The third concatenated features are convolved to obtain the third decoded features. The third decoded features are sampled to be consistent with the encoded features of the fourth convolutional decoding layer to obtain the fourth sampling features. The fourth gating vector is multiplied by the encoded features of the fourth convolutional decoding layer to obtain the fourth gating encoded features. The fourth sampling features and the fourth gating encoded features are concatenated to obtain the fourth concatenated features. The fourth concatenated features are convolved to obtain the multi-level text features.
[0135] Furthermore, global max pooling is performed on the multi-level text features to obtain the first field summary vector. The first field summary vector is concatenated with the complexity information to obtain the concatenated vector. A fully connected mapping is performed on the concatenated vector to obtain the field representation content corresponding to the multi-level text features. Global max pooling is performed on the second type of text to obtain the second field summary vector. A fully connected mapping is performed on the second field summary vector to obtain the field representation content corresponding to the second type of text. The global representation vector is then mapped to the text test results corresponding to the test text set through the classification head.
[0136] Thus, by dividing the test text set into two categories, for the first category of texts which are more prone to feature loss or missing features during feature extraction, complexity information is specifically determined. Considering that the first category of texts contains more content, multi-level feature extraction is performed on the first category of texts based on the complexity information. This ensures that the extracted multi-level text features retain both certain features and features of multiple dimensions. Then, based on the multi-level text features and the second category of texts, text test results are generated, improving the accuracy of sample testing.
[0137] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0138] Based on the same inventive concept, this application also provides a text testing apparatus for implementing the text testing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more text testing apparatus embodiments provided below can be found in the limitations of the text testing method described above, and will not be repeated here.
[0139] In one exemplary embodiment, such as Figure 5As shown, a text testing device is provided, including: a text acquisition module, a text segmentation module, a complexity determination module, a feature extraction module, and a text testing module, wherein:
[0140] The text acquisition module is used to acquire the test text set.
[0141] The text segmentation module is used to classify the test text into two categories: a first category and a second category. The field length of the first category is greater than that of the second category.
[0142] The complexity determination module is used to generate complexity information for the first type of text based on the word features corresponding to each word in the first type of text.
[0143] The feature extraction module is used to extract multi-level features from the first type of text based on complexity information, thereby obtaining multi-level text features.
[0144] The text testing module is used to perform text testing based on multi-level text features and second-class text, and obtain the text test results corresponding to the test text set.
[0145] In one embodiment, the word features include word form features and word phase features; the complexity determination module is further configured to detect the field content complexity of the first type of text based on the word form features of each word in the first type of text; perform word correlation detection on each word in the first type of text based on the word phase features between each word in the first type of text to obtain word-related information; and fuse the field content complexity and word-related information into the complexity information of the first type of text.
[0146] In one embodiment, the complexity determination module is further configured to: detect the degree of diversity among words in the first type of text based on the morphological features of each word in the first type of text, and obtain morphological diversity information of the first type of text; divide the first type of text into multiple tuples, and detect the degree of diversity among each tuple based on the morphological features of each word in the first type of text, and obtain tuple diversity information of the multiple tuples; divide the first type of text into multiple sentence texts, and detect the degree of word overlap among each sentence text based on the morphological features of each word in the first type of text, and obtain morphological feature overlap information of adjacent sentences in the multiple sentence texts; and fuse the morphological diversity information, tuple diversity information, and morphological feature overlap information into the field content complexity of the first type of text.
[0147] In one embodiment, the word-related features include word vector distance; the complexity determination module is further configured to, when the number of words in the first type of text is within a first quantity range, if the number of words in the first type of text is greater than a preset quantity threshold, sample the first type of text to obtain a sampling field, and perform word correlation detection on each word in the sampling field based on the word vector distance between each word in the sampling field to obtain word-related information of the first type of text; if the number of words in the first type of text is not greater than the preset quantity threshold, perform word correlation detection on the first type of text based on the word vector distance between each word in the first type of text to obtain word-related information of the first type of text; when the number of words in the first type of text is within a second quantity range, determine the word-related information of historical texts belonging to the same type as the first type of text as the word-related information of the first type of text; wherein, the minimum value within the first quantity range is greater than the maximum value within the second quantity range.
[0148] In one embodiment, the feature extraction module is further configured to perform multi-level encoding on the first type of text to obtain multi-level encoded features; and to perform multi-level decoding on the multi-level encoded features based on complexity information to obtain multi-level text features.
[0149] In one embodiment, the feature extraction module is further configured to map the complexity information through a fully connected layer to obtain multiple complexity score information; map the multiple complexity score information through activation functions to obtain multiple gate vectors; and perform multi-level decoding on the multi-level encoded features based on the multiple gate vectors to obtain multi-level text features.
[0150] In one embodiment, the text testing module is further configured to perform global max pooling and fully connected mapping on the multi-level text features and the second type of text respectively to obtain multiple field representation vectors; to perform weighted fusion of the multiple field representation vectors according to the vector weights corresponding to the multiple field representation vectors to obtain a global representation vector; and to perform text testing based on the global representation vector to obtain the text test results corresponding to the test text set.
[0151] Each module in the aforementioned text testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0152] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a text testing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0153] Those skilled in the art will understand that Figure 6 The structure shown is a block diagram of a partial structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0154] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0155] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.
[0156] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0157] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0158] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program mentioned can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0159] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0160] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A text testing method, characterized in that, The method includes: Obtain a test text set, and divide the test text set into a first type of text and a second type of text, wherein the text field length of the first type of text is greater than the text field length of the second type of text; Based on the word features corresponding to each word in the first type of text, the complexity information of the first type of text is generated; Based on the complexity information, multi-level feature extraction is performed on the first type of text to obtain multi-level text features; Based on the multi-level text features and the second type of text, text testing is performed to obtain the text test results corresponding to the test text set.
2. The method according to claim 1, characterized in that, The word features include word form features and word phase features; The step of generating complexity information for the first type of text based on the word features corresponding to each word in the first type of text includes: Based on the lexical features of each word in the first type of text, the complexity of the field content of the first type of text is detected; Based on the word-related features between words in the first type of text, word correlation detection is performed on each word in the first type of text to obtain word-related information; The complexity of the field content and the word-related information are combined to form the complexity information of the first type of text.
3. The method according to claim 2, characterized in that, The step of detecting the complexity of field content in the first type of text based on the lexical features of each word in the first type of text includes: Based on the morphological features of each word in the first type of text, the degree of diversity among each word in the first type of text is detected to obtain the morphological diversity information of the first type of text; The first type of text is divided into multiple tuples, and the diversity degree between each tuple is detected based on the word form features of each word in the first type of text, so as to obtain the tuple diversity information of the multiple tuples obtained by division. The first type of text is divided into multiple sentence texts, and the word overlap between the sentence texts is detected based on the word form features of each word in the first type of text, so as to obtain the word form feature overlap information of adjacent sentences in the multiple sentence texts. The word form diversity information, the tuple diversity information, and the word form feature overlap information are fused together to form the field content complexity of the first type of text.
4. The method according to claim 2, characterized in that, The word phase features include word vector distance; the step of performing word correlation detection on each word in the first type of text based on the word phase features between each word in the first type of text to obtain word-related information includes: If the number of words in the first type of text is within a certain range, and the number of words in the first type of text is greater than a preset threshold, then the first type of text is sampled to obtain a sampling field. Based on the word vector distance between each word in the sampling field, word relevance detection is performed on each word in the sampling field to obtain word-related information of the first type of text. If the number of words in the first type of text is not greater than the preset threshold, then based on the word vector distance between each word in the first type of text, word relevance detection is performed on the first type of text to obtain word-related information of the first type of text. If the number of words in the first type of text is within the second range, then the word-related information of historical texts belonging to the same type as the first type of text is determined as the word-related information of the first type of text. Wherein, the minimum value within the first quantity range is greater than the maximum value within the second quantity range.
5. The method according to claim 1, characterized in that, The step of extracting multi-level features from the first type of text based on the complexity information to obtain multi-level text features includes: The first type of text is encoded in multiple levels to obtain multi-level encoded features; Based on the complexity information, the multi-level encoded features are decoded in multiple levels to obtain multi-level text features.
6. The method according to claim 5, characterized in that, The step of performing multi-level decoding on the multi-level encoded features based on the complexity information to obtain multi-level text features includes: The complexity information is mapped and processed through a fully connected layer to obtain multiple complexity score information; Multiple gated vectors are obtained by mapping the multiple complexity score information through activation functions; Based on the multiple gated vectors, the multi-level encoded features are decoded in multiple levels to obtain multi-level text features.
7. The method according to any one of claims 1 to 5, characterized in that, The step of performing text testing based on the multi-level text features and the second type of text to obtain the text test results corresponding to the test text set includes: Global max pooling and fully connected mapping are performed on the multi-level text features and the second type of text respectively to obtain multiple field representation vectors. Based on the vector weights corresponding to the multiple field representation vectors, the multiple field representation vectors are weighted and fused to obtain a global representation vector; Based on the global representation vector, text testing is performed to obtain the text test results corresponding to the test text set.
8. A text testing device, characterized in that, The device includes: The text acquisition module is used to acquire the test text set; The text segmentation module is used to segment a first type of text and a second type of text from the test text set, wherein the text field length of the first type of text is greater than the text field length of the second type of text; The complexity determination module is used to generate complexity information of the first type of text based on the word features corresponding to each word in the first type of text. The feature extraction module is used to perform multi-level feature extraction on the first type of text based on the complexity information to obtain multi-level text features; The text testing module is used to perform text testing based on the multi-level text features and the second type of text, and obtain the text test results corresponding to the test text set.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.