434780
This commit is contained in:
parent
a865e5781f
commit
b6f858fa1e
4
run.py
4
run.py
@ -35,7 +35,7 @@ def predict(before, after):
|
||||
prob += value
|
||||
result += f'{key}:{value} '
|
||||
if prob == 0.0:
|
||||
return 'to:0.02 be:0.02 the:0.02 or:0.01 not:0.01 and:0.01 a:0.01 :0.9'
|
||||
return 'to:0.015 be:0.015 the:0.015 not:0.01 and:0.02 a:0.02 :0.9'
|
||||
result += f':{max(1 - prob, 0.01)}'
|
||||
return result
|
||||
|
||||
@ -46,7 +46,7 @@ def make_prediction(file):
|
||||
for _, row in data.iterrows():
|
||||
before, after = word_tokenize(data_preprocessing(str(row[6]))), word_tokenize(data_preprocessing(str(row[7])))
|
||||
if len(before) < 3 or len(after) < 3:
|
||||
prediction = 'to:0.02 be:0.02 the:0.02 or:0.01 not:0.01 and:0.01 a:0.01 :0.9'
|
||||
prediction = 'to:0.015 be:0.015 the:0.015 not:0.01 and:0.02 a:0.02 :0.9'
|
||||
else:
|
||||
prediction = predict(before[-1], after[0])
|
||||
file_out.write(prediction + '\n')
|
||||
|
Loading…
Reference in New Issue
Block a user