<commit_before>__author__ = 'leif'
import os
import socket
import logging
import logging.config
import logging.handlers

from ifind.common.autocomplete_trie import AutocompleteTrie
from ifind.search.engines.whooshtrecnews import WhooshTrecNews
from experiment_setup import ExperimentSetup


work_dir = os.getcwd()
# when deployed this needs to match up with the hostname, and directory to where the project is

if socket.gethostname() == 'newssearch':
    work_dir = '/ifind/applications/treconomics_project3/'

my_whoosh_doc_index_dir = os.path.join(work_dir, 'data/test100index/')
my_whoosh_query_index_dir = os.path.join(work_dir, "/trec_query_index/index")
my_experiment_log_dir = work_dir
qrels_file = os.path.join(work_dir, "data/TREC2005.qrels.txt")
stopword_file = os.path.join(work_dir, "data/stopwords.txt")
data_dir = os.path.join(work_dir, "data")

print "Work DIR: " + work_dir
print "QRELS File: " + qrels_file
print "my_whoosh_doc_index_dir: " + my_whoosh_doc_index_dir
print "Stopword file: " + stopword_file

event_logger = logging.getLogger('event_log')
event_logger.setLevel(logging.WARNING)
event_logger_handler = logging.FileHandler(os.path.join(my_experiment_log_dir, 'experiment.log'))
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
event_logger_handler.setFormatter(formatter)
event_logger.addHandler(event_logger_handler)

# workflow must always start with /treconomics/startexperiment/

exp_work_flows = [
    ['/treconomics/startexperiment/', '/treconomics/consent', '/treconomics/preexperiment/UK/',
     '/treconomics/prepracticetask/0/', '/treconomics/search/0/', '/treconomics/postpracticetask/0/',
     '/treconomics/pretaskquestions/1/', '/treconomics/search/1/', '/treconomics/posttaskquestions/1/',
     '/treconomics/pretaskquestions/2/', '/treconomics/search/2/', '/treconomics/posttaskquestions/2/',
     '/treconomics/pretaskquestions/3/', '/treconomics/search/3/', '/treconomics/posttaskquestions/3/',
     '/treconomics/logout/'],
    ['/treconomics/startexperiment/', '/treconomics/consent', '/treconomics/preexperiment/AN/',
     '/treconomics/prepracticetask/0/', '/treconomics/search/0/', '/treconomics/postpracticetask/0/',
     '/treconomics/anitatimeinstructions/TC/',
     '/treconomics/anitapretasksurvey/1/', '/treconomics/search/1/', '/treconomics/anitaposttask0survey/1/',
     '/treconomics/anitaposttask1survey/1/', '/treconomics/anitaposttask2survey/1/',<commit_msg>Editing config<commit_after>__author__ = 'leif'
import os
import socket
import logging
import logging.config
import logging.handlers

from ifind.common.autocomplete_trie import AutocompleteTrie
from ifind.search.engines.whooshtrecnews import WhooshTrecNews
from experiment_setup import ExperimentSetup


work_dir = os.getcwd()
# when deployed this needs to match up with the hostname, and directory to where the project is

if socket.gethostname() == 'newssearch':
    work_dir = '~/ifind/applications/treconomics_project3/'

my_whoosh_doc_index_dir = os.path.join(work_dir, 'data/test100index/')
my_whoosh_query_index_dir = os.path.join(work_dir, "/trec_query_index/index")
my_experiment_log_dir = work_dir
qrels_file = os.path.join(work_dir, "data/TREC2005.qrels.txt")
stopword_file = os.path.join(work_dir, "data/stopwords.txt")
data_dir = os.path.join(work_dir, "data")

print "Work DIR: " + work_dir
print "QRELS File: " + qrels_file
print "my_whoosh_doc_index_dir: " + my_whoosh_doc_index_dir
print "Stopword file: " + stopword_file

event_logger = logging.getLogger('event_log')
event_logger.setLevel(logging.WARNING)
event_logger_handler = logging.FileHandler(os.path.join(my_experiment_log_dir, 'experiment.log'))
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
event_logger_handler.setFormatter(formatter)
event_logger.addHandler(event_logger_handler)

# workflow must always start with /treconomics/startexperiment/

exp_work_flows = [
    ['/treconomics/startexperiment/', '/treconomics/preexperiment/UK/',
     '/treconomics/prepracticetask/0/', '/treconomics/search/0/', '/treconomics/postpracticetask/0/',
     '/treconomics/pretaskquestions/1/', '/treconomics/search/1/', '/treconomics/posttaskquestions/1/',
     '/treconomics/pretaskquestions/2/', '/treconomics/search/2/', '/treconomics/posttaskquestions/2/',
     '/treconomics/pretaskquestions/3/', '/treconomics/search/3/', '/treconomics/posttaskquestions/3/',
     '/treconomics/logout/'],
    ['/treconomics/startexperiment/', '/treconomics/consent', '/treconomics/preexperiment/AN/',
     '/treconomics/prepracticetask/0/', '/treconomics/search/0/', '/treconomics/postpracticetask/0/',
     '/treconomics/anitatimeinstructions/TC/',
     '/treconomics/anitapretasksurvey/1/', '/treconomics/search/1/', '/treconomics/anitaposttask0survey/1/',
     '/treconomics/anitaposttask1survey/1/', '/treconomics/anitaposttask2survey/1/',
{'fraction_non_alphanumeric': 0.13921971252566734, 'fraction_numerical': 0.01273100616016427, 'mean_word_length': 5.645293315143247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2372247', 'n_tokens_mistral': 1785, 'n_tokens_neox': 1733, 'n_words': 253}