forked from jim-schwoebel/voicebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
110 lines (86 loc) · 3.8 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
'''
================================================
VOICEBOOK REPOSITORY
================================================
repository name: voicebook
repository version: 1.0
repository link: https://github.com/jim-schwoebel/voicebook
author: Jim Schwoebel
author contact: js@neurolex.co
description: a book and repo to get you started programming voice applications in Python - 10 chapters and 200+ scripts.
license category: opensource
license: Apache 2.0 license
organization name: NeuroLex Laboratories, Inc.
location: Seattle, WA
website: https://neurolex.ai
release date: 2018-09-28
This code (voicebook) is hereby released under a Apache 2.0 license license.
For more information, check out the license terms below.
================================================
LICENSE TERMS
================================================
Copyright 2018 NeuroLex Laboratories, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
SERVICE STATEMENT
================================================
If you are using the code written for a larger project, we are
happy to consult with you and help you with deployment. Our team
has >10 world experts in kafka distributed architectures, microservices
built on top of Node.JS / Python / Docker, and applying machine learning to
model speech and text data.
We have helped a wide variety of enterprises - small businesses,
researchers, enterprises, and/or independent developers.
If you would like to work with us let us know @ js@neurolex.co.
================================================
SETUP.PY
================================================
setup.py
Custom script to install dependencies for Voicebook.
Since I wrote this book in 1.5 months, I may be missing some
dependencies. If you find something that is missing, please let me
know as an issue @ https://github.com/jim-schwoebel/voicebook/issues
and I can add it here.
Requires homebrew to be installed on endpoint device
and assumes an MacOS operating system.
'''
# Install dependencies
import os
def pip3_install():
os.system('pip3 install -r requirements.txt')
def brew_install(modules):
for i in range(len(modules)):
os.system('brew install %s'%(modules[i]))
# things that need some custom setup
os.system('sudo pip3 uninstall crypto')
os.system('pip3 uninstall pycryptodome')
os.system('pip3 install --upgrade setuptools')
os.system('pip3 install -U pyobjc')
os.system('brew install heroku/brew/heroku')
os.system('brew cask info google-cloud-sdk')
# mongoDB setup
os.system('brew install mongodb')
os.system('mkdir -p /data/db')
os.system('sudo chmod 777 /data/db')
# install homebrew and pip modules
brew_modules=['opus','portaudio','sox','nginx', 'kafka', 'kubernetes-cli',
'ffmpeg','opus-tools','opus']
brew_install(brew_modules)
pip3_install()
# scikit-learn needs to be version 0.19.1 because some things break in newest versions
os.system('sudo pip3 uninstall scikit-learn')
os.system('pip3 install scikit-learn==0.19.1')
# customize spacy packages
os.system('python3 -m spacy download en')
os.system("python3 -m spacy download 'en_core_web_sm'")
# download all nltk packages
import nltk
nltk.download('all')