Method for identifying target objects in character-separated value files

Feature extraction and recognition of CSV files through machine learning models solves the problem of identifying the diversity of CSV file formats, enables automatic recognition and processing of files in any format, and improves processing efficiency and accuracy.

CN118552966BActive Publication Date: 2024-10-29JISHU (HANGZHOU) TECH CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202411018831.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-10-29
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

It is difficult for existing technology to automatically identify and process CSV files in different formats, resulting in the need for manual analysis and specific code writing, which lacks universality and efficiency.

Method used

A machine learning model is used to extract and identify features of CSV files. The target object recognition model is trained through training samples and sample labels, and the delimiters and headers in the file are identified to realize the identification of CSV files in any format.

Benefits of technology

It improves the automation, accuracy and efficiency of CSV file processing, saves manpower and material resources, and is suitable for various CSV file formats.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552966B_ABST
    Figure CN118552966B_ABST
Patent Text Reader

Abstract

An embodiment of the present specification provides a target object recognition method for a character separated value file, wherein the method comprises: determining a character separated value file to be recognized; performing feature extraction on the character separated value file to be recognized according to a preset feature extraction method to obtain a target feature vector; inputting the target feature vector into a corresponding target object recognition model to obtain a target object corresponding to the target feature vector, wherein the target object recognition model is obtained by training with feature vector samples corresponding to character separated value file training samples and sample labels corresponding to the character separated value file training samples, and the target object recognition model is a machine learning model, which can utilize the target object recognition model to recognize character separated value files of any format, has universal applicability, and can not only save a large amount of manpower and material resources, but also improve the processing efficiency, accuracy and reliability of processing data in character separated value files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a method for identifying a target object of a character separated value file. Background Art

[0002] CSV (Comma-Separated Values, also known as character-separated values) files are a common data storage format, widely used in various business scenarios, including data analysis, database import / export, data migration, etc. However, there is no reasonable standard for the data format in CSV files, and there are subtle differences in the data read and written by different applications; for example, the delimiters in CSV files can be commas, tabs, or other characters, and there is no unified standard for whether the headers and fields in the file are quoted, and whether each field is enclosed in quotation marks. If it is enclosed, there is no unified standard for whether it is enclosed in single quotation marks or double quotation marks.

[0003] The field separator in a CSV file can be any character, which may cause difficulties when manually or automatically parsing the CSV file. Whether there is a header in a CSV file can usually only be determined through manual analysis. Therefore, a target object recognition method for character-separated value files is urgently needed to solve the problem that manual analysis, judgment, intervention or writing of specific code is currently required to parse CSV files of different formats. Summary of the invention

[0004] In view of this, the embodiments of this specification provide a method for identifying a target object of a character-separated value file and a method for training a target object identification model. One or more embodiments of this specification also relate to a device for identifying a target object of a character-separated value file, a device for training a target object identification model, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of the present specification, a method for identifying a target object of a character separated value file is provided, comprising:

[0006] Determine the character-separated value file to be recognized;

[0007] According to a preset feature extraction method, feature extraction is performed on the character-separated value file to be identified to obtain a target feature vector;

[0008] The target feature vector is input into a corresponding target object recognition model to obtain a target object corresponding to the target feature vector, wherein the target object recognition model is obtained by training with feature vector samples corresponding to character separation value file training samples and sample labels corresponding to the character separation value file training samples, and the target object recognition model is a machine learning model.

[0009] According to a second aspect of an embodiment of this specification, a target object recognition device for a character-separated value file is provided, comprising:

[0010] A determination module, configured to determine a character-separated value file to be identified;

[0011] A vector acquisition module is configured to perform feature extraction on the character-separated value file to be identified according to a preset feature extraction method to obtain a target feature vector;

[0012] The object acquisition module is configured to input the target feature vector into a corresponding target object recognition model to obtain a target object corresponding to the target feature vector, wherein the target object recognition model is obtained by training with feature vector samples corresponding to character separation value file training samples and sample labels corresponding to the character separation value file training samples, and the target object recognition model is a machine learning model.

[0013] According to a third aspect of an embodiment of this specification, a target object recognition model training method is provided, comprising:

[0014] Determine a character-separated value file training sample and a sample label corresponding to the character-separated value file training sample;

[0015] According to a preset feature extraction method, feature extraction is performed on the character-separated value file training sample to obtain a feature vector sample;

[0016] A target object recognition model is obtained by training using a classification algorithm according to the feature vector samples and the sample labels.

[0017] According to a fourth aspect of an embodiment of this specification, a target object recognition model training device is provided, comprising:

[0018] A determination module is configured to determine a character-separated value file training sample and a sample label corresponding to the character-separated value file training sample;

[0019] A vector acquisition module is configured to perform feature extraction on the character-separated value file training sample according to a preset feature extraction method to obtain a feature vector sample;

[0020] The training module is configured to obtain a target object recognition model by training using a classification algorithm according to the feature vector samples and the sample labels.

[0021] According to a fifth aspect of an embodiment of this specification, a computing device is provided, including:

[0022] Memory and processor;

[0023] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the target object recognition method of the character-separated value file mentioned above or the steps of the target object recognition model training method mentioned above are implemented.

[0024] According to the sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, which, when executed by a processor, implement the target object recognition method of the above-mentioned character separated value file, or implement the steps of the above-mentioned target object recognition model training method.

[0025] According to the seventh aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the target object recognition method of the above-mentioned character separated value file, or implement the steps of the above-mentioned target object recognition model training method.

[0026] The target object recognition method for a character separated value file provided in an embodiment of the present specification determines a character separated value file to be recognized; performs feature extraction on the character separated value file to be recognized according to a preset feature extraction method to obtain a target feature vector; inputs the target feature vector into a corresponding target object recognition model to obtain a target object corresponding to the target feature vector, wherein the target object recognition model is obtained by training with feature vector samples corresponding to character separated value file training samples and sample labels corresponding to the character separated value file training samples, and the target object recognition model is a machine learning model.

[0027] Based on this, the target object recognition method of the character separated value file extracts features of the character separated value file to be recognized, inputs the obtained target feature vector into the target object recognition model, and obtains the target object corresponding to the target feature vector. When the character separated value file is processed by the target object recognition model, the character separated value file of any format can be recognized, and it has universality and can not only save a lot of manpower and material resources, but also improve the processing efficiency, accuracy and reliability of processing data in the character separated value file. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1It is a scene schematic diagram of a target object recognition method of a character-separated value file provided by an embodiment of the present specification;

[0029] Figure 2 is a flow chart of a method for identifying a target object of a character-separated value file provided by an embodiment of the present specification;

[0030] Figure 3 It is a schematic diagram of obtaining a delimiter feature vector of a character-separated value file provided by an embodiment of the present specification;

[0031] Figure 4 is a flow chart of a target object recognition model training method provided by an embodiment of this specification;

[0032] Figure 5 It is a process diagram of the training phase and prediction phase of a target object recognition model provided by an embodiment of this specification;

[0033] Figure 6 It is a structural schematic diagram of a target object recognition device for a character-separated value file provided by an embodiment of the present specification;

[0034] Figure 7 It is a structural schematic diagram of a target object recognition model training device provided by an embodiment of this specification;

[0035] Figure 8 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0036] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0037] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0038] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0039] In addition, it should be noted that 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, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0040] First, the terms involved in one or more embodiments of this specification are explained.

[0041] CSV: CSV is the abbreviation of "Comma-Separated Values". It is a common file format used to store bulk data. In a CSV file, each line usually represents a record, and the fields of each record are separated by some delimiter (such as a comma). Because of its simple structure and wide application, the CSV format is often used for importing and exporting data, especially between different applications or systems.

[0042] Delimiter: A delimiter is one or more characters used to distinguish or separate consecutive fields of data in a text or data stream. In a CSV file, the delimiter is usually a character such as a comma (,), tab (\t), or other character that separates different fields.

[0043] Header: The header is a line in a CSV file or other tabular data file, usually at the beginning of the file, used to describe the name or title of each field. It provides contextual information for subsequent data records so that readers or processing programs can understand the meaning of each field.

[0044] Classification Algorithms: In machine learning, a classification algorithm is a supervised learning algorithm that aims to predict the category or label of an input based on its features. Typical examples of classification problems include: whether an email is spam or not spam, whether an object in a picture is a cat or a dog, whether a patient has a certain disease, etc. Classification algorithms use labeled datasets during training and then apply this knowledge to new, unlabeled data.

[0045] Random Forest: Random Forest is an ensemble learning method that builds multiple decision trees and combines them to get more accurate and stable predictions. Random Forest gets its name from its training process, where each tree is trained on a random subset of the data. To make a prediction, Random Forest considers the predictions of all its trees and then votes on the final class (classification problems) or calculates the average (regression problems).

[0046] Decision Tree: A decision tree is a supervised learning algorithm that uses a tree structure to represent a series of decision rules. Each internal node represents a test of a feature, each branch represents a possible value for that feature, and each leaf node represents a predicted category or value. Decision trees are the basis for building random forests. They are intuitive, easy to interpret, and can be used for classification or regression tasks. When making decisions using a decision tree, you start at the root node of the tree and move down the tree based on the test results of the features until you reach a leaf node to get a prediction.

[0047] Traditional CSV parsing methods usually rely on specific rules and assumptions, but these methods may fail when faced with diverse and non-standardized CSV files, and some existing intelligent recognition solutions are usually limited to certain specific scenarios or requirements and lack universality; therefore, implementing a general CSV file parsing method based on machine learning has high practical value.

[0048] In this specification, a target object recognition method for a character-separated value file and a target object recognition model training method are provided. This specification also relates to a target object recognition device for a character-separated value file, a target object recognition model training device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0049] See also Figure 1 , Figure 1 A schematic diagram of a scenario of a method for identifying a target object of a character-separated value file provided by an embodiment of the present specification is shown.

[0050] Figure 1The method includes a client 102 and a server 104, wherein the client 102 can receive a CSV file to be identified determined by a user, and perform feature extraction on the CSV file to be identified according to a preset feature extraction method through a feature extraction module to obtain a feature vector corresponding to the CSV file to be identified; the client 102 sends the feature vector to the server 104, so that the server 104 inputs the feature vector into a target object recognition model upon receiving the feature vector to obtain a target object corresponding to the feature vector.

[0051] The target object recognition model is obtained by training the feature vector samples corresponding to the CSV file training samples and the sample labels corresponding to the CSV file training samples, and the target object recognition model is a machine learning model.

[0052] In one embodiment of the present specification, a feature extraction module may be provided in the client 102. In another embodiment, a feature extraction module may also be provided in the server 104. Specifically, the client 102 sends the CSV file to be identified to the server 104. When the server 104 receives the CSV file to be identified, the feature extraction module performs feature extraction on the CSV file to be identified according to a preset feature extraction method to obtain a feature vector corresponding to the CSV file to be identified; the feature vector is input into a target object recognition model to obtain a target object corresponding to the feature vector.

[0053] The client 102 can be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5, Hypertext Markup Language Version 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application, etc. The client 102 can be based on the software development kit (SDK) of the corresponding service provided by the server, such as developed based on the real-time communication (RTC) SDK, etc.

[0054] The client 102 may be deployed in an electronic device and may rely on the device to run or some APP in the device to run. For example, the electronic device may have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. Various other types of applications may also be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0055] The server 104 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers for background training that support models used on clients, and servers that process data sent by clients. It should be noted that the server 104 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0056] It is worth noting that the target object identification method of the character separated value file provided in the embodiment of this specification can be executed by the server 104. In other embodiments of this specification, the client 102 can also have similar functions to the server 104, so as to execute the target object identification method of the character separated value file provided in the embodiment of this specification; in other embodiments, the target object identification method of the character separated value file provided in the embodiment of this specification can also be executed jointly by the server 104 and the client 102.

[0057] The target object recognition method for a character separated value file provided in the embodiment of the present specification performs feature extraction on the character separated value file to be recognized, inputs the obtained target feature vector into a target object recognition model, and obtains a target object corresponding to the target feature vector. When the character separated value file is processed by the target object recognition model, the character separated value file of any format can be recognized. The method has universal applicability and can not only save a large amount of manpower and material resources, but also improve the processing efficiency, accuracy and reliability of processing data in the character separated value file.

[0058] See also Figure 2 , Figure 2 A flow chart of a method for identifying a target object of a character-separated value file provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0059] Step 202: Determine the character separated value file to be recognized.

[0060] The character separated value file can be understood as a CSV file, and the data in the CSV file is separated by a separator.

[0061] In actual applications, the character-separated value file to be identified is different depending on the application scenario; for example, in the database management scenario, the character-separated value file to be identified can be understood as a CSV file for data import and export; in the data migration scenario, the character-separated value file to be identified can be understood as a CSV file to be migrated when data is migrated between different systems or platforms; in the IoT (Internet of Things) device and sensor scenario, the character-separated value file to be identified can be understood as a CSV file output by different devices and sensors.

[0062] Specifically, the character separated value file to be identified is determined, and feature extraction is performed. Through the target object recognition model, the target object corresponding to the extracted feature vector is obtained to improve the processing efficiency of data processing in the character separated value file and improve the accuracy.

[0063] Step 204: According to a preset feature extraction method, feature extraction is performed on the character-separated value file to be identified to obtain a target feature vector.

[0064] Among them, the preset feature extraction method can be understood as a pre-set feature extraction method, including a separator feature extraction method and / or a header feature extraction method; accordingly, the target feature vector can be understood as a vector that characterizes the characteristics of the character separated value file to be identified, including a separator feature vector and / or a header feature vector, the separator feature vector is used to describe the characteristics of the separator in the CSV file; the header feature vector is used to describe the various characteristics of the first line and other lines in the CSV file.

[0065] Specifically, feature extraction can be performed on the character-separated value file to be identified according to the delimiter feature extraction method and / or the header feature extraction method to obtain a delimiter feature vector and / or a header feature vector corresponding to the character-separated value file to be identified.

[0066] In one or more embodiments of this specification, when the preset feature extraction method is different, the target feature vector obtained is different; the feature extraction of the character-separated value file to be identified can be selectively performed according to the delimiter feature extraction method and the header feature extraction method in the preset feature extraction method. The specific implementation method is as follows:

[0067] The preset feature extraction method includes a separator feature extraction method and a header feature extraction method;

[0068] Accordingly, the feature extraction of the character-separated value file to be identified is performed according to a preset feature extraction method to obtain a target feature vector, including:

[0069] According to the delimiter feature extraction method, feature extraction is performed on the character separation value file to be identified to obtain a delimiter feature vector;

[0070] and / or

[0071] According to the header feature extraction method, feature extraction is performed on the character-separated value file to be identified to obtain a header feature vector.

[0072] Among them, the separator feature extraction method can be understood as a method for extracting separator features of the character separation value file to be identified. The separator feature extraction method and the header feature extraction method are specifically explained in the following embodiments and will not be repeated here; the separator feature vector can be understood as a feature vector extracted using the separator feature extraction method.

[0073] The header feature extraction method can be understood as a method for extracting header features of a character-separated value file to be recognized; the header feature vector can be understood as a feature vector extracted using the header feature extraction method.

[0074] Specifically, when the delimiter feature extraction method is used to extract features from the character-separated value file to be identified, the target feature vector is the delimiter feature vector corresponding to the character-separated value file to be identified; when the header feature extraction method is used to extract features from the character-separated value file to be identified, the target feature vector is the header feature vector corresponding to the character-separated value file to be identified.

[0075] In practical applications, when it is necessary to perform feature extraction on the character-separated value file to be identified, the corresponding preset feature extraction method can be selected for feature extraction according to actual needs; for example, in the data import scenario of database management, if it has been determined that the CSV files to be imported all have headers, then there is no need to determine whether the CSV files to be imported have headers. The delimiter feature extraction method can be used to extract features from the CSV files to be imported to obtain the delimiter feature vector.

[0076] The target object recognition method for the character-separated value file provided in the embodiment of the present specification can extract the separator feature vector and the header feature vector corresponding to the character-separated value file to be recognized when the preset feature extraction method includes a separator feature extraction method and a header feature extraction method. Therefore, the corresponding feature vector can be extracted by using the corresponding feature extraction method according to actual needs, without having to extract both the separator feature and the header feature, thereby reducing the workload of the server.

[0077] In one or more embodiments of the present specification, when extracting features from a character-separated value file to be identified according to a delimiter feature extraction method, in order to make the obtained delimiter feature vector more accurate, the delimiter feature vector is obtained by calculating the minimum number of occurrences of each target delimiter in each target line. The specific implementation method is as follows:

[0078] The method for extracting the separator feature is used to extract the feature of the character-separated value file to be identified, and obtain the separator feature vector, including:

[0079] Counting the number of occurrences of each target separator in each target row of the character-separated value file to be identified;

[0080] Determine the minimum number of occurrences of each target separator in each target row;

[0081] A separator feature vector is obtained according to the minimum occurrence number of each target separator.

[0082] The target separator can be understood as any character in the ASCII (American Standard Code for Information Interchange) code 1 to 127. For example, the target separator can be all characters in the ASCII code 1-127, or all characters in the ASCII code 1-10. There is no limitation here. The ASCII code uses 7-bit binary numbers (0 to 127) to represent 128 characters, and each character corresponds to a unique ASCII code value; ASCII code 1 corresponds to character 1, ASCII code 2 corresponds to character 2... ASCII code 127 corresponds to character 127.

[0083] The target row can be understood as the first preset row in the selected CSV file. For example, the first 100 rows in the CSV file are selected, and the first 100 rows are the target rows.

[0084] Specifically, the field separator of a CSV file can be any character in ASCII code 1-127; therefore, all characters in ASCII code 1-127 are used as target separators; the number of occurrences of characters 1 to 127 in each of the first 100 rows is counted; for example, character 1 appears 9 times in the first row, 10 times in the second row, 9 times in the third row, and so on ...

[0085] In this way, it can be determined that the minimum number of occurrences of character 1 in each line is 9; the minimum number of occurrences of character 2 in each line is 1; and so on, the minimum number of occurrences of character 127 in each line is 0; based on the above determination, the minimum number of occurrences of characters 1-127 is 9, 1, 0…0, and the separator feature vector [9, 1, 0…0] is obtained.

[0086] In practical applications, after counting the number of occurrences of characters 1-127 in each line, the purpose of taking the minimum number of occurrences of characters 1-127 is to analyze which character is more meaningful. If the number of occurrences of a character in each line of the CSV file is 0, it can be preliminarily determined that the character is not the separator of the CSV file; and the purpose of not taking the maximum number of occurrences of a character is that for a certain character, the data of non-separator characters in a certain line of the CSV file may contain the character. For example, when the character is ".", the 4th line of the CSV file records decimal data such as 1.2, 6.5, etc.; at this time, the number of occurrences of the character "." in the fourth line can be 10 times, but the number of occurrences in other lines is 0; therefore, it is more reasonable to take the minimum number of occurrences of each character in each line.

[0087] The target object recognition method of the character separated value file provided in the embodiment of this specification obtains the separator feature vector by determining the minimum number of occurrences of each target separator in each target row, thereby realizing accurate extraction of the separator feature vector of the character separated value file to be recognized.

[0088] In one or more embodiments of the present specification, after determining the minimum number of occurrences of each target delimiter, the delimiter feature vector can be obtained by calculating the first feature vector and the second feature vector, so that when the delimiter feature vector is subsequently input into the target object recognition model, the model can quickly output the target object based on the first feature vector and the second feature vector. The specific implementation method is as follows:

[0089] The step of obtaining a separator feature vector according to the minimum number of occurrences of each target separator comprises:

[0090] Determine the minimum number of occurrences of each target separator as a tag array, wherein the tag array includes the minimum number of occurrences of each target separator;

[0091] Determine the maximum value in the tag array as a target value, and determine the target value and the minimum number of occurrences of the target value in the tag array as a first eigenvector;

[0092] Determine the minimum number of occurrences of values ​​greater than or less than the target value in the tag array as a second feature vector;

[0093] The separator feature vector is obtained according to the first feature vector and the second feature vector.

[0094] Continuing with the above example, in the above embodiment, it is determined that the minimum number of occurrences of characters 1-127 is 9, 1, 0…0, and the marked array is now the array [9, 1, 0…0]; the maximum value in the array is determined as the target data, that is, the value 9 is the target data.

[0095] Specifically, the purpose of taking the maximum value in the tag array is to determine which character among characters 1-127 is most likely to be the separator of the CSV file, that is, the character with the largest frequency of occurrence (number of occurrences) is most likely to be the separator of the CSV file.

[0096] In practical applications, the maximum value and the value equal to the maximum value in the marker array can be recorded as 1 and determined as the first eigenvector, and other values ​​greater than or less than the maximum value can be recorded as 0 and determined as the second eigenvector; for example, in the above marker array, the maximum value 9 is recorded as 1, and the first eigenvector is [1], and the other values ​​except the maximum value are recorded as 0, and the second eigenvector is [0, 0, ...0]; thus, according to the first eigenvector and the second eigenvector, the separator eigenvector can be obtained as [1, 0, 0, ...0].

[0097] The target object recognition method of the character-separated value file provided in the embodiment of this specification obtains the separator feature vector by determining the first feature vector and the second feature vector, which can realize the processing efficiency of the subsequent target object recognition model according to the separator feature vector and improve the recognition efficiency.

[0098] See also Figure 3 , Figure 3 A schematic diagram of obtaining a separator feature vector of a character-separated value file provided by an embodiment of the present specification is shown.

[0099] Specifically, select the first N rows of a CSV file (character separated value file), where the value N can be set according to actual needs, such as Figure 3 Select the first 100 lines of the CSV file shown at the top of the CSV file; put each line into Figure 3 The ASCII code value table of ASCII codes 1-127 shown in the middle part counts the number of times the characters corresponding to each ASCII code appear in each row to obtain a two-dimensional array, that is, Figure 3 The table shown in .

[0100] Take the character corresponding to the ASCII code as the dimension and take the minimum value of the number of occurrences of the characters in each row, such as Figure 3As shown in the figure, the character 1 corresponding to the ASCII code 1 appears 9 times in the first row, 9 times in the second row, and 10 times in the fifth row. Statistics show that the minimum value of character 1 in each row is 9, that is, the minimum value obtained by calculating (9, 9, ..., 10, ..., 12, 9); then use this minimum value as the dimension to form a new array, denoted as: D2=[9, 0, 0, ...], take the maximum value of this array: 9, denoted as: B; count which numerical elements in D2 are equal to B, record the values ​​equal to B as 1, and record the other values ​​as 0, thus obtaining a separator feature vector: [1, 0, 0, ...].

[0101] In one or more embodiments of this specification, when a header feature vector is obtained according to a header feature extraction method, in order to ensure the accuracy of the header feature vector, at least two feature extraction dimensions are selected to perform feature extraction on the CSV file. The specific implementation method is as follows:

[0102] The step of extracting features of the character-separated value file to be identified according to the header feature extraction method to obtain a header feature vector includes:

[0103] According to at least two header feature extraction dimensions, feature extraction is performed on the character-separated value file to be identified to obtain at least two initial feature vectors;

[0104] The at least two initial feature vectors are merged to obtain a header feature vector.

[0105] The header feature extraction dimension can be understood as the aspects from which the header features are extracted to obtain the header feature vector; the initial feature vector can be understood as the feature vector extracted from a single header feature extraction dimension.

[0106] Specifically, the header feature extraction dimensions may include whether the first row is entirely string features, whether the first row contains numeric features, whether the first row contains date string features, whether the first column is entirely numeric features, whether other rows except the first row contain numeric features, the edit distance feature between the first row of text and the second row of text, whether the first row of text contains only strings and other rows contain numeric features, the null value ratio feature of the first column, etc., which are not limited here.

[0107] In practical applications, table headers usually do not have numbers and dates. Therefore, whether the first row is all string features, whether the first row contains numeric features, whether the first row contains date string features, whether the first column is all numeric features, whether other rows except the first row contain numeric features, whether the first row of text contains only strings and other rows contain numeric features are all important features of whether the first row is a table header.

[0108] The edit distance can be understood as the number of steps required to rewrite a string into another string. For example, given two strings, ABC and ACD, it takes two steps to change ABC into ACD. The first step is to change ABC into ACC, and the second step is to change ACC into ACD. These two steps are the edit distance, which is a specific value. The edit distance between the header row and the non-header row is often large, while the edit distance between the non-header row and the non-header row is small. Therefore, the edit distance feature between the first and second rows of text is used.

[0109] The null value ratio of the first column can be understood as the number of null values ​​in the first column divided by the total function; for example, if three fields in a column have null values, and the total function of the column is 10, the null value ratio of the column is 3 / 10=0.3. For the header row, each column usually has a value; for the non-header row, there may be a field with a null value; therefore, the null value ratio feature of the first column is used.

[0110] According to the above header feature extraction dimensions, feature extraction is performed on the CSV file to obtain the initial feature vectors corresponding to each feature extraction dimension; the initial feature vectors are fused to form the header feature vector.

[0111] The target object recognition method for the character separated value file provided in the embodiment of this specification performs feature mining from multiple dimensions such as character features, numeric features, date features, and feature differences between the first line and other lines, which can improve the accuracy of the header feature vector, thereby improving the accuracy of the header recognition result corresponding to the header feature vector.

[0112] Step 206: Input the target feature vector into a corresponding target object recognition model to obtain a target object corresponding to the target feature vector.

[0113] The target object recognition model is obtained by training the feature vector samples corresponding to the character separation value file training samples and the sample labels corresponding to the character separation value file training samples, and the target object recognition model is a machine learning model.

[0114] Among them, the target object recognition model can be understood as a model for identifying the target object, including a delimiter recognition model and / or a header recognition model; accordingly, the target object can be understood as the output result of the target object recognition model corresponding to the target feature vector, including a delimiter and / or whether there is a header.

[0115] Specifically, when the target feature vectors are different, the input target object recognition models are different, and the obtained target objects are also different.

[0116] In one or more embodiments of this specification, the target object recognition model is trained by the following steps:

[0117] Determine a character-separated value file training sample and a sample label corresponding to the character-separated value file training sample;

[0118] According to a preset feature extraction method, feature extraction is performed on the character-separated value file training sample to obtain a feature vector sample;

[0119] A target object recognition model is obtained by training using a classification algorithm according to the feature vector samples and the sample labels.

[0120] The character-separated value file training samples can be understood as CSV files collected from various channels or generated CSV files, which are not limited here; and for the accuracy of the final effect of the model, the character-separated value file training samples must cover various ASCII-encoded CSV files. Classification algorithms include random forest, decision tree and other algorithms, and can also include logistic regression, which are not limited here.

[0121] When the target object recognition model is a delimiter recognition model, the sample label corresponding to the character separation value file training sample is the delimiter of the character separation value file training sample; and the preset feature extraction method is a delimiter feature extraction method.

[0122] Specifically, determine the CSV file training samples and the sample labels corresponding to the CSV file training samples (the delimiters of the CSV file); extract features from the CSV file training samples according to the delimiter feature extraction method to obtain delimiter feature vector samples; and use a classification algorithm to train a delimiter recognition model based on the delimiter feature vector samples and sample labels.

[0123] When the target object recognition model is a header recognition model, the sample label corresponding to the character separated value file training sample is whether the character separated value file training sample has a header; the preset feature extraction method is a header feature extraction method.

[0124] Specifically, determine the CSV file training samples and the sample labels corresponding to the CSV file training samples (whether the CSV file has a header); according to the header feature extraction method, perform feature extraction on the CSV file training samples to obtain header feature vector samples; according to the header feature vector samples and sample labels, use the classification algorithm to train and obtain a header recognition model.

[0125] The target object recognition method for character separated value files provided in the embodiments of this specification uses a classification algorithm to learn the target feature vector and sample label to obtain a target object recognition model. Based on this model, the delimiter and / or whether the CSV file has a header can be predicted, and machine learning technology is introduced into the processing of CSV files, which not only improves the degree of automation of the processing, but also improves the accuracy.

[0126] In one or more embodiments of this specification, when the target feature vector is different, the target object obtained is different; the target feature vector can be selectively processed according to the separator recognition model and / or the header recognition model to obtain the corresponding output result. The specific implementation method is as follows:

[0127] The target object recognition model includes a separator recognition model and / or a header recognition model;

[0128] Correspondingly, the step of inputting the target feature vector into a corresponding target object recognition model to obtain a target object corresponding to the target feature vector includes:

[0129] Inputting the delimiter feature vector into the delimiter recognition model to obtain a delimiter corresponding to the delimiter feature vector;

[0130] and / or

[0131] The header feature vector is input into the header recognition model to obtain a header recognition result corresponding to the header feature vector.

[0132] The delimiter recognition model may be understood as a model for recognizing delimiters; and the header recognition model may be understood as a model for recognizing whether there is a header.

[0133] Specifically, for models such as delimiter recognition models and header recognition models trained by classification algorithms, it will predict the results corresponding to new feature vectors based on the feature vectors and sample labels during training; therefore, when the delimiter feature vector is input into the delimiter recognition model, the delimiter corresponding to the delimiter feature vector can be obtained; when the header feature vector is input into the header recognition model, the header recognition result corresponding to the header feature vector can be obtained.

[0134] Of course, in actual applications, only the delimiters in the CSV file can be identified according to actual needs, or only whether the CSV file has a header can be predicted, which is not limited here.

[0135] The target object recognition method for a character-separated value file provided in the embodiments of this specification, after training a delimiter recognition model and a header recognition model, can not only recognize the delimiter of the character-separated value file to be recognized, but also recognize whether the character-separated value file to be recognized has a header.

[0136] The target object recognition method for a character separated value file provided in the embodiment of this specification automatically recognizes the delimiters in the character separated value file and whether there is a header through a target object recognition model, and introduces machine learning technology into the processing of character separated value files, thereby improving both the degree of automation and accuracy of the processing.

[0137] See also Figure 4 , Figure 4 A flow chart of a target object recognition model training method provided by an embodiment of this specification is shown, which specifically includes the following steps.

[0138] Step 402: Determine a character-separated value file training sample and a sample label corresponding to the character-separated value file training sample.

[0139] Step 404: According to a preset feature extraction method, feature extraction is performed on the character separation value file training sample to obtain a feature vector sample.

[0140] Optionally, the preset feature extraction method includes a separator feature extraction method and a header feature extraction method;

[0141] Accordingly, the feature extraction is performed on the character separation value file training sample according to the preset feature extraction method to obtain a feature vector sample, including:

[0142] According to the delimiter feature extraction method, feature extraction is performed on the character separation value file training sample to obtain a delimiter feature vector sample;

[0143] and / or

[0144] According to the header feature extraction method, feature extraction is performed on the character separated value file training sample to obtain a header feature vector sample.

[0145] Optionally, performing feature extraction on the character separation value file training sample according to the delimiter feature extraction method to obtain a delimiter feature vector sample includes:

[0146] Counting the number of occurrences of each target separator in each target row of the character-separated value file training sample;

[0147] Determine the minimum number of occurrences of each target separator in each target row;

[0148] A separator feature vector sample is obtained according to the minimum occurrence number of each target separator.

[0149] Optionally, obtaining the separator feature vector sample according to the minimum number of occurrences of each target separator includes:

[0150] Determine the minimum number of occurrences of each target separator as a tag array, wherein the tag array includes the minimum number of occurrences of each target separator;

[0151] Determine the maximum value in the tag array as a target value, and determine the target value and the minimum number of occurrences of the target value in the tag array as a first feature vector sample;

[0152] Determine the minimum number of occurrences of the values ​​greater than or less than the target value in the tag array as a second feature vector sample;

[0153] The separator feature vector sample is obtained according to the first feature vector sample and the second feature vector sample.

[0154] Optionally, performing feature extraction on the character separated value file training sample according to the header feature extraction method to obtain a header feature vector sample includes:

[0155] According to at least two header feature extraction dimensions, feature extraction is performed on the character separated value file training sample to obtain at least two initial feature vector samples;

[0156] The at least two initial feature vector samples are merged to obtain a header feature vector sample.

[0157] Step 406: According to the feature vector samples and the sample labels, a target object recognition model is obtained by training using a classification algorithm.

[0158] Optionally, the classification algorithm includes a random forest algorithm or a decision tree algorithm.

[0159] Optionally, the target object recognition model includes a separator recognition model and / or a header recognition model, and the sample label includes a separator sample label and / or a header sample label;

[0160] Accordingly, the method of obtaining a target object recognition model by training with a classification algorithm according to the feature vector samples and the sample labels includes:

[0161] According to the separator feature vector samples and the separator sample labels, a separator recognition model is obtained by training using a classification algorithm;

[0162] and / or

[0163] A header recognition model is obtained by training with a classification algorithm according to the header feature vector samples and the header sample labels.

[0164] The specific implementation of the above steps can be found in the above embodiments, which will not be described again here.

[0165] In one or more embodiments, after obtaining the target object recognition model, the accuracy of the target object recognition model can be evaluated by using other character separation value files other than the character separation value file training sample to improve the accuracy of the target object recognition model. The specific implementation method is as follows:

[0166] After the target object recognition model is obtained through training according to the feature vector samples and the sample labels, the method further includes:

[0167] Determine a character-separated value file verification sample and a verification tag corresponding to the character-separated value file verification sample;

[0168] According to a preset feature extraction method, feature extraction is performed on the character separated value file verification sample to obtain a verification sample feature vector;

[0169] Inputting the verification sample feature vector into the target object recognition model to obtain a verification object corresponding to the verification sample feature vector;

[0170] The target object recognition model is updated and trained according to the verification label and the verification object.

[0171] The character-separated value file verification sample can be understood as any CSV file other than the character-separated value file training sample; accordingly, the verification tag can be the delimiter corresponding to the character-separated value file verification sample, and / or whether it has a header.

[0172] When the target object recognition model is a delimiter recognition model, the verification label corresponding to the character-separated value file verification sample is the delimiter of the character-separated value file verification sample; and the preset feature extraction method is a delimiter feature extraction method.

[0173] Specifically, determine the CSV file verification sample and the verification label corresponding to the CSV file verification sample (the delimiter of the CSV file); according to the delimiter feature extraction method, perform feature extraction on the CSV file verification sample to obtain the verification sample delimiter feature vector, input the verification sample delimiter feature vector into the delimiter recognition model to obtain the verification object, analyze the effect of the delimiter recognition model, that is, the recognition accuracy, according to the verification label and the verification object, and update the delimiter recognition model if the preset accuracy is not reached.

[0174] When the target object recognition model is a header recognition model, the verification label corresponding to the character-separated value file verification sample is whether the character-separated value file verification sample has a header; the preset feature extraction method is a header feature extraction method.

[0175] Specifically, determine the CSV file verification sample, and the verification label corresponding to the CSV file verification sample (whether the CSV file has a header); according to the header feature extraction method, perform feature extraction on the CSV file verification sample to obtain the verification sample header feature vector, input the verification sample header feature vector into the header recognition model to obtain the verification object, and analyze the effect of the header recognition model, that is, the recognition accuracy, according to the verification label and the verification object. If the preset accuracy is not reached, update the header recognition model for training.

[0176] The target object recognition model training method provided in the embodiments of this specification can verify the target object recognition model after the target object recognition model is obtained through training, so that when the output result of the target object recognition model does not achieve the expected effect, the target object recognition model can be updated and trained to improve the accuracy of the target object recognition model.

[0177] See also Figure 5 , Figure 5 A process diagram of the training phase and the prediction phase of a target object recognition model provided by an embodiment of the present specification is shown.

[0178] During the training phase of the target object recognition model, the training set data is loaded, wherein the training set data can be understood as the character separation value file training samples in the above embodiment and their corresponding sample labels; feature calculation is performed on the training set data to obtain a feature vector, specifically, when feature calculation is performed on the training set data, a separator feature vector and / or a separator feature vector can be obtained, and the implementation method for obtaining the feature vector can refer to the above embodiment, which will not be repeated here; the target object recognition model is trained according to the obtained feature vector and the sample labels in the training set data, and after the training is completed, the accuracy of the obtained target object recognition model is evaluated, and the model is saved when the accuracy reaches the expected level.

[0179] In the prediction stage of the target object recognition model, the model saved in the above training stage is loaded, and the predicted CSV file is determined, and feature calculation is performed on the predicted CSV file to obtain its corresponding feature vector; the feature vector is input into the above loaded model to obtain the predicted result, wherein the predicted result can be understood as the target object in the above embodiment.

[0180] For example, for the delimiter recognition model, during the training phase, if a large number of delimiter feature vectors such as 1000000 correspond to sample labels that are commas, but a few of the delimiter feature vectors 1100000 or 1010000 also correspond to sample labels that are commas, then during the prediction phase, the trained model will most likely believe that the delimiter corresponding to feature vector 1000000 is a comma, while feature vectors 1100000 or 1010000 may be predicted as commas, or may not be predicted as commas - this is because the feature vectors calculated from other annotations must be specifically considered.

[0181] For the header recognition model, in the training phase, for example, the trained CSV files include two files. The feature vector corresponding to CSV file 1 is [1,0,1], and the label is 1 (indicating that there is a header); the feature vector corresponding to CSV file 2 is [1,0,0], and the label is 0 (indicating that there is no header). Then in the prediction phase, if the feature vector of the predicted CSV file is [0,0,0], the prediction result may be 0, that is, there is no header, because the machine learning algorithm will recognize that the feature vector [0,0,0] of the predicted CSV file is closer to the feature vector [1,0,0].

[0182] Based on machine learning algorithms, it supports the recognition of CSV files that use characters corresponding to any ASCII encoding as separators. Based on statistical and classification techniques, the accuracy of the trained separator recognition model can reach 90%. When extracting header features, it conducts feature mining from multiple dimensions such as character features, numeric features, date features, and the difference between the first row and other rows, fully considering the diversity of data. Based on this, it can perform more accurate classification and improve the accuracy of the header recognition model.

[0183] By training the target object recognition model, a model for recognizing separators and / or headers in CSV files can be obtained. When making predictions based on the target object recognition model, the separators and / or headers in any CSV file can be accurately and quickly recognized to obtain output results.

[0184] Corresponding to the above method embodiment, this specification also provides a target object recognition device embodiment of a character separated value file, Figure 6 FIG. 1 is a schematic diagram showing a target object recognition device for a character-separated value file provided by an embodiment of the present specification. Figure 6 As shown, the device comprises:

[0185] A determination module 602 is configured to determine a character separated value file to be identified;

[0186] The vector acquisition module 604 is configured to perform feature extraction on the character-separated value file to be identified according to a preset feature extraction method to obtain a target feature vector;

[0187] The object acquisition module 606 is configured to input the target feature vector into a corresponding target object recognition model to obtain a target object corresponding to the target feature vector, wherein the target object recognition model is obtained by training with feature vector samples corresponding to character separation value file training samples and sample labels corresponding to the character separation value file training samples, and the target object recognition model is a machine learning model.

[0188] Optionally, the vector obtaining module 604 is further configured to:

[0189] According to the delimiter feature extraction method, feature extraction is performed on the character separation value file to be identified to obtain a delimiter feature vector;

[0190] and / or

[0191] According to the header feature extraction method, feature extraction is performed on the character-separated value file to be identified to obtain a header feature vector.

[0192] Optionally, the object obtaining module 606 is further configured to:

[0193] Inputting the delimiter feature vector into the delimiter recognition model to obtain a delimiter corresponding to the delimiter feature vector;

[0194] and / or

[0195] The header feature vector is input into the header recognition model to obtain a header recognition result corresponding to the header feature vector.

[0196] Optionally, the vector obtaining module 604 is further configured to:

[0197] Counting the number of occurrences of each target separator in each target row of the character-separated value file to be identified;

[0198] Determine the minimum number of occurrences of each target separator in each target row;

[0199] A separator feature vector is obtained according to the minimum occurrence number of each target separator.

[0200] Optionally, the vector obtaining module 604 is further configured to:

[0201] Determine the minimum number of occurrences of each target separator as a tag array, wherein the tag array includes the minimum number of occurrences of each target separator;

[0202] Determine the maximum value in the tag array as a target value, and determine the target value and the minimum number of occurrences of the target value in the tag array as a first eigenvector;

[0203] Determine the minimum number of occurrences of values ​​greater than or less than the target value in the tag array as a second feature vector;

[0204] The separator feature vector is obtained according to the first feature vector and the second feature vector.

[0205] Optionally, the vector obtaining module 604 is further configured to:

[0206] According to at least two header feature extraction dimensions, feature extraction is performed on the character-separated value file to be identified to obtain at least two initial feature vectors;

[0207] The at least two initial feature vectors are merged to obtain a header feature vector.

[0208] The device further comprises:

[0209] A training module is configured to determine a character-separated value file training sample and a sample label corresponding to the character-separated value file training sample,

[0210] According to a preset feature extraction method, feature extraction is performed on the character-separated value file training sample to obtain a feature vector sample,

[0211] A target object recognition model is obtained by training using a classification algorithm according to the feature vector samples and the sample labels.

[0212] The target object recognition device for a character separated value file provided in the embodiment of the present specification extracts features from the character separated value file to be recognized, inputs the obtained target feature vector into a target object recognition model, and obtains a target object corresponding to the target feature vector. When the character separated value file is processed using the target object recognition model, the device can recognize character separated value files of any format, has universal applicability, and can not only save a large amount of manpower and material resources, but also improve the processing efficiency, accuracy and reliability of processing data in character separated value files.

[0213] The above is a schematic scheme of a target object recognition device for a character-separated value file of the present embodiment. It should be noted that the technical scheme of the target object recognition device for a character-separated value file and the technical scheme of the target object recognition method for a character-separated value file are of the same concept, and the details not described in detail in the technical scheme of the target object recognition device for a character-separated value file can be found in the description of the technical scheme of the target object recognition method for a character-separated value file.

[0214] Corresponding to the above method embodiment, this specification also provides a target object recognition model training device embodiment, Figure 7 FIG. 1 is a schematic diagram showing the structure of a target object recognition model training device provided by an embodiment of the present specification. Figure 7 As shown, the device comprises:

[0215] A determination module 702 is configured to determine a character-separated value file training sample and a sample label corresponding to the character-separated value file training sample;

[0216] The vector acquisition module 704 is configured to perform feature extraction on the character separation value file training sample according to a preset feature extraction method to obtain a feature vector sample;

[0217] The training module 706 is configured to obtain a target object recognition model by training using a classification algorithm according to the feature vector samples and the sample labels.

[0218] Optionally, the vector obtaining module 704 is further configured to:

[0219] According to the delimiter feature extraction method, feature extraction is performed on the character separation value file training sample to obtain a delimiter feature vector sample;

[0220] and / or

[0221] According to the header feature extraction method, feature extraction is performed on the character separated value file training sample to obtain a header feature vector sample.

[0222] Optionally, the vector obtaining module 704 is further configured to:

[0223] Counting the number of occurrences of each target separator in each target row of the character-separated value file training sample;

[0224] Determine the minimum number of occurrences of each target separator in each target row;

[0225] A separator feature vector sample is obtained according to the minimum occurrence number of each target separator.

[0226] Optionally, the vector obtaining module 704 is further configured to:

[0227] Determine the minimum number of occurrences of each target separator as a tag array, wherein the tag array includes the minimum number of occurrences of each target separator;

[0228] Determine the maximum value in the tag array as a target value, and determine the target value and the minimum number of occurrences of the target value in the tag array as a first feature vector sample;

[0229] Determine the minimum value of the number of occurrences greater than or less than the target value in the tag array as a second feature vector sample;

[0230] The separator feature vector sample is obtained according to the first feature vector sample and the second feature vector sample.

[0231] Optionally, the vector obtaining module 704 is further configured to:

[0232] According to at least two header feature extraction dimensions, feature extraction is performed on the character separated value file training sample to obtain at least two initial feature vector samples;

[0233] The at least two initial feature vector samples are merged to obtain a header feature vector sample.

[0234] Optionally, the training module 706 is further configured to:

[0235] According to the separator feature vector samples and the separator sample labels, a separator recognition model is obtained by training using a classification algorithm;

[0236] and / or

[0237] A header recognition model is obtained by training with a classification algorithm according to the header feature vector samples and the header sample labels.

[0238] The device further comprises:

[0239] An update module is configured to determine a character-separated value file verification sample and a verification tag corresponding to the character-separated value file verification sample,

[0240] According to a preset feature extraction method, feature extraction is performed on the character separated value file verification sample to obtain a verification sample feature vector,

[0241] Input the verification sample feature vector into the target object recognition model to obtain a verification object corresponding to the verification sample feature vector,

[0242] The target object recognition model is updated and trained according to the verification label and the verification object.

[0243] The target object recognition model training device provided in the embodiment of the present specification performs feature extraction on character separation value file training samples, and trains a target object recognition model based on the character separation value file training samples and their corresponding sample labels. The target object recognition model can be used to recognize the character separation value file to be recognized. When the character separation value file is processed using the target object recognition model, character separation value files of any format can be recognized. It has universal applicability and can not only save a lot of manpower and material resources, but also improve the processing efficiency, accuracy and reliability of processing data in character separation value files.

[0244] The above is a schematic scheme of a target object recognition model training device of this embodiment. It should be noted that the technical scheme of the target object recognition model training device and the technical scheme of the target object recognition model training method described above belong to the same concept, and the details not described in detail in the technical scheme of the target object recognition model training device can be found in the description of the technical scheme of the target object recognition model training method described above.

[0245] Figure 8 The structure block diagram of a computing device 800 provided according to an embodiment of the present specification is shown. The components of the computing device 800 include but are not limited to a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and the database 850 is used to store data.

[0246] The computing device 800 also includes an access device 840 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).

[0247] In one embodiment of the present specification, the above components of the computing device 800 and Figure 8 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 8 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0248] The computing device 800 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 800 may also be a mobile or stationary server.

[0249] Among them, the processor 820 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the target object recognition method and the target object recognition model training method of the above-mentioned character separated value file.

[0250] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the target object recognition method and the target object recognition model training method of the above-mentioned character separation value file belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the target object recognition method and the target object recognition model training method of the above-mentioned character separation value file.

[0251] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the target object recognition method and the target object recognition model training method for the above-mentioned character separated value file.

[0252] The above is a schematic scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the target object recognition method and the target object recognition model training method of the above-mentioned character-separated value file belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the target object recognition method and the target object recognition model training method of the above-mentioned character-separated value file.

[0253] An embodiment of the present specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the target object recognition method and the target object recognition model training method of the above-mentioned character separated value file.

[0254] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the target object recognition method and the target object recognition model training method of the above-mentioned character separation value file belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be referred to the description of the technical scheme of the target object recognition method and the target object recognition model training method of the above-mentioned character separation value file.

[0255] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0256] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0257] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0258] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0259] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A method for identifying a target object of a character separated value file, characterized in that: include: Determine the character-separated value file to be recognized; According to a preset feature extraction method, feature extraction is performed on the character-separated value file to be identified to obtain a target feature vector, wherein according to the preset feature extraction method, feature extraction is performed on the character-separated value file to be identified to obtain a target feature vector, including: Counting the number of occurrences of each target delimiter of the character-separated value file to be identified in each target row, and determining the minimum number of occurrences of each target delimiter in each target row; determining the minimum number of occurrences of each target delimiter as a tag array, wherein the tag array includes the minimum number of occurrences of each target delimiter; determining the maximum value in the tag array as a target value, and determining the target value and the minimum number of occurrences equal to the target value in the tag array as a first feature vector; determining the minimum number of occurrences greater than or less than the target value in the tag array as a second feature vector; obtaining a delimiter feature vector based on the first feature vector and the second feature vector; and According to the header feature extraction method, feature extraction is performed on the character-separated value file to be identified to obtain a header feature vector; The target feature vector is input into a corresponding target object recognition model to obtain a target object corresponding to the target feature vector, wherein the target object recognition model is obtained by training with feature vector samples corresponding to character separation value file training samples and sample labels corresponding to the character separation value file training samples, and the target object recognition model is a machine learning model.

2. The target object recognition method of the character separated value file according to claim 1, characterized in that: The target object recognition model includes a separator recognition model and a header recognition model; Correspondingly, the step of inputting the target feature vector into a corresponding target object recognition model to obtain a target object corresponding to the target feature vector includes: Inputting the delimiter feature vector into the delimiter recognition model to obtain a delimiter corresponding to the delimiter feature vector; The header feature vector is input into the header recognition model to obtain a header recognition result corresponding to the header feature vector.

3. The target object recognition method of the character separated value file according to claim 1, characterized in that: The method of extracting features from the character-separated value file to be identified according to the header feature extraction method to obtain a header feature vector includes: According to at least two header feature extraction dimensions, feature extraction is performed on the character-separated value file to be identified to obtain at least two initial feature vectors; The at least two initial feature vectors are merged to obtain a header feature vector.

4. The target object recognition method of the character separated value file according to claim 1, characterized in that: The target object recognition model is trained by the following steps: Determine a character-separated value file training sample and a sample label corresponding to the character-separated value file training sample; According to a preset feature extraction method, feature extraction is performed on the character-separated value file training sample to obtain a feature vector sample; A target object recognition model is obtained by training using a classification algorithm according to the feature vector samples and the sample labels.

5. A target object recognition model training method, characterized in that: include: Determine a character-separated value file training sample and a sample label corresponding to the character-separated value file training sample; According to a preset feature extraction method, feature extraction is performed on the character-separated value file training sample to obtain a feature vector sample, wherein according to the preset feature extraction method, feature extraction is performed on the character-separated value file training sample to obtain a feature vector sample, including: Counting the number of occurrences of each target separator of the character separation value file training sample in each target row, and determining the minimum number of occurrences of each target separator in each target row; determining the minimum number of occurrences of each target separator as a tag array, wherein the tag array includes the minimum number of occurrences of each target separator; determining the maximum value in the tag array as a target value, and determining the target value and the minimum number of occurrences equal to the target value in the tag array as a first feature vector; determining the minimum number of occurrences greater than or less than the target value in the tag array as a second feature vector; obtaining a separator feature vector sample according to the first feature vector and the second feature vector; and According to the header feature extraction method, feature extraction is performed on the character separation value file training sample to obtain a header feature vector sample; A target object recognition model is obtained by training using a classification algorithm according to the feature vector samples and the sample labels.

6. The target object recognition model training method according to claim 5, characterized in that: The target object recognition model includes a separator recognition model and a header recognition model, and the sample labels include a separator sample label and a header sample label; Accordingly, the method of obtaining a target object recognition model by training with a classification algorithm according to the feature vector samples and the sample labels includes: According to the separator feature vector samples and the separator sample labels, a separator recognition model is obtained by training using a classification algorithm; A header recognition model is obtained by training with a classification algorithm according to the header feature vector samples and the header sample labels.

Citation Information

Patent Citations

  • Model training method and device, text recognition method and device, equipment and medium

    CN113254654A

  • Text recognition model training method and device, text recognition method and device, equipment and medium

    CN114022882A

  • Sensitive information identification model construction method and device and sensitive information identification method and device

    CN114238643A

  • Training method and device of character recognition model, storage medium and electronic equipment

    CN114359536A

  • Character recognition method and device, equipment and medium

    CN114445813A