All info at: https://github.com/guyrt/court-reminder/
Calling things and transcribing.
Here we have instructions for running the program on a local machine and on an Azure VM.
go to www.github.com in order to install git
Open a terminal on your computer.
Navigate to the directory you would want your new directory to be:
e.g. cd C:\Users\yourname
Then clone github repo:
Go to https://github.com/guyrt/court-reminder/ and click on the green Clone or download button. Copy the url.
In your terminal, type:
git clone < url >
sudo apt-get update (you will have to enter the password for your machine) sudo apt-get install python-dev build-essential libssl-dev libffi-dev python3-pip libffi-dev -y
Install anaconda: https://www.continuum.io/downloads
xcode-select --install ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew doctor "Once you’ve installed Homebrew, insert the Homebrew directory at the top of your PATH environment variable. You can do this by adding the following line at the bottom of your ~/.profile file export PATH=/usr/local/bin:/usr/local/sbin:$PATH " (from http://python-guide-pt-br.readthedocs.io/en/latest/starting/install3/osx/) brew install python3
sudo pip3 install -r requirements.txt
sudo apt-get install sox -y
download sox from their website
brew install sox
You will need to set up accounts with the various services that we use (Twilio, Google Clound, Azure Storage table).
You will then need to fill in the various secrets files with your credentials for these accounts. Copy secrets sample and then fill in the blanks. (cp secrets.sample.py secrets.py)
The secrets files are located in the following folders:
-
Call -- ~\CourtHearings\court-reminder\call\secrets.py To fill out this information, you first need a Twilio account. Set up one at www.twilio.com. Then edit the fields in the secret file: ~\CourtHearings\court-reminder\call\secrets.py Your AccountSid and AuthToken can be found on your Account Dashboard.
-
Storage -- ~\CourtHearings\court-reminder\storage\secrets.py We use an Azure storage account for this. Here are instructions on how to set up an Azure storage account. https://docs.microsoft.com/en-us/azure/storage/storage-create-storage-account#create-a-storage-account The deployment model is resource manager, and you will want to create a General Purpose with performance tier standard. Store the name of the storage_account in the storage_account variable in the secrets file. Go to the access keys tab, and set Key1 in the variables blob_key and table_connection_string. Next, go to "blob store" from overview and create a container. Store the name of this container in the variable blob_container. Next, set table_name = "courtreminder" in secrets.py. Our code will make the table for you. Note that the db_* variables shouldn't be used
-
Transcription ~\CourtHearings\court-reminder\transcribe\secrets.py Here are instructions to get started with the google cloud speech API here: https://cloud.google.com/speech/docs/getting-started Create a new project. Give it a name. Go to API manager, then click on credentials Click create credentials, and choose Service Account Key Choose your project as the service account and then download the json.
Copy the json into secrets.py. Don't do anything for the Bing speech recognition credentials (we used to use Bing, then we switched to Google). You don't need to enter anything in the preferred phrases line either.
Three parts:
- Inserting the AINs into the database.
- Have a file with one AIN per line. Run insert.py < filename > .
- Running the runners (transcribing, calling, extracting)
- python ./court-reminder/runners.py
- Running the servers (twiml server, admin server)
- python start_server.py --twilio_prod
- python start_server.py --admin_prod
Type < server_ip > :8080/admin into your web browser
This is optional. Only follow these instructions if you would prefer to run this program on a virtual machine instead of on your local computer.
Make an account with Microsoft azure.
Go to portal.azure.com Go to virtual machine tab Add Ubuntu server 16.04 LTS (or a recent version that is not LTS because it will have python 3) Click create Specify username, and say you want to use password PS1_V2 is a good plan Keep settings as is In overview, you can get your public IP.
Go to network interfaces Retrieve name of security group Search for name of security roup Add new rule to inbound security rules Port range 8080. Name httpaccess Password for this will be in the secrets.py file in the server folder in the repo
ssh < username > @ < IP address >
git clone < court reminder repo >
sudo apt-get update sudo apt-get install python-dev build-essential libssl-dev libffi-dev python-pip3 -y
sudo pip3 install -r requirements.txt sudo apt-get install sox -y
The secrets files are located in the following folders:
- Storage
- Server
- Transcription
- Call You want to copy secrets sample and then fill in the blanks. You will need to set up your own API keys.
screen -S < screen_name > python3 runners.py < CTRL A-D >
screen -S < screen_name > python3 start_server.py --twilio_prod < CTRL A-D >
screen -S < screen_name > python3 start_server.py --admin_prod < CTRL A-D >
[< CTRL A-D > exits but does not terminate the screen] [screen -r < screen_name > returns to the screen to check the status] [< CTRL D > terminates the screen]
< server_ip > :8080/admin