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
13
run.py
13
run.py
@ -4,7 +4,7 @@ man = ['silnik', 'windows', 'silnika', 'gb', 'mb', 'meczu', 'pc', 'opony', 'appl
|
|||||||
'ubuntu', 'systemu', 'serwer']
|
'ubuntu', 'systemu', 'serwer']
|
||||||
woman = ['ciąży', 'miesiączki', 'ciasto', 'ciążę', 'zadowolona', 'ciąża', 'ciazy', 'antykoncepcyjne', 'ginekologa',
|
woman = ['ciąży', 'miesiączki', 'ciasto', 'ciążę', 'zadowolona', 'ciąża', 'ciazy', 'antykoncepcyjne', 'ginekologa',
|
||||||
'tabletki', 'porodzie', 'mąż', 'miesiączkę', 'krwawienie', 'ciasta']
|
'tabletki', 'porodzie', 'mąż', 'miesiączkę', 'krwawienie', 'ciasta']
|
||||||
#
|
|
||||||
# stemowanie
|
# stemowanie
|
||||||
def steming(man, woman):
|
def steming(man, woman):
|
||||||
man_stem = []
|
man_stem = []
|
||||||
@ -28,12 +28,12 @@ def predict(man_stem, woman_stem, dane):
|
|||||||
man_count += 1
|
man_count += 1
|
||||||
elif w[:5].lower() in woman_stem:
|
elif w[:5].lower() in woman_stem:
|
||||||
woman_count += 1
|
woman_count += 1
|
||||||
if man_count > woman_count:
|
if man_count >= woman_count:
|
||||||
res.append('1')
|
res.append('1')
|
||||||
elif man_count < woman_count:
|
elif man_count < woman_count:
|
||||||
res.append('0')
|
res.append('0')
|
||||||
else:
|
# else:
|
||||||
res.append(str(round(random.random())))
|
# res.append(str(round(random.random())))
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@ -43,12 +43,7 @@ def out_file(res, name):
|
|||||||
file.write(p + "\n")
|
file.write(p + "\n")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
man_dict, woman_dict = steming(man, woman)
|
man_dict, woman_dict = steming(man, woman)
|
||||||
|
|
||||||
dane = []
|
dane = []
|
||||||
with open('dev-0/in.tsv') as data:
|
with open('dev-0/in.tsv') as data:
|
||||||
for idx, line in enumerate(data.readlines()):
|
for idx, line in enumerate(data.readlines()):
|
||||||
|
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