An apparatus for generating a database mapping prediction for an input string with respect to a ground-truth database table comprising a group of ground-truth database table rows associated with a group of row-wise strings, the apparatus comprising at least one processor and at least one memory including program code, the at least one memory and the program code configured to, with the processor, cause the apparatus to at least:
- generate, using a hierarchical string matching machine learning framework, and based at least in part on the input string, the database mapping prediction, wherein:
- the hierarchical string matching machine learning framework comprises a group of table-independent match models and a plurality of table-dependent match models,
- the group of table-independent match models comprise a plurality of exact match models and a plurality of probabilistic match models,
- the plurality of table-dependent match models comprises a disjoint match model and an embedding-based match model,
- each table-independent match model is associated with a respective mapping label of a plurality of defined mapping labels,
- each exact match model is configured to:
- (i) retrieve an exact match rules file associated with the exact match model that describes one or more exact target strings for the exact match model, (ii) determine whether the input string exactly matches one of the one or more exact target strings, and (iii) in response to determining that the input string exactly matches one of the one or more exact target strings:
- (a) generating a selected mapping label for the input string based at least in part on the respective mapping label for the exact match model, and (b) generating an affirmative exact match determination,
- each probabilistic match model is configured to, in response to determining that each exact match model is associated with a negative exact match determination:
- (i) retrieve a probabilistic match rules file associated with the probabilistic match model that describes:
- (a) one or more probabilistic target strings for the probabilistic match model, and (b) an optimized probabilistic match threshold for the probabilistic match model, (ii) for each probabilistic target string, generating a respective pairwise fuzzy match score with respect to the input string, (iii) determining whether at least one respective pairwise fuzzy match score satisfies the optimized probabilistic match threshold for the probabilistic match model, and (iv) in response to determining that at least one respective pairwise fuzzy match score satisfies the optimized probabilistic match threshold for the probabilistic match model:
- (a) generating the selected mapping label for the input string based at least in part on the respective mapping label for the probabilistic match model, and (b) generating an affirmative probabilistic match determination,
- the disjoint match model is configured to, in response to determining that each probabilistic match model is associated with a negative probabilistic match determination:
- (i) determining whether the token count of the input string satisfies a token count threshold, and (ii) in response to determining that the token count of the input string satisfies the token count threshold, performing a required number of row-wise token match determination iterations until an earlier-satisfied condition of:
- (a) reaching a qualifying row-wise token match determination iteration that is associated with a qualifying row-wise string whose qualifying token match score with respect to the input string satisfies a qualifying token match score threshold, or (b) reaching a final row-wise token match determination iteration that is associated with a final row-wise string of the group of row-wise strings, wherein:
- (i) each ith row-wise token match determination iteration is associated with an ith row-wise string of the group of row-wise strings that is selected in accordance with a row order for the group of ground-truth database table rows, and (ii) in response to reaching the qualifying row-wise token match determination iteration, the selected mapping label for the input string is generated based at least in part on a row-wise mapping label for the qualifying row-wise string and an affirmative disjoint match determination is generated,
- the embedding-based match model is configured to, in response to determining that the disjoint match model is associated with a negative disjoint match determination:
- (i) generate, based at least in part on an input string embedding vector for the input string and a group of row-wise string embedding vectors for the group of row-wise strings, a defined-size subset of highest-likelihood matched row-wise strings in the group of row-wise strings, (ii) for each row-wise string in the defined-size subset, generating a corresponding pairwise fuzzy match score with respect to the input string, and (iii) in response to determining that at least one corresponding pairwise fuzzy match score satisfies a pairwise fuzzy match score threshold:
- (a) generating the selected mapping label for the input string based at least in part on the row-wise mapping label for the row-wise string in the defined-size subset that is associated with a highest corresponding pairwise fuzzy match, and (b) generating an affirmative embedding-based match determination, and
- the database mapping prediction is generated based at least in part on at least one of the selected mapping labels for the input string or a negative embedding-based match determination;
- and
- perform one or more prediction-based actions based at least in part on the database mapping prediction.