Table search method, apparatus and device, and storage medium
By identifying the type of user input, cleaning the data, calculating vectors, and calculating similarity, the problem of low efficiency and low accuracy in existing table searches is solved, and efficient and accurate table searches are achieved.
Patent Information
- Application Number
- CN202211201173.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-09-29
AI Technical Summary
Existing table search technologies suffer from low efficiency and accuracy due to their limited support for searching a single object and lack of a robust matching mechanism, making it difficult to meet users' needs for efficient data retrieval.
By identifying the type of user input, text or table input is processed; text input is cleaned and entity is extracted, and table input is identified by column name and content; using vector calculation and similarity calculation, combined with the relevance of table column names and content, a comprehensive score is given to select the matching table.
It enables efficient table search that supports both text and table input, improving retrieval efficiency and accuracy, expanding the search scope, and meeting users' retrieval needs.
Smart Images

Figure CN115438048B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a table search method and device, electronic equipment and computer readable storage medium. BACKGROUND
[0002] In the face of massive data, users often need to accurately search for effective data from the data. As one of the important data storage methods, tables become the carrier of user search objects. In the use process, there are both effective data and a large amount of interference data in the table. Therefore, quickly identifying user input, accurately matching data and meeting user needs can help improve the efficiency and accuracy of table search. The existing table search technology has the problems of low efficiency and low accuracy of table search based on user input due to the single object supported by the search and the lack of a perfect matching mechanism, so it is difficult to meet the efficient acquisition of the required data by the user. SUMMARY
[0003] The present application provides a table search method, device, electronic equipment and computer readable storage medium, which mainly aims to solve the problem of low efficiency and low accuracy of table search based on user input.
[0004] To achieve the above purpose, the present application provides a table search method, comprising:
[0005] Obtaining user input, identifying the type of the user input, and determining whether the user input is a text input or a table input according to the result of type identification;
[0006] When the user input is a text input, the user input is data cleaned to obtain cleaned data, and entities are extracted from the cleaned data to obtain input entities;
[0007] Vector calculation is performed on the input entities and tables in a preset table database to obtain a first representation vector of the input entities and a second representation vector of the tables in the table database;
[0008] Similarity calculation is performed on the first representation vector and the second representation vector, and a matching table is selected from the table database according to the result of similarity calculation;
[0009] When the user input is a table input, table column name recognition and content recognition are performed on the user input and each table in the table database, respectively, and table column name relevance and content relevance of each table are calculated according to the results of table column name recognition and content recognition;
[0010] The table column name relevance and the content relevance are comprehensively scored to obtain a comprehensive relevance, and a matching table is selected from the table database through the comprehensive relevance.
[0011] Optionally, the type recognition of the user input, according to the type recognition result, judges whether the user input is a text input or a table input, comprising:
[0012] Extracting the data format of the user input, obtaining a target data format;
[0013] Using the target data format to perform the same type search in the preset text data format set and the preset table data format set, obtaining a matching type;
[0014] If the matching type belongs to the text data format set, it is determined that the user input is a text input;
[0015] If the matching type belongs to the table data format set, it is determined that the user input is a table input.
[0016] Optionally, the data cleaning of the user input obtains cleaned data, comprising:
[0017] According to the preset text rule, the user input is parsed to obtain interference data;
[0018] Filtering and data correction of the interference data to obtain cleaned data.
[0019] Optionally, the entity extraction from the cleaned data obtains input entity, comprising:
[0020] The part-of-speech analysis and word segmentation processing of the cleaned data obtain input word segmentation and corresponding part-of-speech;
[0021] Obtaining a preset stop word label, filtering the input word segmentation according to the part-of-speech of the word segmentation, and obtaining a standard word segmentation;
[0022] Using the standard word segmentation to search in the preset entity database, and taking the searched standard word segmentation as the input entity.
[0023] Optionally, the vector calculation of the input entity and the table in the preset table database obtains the first representation vector of the input entity and the second representation vector of the table in the table database, comprising:
[0024] Converting the input entity into a word vector to obtain the word vector corresponding to the input entity;
[0025] Weighted average of the word vector to obtain the first representation vector of the input entity;
[0026] Obtaining the table field corresponding to the table in the table database, and converting the table field into a table field vector to obtain the table field vector corresponding to the table field;
[0027] generate a weight coefficient corresponding to the table field according to the word frequency and the table frequency of the table field, and perform vector synthesis calculation according to the table field vector and the weight coefficient to obtain a second representation vector of the table in the table database.
[0028] Optionally, the vector synthesis calculation according to the table field vector and the weight coefficient to obtain the second representation vector of the table in the table database comprises:
[0029] The vector synthesis calculation according to the table field vector and the weight coefficient is performed by using the following formula:
[0030]
[0031] wherein, is the jth table field in the table database j = 1, 2, 3, …, N (N is a natural number); w(t j ) is the weight coefficient of the jth table field; is the second representation vector of the table in the table database.
[0032] Optionally, the calculation of the table column name relevance and the content relevance of each table according to the result of table column name recognition and the result of content recognition comprises:
[0033] The calculation of the table column name relevance of each table according to the result of table column name recognition is performed by using the following formula:
[0034]
[0035] wherein, H is the identification of table column name recognition; is the table column name data input by the user in the result of table column name recognition; is the table column name data of the ith table in the table database in the result of table column name recognition; is the table column name relevance of the ith table in the table database.
[0036] The calculation of the content relevance of each table according to the result of content recognition is performed by using the following formula:
[0037]
[0038] wherein, C is the identification of content recognition; is the content data input by the user in the result of content recognition; is the content data of the ith table in the table database in the result of content recognition; is the content relevance of the ith table in the table database.
[0039] To solve the above problems, the present application also provides a table search device, the device comprises:
[0040] A type identification module is configured to obtain a user input, perform type identification on the user input, and determine whether the user input is a text input or a table input according to a result of the type identification.
[0041] An input entity generation module is configured to perform data cleaning on the user input when the user input is a text input, obtain cleaned data, extract an entity from the cleaned data, and obtain an input entity.
[0042] A vector calculation module is configured to perform vector calculation on the input entity and tables in a preset table database, and obtain a first representation vector of the input entity and a second representation vector of the tables in the table database.
[0043] A similarity calculation module is configured to perform similarity calculation on the first representation vector and the second representation vector, and select a matching table from the table database according to a result of the similarity calculation.
[0044] A correlation generation module is configured to perform table column name identification and content identification on the user input and each table in the table database when the user input is a table input, and calculate table column name correlation and content correlation of each table according to a result of the table column name identification and a result of the content identification.
[0045] A comprehensive scoring module is configured to perform comprehensive scoring according to the table column name correlation and the content correlation, obtain a comprehensive correlation, and select a matching table from the table database through the comprehensive correlation.
[0046] To solve the above problems, the present application also provides an electronic device, the electronic device comprises:
[0047] at least one processor; and
[0048] a memory connected with the at least one processor in communication; wherein
[0049] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the above-mentioned table search method.
[0050] To solve the above problems, the present application also provides a computer readable storage medium, the computer readable storage medium stores at least one computer program, and the at least one computer program is executed by a processor in an electronic device to implement the above-mentioned table search method.
[0051] The embodiment of the present application can support text input and table input simultaneously, realize the function requirements of searching table by text and searching table by table, improve the efficiency and practicability of table information retrieval; in searching table by text, the vector of input entity and the table in the preset table database is calculated, the semantic features of user input and table database are enriched, the retrieval accuracy is higher than the traditional keyword-based retrieval; in searching table by table, the similarity of table column name and table content is calculated, the comprehensive score of the calculation result is obtained by using the scoring function, the table information is fully utilized, more relevant tables are obtained, the search range is expanded, the effective table selectivity is improved, and the user retrieval requirements are further met. Therefore, the table search method, device, electronic equipment and computer readable storage medium provided by the present application can solve the problems of low search efficiency and low accuracy based on user input. BRIEF DESCRIPTION OF DRAWINGS
[0052] Figure 1 The flowchart of the table search method provided by an embodiment of the present application is shown in the figure.
[0053] Figure 2 The flowchart of extracting entity from the cleaning data to obtain input entity provided by an embodiment of the present application is shown in the figure.
[0054] Figure 3 The flowchart of vector calculation of the input entity and the table in the preset table database provided by an embodiment of the present application is shown in the figure.
[0055] Figure 4 The function module diagram of the table search device provided by an embodiment of the present application is shown in the figure.
[0056] Figure 5 The structure diagram of the electronic equipment for realizing the table search method provided by an embodiment of the present application is shown in the figure.
[0057] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0058] It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0059] The table search method provided in the embodiments of the present application can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be a stand-alone server, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and basic cloud computing services such as big data and data processing platforms, etc.
[0060] Referring to Figure 1 FIG. 1 is a flowchart of a table search method provided in an embodiment of the present application. In this embodiment, the table search method includes the following steps.
[0061] S1, obtaining a user input, performing type identification on the user input, and determining whether the user input is a text input or a table input according to a result of the type identification;
[0062] In the embodiments of the present application, the user input is content input by a user when using a table search, and the user input can be text or a table. The text includes Chinese characters, English words, numbers, etc., and the table includes a structured table or a table image. The type identification determines whether the user input is text or a table, and a text input processing flow or a table input processing flow is executed according to the determination result.
[0063] In the embodiments of the present application, the type identification on the user input and the determination of whether the user input is a text input or a table input according to a result of the type identification include the following steps.
[0064] extracting a data format of the user input to obtain a target data format;
[0065] performing a same-type search in a preset text data format set and a preset table data format set by using the target data format to obtain a matching type;
[0066] if the matching type belongs to the text data format set, determining that the user input is a text input;
[0067] if the matching type belongs to the table data format set, determining that the user input is a table input.
[0068] The data formats contained in the text data format set include numerical values, strings, Boolean values, arrays, literal objects and the like; and the data formats contained in the table data format set include excel formats, JPEG formats, TIF formats, EPS formats and the like.
[0069] When the user input is a text input, S2 is performed, data cleaning is performed on the user input, cleaned data is obtained, entities are extracted from the cleaned data, and input entities are obtained;
[0070] In the embodiment of the application, the data cleaning on the user input to obtain cleaned data comprises:
[0071] According to a preset text rule, syntactic analysis is performed on the user input, and interference data is obtained;
[0072] The interference data is filtered and corrected, and cleaned data is obtained.
[0073] In the embodiment of the application, the data cleaning can use an ETL (Extract-Transform-Load) cleaning method. The ETL cleaning is to analyze the causes and forms of interference data to clean the interference data. The types of the interference data include incomplete data, error data, duplicate data, emojis, sensitive data and the like. The original data that does not meet the text requirements is converted into data that meets the text requirements, thereby effectively ensuring the high quality of the user input and improving the accuracy of subsequent table retrieval.
[0074] Referring to FIG. 1, Figure 2 In the embodiment of the application, the extraction of entities from the cleaned data to obtain input entities comprises:
[0075] S21, performing part-of-speech analysis and word segmentation processing on the cleaned data to obtain input words and corresponding parts of speech;
[0076] S22, obtaining a preset stop word part-of-speech label, screening the input words according to the parts of speech of the input words based on the stop word part-of-speech label, and obtaining standard words;
[0077] S23, searching in a preset entity database using the standard words, and taking the searched standard words as input entities.
[0078] In the embodiment of the application, the cleaned data can be processed by a word segmenter. The word segmenter includes but is not limited to a Jieba word segmenter. The parts of speech of the input words include nouns, verbs, adjectives, adverbs, auxiliary words and the like. Further, the stop word part-of-speech label can be an adjective, an adverb, an auxiliary word and the like.
[0079] In the embodiment of the present application, the entity database can be summarized by business personnel according to the table data of actual business, or constructed by information of historical data table.
[0080] For example, assuming that there is a stop word label: auxiliary word, there are input words "23", "of", "business report", the part-of-speech of the above input words are "noun", "auxiliary word", "noun" respectively, therefore, the input word "of" corresponding to the part-of-speech "auxiliary word" can be deleted, and the standard words "23" and "business report" are obtained.
[0081] In the embodiment of the present application, the key information in the cleaning data is determined by extracting entities from the cleaning data to obtain input entities, so that the key information in the entire user input is sorted.
[0082] S3, vector calculation is performed on the input entity and the table in the preset table database to obtain a first representation vector of the input entity and a second representation vector of the table in the table database;
[0083] Referring to Figure 3 In the embodiment of the present application, the vector calculation on the input entity and the table in the preset table database to obtain the first representation vector of the input entity and the second representation vector of the table in the table database includes:
[0084] S31, word vector conversion is performed on the input entity to obtain a word vector corresponding to the input entity;
[0085] S32, weighted average is performed on the word vector to obtain a first representation vector of the input entity;
[0086] S33, a table field corresponding to the table in the table database is obtained, and vector conversion is performed on the table field to obtain a table field vector corresponding to the table field;
[0087] S34, a weight coefficient corresponding to the table field is generated according to the word frequency and table frequency of the table field, and vector comprehensive calculation is performed according to the table field vector and the weight coefficient to obtain a second representation vector of the table in the table database.
[0088] In the embodiment of the present application, Word2vec model can be used to perform vector calculation on the input entity and the table field corresponding to the table in the table database.
[0089] Specifically, weighted average is performed on the word vector by using the following formula to obtain a first representation vector of the input entity:
[0090]
[0091] wherein, is the i-th word vector corresponding to the input entity, i=1, 2, 3, …, N (N is a natural number); n is the total number of entities of the input entity; is the first representation vector of the input entity.
[0092] Further, the weight coefficient corresponding to the table field can be generated according to the word frequency and the frequency of the table field by using the following formula:
[0093]
[0094] wherein, T is the table word frequency of the table field; a is the number of times that the table field appears in the table of the table database; b is the total number of table fields of the table in the table database;
[0095]
[0096] wherein, F is the table frequency of the table field; c is the total number of tables in the table database; d is the number of tables containing the table field in the table database;
[0097] w=TxF
[0098] wherein, w is the weight coefficient; T is the table word frequency of the table field; F is the table frequency of the table field.
[0099] In the embodiment of the application, the TF (Term Frequency) and the IDF (inverse document frequency) of the table field can be used to represent the word frequency and the table frequency of the table field, and the weight coefficient corresponding to the table field can be determined by using the TF-IDF algorithm.
[0100] Specifically, in the embodiment of the application, the second representation vector of the table in the table database can be obtained by using the following formula to perform vector synthesis calculation according to the table field vector and the weight coefficient:
[0101]
[0102] wherein, is the j-th table field corresponding to the table in the table database, j=1, 2, 3, …, N (N is a natural number); w(t j ) is the weight coefficient of the j-th table field; is the second representation vector of the table in the table database.
[0103] In the embodiment of the application, the first representation vector of the input entity is the weighted average vector of the input entity vectors; and the second representation vector of the table in the table database is the weighted average vector of the table field weight coefficients.
[0104] S4, similarity calculation is performed on the first representation vector and the second representation vector, and a matching table is selected from the table database according to a result of the similarity calculation;
[0105] In the embodiment of the application, the first representation vector and the second representation vector can be subjected to hash calculation by using a string value hash algorithm to obtain hash strings of the first representation vector and the second representation vector, and the first representation vector and the second representation vector are subjected to string matching according to the hash strings to perform preliminary similarity comparison.
[0106] In the embodiment of the application, the first representation vector and the second representation vector can be subjected to similarity calculation by using the following similarity calculation formula:
[0107]
[0108] wherein, the value of the first representation vector and the second representation vector is the similarity of the first representation vector and the second representation vector , and the value range of the similarity calculation is [0-1].
[0109] In the embodiment of the application, when the similarity calculation result is in the range of [0.7-1], it is determined that the input entity and the table in the table database are similar, and a corresponding matching table can be selected from the table database. For example, the first representation vector sentence A is (1, 1, 2, 1, 1, 1, 0, 0, 0), the second representation vector sentence B is (1, 1, 1, 0, 1, 1, 1, 1, 1), and the similarity calculation formula is used to calculate
[0110]
[0111] The calculation result of the size of the similarity is 0.81, which is in the range of [0.7-1], so the sentence A and the sentence B are similar, and a corresponding matching table is selected from the table database according to the second representation vector.
[0112] When the user input is a table input, S5 is performed to perform table column name recognition and content recognition on the user input and each table in the table database respectively, and table column name relevance and content relevance of each table are calculated according to a result of the table column name recognition and a result of the content recognition;
[0113] In the embodiment of the application, the table column name recognition and the content recognition on the user input and each table in the table database respectively include:
[0114] extracting the user input and the structural data in the table database respectively;
[0115] performing attribute classification according to data attributes of the structural data to obtain table column name data and content data.
[0116] In the embodiment of the present application, the structural data has different data attributes due to different positions in the table. For example, the data in the row and column has basically single time attribute and type attribute.
[0117] In the embodiment of the present application, the table column name relevance and the content relevance of each table are calculated according to the table column name recognition result and the content recognition result, comprising:
[0118] The table column name relevance of each table is calculated according to the table column name recognition result by using the following formula:
[0119]
[0120] wherein, H is the identification of the table column name recognition; is the table column name data of the user input in the table column name recognition result; is the table column name data of the i th table in the table database in the table column name recognition result; is the table column name relevance of the i th table in the table database.
[0121] The content relevance of each table is calculated according to the content recognition result by using the following formula:
[0122]
[0123] wherein, C is the identification of the content recognition; is the content data of the user input in the content recognition result; is the content data of the i th table in the table database in the content recognition result; is the content relevance of the i th table in the table database.
[0124] In the embodiment of the present application, the table search is performed by comprehensively searching the table column name and the table content, thereby expanding the range of the table search.
[0125] S6, comprehensive scoring is performed according to the table column name relevance and the content relevance to obtain comprehensive relevance, and the matching table is selected from the table database through the comprehensive relevance.
[0126] In the embodiment of the present application, the comprehensive scoring is performed according to the table column name relevance and the content relevance to obtain the comprehensive relevance by using the following formula:
[0127]
[0128] wherein, score(i) is the comprehensive correlation degree of the ith table in the table database; and a is a preset weight adjustment factor; is the table column name correlation degree of the ith table in the table database; is the content correlation degree of the ith table in the table database.
[0129] In the embodiment of the present application, the greater the comprehensive correlation degree is, the more matched the user input is to the table corresponding to the comprehensive correlation degree. The matching table with the highest comprehensive correlation degree is selected as the optimal matching table of the user input. For example, the comprehensive correlation degree of the matching table E is 0.6, and the comprehensive correlation degree of the matching table G is 0.8. Therefore, the matching table G is the optimal matching table of the user input.
[0130] The embodiment of the present application can simultaneously support text input and table input, realize the function requirements of searching tables by text and searching tables by table, improve the efficiency and practicability of table information retrieval; in the text-to-table search, the vectors of the input entity and the tables in the preset table database are calculated, the semantic features of the user input and the table database are enriched, and the search accuracy is higher than that of the traditional keyword-based search; in the table-to-table search, the similarity of the table column name and the table content is calculated, the comprehensive score of the calculation result is calculated by using a scoring function, the table information is fully utilized, more relevant tables are obtained, the search range is expanded, the selectivity of the effective table is improved, and the user search requirements are further met. Therefore, the table search method provided by the present application can solve the problems of low search efficiency and low accuracy based on user input.
[0131] As shown in Figure 4 FIG. 1 is a functional module diagram of a table search device according to an embodiment of the present application.
[0132] The table search device 100 can be installed in an electronic device. According to the implemented functions, the table search device 100 can include a type identification module 101, an input entity generation module 102, a vector calculation module 103, a similarity calculation module 104, a correlation degree generation module 105, and a comprehensive scoring module 106. The modules of the present application can also be referred to as units, which refer to a series of computer program segments that can be executed by an electronic device processor and can complete a fixed function, and are stored in the memory of the electronic device.
[0133] In the embodiment, the functions of each module / unit are as follows:
[0134] The type identification module 101 is configured to obtain a user input, identify the type of the user input, and determine whether the user input is a text input or a table input according to the type identification result.
[0135] The input entity generation module 102 is configured to, when the user input is a text input, perform data cleaning on the user input to obtain cleaned data, extract entities from the cleaned data, and obtain input entities;
[0136] The vector calculation module 103 is configured to perform vector calculation on the input entities and tables in a preset table database to obtain a first representation vector of the input entities and a second representation vector of the tables in the table database.
[0137] The similarity calculation module 104 is configured to perform similarity calculation on the first representation vector and the second representation vector, and select a matching table from the table database according to a result of the similarity calculation.
[0138] The correlation generation module 105 is configured to, when the user input is a table input, perform table column name recognition and content recognition on the user input and each table in the table database respectively, and calculate table column name correlation and content correlation of each table according to a result of the table column name recognition and a result of the content recognition.
[0139] The comprehensive scoring module 106 is configured to perform comprehensive scoring according to the table column name correlation and the content correlation to obtain a comprehensive correlation, and select a matching table from the table database through the comprehensive correlation.
[0140] In detail, each module in the table search device 100 in the embodiment of the present application adopts the same technical means as the table search method in the accompanying drawings when in use, and can produce the same technical effects, which will not be described here.
[0141] As shown in FIG. 1, it is a structure schematic diagram of an electronic device for implementing a table search method according to an embodiment of the present application. Figure 5
[0142] The electronic device 1 can include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and can further include a computer program, such as a table search program, stored in the memory 11 and executable on the processor 10.
[0143] The processor 10 may, in some embodiments, be composed of integrated circuits, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits of the same or different functions, including one or more combinations of central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, and connects various components of the electronic device through various interfaces and lines, and executes programs or modules stored in the memory 11 (for example, a table search program, etc.), and calls data stored in the memory 11, to perform various functions and process data of the electronic device.
[0144] The memory 11 includes at least one type of readable storage medium, including a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. The memory 11 may, in some embodiments, be an internal storage unit of the electronic device, for example, a mobile hard disk of the electronic device. The memory 11 may, in other embodiments, also be an external storage device of the electronic device, for example, a plug-in mobile hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 11 may include both an internal storage unit and an external storage device of the electronic device. The memory 11 can be used not only to store application software and various data installed in the electronic device, for example, a code of a table search program, etc., but also to temporarily store data that has been output or will be output.
[0145] The communication bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable connection and communication between the memory 11 and at least one processor 10, etc.
[0146] The communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface. Optionally, the network interface can include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to establish a communication connection between the electronic device and other electronic devices. The user interface can be a display, an input unit (such as a keyboard), and optionally, the user interface can also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, etc. The display can also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0147] Figure 5 Only the electronic device with components is shown, and those skilled in the art can understand that, Figure 5 The structure shown does not constitute a limitation on the electronic device 1, and can include fewer or more components than shown, or combine certain components, or different component arrangements.
[0148] For example, although not shown, the electronic device can also include a power supply (such as a battery) for powering each component. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, so that functions such as charge management, discharge management, and power consumption management can be realized through the power management device. The power supply can also include one or more direct current or alternating current power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device can also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which are not described here.
[0149] It should be understood that the embodiments are only for illustration and are not limited in the scope of the patent application by this structure.
[0150] The table search program stored in the memory 11 in the electronic device 1 is a combination of a plurality of instructions, which, when executed in the processor 10, can implement:
[0151] Obtaining user input, performing type recognition on the user input, and determining whether the user input is text input or table input according to the type recognition result;
[0152] When the user input is text input, performing data cleaning on the user input to obtain cleaned data, extracting entities from the cleaned data to obtain input entities;
[0153] vector calculation is performed on the input entity and tables in a preset table database, to obtain a first representation vector of the input entity and a second representation vector of the tables in the table database;
[0154] similarity calculation is performed on the first representation vector and the second representation vector, and a matching table is selected from the table database according to a result of the similarity calculation;
[0155] When the user input is table input, table column name recognition and content recognition are respectively performed on the user input and each table in the table database, and table column name relevance and content relevance of each table are calculated according to a result of the table column name recognition and a result of the content recognition;
[0156] Comprehensive scoring is performed according to the table column name relevance and the content relevance, to obtain comprehensive relevance, and a matching table is selected from the table database through the comprehensive relevance.
[0157] Specifically, the processor 10 can refer to the description of the related steps in the corresponding embodiments of the drawings for the specific implementation method of the above instructions, and details are not described here.
[0158] Further, the modules / units integrated in the electronic device 1 are implemented in the form of software function units and sold or used as independent products, which can be stored in a computer readable storage medium. The computer readable storage medium can be volatile or non-volatile. For example, the computer readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM).
[0159] The application also provides a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor of an electronic device, the following steps can be implemented:
[0160] Obtaining user input, performing type recognition on the user input, and determining whether the user input is text input or table input according to a result of the type recognition;
[0161] When the user input is text input, data cleaning is performed on the user input to obtain cleaned data, and an entity is extracted from the cleaned data to obtain an input entity;
[0162] Vector calculation is performed on the input entity and tables in a preset table database, to obtain a first representation vector of the input entity and a second representation vector of the tables in the table database;
[0163] The first representation vector and the second representation vector are subjected to similarity calculation, and a matching table is selected from the table database according to a result of the similarity calculation;
[0164] When the user input is a table input, table column name recognition and content recognition are respectively performed on the user input and each table in the table database, and table column name relevance and content relevance of each table are calculated according to a result of the table column name recognition and a result of the content recognition;
[0165] Comprehensive scoring is performed according to the table column name relevance and the content relevance, to obtain comprehensive relevance, and a matching table is selected from the table database through the comprehensive relevance.
[0166] In several embodiments provided by the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other manners. For example, the described embodiments of the apparatus are merely schematic, and the division of the modules is merely a logical function division, and there can be another division manner in actual implementation.
[0167] The modules illustrated as separated components can or can not be physically separated, and the components illustrated as modules can or can not be physical units, i.e., can be located in one place or distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purposes of the embodiments of the present application.
[0168] In addition, each function module in each embodiment of the present application can be integrated in a processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of hardware plus software function modules.
[0169] It is obvious for those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
[0170] Therefore, the embodiments should be considered in all aspects as exemplary and non-restrictive, and the scope of the present application is defined by the appended claims rather than the above description, and all changes falling within the meaning and range of equivalent elements of the claims are intended to be included in the present application. Any reference signs in the claims should not be considered as limiting the claims to which they belong.
[0171] Furthermore, the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural and vice-versa, unless the context clearly requires these exclusions. The conjunction "or" is used to link items in a list or a set of alternatives, and is not disjunctive, unless the context clearly requires it to be disjunctive. The conjunction "and" is used to link items in a list or a set of alternatives, and is not conjunctive, unless the context clearly requires it to be conjunctive. The prefix "first", "second", "third", etc. is used to identify similar entities of a different class or a different category, and is not a requirement of temporal priority, unless the context clearly requires it to be a requirement of temporal priority. The suffix "er", "or", "ian", etc. is used to identify an entity of a different class or a different category, and is not a requirement of membership of a particular group, unless the context clearly requires it to be a requirement of membership of a particular group.
[0172] Finally, it should be noted that the above-mentioned embodiments illustrate rather than limit the application, since the scope of the application is determined by the appended claims.
Claims
1. A table search method characterized by comprising: The method comprises: acquiring user input, performing type recognition on the user input, and determining whether the user input is text input or table input according to the result of type recognition; when the user input is text input, performing data cleaning on the user input to obtain cleaned data, extracting entities from the cleaned data to obtain input entities; performing vector calculation on the input entities and tables in a preset table database to obtain a first representation vector of the input entities and a second representation vector of the tables in the table database; performing similarity calculation on the first representation vector and the second representation vector, and selecting a matching table from the table database according to the result of similarity calculation; when the user input is table input, performing table column name recognition and content recognition on the user input and each table in the table database respectively, and calculating table column name relevance and content relevance of each table according to the results of table column name recognition and content recognition; performing comprehensive scoring according to the table column name relevance and the content relevance to obtain comprehensive relevance, and selecting a matching table from the table database through the comprehensive relevance; wherein the type recognition of the user input and the determination of whether the user input is text input or table input according to the result of type recognition comprises: extracting the data format of the user input to obtain a target data format; performing same-type retrieval in a preset text data format set and a preset table data format set by using the target data format to obtain a matching type; if the matching type belongs to the text data format set, it is determined that the user input is text input; if the matching type belongs to the table data format set, it is determined that the user input is table input; the vector calculation on the input entities and the tables in the preset table database to obtain the first representation vector of the input entities and the second representation vector of the tables in the table database comprises: word vector conversion of the input entities to obtain a word vector corresponding to the input entities; weighted average of the word vector to obtain the first representation vector of the input entities; obtaining table fields corresponding to the tables in the table database, vector conversion of the table fields to obtain table field vectors corresponding to the table fields; generating a weight coefficient corresponding to the table fields according to the word frequency and table frequency of the table fields, and performing vector comprehensive calculation according to the table field vectors and the weight coefficient to obtain the second representation vector of the tables in the table database.
2. The table search method of claim 1, wherein, The data cleaning of the user input to obtain cleaned data comprises: performing syntax analysis on the user input according to a preset text rule to obtain interference data; filtering and data correction of the interference data to obtain cleaned data.
3. The table search method of claim 1, wherein, The extraction of entities from the cleaned data to obtain input entities comprises: performing part-of-speech analysis and word segmentation processing on the cleaned data to obtain input words and corresponding parts of speech; obtaining a preset stop word part-of-speech label, screening the input words according to the part of speech of the input words and the part-of-speech label to obtain standard words; The standard segmentation is used to search in a preset entity database, and the searched standard segmentation is taken as an input entity.
4. The table search method of claim 1, wherein, The vector comprehensive calculation according to the table field vector and the weight coefficient obtains a second representation vector of a table in the table database, and the vector comprehensive calculation comprises: The vector comprehensive calculation according to the table field vector and the weight coefficient comprises: in, The table corresponding to the table in the table database Each table field =1,2,3,…,N, where N is a natural number; For the first Weight coefficients for each table field; This is the second representation vector of the tables in the table database.
5. The table search method according to any one of claims 1 to 4, wherein, The table column name relevance and the content relevance of each table are calculated according to the table column name recognition result and the content recognition result, and the calculation comprises: The table column name relevance of each table is calculated according to the table column name recognition result, and the calculation comprises: in, Identifiers for table column names; The table column name data entered by the user in the result of the table column name recognition; The result of identifying the column names of the table in the database is the first table. Table column name data for each table; For the first table in the database The relevance of column names in each table; The content relevance of each table is calculated according to the content recognition result, and the calculation comprises: in, Identifiers for content recognition; The content data input by the user in the result of the content recognition; The results of the content recognition are in the table database number 1 The content data of each table; For the first table in the database The relevance of the content in each table.
6. A table search device for implementing the table search method according to any one of claims 1 to 5, characterized by, The device comprises: A type recognition module is configured to acquire a user input, perform type recognition on the user input, and determine whether the user input is a text input or a table input according to a result of the type recognition. An input entity generation module is configured to, when the user input is a text input, perform data cleaning on the user input to obtain cleaned data, extract an entity from the cleaned data, and obtain an input entity. A vector calculation module is configured to perform vector calculation on the input entity and tables in a preset table database to obtain a first representation vector of the input entity and second representation vectors of the tables in the table database. A similarity calculation module is configured to perform similarity calculation on the first representation vector and the second representation vectors, and select a matching table from the table database according to a result of the similarity calculation. A relevance generation module is configured to, when the user input is a table input, perform table column name recognition and content recognition on the user input and each table in the table database respectively, and calculate table column name relevance and content relevance of each table according to a result of the table column name recognition and a result of the content recognition. A comprehensive scoring module is configured to perform comprehensive scoring according to the table column name relevance and the content relevance to obtain comprehensive relevance, and select a matching table from the table database through the comprehensive relevance.
7. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the table search method according to any one of claims 1 to 5.
8. A computer readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to implement the table search method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Artificial intelligence-based search intention recognition method, device, equipment and storage medium
CN113707300A
Asset meta-information searching method and device, computer equipment and readable storage medium
CN114911917A