forked from efficientqa/retrieval-based-baselines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
34 lines (26 loc) · 814 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import os
DATA_DIR = "/home/sewon/analysis_multiple/DrQA/data"
DEFAULTS = {
'db_path': os.path.join(DATA_DIR, 'wikipedia/docs.db'),
'tfidf_path': os.path.join(
DATA_DIR,
'wikipedia/docs-tfidf-ngram=2-hash=16777216-tokenizer=simple.npz'
),
}
def set_default(key, value):
global DEFAULTS
DEFAULTS[key] = value
def get_class(name):
if name == 'tfidf':
return TfidfDocRanker
if name == 'sqlite':
return DocDB
raise RuntimeError('Invalid retriever class: %s' % name)
from .doc_db import DocDB
from .tfidf_doc_ranker import TfidfDocRanker