Compare commits
2 Commits
linear-reg
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
2787573a2c | ||
|
9cb993d397 |
10544
dev-0/expected.tsv
10544
dev-0/expected.tsv
File diff suppressed because it is too large
Load Diff
10544
dev-0/out.tsv
10544
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
@ -64,8 +64,8 @@ def calc_words_logprobs(words_counts):
|
||||
total_paranormal = sum(word_counts['paranormal'].values() + len(word_counts['paranormal'].keys()))
|
||||
|
||||
|
||||
# with open('prediction.tsv', 'wt') as tsvfile:
|
||||
# tsv_writer = csv.writer(tsvfile, delimiter='\t')
|
||||
# for i in range(counter):
|
||||
# tsv_writer.writerow('S')
|
||||
with open('prediction.tsv', 'wt') as tsvfile:
|
||||
tsv_writer = csv.writer(tsvfile, delimiter='\t')
|
||||
for i in range(counter):
|
||||
tsv_writer.writerow('S')
|
||||
|
||||
|
@ -1,17 +1,22 @@
|
||||
import csv
|
||||
|
||||
import re
|
||||
|
||||
def makeoutput(infile, outfile):
|
||||
counter = 0
|
||||
output = []
|
||||
regex = r'paranormal|ufo|youtube|spirit'
|
||||
with open(infile) as tsvfile:
|
||||
reader = csv.reader(tsvfile, delimiter='\t')
|
||||
for row in reader:
|
||||
counter+=1
|
||||
if re.search(regex, str(row).lower()):
|
||||
output.append('1')
|
||||
else:
|
||||
output.append('0')
|
||||
|
||||
|
||||
with open(outfile, 'wt') as tsvfile:
|
||||
tsv_writer = csv.writer(tsvfile, delimiter='\t')
|
||||
for i in range(counter):
|
||||
tsv_writer.writerow('S')
|
||||
for i in output:
|
||||
tsv_writer.writerow(i)
|
||||
|
||||
makeoutput("test-A/in.tsv", "test-A/out.tsv")
|
||||
makeoutput("train/in.tsv", "train/out.tsv")
|
||||
|
10304
test-A/out.tsv
10304
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
579158
train/expected.tsv
579158
train/expected.tsv
File diff suppressed because it is too large
Load Diff
579082
train/out.tsv
579082
train/out.tsv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user