Compare commits

...

2 Commits

Author SHA1 Message Date
Artur Dylewski
2787573a2c poprawki 2020-06-08 15:25:08 +02:00
dylodylo
9cb993d397 test commit from Windows 2020-04-06 15:34:10 +02:00
7 changed files with 594830 additions and 594825 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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')

View File

@ -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")

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

579082
train/out.tsv

File diff suppressed because it is too large Load Diff