forked from yask123/Summarize-it
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
76 lines (54 loc) · 1.52 KB
/
Makefile
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
platform=$(shell uname -s)
conda_path=$(shell which conda)
.PHONY: show check-env venv check run hyp spacy_hyp
ifeq ($(platform),Darwin)
ifneq ($(findstring conda,$(conda_path)),conda)
$(error Conda not present)
else
@echo Conda present at $(conda_path)
endif
ifeq ($(SUMMARIZE_VENV),)
SUMMARIZE_VENV=summarize_venv2
endif
ifeq ($(CONDA_ENV_PATH),)
CONDA_ENV_PATH=//anaconda
endif
HOST_IP?=10.0.0.10
NB_PORT?=8887
PYLIBS := numpy scipy scikit-learn gensim spacy flask
VENVDIR := $(CONDA_ENV_PATH)/envs/$(SUMMARIZE_VENV)
$(VENVDIR):
test -d $(VENVDIR) || conda create -y -n $(SUMMARIZE_VENV) $(PYLIBS)
deps: $(VENVDIR)
check: $(VENVDIR)
source activate $(SUMMARIZE_VENV);\
python ./test_summarizer.py;\
python ./test_service_components.py
run: $(VENVDIR)
source activate $(SUMMARIZE_VENV);\
python ./ts_summarizer.py
else ifeq ($(platform),Linux)
VENVDIR := ./venv
PYVENV := $(VENVDIR)/bin/python
NBVENV := $(VENVDIR)/bin/ipython
PIPVENV := $(VENVDIR)/bin/pip
clean:
rm -r $(VENVDIR)
check: | $(VENVDIR)
$(PYVENV) ./test_summarizer.py;\
$(PYVENV) ./test_service_components.py
hyp: | $(VENVDIR)
$(PYVENV) ./test_hypothesis_summarizer.py
spacy_hyp: | $(VENVDIR)
$(PYVENV) ./test_spacy_with_hypothesis.py
run: | $(VENVDIR)
$(PYVENV) ./ts_summarizer.py
notebook: | $(VENVDIR)
$(NBVENV) notebook --ip=$(HOST_IP) --port=$(NB_PORT) --no-browser
$(VENVDIR):
test -d $(VENVDIR) || (virtualenv $(VENVDIR);\
$(PIPVENV) install -r ./requirements.txt;\
$(PYVENV) -m spacy.en.download all)
else
$(error, Unknown platform)
endif