This repository has been archived by the owner on May 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
96 lines (81 loc) · 3.19 KB
/
setup.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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# PyTorch Datasets utility repository
# Copyright (C) 2020 Abien Fred Agarap
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
"""Setup file for pt-datasets"""
import os
from os import path
from pathlib import Path
from setuptools import setup
__author__ = "Abien Fred Agarap"
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
def _post_install():
ag_news_setup = """
echo "[INFO] Downloading AG News Dataset..."
mkdir -p ~/datasets
wget --no-clobber -O ~/datasets/ag_news.train https://raw.githubusercontent.com/AnubhavGupta3377/Text-Classification-Models-Pytorch/master/data/ag_news.train
wget --no-clobber -O ~/datasets/ag_news.test https://raw.githubusercontent.com/AnubhavGupta3377/Text-Classification-Models-Pytorch/master/data/ag_news.test
echo "[SUCCESS] Done downloading AG News Dataset."
"""
os.system(ag_news_setup)
def _download_imdb():
imdb_dataset = "https://drive.google.com/uc?id=1VhjJUc6hlJfHmEln8b0xfxuzUC36bBHE"
imdb_path = os.path.join(str(Path.home()), "datasets")
filename = "imdb.csv"
print("[INFO] Downloading the IMDB dataset...")
imdb_download_script = f"""
gdown {imdb_dataset} -O {os.path.join(imdb_path, filename)}
"""
os.system(imdb_download_script)
def _download_yelp():
yelp_dataset = "https://drive.google.com/uc?id=1-RG97iRFppt3zK939cijAH8JQIhOyqu8"
yelp_path = os.path.join(str(Path.home()), "datasets")
filename = "yelp.csv"
print("[INFO] Downloading the Yelp dataset...")
yelp_download_script = f"""
gdown {yelp_dataset} -O {os.path.join(yelp_path, filename)}
"""
os.system(yelp_download_script)
setup(
name="pt-datasets",
version="0.15.0",
packages=["pt_datasets", "pt_datasets/datasets"],
url="https://github.com/AFAgarap/pt-datasets",
license="AGPL-3.0 License",
author="Abien Fred Agarap",
author_email="abienfred.agarap@gmail.com",
description="Library for loading PyTorch datasets and data loaders.",
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=[
"numpy==1.20.3",
"torchvision==0.9.1",
"umap_learn==0.5.1",
"torch==1.8.1",
"MulticoreTSNE==0.1",
"scikit_learn==0.23.2",
"gdown==3.12.2",
"nltk==3.5",
"cmake==3.18.0",
"opencv-python==4.2.0.34",
"imbalanced_learn==0.7.0",
"numba==0.53.1",
"llvmlite==0.36.0",
],
)
_post_install()
_download_imdb()
_download_yelp()