Systems and methods for determination, description, and use of feature sets for machine learning classification systems, including electronic messaging systems employing machine learning classification
Systems and methods for dynamically defining features for machine learning models in classification systems are disclosed. Such systems and methods may be usefully applied to train and utilize machine learning models in a variety of contexts, including email classification systems.
1 . A method for feature creation in machine learning models, comprising:
processing each of a plurality of training documents of a training corpus, the training documents associated with a class label, wherein a set of features for a current training cycle is dynamically determined based on fragments generated from the training documents of the training corpus for the current training cycle, and wherein the processing of each training document comprises:
determining a first fragment from the training document based on parsing the training document using a set of pattern definitions to segment content of the training document into fragments;
determining a first feature descriptor for the first fragment, the first feature descriptor determined based on attributes of the first fragment according to an abstract naming schema that defines portions of the first feature descriptor based on those attributes, wherein the abstract naming schema encodes at least: (i) a location portion indicating a source field from which the fragment was obtained, (ii) a value definition portion indicating a type of value to be derived from the fragment, and (iii) a fragment address portion indicating a position of the fragment relative to other fragments;
determining a value associated with the first feature descriptor based on the first fragment and based on the type of value indicated by the value definition portion;
adding the first feature descriptor to a feature descriptor catalog when the determined first feature descriptor is not in the feature descriptor catalog, wherein the feature descriptor catalog is dynamically populated during processing of the training corpus such that the features used to train the machine learning model vary between training cycles based on actual content of the training documents; and
adding the value for the first feature to training data in association with the first feature descriptor and the training document;
training the machine learning model based on the training data such that features of the trained machine learning model comprise feature descriptors determined for fragments of the training document of the training corpus, wherein the training data comprises the values for feature descriptors for the training documents and the class label associated with the training documents, and wherein the features used to train the machine learning model for the current training cycle differ from features used in a different training cycle based on differences in fragments generated based on training documents between the training cycles; and
providing the feature descriptor catalog and the trained machine learning model to a classification system for use in classification of documents, wherein the classification system uses the abstract naming schema to generate feature descriptors for fragments of an incoming document such that a feature descriptor generated for a fragment of the incoming document matches a corresponding feature descriptor in the feature descriptor catalog when the fragment has attributes that match attributes of a fragment from the training corpus.
2 . The method of claim 1 , wherein the documents are email messages.
3 . The method of claim 2 , wherein the first fragment is determined from an email address from the header of the email message.
4 . The method of claim 3 , wherein the first fragment is determined from a segment of the email address, the segment comprising a local part, domain part or friendly part of the email address.
5 . The method of claim 4 , wherein the class label comprises a spam label.
6 . The method of claim 1 , further comprising:
receiving an incoming document;
determining a set of second fragments from the incoming document;
for each second fragment:
determining a second feature descriptor for the second fragment, the second feature descriptor determined based on attributes of the second fragment according to the abstract naming schema that defines portions of the second feature descriptor based on those attributes;
determining a value associated with the second feature descriptor based on the second fragment; and
when the second feature descriptor is in the feature descriptor catalog, adding the value for the second feature descriptor to a feature vector for the incoming document in association with the second feature descriptor; and
classifying the incoming document by applying the trained machine learning model to the feature vector for the incoming document.
7 . The method of claim 6 , further comprising assigning default values for feature descriptors of the feature descriptor catalog that have no assigned values in the feature vector.
8 . A system for training and use of machine learning models in document classification, comprising:
a processor;
a non-transitory computer-readable medium comprising instructions for:
processing each of a plurality of training documents of a training corpus, the training documents associated with a class label, wherein a set of features for a current training cycle is dynamically determined based on fragments generated from the training documents of the training corpus for the current training cycle, and wherein the processing of each training document comprises:
determining a first fragment from the training document based on parsing the training document using a set of pattern definitions to segment content of the training document into fragments;
determining a first feature descriptor for the first fragment, the first feature descriptor determined based on attributes of the first fragment according to an abstract naming schema that defines portions of the first feature descriptor based on those attributes, wherein the abstract naming schema encodes at least: (i) a location portion indicating a source field from which the fragment was obtained, (ii) a value definition portion indicating a type of value to be derived from the fragment, and (iii) a fragment address portion indicating a position of the fragment relative to other fragments;
determining a value associated with the first feature descriptor based on the first fragment and based on the type of value indicated by the value definition portion;
adding the first feature descriptor to a feature descriptor catalog when the determined first feature descriptor is not in the feature descriptor catalog, wherein the feature descriptor catalog is dynamically populated during processing of the training corpus such that the features used to train the machine learning model vary between training cycles based on actual content of the training documents; and
adding the value for the first feature to training data in association with the first feature descriptor and the training document;
training the machine learning model based on the training data such that features of the trained machine learning model comprise feature descriptors determined for fragments of the training document of the training corpus, wherein the training data comprises the values for feature descriptors for the training documents and the class label associated with the training documents, and wherein the features used to train the machine learning model for the current training cycle differ from features used in a different training cycle based on differences in fragments generated based on training documents between the training cycles; and
providing the feature descriptor catalog and the trained machine learning model to a classification system for use in classification of documents, wherein the classification system uses the abstract naming schema to generate feature descriptors for fragments of an incoming document such that a feature descriptor generated for a fragment of the incoming document matches a corresponding feature descriptor in the feature descriptor catalog when the fragment has attributes that match attributes of a fragment from the training corpus.
9 . The system of claim 8 , wherein the documents are email messages.
10 . The system of claim 9 , wherein the first fragment is determined from an email address from the header of the email message.
11 . The system of claim 10 , wherein the first fragment is determined from a segment of the email address, the segment comprising a local part, domain part or friendly part of the email address.
12 . The system of claim 11 , wherein the class label comprises a spam label.
13 . The system of claim 8 , wherein the instructions are further for:
receiving an incoming document;
determining a set of second fragments from the incoming document;
for each second fragment:
determining a second feature descriptor for the second fragment, the second feature descriptor determined based on attributes of the second fragment according to the abstract naming schema that defines portions of the second feature descriptor based on those attributes;
determining a value associated with the second feature descriptor based on the second fragment; and
when the second feature descriptor is in the feature descriptor catalog, adding the value for the second feature descriptor to a feature vector for the incoming document in association with the second feature descriptor; and
classifying the incoming document by applying the trained machine learning model to the feature vector for the incoming document.
14 . The system of claim 13 , wherein the instructions are further for: assigning default values for feature descriptors of the feature descriptor catalog that have no assigned values in the feature vector.
15 . A non-transitory computer readable medium, comprising instructions for:
processing each of a plurality of training documents of a training corpus, the training documents associated with a class label, wherein a set of features for a current training cycle is dynamically determined based on fragments generated from the training documents of the training corpus for the current training cycle, and wherein the processing of each training document comprises:
determining a first fragment from the training document based on parsing the training document using a set of pattern definitions to segment content of the training document into fragments;
determining a first feature descriptor for the first fragment, the first feature descriptor determined based on attributes of the first fragment according to an abstract naming schema that defines portions of the first feature descriptor based on those attributes, wherein the abstract naming schema encodes at least: (i) a location portion indicating a source field from which the fragment was obtained, (ii) a value definition portion indicating a type of value to be derived from the fragment, and (iii) a fragment address portion indicating a position of the fragment relative to other fragments;
determining a value associated with the first feature descriptor based on the first fragment and based on the type of value indicated by the value definition portion;
adding the first feature descriptor to a feature descriptor catalog when the determined first feature descriptor is not in the feature descriptor catalog, wherein the feature descriptor catalog is dynamically populated during processing of the training corpus such that the features used to train the machine learning model vary between training cycles based on actual content of the training documents; and
adding the value for the first feature to training data in association with the first feature descriptor and the training document;
training the machine learning model based on the training data such that features of the trained machine learning model comprise feature descriptors determined for fragments of the training document of the training corpus, wherein the training data comprises the values for feature descriptors for the training documents and the class label associated with the training documents, and wherein the features used to train the machine learning model for the current training cycle differ from features used in a different training cycle based on differences in fragments generated based on training documents between the training cycles; and
providing the feature descriptor catalog and the trained machine learning model to a classification system for use in classification of documents, wherein the classification system uses the abstract naming schema to generate feature descriptors for fragments of an incoming document such that a feature descriptor generated for a fragment of the incoming document matches a corresponding feature descriptor in the feature descriptor catalog when the fragment has attributes that match attributes of a fragment from the training corpus.
16 . The non-transitory computer readable medium of claim 15 , wherein the documents are email messages.
17 . The non-transitory computer readable medium of claim 16 , wherein the first fragment is determined from an email address from the header of the email message.
18 . The non-transitory computer readable medium of claim 17 , wherein the first fragment is determined from a segment of the email address, the segment comprising a local part, domain part or friendly part of the email address.
19 . The non-transitory computer readable medium of claim 18 , wherein the class label comprises a spam label.
20 . The non-transitory computer readable medium of claim 15 , wherein the instructions are further for:
receiving an incoming document;
determining a set of second fragments from the incoming document;
for each second fragment:
determining a second feature descriptor for the second fragment, the second feature descriptor determined based on attributes of the second fragment according to the abstract naming schema that defines portions of the second feature descriptor based on those attributes;
determining a value associated with the second feature descriptor based on the second fragment; and
when the second feature descriptor is in the feature descriptor catalog, adding the value for the second feature descriptor to a feature vector for the incoming document in association with the second feature descriptor; and
classifying the incoming document by applying the trained machine learning model to the feature vector for the incoming document.
21 . The non-transitory computer readable medium of claim 20 , wherein the instructions are further for: assigning default values for feature descriptors of the feature descriptor catalog that have no assigned values in the feature vector.