Skip to content

Commit 640afe4

Browse files
committed
Dockerization done
1 parent 6eb378a commit 640afe4

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

docker/article-relevance/docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ services:
77
- DOI_PATH=data/article-relevance/raw
88
- PARQUET_PATH=data/article-relevance/processed/prediction_parquet
99
- N_RECENT=10
10+
- MIN_DATE=
11+
- MAX_DATE=
1012
- AUTO_MIN_DATE=False
1113
- AUTO_CHECK_DUP=False
1214

1315
# Arguments for relevance prediction script
1416
- DOI_FILE_PATH=data/article-relevance/raw/gdd_api_return.json
15-
- MODEL_PATH=data/article-relevance/processed/logistic_regression_model.joblib
17+
- MODEL_PATH=models/article-relevance/logistic_regression_model.joblib
1618
- OUTPUT_PATH=data/article-relevance/processed
1719
- SEND_XDD=False
42.9 KB
Binary file not shown.

src/article_relevance/gdd_api_query.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ def get_new_gdd_articles(output_path,
7272
get_new_gdd_articles(n_recent_articles = 1000)
7373
"""
7474

75+
# ======== To handle placeholder for arguments in the docker compose, convert empty str to None ===
76+
if n_recent_articles == '':
77+
n_recent_articles = None
78+
if min_date == '':
79+
min_date = None
80+
if max_date == '':
81+
max_date = None
82+
if term == '':
83+
term = None
84+
7585
# ======== Tests for input data type ==========
7686
if (n_recent_articles is None) and (min_date is None and max_date is None):
7787
raise ValueError("Either n_recent_articles or a date range should be specified.")

src/article_relevance/relevance_prediction_parquet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Usage: relevance_prediction.py --doi_file_path=<doi_path> --model_path=<model_path> --output_path=<output_path> --send_xdd=<send_xdd>
1111
1212
Options:
13-
--doi_file_path=<doi_file_path> The path to where the list of DOI is.
13+
--doi_file_path=<doi_file_path> The path to where the list of DOI is.
1414
--model_path=<model_path> The path to where the model object is stored.
1515
--output_path=<output_path> The path to where the output files will be saved.
1616
--send_xdd=<send_xdd> When True, relevant articles will be sent to xDD through API query. Default is False.

0 commit comments

Comments
 (0)