-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (27 loc) · 1.2 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
python = python3
all: html_output
data/work/texts.csv:
$(python) code/segment_texts.py data/raw/*.json > $@
data/work/embeddings_ngrams.pt: data/work/texts.csv
$(python) code/embed_ngrams.py -i $< -e $@ -d 450 -n 2
# Note: use the -m parameter to change the SentenceBERT model
data/work/embeddings_sbert.pt: data/work/texts.csv
$(python) code/embed_sbert.py -i $< -e $@
data/final/alignments_ngrams.csv: \
data/work/texts.csv \
data/work/embeddings_ngrams.pt
$(python) code/run_alignment.py \
-l book -i data/work/texts.csv -e data/work/embeddings_ngrams.pt > $@
data/final/alignments_sbert.csv: \
data/work/texts.csv \
data/work/embeddings_sbert.pt
$(python) code/run_alignment.py \
-l book -i data/work/texts.csv -e data/work/embeddings_sbert.pt > $@
html_output: data/work/texts.csv data/final/alignments_ngrams.csv data/final/alignments_sbert.csv
mkdir -p html_output
mkdir -p html_output/ngrams
mkdir -p html_output/sbert
$(python) code/render_alignments.py \
-l book -i data/work/texts.csv -a data/final/alignments_ngrams.csv -o html_output/ngrams
$(python) code/render_alignments.py \
-l book -i data/work/texts.csv -a data/final/alignments_sbert.csv -o html_output/sbert