Scripts for updating a corpus-specific topic model in the FOIArchive database.
Clone this repo.
- Copy the topic model CSVs into the data subdirectory
- Define an environment varable called DBCONNECT containing the database connect string
- Run the shell script
update-topic-model.sh
in the directory where it is installed, passing it the shortcode for the corpus it is updating:
./update-topic-model.sh frus
Postgres tools (at least psql, pg_dump) are installed and in the PATH Also, zip and aws cli should both be installed and the latter configured to connect to HL's AWS S3 account
- backs up the topic tables in case of error
- creates staging tables
- loads the staging tables with the CSVs contents
- replaces the topic model for the corpus specified with the contents of the staging tables
- uploads a zip file to AWS S3
The script provides provides progress updates and error handling. For more details, review its source. Please reach out if something isn't clear or you encouter problems.