Fixed problem with KeyError
This commit is contained in:
parent
c6dff78d16
commit
5d7f903e18
@ -10,13 +10,13 @@ paranomal_class_logprob, skeptic_class_logprob, word_logprobs = pickle_loaded
|
|||||||
#Niektórych słów nie bezie w zbiorze treningowym dev-0 i dev-A
|
#Niektórych słów nie bezie w zbiorze treningowym dev-0 i dev-A
|
||||||
for i in word_logprobs.keys():
|
for i in word_logprobs.keys():
|
||||||
for token, tokens in word_logprobs[i].items():
|
for token, tokens in word_logprobs[i].items():
|
||||||
if token in word_logprobs['skeptic'] and word_logprobs['paranormal']:
|
try:
|
||||||
try:
|
if (word_logprobs['skeptic'][token] > word_logprobs['paranormal'][token]):
|
||||||
if (word_logprobs['skeptic'][token] > word_logprobs['paranormal'][token]):
|
write_file_test.write("S\n")
|
||||||
write_file_test.write("S\n")
|
write_file_dev.write("S\n")
|
||||||
write_file_dev.write("S\n")
|
else:
|
||||||
else:
|
write_file_test.write("P\n")
|
||||||
write_file_test.write("P\n")
|
write_file_dev.write("P\n")
|
||||||
write_file_dev.write("P\n")
|
except KeyError:
|
||||||
except KeyError:
|
write_file_dev.write("N\n")
|
||||||
print(token + " not avaible")
|
write_file_test.write("N\n")
|
591396
dev-0/out.tsv
591396
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
591396
test-A/out.tsv
591396
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user