I want to classify emails as Spam and Non-Spam.
I have a labelled dataset of 20,000 emails in TXT format. The emails are in individual files and also in one combined file.
An example email looks like this:
From: "Sender Display Name" <firstname.lastname@example.org> To: systudent <email@example.com>, tystudent <firstname.lastname@example.org>, btechstudent <email@example.com>, mtech16 <firstname.lastname@example.org>, mtech17 <email@example.com> Subject: Register to the event Date: Tue, 21 Nov 2017 14:16:17 +0000 X-Originating-IP: [22.214.171.124] Body: Some spam text <https://somelink.com/abc> EOM Label: Spam
The features that I want to use are: Sender Display Name, Sender Email address, Receivers, Subject, Date, IP, URL.
How do I convert these to input feature vectors or how can I give these as input which are currently in TXT format, to Machine Learning Algorithms like Random Forest, Naive Bayes, etc. ?