Machine learning based spend classification
Embodiments classify a product to a product category. Embodiments receive a textual description of the product and create an index of product categories. Embodiments use a plurality of classifiers to classify the textual description to one of the product categories, the classifiers including an index based classifier, an encyclopedia based classifier, a Bayes' rule based classifier, and an embeddings classifier.
1 . A method of classifying a product to a product category, the method comprising:
receiving a textual description of the product;
creating an index of product categories;
sequentially inputting the entire textual description to a sequence of different types of classifiers until the textual description is classified, with a confidence score above a predefined threshold, as one of the product categories, wherein the confidence score is determined for each classification output by one of the sequence of classifiers, and a determination is made after every output of the classifier, except a last classifier of the sequence, whether to input the textual description to the next classifier of the sequence of classifiers based on the confidence score;
wherein a first plurality of the classifiers in a beginning of the sequence are unsupervised classifiers, followed by one or more supervised classifiers;
wherein a first textual description corresponding to a first product is classified after being input to each of the first plurality of the classifiers without being input to the one or more supervised classifiers;
wherein a second textual description corresponding to a second product is classified after being input to the first plurality of the classifiers and the one or more supervised classifiers;
wherein the sequence of classifiers comprise a plurality of syntactic match classifiers and a plurality of semantic match classifiers;
wherein the unsupervised classifiers comprise an index based classifier followed by an encyclopedia based classifier and the one or more supervised classifiers comprise a Bayes' rule based classifier followed by an embeddings classifier.
2 . The method of claim 1 , wherein the encyclopedia based classifier uses an online encyclopedia comprising a plurality of subjects with corresponding titles.
3 . The method of claim 2 , further comprising:
mapping the textual description to one of the titles using an index build of the titles;
mapping the product categories to the titles based on embedding similarity; and
mapping the textual description to the product category based on the title.
4 . The method of claim 1 , wherein the sequence of classifiers form a pipeline comprising, in sequential order, two syntactic match classifiers followed by three semantic match classifiers, wherein for each classifier a classification is output when the threshold is reached.
5 . The method of claim 1 , wherein the index based classifier preprocesses the textual description of the product, the preprocessing comprising:
converting to lower case;
keeping alphabetic characters only;
removing stop words;
converting words to base form using lemmatization; and
applying collocations.
6 . The method of claim 1 , wherein the Bayes' rule based classifier is trained using a publicly available online dataset, further comprising automatically labeling the online dataset.
7 . The method of claim 1 , wherein the embeddings classifier uses a Universal Sentence Encoder to determine sematic similarly between the textual description and one or more of the product categories.
8 . A non-transitory computer readable medium having instructions stored thereon that, when executed by one or more processors, cause the processors to classify a product to a product category, the classifying comprising:
receiving a textual description of the product;
creating an index of product categories;
sequentially inputting the entire textual description to a sequence of different types of classifiers until the textual description is classified, with a confidence score above a predefined threshold, as one of the product categories, wherein the confidence score is determined for each classification output by one of the sequence of classifiers, and a determination is made after every output of the classifier, except a last classifier of the sequence, whether to input the textual description to the next classifier of the sequence of classifiers based on the confidence score;
wherein a first plurality of the classifiers in a beginning of the sequence are unsupervised classifiers, followed by one or more supervised classifiers;
wherein a first textual description corresponding to a first product is classified after being input to each of the first plurality of the classifiers without being input to the one or more supervised classifiers;
wherein a second textual description corresponding to a second product is classified after being input to the first plurality of the classifiers and the one or more supervised classifiers;
wherein the sequence of classifiers comprise a plurality of syntactic match classifiers and a plurality of semantic match classifiers;
wherein the unsupervised classifiers comprise an index based classifier followed by an encyclopedia based classifier and the one or more supervised classifiers comprise a Bayes' rule based classifier followed by an embeddings classifier.
9 . The computer readable medium of claim 8 , wherein the encyclopedia based classifier uses an online encyclopedia comprising a plurality of subjects with corresponding titles.
10 . The computer readable medium of claim 9 , further comprising:
mapping the textual description to one of the titles using an index build of the titles;
mapping the product categories to the titles based on embedding similarity; and
mapping the textual description to the product category based on the title.
11 . The computer readable medium of claim 8 , wherein the sequence of classifiers form a pipeline comprising, in sequential order, two syntactic match classifiers followed by three semantic match classifiers, wherein for each classifier a classification is output when the threshold is reached.
12 . The computer readable medium of claim 8 , wherein the index based classifier preprocesses the textual description of the product, the preprocessing comprising:
converting to lower case;
keeping alphabetic characters only;
removing stop words;
converting words to base form using lemmatization; and
applying collocations.
13 . The computer readable medium of claim 8 , wherein the Bayes' rule based classifier is trained using a publicly available online dataset, further comprising automatically labeling the online dataset.
14 . The computer readable medium of claim 8 , wherein the embeddings classifier uses a Universal Sentence Encoder to determine sematic similarly between the textual description and one or more of the product categories.
15 . A spend classification system comprising:
one or more processors configured to classify a product to a product category by:
receiving a textual description of the product;
creating an index of product categories;
sequentially inputting the entire textual description to a sequence of different types of classifiers until the textual description is classified, with a confidence score above a predefined threshold, as one of the product categories, wherein the confidence score is determined for each classification output by one of the sequence of classifiers, and a determination is made after every output of the classifier, except a last classifier of the sequence, whether to input the textual description to the next classifier of the sequence of classifiers based on the confidence score;
wherein a first plurality of the classifiers in a beginning of the sequence are unsupervised classifiers, followed by one or more supervised classifiers;
wherein a first textual description corresponding to a first product is classified after being input to each of the first plurality of the classifiers without being input to the one or more supervised classifiers;
wherein a second textual description corresponding to a second product is classified after being input to the first plurality of the classifiers and the one or more supervised classifiers;
wherein the sequence of classifiers comprise a plurality of syntactic match classifiers and a plurality of semantic match classifiers;
wherein the unsupervised classifiers comprise an index based classifier followed by an encyclopedia based classifier and the one or more supervised classifiers comprise a Bayes' rule based classifier followed by an embeddings classifier.
16 . The system of claim 15 , wherein the encyclopedia based classifier uses an online encyclopedia comprising a plurality of subjects with corresponding titles.
17 . The system of claim 16 , the one or more processors further configured for:
mapping the textual description to one of the titles using an index build of the titles;
mapping the product categories to the titles based on embedding similarity; and
mapping the textual description to the product category based on the title.
18 . The system of claim 15 , wherein the sequence of classifiers form a pipeline comprising, in sequential order, two syntactic match classifiers followed by three semantic match classifiers, wherein for each classifier a classification is output when the threshold is reached.
19 . The system of claim 15 , wherein the index based classifier preprocesses the textual description of the product, the preprocessing comprising:
converting to lower case;
keeping alphabetic characters only;
removing stop words;
converting words to base form using lemmatization; and
applying collocations.
20 . The system of claim 15 , wherein the Bayes' rule based classifier is trained using a publicly available online dataset, the one or more processors further configured for automatically labeling the online dataset.