Spaces:
Runtime error
Runtime error
Commit
·
0842de0
0
Parent(s):
Initial commit
Browse files- .dvc/.gitignore +9 -0
- .dvc/config +0 -0
- .gitattributes +1 -0
- .gitignore +90 -0
- LICENSE +8 -0
- Makefile +94 -0
- README.md +71 -0
- dvc.lock +34 -0
- dvc.yaml +29 -0
- notebooks/.gitkeep +0 -0
- raw_data.dvc +3 -0
- references/.gitkeep +0 -0
- reports/.gitkeep +0 -0
- reports/figures/.gitkeep +0 -0
- reports/metrics.txt +0 -0
- reports/training_metrics.txt +0 -0
- requirements.txt +9 -0
- setup.py +7 -0
- src/__init__.py +0 -0
- src/data/.gitkeep +0 -0
- src/data/__init__.py +0 -0
- src/data/make_dataset.py +0 -0
- src/models/.gitkeep +0 -0
- src/models/__init__.py +0 -0
- src/models/predict_model.py +0 -0
- src/models/train_model.py +0 -0
- src/visualization/.gitkeep +0 -0
- src/visualization/__init__.py +0 -0
- src/visualization/visualize.py +0 -0
- tox.ini +3 -0
.dvc/.gitignore
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/state
|
2 |
+
/lock
|
3 |
+
/config.local
|
4 |
+
/updater
|
5 |
+
/updater.lock
|
6 |
+
/state-journal
|
7 |
+
/state-wal
|
8 |
+
/cache
|
9 |
+
/tmp
|
.dvc/config
ADDED
File without changes
|
.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
* text=auto
|
.gitignore
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Byte-compiled / optimized / DLL files
|
2 |
+
__pycache__/
|
3 |
+
*.py[cod]
|
4 |
+
|
5 |
+
# C extensions
|
6 |
+
*.so
|
7 |
+
|
8 |
+
# Distribution / packaging
|
9 |
+
.Python
|
10 |
+
/env/
|
11 |
+
/build/
|
12 |
+
/develop-eggs/
|
13 |
+
/dist/
|
14 |
+
/downloads/
|
15 |
+
/eggs/
|
16 |
+
/.eggs/
|
17 |
+
/lib/
|
18 |
+
/lib64/
|
19 |
+
/parts/
|
20 |
+
/sdist/
|
21 |
+
/var/
|
22 |
+
*.egg-info/
|
23 |
+
.installed.cfg
|
24 |
+
*.egg
|
25 |
+
|
26 |
+
# PyInstaller
|
27 |
+
# Usually these files are written by a python script from a template
|
28 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
29 |
+
*.manifest
|
30 |
+
*.spec
|
31 |
+
|
32 |
+
# Installer logs
|
33 |
+
pip-log.txt
|
34 |
+
pip-delete-this-directory.txt
|
35 |
+
|
36 |
+
# Unit test / coverage reports
|
37 |
+
htmlcov/
|
38 |
+
.tox/
|
39 |
+
.coverage
|
40 |
+
.coverage.*
|
41 |
+
.cache
|
42 |
+
nosetests.xml
|
43 |
+
coverage.xml
|
44 |
+
*.cover
|
45 |
+
|
46 |
+
# Translations
|
47 |
+
*.mo
|
48 |
+
*.pot
|
49 |
+
|
50 |
+
# Django stuff:
|
51 |
+
*.log
|
52 |
+
|
53 |
+
# Sphinx documentation
|
54 |
+
/docs/_build/
|
55 |
+
|
56 |
+
# PyBuilder
|
57 |
+
/target/
|
58 |
+
|
59 |
+
# DotEnv configuration
|
60 |
+
.env
|
61 |
+
|
62 |
+
# Database
|
63 |
+
*.db
|
64 |
+
*.rdb
|
65 |
+
|
66 |
+
# Pycharm
|
67 |
+
.idea
|
68 |
+
|
69 |
+
# VS Code
|
70 |
+
.vscode/
|
71 |
+
|
72 |
+
# Spyder
|
73 |
+
.spyproject/
|
74 |
+
|
75 |
+
# Jupyter NB Checkpoints
|
76 |
+
.ipynb_checkpoints/
|
77 |
+
|
78 |
+
# exclude data and trained models from source control by default
|
79 |
+
/data/
|
80 |
+
/models/
|
81 |
+
|
82 |
+
# Mac OS-specific storage files
|
83 |
+
.DS_Store
|
84 |
+
|
85 |
+
# vim
|
86 |
+
*.swp
|
87 |
+
*.swo
|
88 |
+
|
89 |
+
# Mypy cache
|
90 |
+
.mypy_cache/
|
LICENSE
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
Copyright (c) <year> <copyright holders>
|
3 |
+
|
4 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
5 |
+
|
6 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
7 |
+
|
8 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Makefile
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.PHONY: clean dirs virtualenv lint requirements push pull reproduce
|
2 |
+
|
3 |
+
#################################################################################
|
4 |
+
# GLOBALS #
|
5 |
+
#################################################################################
|
6 |
+
|
7 |
+
PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
8 |
+
PYTHON_INTERPRETER = python
|
9 |
+
|
10 |
+
#################################################################################
|
11 |
+
# COMMANDS #
|
12 |
+
#################################################################################
|
13 |
+
|
14 |
+
## Create virtualenv.
|
15 |
+
## Activate with the command:
|
16 |
+
## source env/bin/activate
|
17 |
+
virtualenv:
|
18 |
+
virtualenv -p $(PYTHON_INTERPRETER) env
|
19 |
+
|
20 |
+
## Install Python Dependencies.
|
21 |
+
## Make sure you activate the virtualenv first!
|
22 |
+
requirements:
|
23 |
+
$(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
|
24 |
+
$(PYTHON_INTERPRETER) -m pip install -r requirements.txt
|
25 |
+
|
26 |
+
## Create directories that are ignored by git but required for the project
|
27 |
+
dirs:
|
28 |
+
mkdir -p data/raw data/processed models
|
29 |
+
|
30 |
+
## Delete all compiled Python files
|
31 |
+
clean:
|
32 |
+
find . -type f -name "*.py[co]" -delete
|
33 |
+
find . -type d -name "__pycache__" -delete
|
34 |
+
|
35 |
+
## Lint using flake8
|
36 |
+
lint:
|
37 |
+
flake8 src
|
38 |
+
|
39 |
+
## Upload Data to default DVC remote
|
40 |
+
push:
|
41 |
+
dvc push
|
42 |
+
|
43 |
+
## Download Data from default DVC remote
|
44 |
+
pull:
|
45 |
+
dvc pull
|
46 |
+
|
47 |
+
## Reproduce the DVC pipeline - recompute any modified outputs such as processed data or trained models
|
48 |
+
reproduce:
|
49 |
+
dvc repro eval.dvc
|
50 |
+
|
51 |
+
#################################################################################
|
52 |
+
# PROJECT RULES #
|
53 |
+
#################################################################################
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
#################################################################################
|
58 |
+
# Self Documenting Commands #
|
59 |
+
#################################################################################
|
60 |
+
|
61 |
+
.DEFAULT_GOAL := help
|
62 |
+
|
63 |
+
# Inspired by <http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html>
|
64 |
+
# sed script explained:
|
65 |
+
# /^##/:
|
66 |
+
# * save line in hold space
|
67 |
+
# * purge line
|
68 |
+
# * Loop:
|
69 |
+
# * append newline + line to hold space
|
70 |
+
# * go to next line
|
71 |
+
# * if line starts with doc comment, strip comment character off and loop
|
72 |
+
# * remove target prerequisites
|
73 |
+
# * append hold space (+ newline) to line
|
74 |
+
# * replace newline plus comments by `---`
|
75 |
+
# * print line
|
76 |
+
# Separate expressions are necessary because labels cannot be delimited by
|
77 |
+
# semicolon; see <http://stackoverflow.com/a/11799865/1968>
|
78 |
+
.PHONY: help
|
79 |
+
help:
|
80 |
+
@echo "$$(tput bold)Available rules:$$(tput sgr0)"
|
81 |
+
@echo
|
82 |
+
@sed -n -e "/^## / Missing" $Missing \
|
83 |
+
| LC_ALL='C' sort --ignore-case \
|
84 |
+
| awk -F '---' \
|
85 |
+
-v ncol=$$(tput cols) \
|
86 |
+
-v indent=19 \
|
87 |
+
-v col_on="$$(tput setaf 6)" \
|
88 |
+
-v col_off="$$(tput sgr0)" \
|
89 |
+
'Missing \
|
90 |
+
printf "%s ", words[i]; \
|
91 |
+
} \
|
92 |
+
printf "\n"; \
|
93 |
+
}' \
|
94 |
+
| more $(shell test $(shell uname) = Darwin && echo '--no-init --raw-control-chars')
|
README.md
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
summarization
|
2 |
+
==============================
|
3 |
+
|
4 |
+
T5 Summarisation Using Pytorch Lightning
|
5 |
+
|
6 |
+
Instructions
|
7 |
+
------------
|
8 |
+
1. Clone the repo.
|
9 |
+
1. Run `make dirs` to create the missing parts of the directory structure described below.
|
10 |
+
1. *Optional:* Run `make virtualenv` to create a python virtual environment. Skip if using conda or some other env manager.
|
11 |
+
1. Run `source env/bin/activate` to activate the virtualenv.
|
12 |
+
1. Run `make requirements` to install required python packages.
|
13 |
+
1. Put the raw data in `data/raw`.
|
14 |
+
1. To save the raw data to the DVC cache, run `dvc commit raw_data.dvc`
|
15 |
+
1. Edit the code files to your heart's desire.
|
16 |
+
1. Process your data, train and evaluate your model using `dvc repro eval.dvc` or `make reproduce`
|
17 |
+
1. When you're happy with the result, commit files (including .dvc files) to git.
|
18 |
+
|
19 |
+
Project Organization
|
20 |
+
------------
|
21 |
+
|
22 |
+
├── LICENSE
|
23 |
+
├── Makefile <- Makefile with commands like `make dirs` or `make clean`
|
24 |
+
├── README.md <- The top-level README for developers using this project.
|
25 |
+
├── data
|
26 |
+
│ ├── processed <- The final, canonical data sets for modeling.
|
27 |
+
│ └── raw <- The original, immutable data dump.
|
28 |
+
│
|
29 |
+
├── eval.dvc <- The end of the data pipeline - evaluates the trained model on the test dataset.
|
30 |
+
│
|
31 |
+
├── models <- Trained and serialized models, model predictions, or model summaries
|
32 |
+
│
|
33 |
+
├── notebooks <- Jupyter notebooks. Naming convention is a number (for ordering),
|
34 |
+
│ the creator's initials, and a short `-` delimited description, e.g.
|
35 |
+
│ `1.0-jqp-initial-data-exploration`.
|
36 |
+
│
|
37 |
+
├── process_data.dvc <- Process the raw data and prepare it for training.
|
38 |
+
├── raw_data.dvc <- Keeps the raw data versioned.
|
39 |
+
│
|
40 |
+
├── references <- Data dictionaries, manuals, and all other explanatory materials.
|
41 |
+
│
|
42 |
+
├── reports <- Generated analysis as HTML, PDF, LaTeX, etc.
|
43 |
+
│ └── figures <- Generated graphics and figures to be used in reporting
|
44 |
+
│ └── metrics.txt <- Relevant metrics after evaluating the model.
|
45 |
+
│ └── training_metrics.txt <- Relevant metrics from training the model.
|
46 |
+
│
|
47 |
+
├── requirements.txt <- The requirements file for reproducing the analysis environment, e.g.
|
48 |
+
│ generated with `pip freeze > requirements.txt`
|
49 |
+
│
|
50 |
+
├── setup.py <- makes project pip installable (pip install -e .) so src can be imported
|
51 |
+
├── src <- Source code for use in this project.
|
52 |
+
│ ├── __init__.py <- Makes src a Python module
|
53 |
+
│ │
|
54 |
+
│ ├── data <- Scripts to download or generate data
|
55 |
+
│ │ └── make_dataset.py
|
56 |
+
│ │
|
57 |
+
│ ├── models <- Scripts to train models and then use trained models to make
|
58 |
+
│ │ │ predictions
|
59 |
+
│ │ ├── predict_model.py
|
60 |
+
│ │ └── train_model.py
|
61 |
+
│ │
|
62 |
+
│ └── visualization <- Scripts to create exploratory and results oriented visualizations
|
63 |
+
│ └── visualize.py
|
64 |
+
│
|
65 |
+
├── tox.ini <- tox file with settings for running tox; see tox.testrun.org
|
66 |
+
└── train.dvc <- Traing a model on the processed data.
|
67 |
+
|
68 |
+
|
69 |
+
--------
|
70 |
+
|
71 |
+
<p><small>Project based on the <a target="_blank" href="https://drivendata.github.io/cookiecutter-data-science/">cookiecutter data science project template</a>. #cookiecutterdatascience</small></p>
|
dvc.lock
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
train:
|
2 |
+
cmd: python src/models/train_model.py
|
3 |
+
deps:
|
4 |
+
- path: data/processed
|
5 |
+
md5: d751713988987e9331980363e24189ce.dir
|
6 |
+
- path: src/models/train_model.py
|
7 |
+
md5: d41d8cd98f00b204e9800998ecf8427e
|
8 |
+
outs:
|
9 |
+
- path: models
|
10 |
+
md5: d751713988987e9331980363e24189ce.dir
|
11 |
+
- path: reports/training_metrics.txt
|
12 |
+
md5: d41d8cd98f00b204e9800998ecf8427e
|
13 |
+
eval:
|
14 |
+
cmd: python src/models/predict_model.py
|
15 |
+
deps:
|
16 |
+
- path: data/processed
|
17 |
+
md5: d751713988987e9331980363e24189ce.dir
|
18 |
+
- path: models
|
19 |
+
md5: d751713988987e9331980363e24189ce.dir
|
20 |
+
- path: src/models/predict_model.py
|
21 |
+
md5: d41d8cd98f00b204e9800998ecf8427e
|
22 |
+
outs:
|
23 |
+
- path: reports/metrics.txt
|
24 |
+
md5: d41d8cd98f00b204e9800998ecf8427e
|
25 |
+
process_data:
|
26 |
+
cmd: python src/data/make_dataset.py
|
27 |
+
deps:
|
28 |
+
- path: data/raw
|
29 |
+
md5: d751713988987e9331980363e24189ce.dir
|
30 |
+
- path: src/data/make_dataset.py
|
31 |
+
md5: d41d8cd98f00b204e9800998ecf8427e
|
32 |
+
outs:
|
33 |
+
- path: data/processed
|
34 |
+
md5: d751713988987e9331980363e24189ce.dir
|
dvc.yaml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
stages:
|
2 |
+
train:
|
3 |
+
cmd: python src/models/train_model.py
|
4 |
+
deps:
|
5 |
+
- data/processed
|
6 |
+
- src/models/train_model.py
|
7 |
+
outs:
|
8 |
+
- models:
|
9 |
+
persist: true
|
10 |
+
metrics:
|
11 |
+
- reports/training_metrics.txt:
|
12 |
+
cache: false
|
13 |
+
eval:
|
14 |
+
cmd: python src/models/predict_model.py
|
15 |
+
deps:
|
16 |
+
- data/processed
|
17 |
+
- models
|
18 |
+
- src/models/predict_model.py
|
19 |
+
metrics:
|
20 |
+
- reports/metrics.txt:
|
21 |
+
cache: false
|
22 |
+
process_data:
|
23 |
+
cmd: python src/data/make_dataset.py
|
24 |
+
deps:
|
25 |
+
- data/raw
|
26 |
+
- src/data/make_dataset.py
|
27 |
+
outs:
|
28 |
+
- data/processed:
|
29 |
+
persist: true
|
notebooks/.gitkeep
ADDED
File without changes
|
raw_data.dvc
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
outs:
|
2 |
+
- md5: d751713988987e9331980363e24189ce.dir
|
3 |
+
path: data/raw
|
references/.gitkeep
ADDED
File without changes
|
reports/.gitkeep
ADDED
File without changes
|
reports/figures/.gitkeep
ADDED
File without changes
|
reports/metrics.txt
ADDED
File without changes
|
reports/training_metrics.txt
ADDED
File without changes
|
requirements.txt
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# local package
|
2 |
+
-e .
|
3 |
+
|
4 |
+
# external requirements
|
5 |
+
click
|
6 |
+
coverage
|
7 |
+
awscli
|
8 |
+
flake8
|
9 |
+
python-dotenv>=0.5.1
|
setup.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from setuptools import find_packages, setup
|
2 |
+
|
3 |
+
setup(
|
4 |
+
name='src',
|
5 |
+
packages=find_packages(),
|
6 |
+
version='0.1.0',
|
7 |
+
)
|
src/__init__.py
ADDED
File without changes
|
src/data/.gitkeep
ADDED
File without changes
|
src/data/__init__.py
ADDED
File without changes
|
src/data/make_dataset.py
ADDED
File without changes
|
src/models/.gitkeep
ADDED
File without changes
|
src/models/__init__.py
ADDED
File without changes
|
src/models/predict_model.py
ADDED
File without changes
|
src/models/train_model.py
ADDED
File without changes
|
src/visualization/.gitkeep
ADDED
File without changes
|
src/visualization/__init__.py
ADDED
File without changes
|
src/visualization/visualize.py
ADDED
File without changes
|
tox.ini
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
[flake8]
|
2 |
+
max-line-length = 79
|
3 |
+
max-complexity = 10
|