-
Notifications
You must be signed in to change notification settings - Fork 11
/
pbm.py
37 lines (34 loc) · 974 Bytes
/
pbm.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
35
36
37
"""Executes various steps within the PubMed Best Match (pbm) pipeline.
Usage:
pbm load
pbm classify
pbm fetch
pbm calculate
pbm train
pbm evaluate (before|after)
pbm export
"""
from docopt import docopt
# TODO: add controls to verify the workflow (e.g. not to train before loading articles)
def main():
args = docopt(__doc__)
if args["load"]:
from bestmatch import loadData
if args["classify"]:
from bestmatch import classifyQueries
if args["fetch"]:
from bestmatch import fetchArticles
if args["calculate"]:
from bestmatch import createDataset
if args["train"]:
from bestmatch import train
if args["evaluate"]:
from bestmatch import evaluate
if args["before"]:
evaluate.evaluate(False)
if args["after"]:
evaluate.evaluate(True)
if args["export"]:
from bestmatch import export
if __name__ == '__main__':
main()