Model Retraining Code. More...
Functions | |
| def | partial_filter.update_Dictionary (emails) |
| Method to update Dictionary. More... | |
| def | partial_filter.extract_features (files) |
| Method to extract features from all mails. More... | |
| def | partial_filter.mail_features (mail) |
| Method to find features of a single mail. More... | |
| def | partial_filter.preprocessor (mail) |
| Method to pre-process the mails. More... | |
| def | partial_filter.find_payload (mail_body, all_words) |
| Method to recursively find single part payloads. More... | |
| def | partial_filter.split_payload (payload, all_words) |
| Method to split the large payloads into smaller chunks. More... | |
| def | partial_filter.get_words_plain (content, all_words) |
| Method to get words out of plain text content. More... | |
| def | partial_filter.get_words_html (content, all_words) |
| Method to get words out of html content. More... | |
Model Retraining Code.
This code loads the current model and dictionary and updates them based on the new mails.
| directory | The full address of directory containing retraining mails. |
| spam_status | 1 if the mails in directory are spam, 0 if they are ham. |
| def partial_filter.extract_features | ( | files | ) |
Method to extract features from all mails.
| files | The list of mail files' addresses |
| def partial_filter.find_payload | ( | mail_body, | |
| all_words | |||
| ) |
Method to recursively find single part payloads.
| mail_body | The complete mail body |
| all_words | List of all words in the mail |
| def partial_filter.get_words_html | ( | content, | |
| all_words | |||
| ) |
Method to get words out of html content.
| content | The html content |
| all_words | List of all words in the mail |
| def partial_filter.get_words_plain | ( | content, | |
| all_words | |||
| ) |
Method to get words out of plain text content.
| content | Plain text content |
| all_words | List of all words in the mail |
| def partial_filter.mail_features | ( | ) |
Method to find features of a single mail.
| The address of mail |
| def partial_filter.preprocessor | ( | ) |
Method to pre-process the mails.
| The address of mail |
| def partial_filter.split_payload | ( | payload, | |
| all_words | |||
| ) |
Method to split the large payloads into smaller chunks.
| payload | The complete payload |
| all_words | List of all words in the mail |
| def partial_filter.update_Dictionary | ( | emails | ) |
Method to update Dictionary.
| emails | The list of mail files' addresses |