-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
36 lines (31 loc) · 1018 Bytes
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
from FeatureExtractor import extractDataFilesAndFeatures
from Util import saveFolder
def extractFolderPath(path):
index = path.find('/')
while index!=-1:
lastIndex = index
index = path.find('/', index+1)
folderPath = path[0:lastIndex+1]
return folderPath
def doPreProcessingAndTraining(trainDB):
model = ''
path = extractFolderPath(trainDB)
finalPath = path+'blogs_final'
saveFolder(finalPath)
resultPath =path+'blogs_result'
saveFolder(resultPath)
#read files from the train DB and extract features
extractDataFilesAndFeatures(trainDB,finalPath,resultPath)
#make a model
return model
def doProcessingAndTesting(testDB):
result =''
#read files from the test DB
#run the model on test data
#get prediction file
return result
def run(trainDB, testDB):
doPreProcessingAndTraining(trainDB)
doProcessingAndTesting(testDB)
doPreProcessingAndTraining('/Users/Golnoosh/Documents/Blog data/blogs')