CN113011164B - Data quality detection method, device, electronic equipment and medium - Google Patents
Data quality detection method, device, electronic equipment and medium Download PDFInfo
- Publication number
- CN113011164B CN113011164B CN202110283424.3A CN202110283424A CN113011164B CN 113011164 B CN113011164 B CN 113011164B CN 202110283424 A CN202110283424 A CN 202110283424A CN 113011164 B CN113011164 B CN 113011164B
- Authority
- CN
- China
- Prior art keywords
- data set
- original data
- value
- confusion
- sentences
- 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.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 61
- 238000004458 analytical method Methods 0.000 claims abstract description 45
- 238000000034 method Methods 0.000 claims abstract description 34
- 238000012545 processing Methods 0.000 claims abstract description 34
- 238000012549 training Methods 0.000 claims description 25
- 230000007246 mechanism Effects 0.000 claims description 23
- 230000006870 function Effects 0.000 claims description 21
- 238000011156 evaluation Methods 0.000 claims description 16
- 238000005070 sampling Methods 0.000 claims description 15
- 238000004364 calculation method Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 8
- 238000010801 machine learning Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 239000000284 extract Substances 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 238000012512 characterization method Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000003058 natural language processing Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000003203 everyday effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000001303 quality assessment method Methods 0.000 description 1
- 238000013441 quality evaluation Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/216—Parsing using statistical methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/18—Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/211—Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0639—Performance analysis of employees; Performance analysis of enterprise or organisation operations
- G06Q10/06393—Score-carding, benchmarking or key performance indicator [KPI] analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0639—Performance analysis of employees; Performance analysis of enterprise or organisation operations
- G06Q10/06395—Quality analysis or management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Human Resources & Organizations (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Educational Administration (AREA)
- Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Strategic Management (AREA)
- Development Economics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Operations Research (AREA)
- Evolutionary Computation (AREA)
- Evolutionary Biology (AREA)
- General Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Health & Medical Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Mathematical Physics (AREA)
- Pure & Applied Mathematics (AREA)
- Game Theory and Decision Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Probability & Statistics with Applications (AREA)
- Tourism & Hospitality (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Quality & Reliability (AREA)
- General Business, Economics & Management (AREA)
- Software Systems (AREA)
- Marketing (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Databases & Information Systems (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
Abstract
The application relates to a data processing technology, and discloses a data quality detection method, which comprises the following steps: obtaining an original data set, carrying out fluency processing on the original data set by using a pre-constructed fluency analysis model to obtain a fluency value, carrying out confusion analysis on the original data set by using a pre-constructed language model to obtain a confusion value, carrying out accuracy detection processing on the original data set by using a pre-constructed grammar detection model to obtain an accuracy value, and carrying out matching degree detection on dialogue data in the original data set by using a pre-constructed supervision model to obtain a matching degree value; and analyzing and obtaining the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching degree value. The application also relates to blockchain techniques, the raw dataset quality scores may be stored in blockchain nodes. The application also discloses a data quality detection device, electronic equipment and a storage medium. The application can improve the accuracy of data quality detection.
Description
Technical Field
The present application relates to the field of data processing, and in particular, to a data quality detection method, apparatus, electronic device, and computer readable storage medium.
Background
The dialogue is a behavior which can happen every day, the quality of dialogue data has important significance for evaluating the whole dialogue data set, at present, the main modes of evaluating the dialogue data set in academic circles and industry are manual evaluation and automatic evaluation based on a machine learning model, the subjectivity of the manual evaluation mode is strong, a data quality inspector is required to have higher concentration and business background knowledge level, and in addition, the cost of the manual evaluation mode is higher in consideration of factors such as labor cost, time and the like. The automatic evaluation of the statistical or machine learning model considers that the dialogue data and the general corpus distribution are different, and the evaluation result tends to underestimate the quality of the data set. In general, current dialogue dataset quality assessment schemes also consider fewer dimensions, resulting in poor accuracy of data quality detection.
Disclosure of Invention
The application provides a data quality detection method, a data quality detection device, electronic equipment and a computer readable storage medium, and mainly aims to solve the problem that dimensions are less in dialogue data set quality evaluation.
In order to achieve the above object, the present application provides a data quality detection method, including:
obtaining an original data set, wherein the original data set comprises dialogue data;
randomly extracting a preset number of sentences from the original data set by using a preset sampling method, scoring the smoothness of the sentences, and obtaining the smoothness value of the original data set according to the smoothness score;
performing confusion analysis on the original data set by using a pre-constructed language model with an attention adding mechanism to obtain a confusion value of the original data set;
dividing the text in the original data set into N sentences, detecting the N sentences by using a pre-constructed grammar detection model, counting to obtain M sentences without grammar errors, and calculating to obtain the correctness value of the original data set;
training a classifier containing positive and negative examples to obtain a supervision model, and detecting the matching degree of dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set;
and analyzing and obtaining the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching degree value.
Optionally, the randomly extracting a preset number of sentences from the original dataset by using a preset sampling method, scoring the smoothness of the sentences, and obtaining the smoothness value of the original dataset according to the smoothness score, including:
randomly extracting a preset number of sentences from the original data set by using a preset sampling method to obtain sentence subsets;
outputting the sentence set to a user, prompting the user to execute scoring on each sentence in the sentence set based on subjective feeling during reading, and obtaining scoring set according to the scoring of the user;
performing average value processing on the evaluation diversity to obtain an average value of the evaluation diversity;
and carrying out per unit processing on the average value to obtain the fluency value of the original data set.
Optionally, the performing per unit processing on the average value to obtain a fluency value of the original data set includes:
presetting a per unit value;
and dividing the average value equally according to the per unit value to obtain the fluency value of the original data set.
Optionally, before the confusion analysis is performed on the original data set by using the pre-constructed language model with the attention adding mechanism to obtain the confusion value of the original data set, the method further includes:
constructing an original BERT model;
adding an attention mechanism into the original BERT model to obtain a primary BERT model;
and connecting the primary BERT model by utilizing a pre-constructed classification function to obtain the language model.
Optionally, the performing confusion analysis on the original data set by using a pre-constructed language model to obtain a confusion value of the original data set includes:
calculating a distributed representation of text in the original dataset using the primary BERT model and calculating a probability distribution p (token) over time of words or phrases in the text using the classification function t );
And calculating the confusion degree value of the original data set by using a first preset formula.
Optionally, the calculating the confusion value of the original data set by using a first preset formula includes:
calculating the confusion degree value by using the following first preset formula:
wherein T is the total number of all words or words in the text.
Optionally, training a classifier including positive and negative examples to obtain a supervision model, and performing matching degree detection on dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set, where the matching degree value includes:
constructing a classifier training data set containing positive and negative examples by using dialogue data in a preset field;
training a classifier by using the training data set to obtain a supervision model;
each pair of dialogue data in the original data set is obtained, and the matching degree of the dialogue data is calculated by using the supervision model;
and calculating and obtaining the matching degree value of the original data set by using a second preset formula.
In order to solve the above problems, the present application also provides a data quality detection apparatus, the apparatus comprising:
the system comprises an original data set acquisition module, a data processing module and a data processing module, wherein the original data set acquisition module is used for acquiring an original data set, and the original data set comprises dialogue data;
the fluency analysis module is used for randomly extracting a preset number of sentences from the original data set by using a preset sampling method, scoring the fluency of the sentences, and obtaining the fluency value of the original data set according to the fluency score;
the confusion analysis module is used for carrying out confusion analysis on the original data set by utilizing a pre-constructed language model with an attention adding mechanism to obtain a confusion value of the original data set;
the correctness analysis module is used for segmenting the text in the original data set into N sentences, detecting the N sentences by using a pre-constructed grammar detection model, counting to obtain M sentences without grammar errors, and calculating to obtain a correctness value of the original data set;
the matching degree analysis module is used for obtaining a supervision model by training a classifier containing positive and negative examples, and carrying out matching degree detection on dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set;
and the quality score calculation module is used for analyzing and obtaining the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching value.
In order to solve the above-mentioned problems, the present application also provides an electronic apparatus including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the data quality detection method described above.
In order to solve the above-mentioned problems, the present application also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-mentioned data quality detection method.
According to the embodiment of the application, the original data set is subjected to fluency processing to obtain a fluency value; performing confusion degree analysis on the original data set to obtain a confusion degree value; performing accuracy detection processing on the original data set to obtain an accuracy value; performing matching degree detection on dialogue data in the original data set to obtain a matching degree value; and analyzing and obtaining the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching value. According to the embodiment of the application, the dialogue data is analyzed and calculated from four dimensions of fluency, confusion, accuracy and matching degree of the dialogue data, so that the quality score of the dialogue data is obtained. Therefore, the data quality detection method, the data quality detection device and the computer readable storage medium can improve the accuracy of the data quality detection method.
Drawings
Fig. 1 is a flow chart of a data quality detection method according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating one of the steps in the data quality detection method shown in FIG. 1;
FIG. 3 is a schematic block diagram of a data quality detecting apparatus according to an embodiment of the present application;
fig. 4 is a schematic diagram of an internal structure of an electronic device for implementing a data quality detection method according to an embodiment of the present application;
the achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The embodiment of the application provides a data quality detection method. The execution body of the data quality detection method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the data quality detection method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Referring to fig. 1, a flow chart of a data quality detection method according to an embodiment of the present application is shown. In this embodiment, the data quality detection method includes:
s1, acquiring an original data set, wherein the original data set comprises dialogue data.
In the embodiment of the application, the original data set comprises dialogue data, wherein the dialogue data is data generated in a human interaction process in a service scene and is important data for training a human-computer interaction system.
Preferably, the embodiment of the application can utilize the python sentence with the data grabbing function to grab data from the Internet containing various data, so as to obtain an original data set.
S2, randomly extracting a preset number of sentences from the original data set by using a preset sampling method, scoring the smoothness of the sentences, and obtaining the smoothness value of the original data set according to the smoothness score.
In the embodiment of the present application, referring to fig. 2, the randomly extracting a preset number of sentences from the original data set by using a preset sampling method, scoring the smoothness of the sentences, and obtaining a smoothness value of the original data set according to the smoothness score includes:
s21, randomly extracting a preset number of sentences from the original data set by using a preset sampling method to obtain a sentence subset S= (S) 1 ,…,s K ) Where K is the number of sentences extracted.
S22, outputting the sentence set to a user, prompting the user to score each sentence in the sentence set based on subjective feeling during reading, and obtaining scoring set F= (F) according to the scores of the user 1 ,…,f K );
S23, carrying out average value processing on the evaluation diversity to obtain an average value of the evaluation diversity;
s24, carrying out per unit processing on the average value to obtain the fluency value of the original data set.
Preferably, the embodiment of the application uses the following mean formula to perform mean processing on the evaluation diversity:
wherein,,is the average value, K is the number of sentences, f k Is the score for the kth sentence.
In detail, the embodiment of the application uses the preset value as the per unit value to perform per unit processing on the average value:
presetting a per unit value;
and dividing the average value equally according to the per unit value to obtain the fluency value of the original data set.
Preferably, the per unit value in the embodiment of the present application may be 5.
In detail, the per unit processing is performed on the mean value to avoid the influence of dimension, and the accuracy of subsequent data calculation is ensured.
S3, performing confusion degree analysis on the original data set by using a pre-constructed language model with an attention adding mechanism to obtain a confusion degree value of the original data set.
In another embodiment of the present application, before the performing the confusion analysis on the original data set by using the pre-constructed language model with the attention adding mechanism to obtain the confusion value of the original data set, the method further includes:
step A: constructing an original BERT (BidirectionalEncoderRepresentationsfrom Transformer) model;
and (B) step (B): adding an attention mechanism into the original BERT model to obtain a primary BERT model;
step C: and connecting the primary BERT model by utilizing a pre-constructed classification function to obtain the language model.
The BERT model is a language characterization model.
The Attention mechanism (Attention) is a data processing method in machine learning, and is widely applied to various machine learning tasks such as natural language processing, image recognition, voice recognition and the like.
Specifically, the adding of the attention mechanism within the original BERT model is adding the attention mechanism to a hidden layer in the original BERT model to better extract key information.
Preferably, the classification function may be a softmax function.
Wherein the language model is trained and tested by classifying the raw dataset using the softmax classifier, thereby enabling confusion analysis.
Specifically, the performing confusion analysis on the original data set by using the pre-constructed language model with the attention adding mechanism to obtain a confusion value of the original data set includes:
calculating a distributed representation of text in the original dataset using the primary BERT model and calculating a probability distribution p (token) over time of words or phrases in the text using the classification function t ) The method comprises the steps of carrying out a first treatment on the surface of the And calculating a confusion value PP(s) of the original data set using a first preset formula:
wherein T is the total number of all words or words in the text.
S4, segmenting the text in the original data set into N sentences, detecting the N sentences by using a pre-constructed grammar detection model, counting to obtain M sentences without grammar errors, and calculating to obtain the correctness value of the original data set.
In the embodiment of the application, the text in the original data set is segmented into N sentences, the N sentences are detected by using a pre-constructed grammar detection model, M sentences without grammar errors are obtained through statistics, the correctness value of the original data set is obtained through calculation,
calculating the correctness value of the original data set by using the following correctness calculation formula:
where precision is accuracy, M is the number of sentences without grammar errors, and N is the number of sentence subsets.
S5, training a classifier containing positive and negative examples to obtain a supervision model, and detecting the matching degree of dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set.
In the embodiment of the present application, a supervision model is obtained by training a classifier including positive and negative examples, and the matching degree detection is performed on dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set, including:
constructing a classifier training data set containing positive and negative examples by using dialogue data in a preset field;
training a classifier by using the training data set to obtain a supervision model;
acquiring each pair of corresponding data (s n-1 s n ) Calculating the dialogue data(s) using the supervision model (s n-1 s n ) Matching degree(s) n matchs n-1 );
Calculating to obtain a matching degree value of the original data set by using the following second preset formula:
wherein, match score is the matching degree, N is the total number in the original data set, s n Sum s n-1 For any two sentences in the original dataset.
S6, analyzing and obtaining the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching degree value.
In the embodiment of the present application, the analyzing to obtain the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching value includes:
score=α 1 *fluency+α 2 *perplexity+α 3 *precision+α 4 *matchScore
wherein score is a quality score, fluency is a fluency, superplexity is a confusion, precision is a correctness, match score is a matching degree, α 1 、α 2 、α 3 And alpha 4 Are all preset parameters.
According to the embodiment of the application, the data quality is judged according to the quality score of the original data set, when the quality score of the original data set is larger than the preset score threshold value, the data quality level of the original data set is high, and when the quality score of the original data set is smaller than or equal to the preset score threshold value, the data quality level of the original data set is low.
In one embodiment of the application, the raw dataset quality score may be stored in a blockchain node.
According to the embodiment of the application, the original data set is subjected to fluency processing to obtain a fluency value; performing confusion degree analysis on the original data set to obtain a confusion degree value; performing accuracy detection processing on the original data set to obtain an accuracy value; performing matching degree detection on dialogue data in the original data set to obtain a matching degree value; and analyzing and obtaining the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching value. According to the embodiment of the application, the dialogue data is analyzed and calculated from four dimensions of fluency, confusion, accuracy and matching degree of the dialogue data, so that the quality score of the dialogue data is obtained. Therefore, the application can improve the accuracy of the data quality detection method.
Fig. 3 is a schematic block diagram of the data quality detecting apparatus according to the present application.
The data quality detection apparatus 100 of the present application may be mounted in an electronic device. Depending on the implemented functionality, the data quality detection apparatus 100 may include an original data set acquisition module 101, a fluency analysis module 102, a confusion analysis module 103, a correctness analysis module 104, a matching analysis module 105, and a quality score calculation module 106. The module of the application, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the original data set obtaining module 101 is configured to obtain an original data set, where the original data set includes dialogue data;
the fluency analysis module 102 is configured to randomly extract a preset number of sentences from the original dataset by using a preset sampling method, score the fluency of the sentences, and obtain a fluency value of the original dataset according to the fluency score;
the confusion analysis module 103 is configured to perform confusion analysis on the original data set by using a pre-constructed language model with an attention adding mechanism, so as to obtain a confusion value of the original data set;
the correctness analysis module 104 is configured to segment the text in the original dataset into N sentences, detect the N sentences by using a pre-constructed grammar detection model, count M sentences without grammar errors, and calculate a correctness value of the original dataset;
the matching degree analysis module 105 is configured to obtain a supervision model by training a classifier including positive and negative examples, and perform matching degree detection on dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set;
the quality score calculation module 106 is configured to analyze and obtain the quality score of the original dataset according to the fluency value, the confusion value, the correctness value and the matching value.
In detail, each module in the data quality detection apparatus 100, when executed by a processor of an electronic device, may implement a data quality detection method including the steps of:
step one, the raw data set obtaining module 101 obtains a raw data set, where the raw data set includes dialogue data.
In the embodiment of the application, the original data set comprises dialogue data, wherein the dialogue data is data generated in a human interaction process in a service scene and is important data for training a human-computer interaction system.
Preferably, the embodiment of the application can utilize the python sentence with the data grabbing function to grab from the Internet containing various data to obtain the original data set.
Step two, the fluency analysis module 102 randomly extracts a preset number of sentences from the original data set by using a preset sampling method, and the sentences are subjected to fluency scoring to obtain the fluency value of the original data set according to the fluency scoring.
In the embodiment of the present application, the fluency analysis module 102 performs fluency processing on the original data set by:
step a: randomly extracting a preset number of sentences from the original data set by using a preset sampling method to obtain a sentence subset S= (S) 1 ,…,s K ) Where K is the number of sentences extracted.
Step b: outputting the sentence set to a user, prompting the user to score each sentence in the sentence set based on subjective feeling during reading, and obtaining scoring set F= (F) according to the scores of the user 1 ,…,f K );
Step c: performing average value processing on the evaluation diversity to obtain an average value of the evaluation diversity;
step d: and carrying out per unit processing on the average value to obtain the fluency value of the original data set.
Preferably, the embodiment of the application uses the following mean formula to perform mean processing on the evaluation diversity:
wherein,,is the average value, K is the number of sentences, f k Is the score for the kth sentence.
In detail, the embodiment of the application uses the preset value as the per unit value to perform per unit processing on the average value:
presetting a per unit value;
and dividing the average value equally according to the per unit value to obtain the fluency value of the original data set.
Preferably, the per unit value in the embodiment of the present application may be 5.
In detail, the per unit processing is performed on the mean value to avoid the influence of dimension, and the accuracy of subsequent data calculation is ensured.
And thirdly, the confusion analysis module 103 performs confusion analysis on the original data set by utilizing a pre-constructed language model with an attention adding mechanism to obtain a confusion value of the original data set.
In another embodiment of the present application, the confusion analysis module 103 is further configured to:
constructing an original BERT (BidirectionalEncoderRepresentationsfrom Transformer) model; adding an attention mechanism into the original BERT model to obtain a primary BERT model; and connecting the primary BERT model by utilizing a pre-constructed classification function to obtain the language model. In the embodiment of the application, the BERT model is a language characterization model.
The Attention mechanism (Attention) is a data processing method in machine learning, and is widely applied to various machine learning tasks such as natural language processing, image recognition, voice recognition and the like.
Specifically, the adding of the attention mechanism within the original BERT model is adding the attention mechanism to a hidden layer in the original BERT model to better extract key information.
Further, the classification function may be a softmax function.
Wherein the language model is trained and tested by classifying the raw dataset using the softmax classifier, thereby enabling confusion analysis.
Specifically, the confusion analysis module 103 performs a confusion analysis on the original data set to obtain a confusion value of the original data set by using the following operations:
calculating a distributed representation of text in the original dataset using the primary BERT model and calculating a probability distribution p (token) over time of words or phrases in the text using the classification function t ) The method comprises the steps of carrying out a first treatment on the surface of the And calculating a confusion value PP(s) of the original data set using a first preset formula:
wherein T is the total number of all words or words in the text.
And step four, the correctness analysis module 104 segments the text in the original data set into N sentences, detects the N sentences by using a pre-constructed grammar detection model, calculates M sentences without grammar errors, and calculates the correctness value of the original data set.
In the embodiment of the present application, the correctness analysis module 104 performs the correctness detection processing on the original data set by the following operations to obtain a correctness value of the original data set:
segmenting the text in the original dataset into N sentences;
detecting the N sentences by utilizing a pre-constructed grammar error detection model, and counting to obtain M sentences without grammar errors;
calculating the correctness value of the original data set by using the following correctness calculation formula:
where precision is accuracy, M is the number of sentences without grammar errors, and N is the number of sentence subsets.
And fifthly, the matching degree analysis module 105 obtains a supervision model by training a classifier containing positive and negative examples, and performs matching degree detection on dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set.
In the embodiment of the present application, the matching degree analysis module 105 performs matching degree detection on the dialogue data in the original data set to obtain a matching degree value of the original data set by:
constructing a classifier training data set containing positive and negative examples by using dialogue data in a preset field;
training a classifier by using the training data set to obtain a supervision model;
acquiring each pair of corresponding data (s n-1 s n ) Calculating the dialogue data(s) using the supervision model (s n-1 s n ) Matching degree(s) n matchs n-1 );
Calculating to obtain a matching degree value of the original data set by using the following second preset formula:
wherein, match score is the matching degree, N is the total number in the original data set, s n Sum s n-1 For any two sentences in the original dataset.
Step six, the quality score calculating module 106 analyzes and obtains the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching value.
In the embodiment of the present application, the quality score calculation module 106 calculates the quality score of the original dataset according to the following formula:
score=α 1 *fluency+α 2 *perplexity+α 3 *precision+α 4 *matchScore
wherein Score is a quality Score, fluency is a fluency, superplexity is a confusion, precision is a correctness, match Score is a matching degree, α 1 、α 2 、α 3 And alpha 4 Are all preset parameters.
According to the embodiment of the application, the data quality is judged according to the quality score of the original data set, when the quality score of the original data set is larger than the preset score threshold value, the data quality level of the original data set is high, and when the quality score of the original data set is smaller than or equal to the preset score threshold value, the data quality level of the original data set is low.
Fig. 4 is a schematic structural diagram of an electronic device for implementing the data quality detection method according to the present application.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a data quality detection program 12, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may in other embodiments also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of the data quality detection program 12, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects respective parts of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device 1 and processes data by running or executing programs or modules (for example, executing a data quality detection program or the like) stored in the memory 11, and calling data stored in the memory 11.
The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
Fig. 4 shows only an electronic device with components, it being understood by a person skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for supplying power to each component, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
Further, the electronic device 1 may also comprise a network interface, optionally the network interface may comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the electronic device 1 and other electronic devices.
The electronic device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The data quality detection program 12 stored in the memory 11 in the electronic device 1 is a combination of instructions that, when executed in the processor 10, may implement:
obtaining an original data set, wherein the original data set comprises dialogue data;
randomly extracting a preset number of sentences from the original data set by using a preset sampling method, scoring the smoothness of the sentences, and obtaining the smoothness value of the original data set according to the smoothness score;
performing confusion analysis on the original data set by using a pre-constructed language model with an attention adding mechanism to obtain a confusion value of the original data set;
dividing the text in the original data set into N sentences, detecting the N sentences by using a pre-constructed grammar detection model, counting to obtain M sentences without grammar errors, and calculating to obtain the correctness value of the original data set;
training a classifier containing positive and negative examples to obtain a supervision model, and detecting the matching degree of dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set;
and analyzing and obtaining the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching degree value.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any accompanying diagram representation in the claims should not be considered as limiting the claim concerned.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application and not for limiting the same, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present application without departing from the spirit and scope of the technical solution of the present application.
Claims (6)
1. A method for detecting data quality, the method comprising:
obtaining an original data set, wherein the original data set comprises dialogue data;
randomly extracting a preset number of sentences from the original data set by using a preset sampling method, scoring the smoothness of the sentences, and obtaining the smoothness value of the original data set according to the smoothness score;
performing confusion analysis on the original data set by using a pre-constructed language model with an attention adding mechanism to obtain a confusion value of the original data set;
dividing the text in the original data set into N sentences, detecting the N sentences by using a pre-constructed grammar detection model, counting to obtain M sentences without grammar errors, and calculating to obtain the correctness value of the original data set;
training a classifier containing positive and negative examples to obtain a supervision model, and detecting the matching degree of dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set;
analyzing and obtaining the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching value;
the step of randomly extracting a preset number of sentences from the original data set by using a preset sampling method, scoring the smoothness of the sentences, and obtaining the smoothness value of the original data set according to the smoothness score comprises the following steps: randomly extracting a preset number of sentences from the original data set by using a preset sampling method to obtain sentence subsets; outputting the sentence set to a user, prompting the user to execute scoring on each sentence in the sentence set based on subjective feeling during reading, and obtaining scoring set according to the scoring of the user; performing average value processing on the evaluation diversity to obtain an average value of the evaluation diversity; performing per unit processing on the average value to obtain a fluency value of the original data set;
the method for analyzing the confusion degree of the original data set by using the language model of the pre-constructed attention adding mechanism further comprises the following steps before the confusion degree value of the original data set is obtained: constructing an original BERT model; adding an attention mechanism into the original BERT model to obtain a primary BERT model; connecting the primary BERT model by utilizing a pre-constructed classification function to obtain the language model;
the confusion degree analysis is carried out on the original data set by using the pre-constructed language model with the attention adding mechanism to obtain the confusion degree value of the original data set, and the method comprises the following steps: calculating a distributed representation of text in the original dataset using the primary BERT model and calculating a probability distribution p (token) over time of words or phrases in the text using the classification function t ) The method comprises the steps of carrying out a first treatment on the surface of the Calculating a confusion degree value of the original data set by using a first preset formula;
the calculating the confusion degree value of the original data set by using a first preset formula comprises the following steps:
calculating the confusion degree value by using the following first preset formula:
wherein T is the total number of all words or words in the text.
2. The method of claim 1, wherein said subjecting the average value to per unit processing to obtain a fluency value of the original dataset comprises:
presetting a per unit value;
and dividing the average value according to the per unit value to obtain the fluency value of the original data set.
3. The method for detecting data quality according to claim 1, wherein the step of obtaining a supervision model by training a classifier including positive and negative examples, and performing matching degree detection on dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set, comprises:
constructing a classifier training data set containing positive and negative examples by using dialogue data in a preset field;
training a classifier by using the training data set to obtain a supervision model;
each pair of dialogue data in the original data set is obtained, and the matching degree of the dialogue data is calculated by using the supervision model;
and calculating and obtaining the matching degree value of the original data set by using a second preset formula.
4. A data quality detection apparatus for implementing the data quality detection method according to any one of claims 1 to 3, characterized in that the apparatus comprises:
the system comprises an original data set acquisition module, a data processing module and a data processing module, wherein the original data set acquisition module is used for acquiring an original data set, and the original data set comprises dialogue data;
the fluency analysis module is used for randomly extracting a preset number of sentences from the original data set by using a preset sampling method, scoring the fluency of the sentences, and obtaining the fluency value of the original data set according to the fluency score;
the confusion analysis module is used for carrying out confusion analysis on the original data set by utilizing a pre-constructed language model with an attention adding mechanism to obtain a confusion value of the original data set;
the correctness analysis module is used for segmenting the text in the original data set into N sentences, detecting the N sentences by using a pre-constructed grammar detection model, counting to obtain M sentences without grammar errors, and calculating to obtain a correctness value of the original data set;
the matching degree analysis module is used for obtaining a supervision model by training a classifier containing positive and negative examples, and carrying out matching degree detection on dialogue data in the original data set by using the supervision model to obtain a matching degree value of the original data set;
and the quality score calculation module is used for analyzing and obtaining the quality score of the original data set according to the fluency value, the confusion value, the correctness value and the matching value.
5. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the data quality detection method of any one of claims 1 to 3.
6. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the data quality detection method according to any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110283424.3A CN113011164B (en) | 2021-03-17 | 2021-03-17 | Data quality detection method, device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110283424.3A CN113011164B (en) | 2021-03-17 | 2021-03-17 | Data quality detection method, device, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113011164A CN113011164A (en) | 2021-06-22 |
CN113011164B true CN113011164B (en) | 2023-10-20 |
Family
ID=76408728
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110283424.3A Active CN113011164B (en) | 2021-03-17 | 2021-03-17 | Data quality detection method, device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113011164B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114330556A (en) * | 2021-12-29 | 2022-04-12 | 绍兴兰红智能科技有限公司 | BERT model scoring method based on attention and validity degree |
CN116227894B (en) * | 2023-05-06 | 2023-07-21 | 苏州市世为科技有限公司 | Man-machine interaction operation quality supervision system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111832278A (en) * | 2020-06-15 | 2020-10-27 | 北京百度网讯科技有限公司 | Document fluency detection method and device, electronic equipment and medium |
CN112380845A (en) * | 2021-01-15 | 2021-02-19 | 鹏城实验室 | Sentence noise design method, equipment and computer storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4878471B2 (en) * | 2005-11-02 | 2012-02-15 | キヤノン株式会社 | Information processing apparatus and control method thereof |
JP5526396B2 (en) * | 2008-03-11 | 2014-06-18 | クラリオン株式会社 | Information search apparatus, information search system, and information search method |
US11170761B2 (en) * | 2018-12-04 | 2021-11-09 | Sorenson Ip Holdings, Llc | Training of speech recognition systems |
-
2021
- 2021-03-17 CN CN202110283424.3A patent/CN113011164B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111832278A (en) * | 2020-06-15 | 2020-10-27 | 北京百度网讯科技有限公司 | Document fluency detection method and device, electronic equipment and medium |
CN112380845A (en) * | 2021-01-15 | 2021-02-19 | 鹏城实验室 | Sentence noise design method, equipment and computer storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113011164A (en) | 2021-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113051356B (en) | Open relation extraction method and device, electronic equipment and storage medium | |
CN113378970B (en) | Sentence similarity detection method and device, electronic equipment and storage medium | |
WO2022160449A1 (en) | Text classification method and apparatus, electronic device, and storage medium | |
CN112380343A (en) | Problem analysis method, problem analysis device, electronic device and storage medium | |
CN112270196A (en) | Entity relationship identification method and device and electronic equipment | |
CN113628043B (en) | Complaint validity judging method, device, equipment and medium based on data classification | |
CN114461777B (en) | Intelligent question-answering method, device, equipment and storage medium | |
CN114781402B (en) | Method, device, electronic device and readable storage medium for identifying medical consultation intention | |
CN113887930B (en) | Question-answering robot health evaluation method, device, equipment and storage medium | |
CN113064994A (en) | Conference quality evaluation method, device, equipment and storage medium | |
CN113011164B (en) | Data quality detection method, device, electronic equipment and medium | |
CN113935331A (en) | Abnormal semantic truncation detection method, device, equipment and medium | |
CN116956896B (en) | Text analysis method, system, electronic equipment and medium based on artificial intelligence | |
CN115081025A (en) | Sensitive data management method and device based on digital middlebox and electronic equipment | |
CN112347739A (en) | Applicable rule analysis method, device, electronic device and storage medium | |
CN112579781B (en) | Text classification method, device, electronic equipment and medium | |
CN117390213A (en) | Training method of image and text retrieval model based on OSCAR and method of implementing image and text retrieval | |
CN114662477B (en) | Method, device and storage medium for generating deactivated word list based on Chinese medicine dialogue | |
CN115471775A (en) | Information verification method, device and equipment based on screen recording video and storage medium | |
CN112632260B (en) | Intelligent question answering method, device, electronic device and computer readable storage medium | |
WO2021208700A1 (en) | Method and apparatus for speech data selection, electronic device, and storage medium | |
CN114186028A (en) | Consultation work order processing method, device, equipment and storage medium | |
CN113808616A (en) | Voice compliance detection method, device, equipment and storage medium | |
CN113704405B (en) | Quality inspection scoring method, device, equipment and storage medium based on recorded content | |
CN116579349A (en) | Text semantic segmentation method, device, equipment 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |