repaired
This commit is contained in:
parent
0a9af20404
commit
3f33af372f
9
app.py
9
app.py
@ -5,7 +5,7 @@ from sklearn.feature_extraction.text import TfidfVectorizer
|
||||
import numpy as np
|
||||
|
||||
|
||||
def getResult(filePath):
|
||||
def makePrediction(filePath):
|
||||
with open(filePath + 'in.tsv') as input:
|
||||
predictData = input.readlines()
|
||||
pred = model.predict(predictData)
|
||||
@ -14,9 +14,6 @@ def getResult(filePath):
|
||||
result.write(str(prediction) + '\n')
|
||||
|
||||
|
||||
# trainInData = getData('./train/in.tsv')
|
||||
# trainExpData = getData('./train/expected.tsv')
|
||||
|
||||
expectedTraining = open('./train/expected.tsv').readlines()
|
||||
inTraining = open('./train/in.tsv').readlines()
|
||||
|
||||
@ -27,5 +24,5 @@ pipeline = Pipeline(
|
||||
model = pipeline.fit(inTraining, afterTransform)
|
||||
|
||||
|
||||
getResult('./dev-0/')
|
||||
getResult('./test-A/')
|
||||
makePrediction('./dev-0/')
|
||||
makePrediction('./test-A/')
|
||||
|
Loading…
Reference in New Issue
Block a user