Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi! I'm working on an exercise about Spam Filters using Naive Bayes. Got the data from TREC06 Public Spam Corpus. However, I'm having trouble starting.

Hi! I'm working on an exercise about Spam Filters using Naive Bayes.

Got the data from TREC06 Public Spam Corpus. However, I'm having trouble starting.

Basically there is a file that contains directory of emails in another folder. Format is as follows:

ham ../data/000/000 spam ../data/000/001 spam ../data/000/002 ham ../data/000/003 spam ../data/000/004 ham ../data/000/005 ham ../data/000/006 spam ../data/000/007

This file basically says that in the folder data > 000 > 000 is ham. Then data > 000 > 001 is spam, and so forth.

The folder named data has all the emails (1 email = 1 file).

Wondering how I can create a dataset that has all the email body in one? Kindly help me on the python code please.

Index Classification Email content
000/001 Ham This is the email body
000/002 Spam This is another.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Upgrade Migration And Transformation Tips And Techniques

Authors: Edward Whalen ,Jim Czuprynski

1st Edition

0071846050, 978-0071846059

More Books

Students also viewed these Databases questions

Question

define what is meant by the term human resource management

Answered: 1 week ago