s444356
This commit is contained in:
parent
4cc9c3dcf5
commit
f97a19712e
134238
dev-0/out.tsv
134238
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
154956
dev-1/out.tsv
154956
dev-1/out.tsv
File diff suppressed because it is too large
Load Diff
15
run.py
15
run.py
@ -4,7 +4,7 @@ man = ['silnik', 'windows', 'silnika', 'gb', 'mb', 'meczu', 'pc', 'opony', 'appl
|
||||
'ubuntu', 'systemu', 'serwer']
|
||||
woman = ['ciąży', 'miesiączki', 'ciasto', 'ciążę', 'zadowolona', 'ciąża', 'ciazy', 'antykoncepcyjne', 'ginekologa',
|
||||
'tabletki', 'porodzie', 'mąż', 'miesiączkę', 'krwawienie', 'ciasta']
|
||||
#
|
||||
|
||||
# stemowanie
|
||||
def steming(man, woman):
|
||||
man_stem = []
|
||||
@ -28,12 +28,12 @@ def predict(man_stem, woman_stem, dane):
|
||||
man_count += 1
|
||||
elif w[:5].lower() in woman_stem:
|
||||
woman_count += 1
|
||||
if man_count > woman_count:
|
||||
if man_count >= woman_count:
|
||||
res.append('1')
|
||||
elif man_count < woman_count:
|
||||
res.append('0')
|
||||
else:
|
||||
res.append(str(round(random.random())))
|
||||
# else:
|
||||
# res.append(str(round(random.random())))
|
||||
|
||||
return res
|
||||
|
||||
@ -43,12 +43,7 @@ def out_file(res, name):
|
||||
file.write(p + "\n")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
man_dict, woman_dict = steming(man, woman)
|
||||
|
||||
dane = []
|
||||
with open('dev-0/in.tsv') as data:
|
||||
for idx, line in enumerate(data.readlines()):
|
||||
@ -71,4 +66,4 @@ with open('test-A/in.tsv') as data:
|
||||
dane3.append(line.replace('\n', ''))
|
||||
|
||||
result = predict(man_dict, woman_dict, dane3)
|
||||
out_file(result, 'test-A/out.tsv')
|
||||
out_file(result, 'test-A/out.tsv')
|
132888
test-A/out.tsv
132888
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user