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
|
||||
for i in word_logprobs.keys():
|
||||
for token, tokens in word_logprobs[i].items():
|
||||
if token in word_logprobs['skeptic'] and word_logprobs['paranormal']:
|
||||
try:
|
||||
if (word_logprobs['skeptic'][token] > word_logprobs['paranormal'][token]):
|
||||
write_file_test.write("S\n")
|
||||
write_file_dev.write("S\n")
|
||||
else:
|
||||
write_file_test.write("P\n")
|
||||
write_file_dev.write("P\n")
|
||||
except KeyError:
|
||||
print(token + " not avaible")
|
||||
try:
|
||||
if (word_logprobs['skeptic'][token] > word_logprobs['paranormal'][token]):
|
||||
write_file_test.write("S\n")
|
||||
write_file_dev.write("S\n")
|
||||
else:
|
||||
write_file_test.write("P\n")
|
||||
write_file_dev.write("P\n")
|
||||
except KeyError:
|
||||
write_file_dev.write("N\n")
|
||||
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