{"id":27938590,"url":"https://github.com/willowtreeapps/catalyst-bias-correct-service","last_synced_at":"2025-05-07T08:49:29.051Z","repository":{"id":56386953,"uuid":"229995701","full_name":"willowtreeapps/catalyst-bias-correct-service","owner":"willowtreeapps","description":"A bias correction service","archived":false,"fork":false,"pushed_at":"2020-11-10T21:42:32.000Z","size":101,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":113,"default_branch":"develop","last_synced_at":"2024-04-14T23:17:08.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willowtreeapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2019-12-24T19:36:27.000Z","updated_at":"2020-11-19T01:44:18.000Z","dependencies_parsed_at":"2022-08-15T17:50:20.776Z","dependency_job_id":null,"html_url":"https://github.com/willowtreeapps/catalyst-bias-correct-service","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fcatalyst-bias-correct-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fcatalyst-bias-correct-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fcatalyst-bias-correct-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willowtreeapps%2Fcatalyst-bias-correct-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willowtreeapps","download_url":"https://codeload.github.com/willowtreeapps/catalyst-bias-correct-service/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252847291,"owners_count":21813439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T08:49:28.064Z","updated_at":"2025-05-07T08:49:29.038Z","avatar_url":"https://github.com/willowtreeapps.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bias Correction Service\nA microservice to provide detection and suggestion corrections for gendered language.  Intended to be used in integration with chat services (i.e. integrated into [Catalyst Slack Service](https://github.com/willowtreeapps/catalyst-slack-service)).\n\n## Prerequisites\n* [JDK 12](https://www.oracle.com/java/technologies/javase/jdk12-archive-downloads.html)\n* [sbt 1.3.5](https://www.scala-sbt.org/download.html)\n* [docker](https://hub.docker.com/editions/community/docker-ce-desktop-mac)\n\n## Run\n\nThe only configuration variable needed for this service is `PLAY_SECRET_KEY`. You can generate a new secret using `sbt playGenerateSecret` or if you don't already have an sbt server running `head -c 30 /dev/random | base64`.\n\n### [IntelliJ IDEA](https://www.jetbrains.com/idea/)\n1. Open Project wizard, select **Import Project**.\n1. In the window that opens, select this project.\n1. On the next page of the wizard, select **Import project from external model** option, choose **sbt project**.\n1. On the next page of the wizard, ensure that the **Project JDK** is set to **JDK 12**.\n1. Enable Auto-Import for **sbt projects**.\n\nSetup Configuration\n1. Add configuration template **sbt Task**.\n2. In the window that opens, enter \"compile; run\" into the **Tasks** input.\n3. Uncheck the **Use sbt shell** option.\n4. Add the above configuration as environment variables.\n\nPress Run. Navigate to http://localhost:9000 to verify that the service is running.\n\n### [Docker](https://hub.docker.com/editions/community/docker-ce-desktop-mac)\nsbt provides the infrastructure to easily build out a Docker image from our application.  The current build.sbt file is configured with the options to use OpenJDK 12 on Alpine.  This is intended to keep our shipping image as lean as possible.  The application.conf file has also been updated to capture a few values from the environment when available.  Finally, the build.sbt file has the option to configure the current version from an environment variable (which will be captured in the docker container tags).\n\n```\nsbt docker:publishLocal\n\ndocker run -p 8000:9000 -e PLAY_SECRET_KEY=\"$(head -c 30 /dev/random | base64)\" bias-correct-service:1.0-SNAPSHOT\n```\n\nIn the above example, we expose the host/local port 8000 to the container's port 9000 (the default port for the Play framework).  We've also chosen to generate a random secret key and use the default Docker tag.  If we had specified an environment variable during the build phase (`VERSION_NUMBER=example sbt docker:publishLocal`), then our tag would be `bias-correct-service:example`.\n\n### Terminal\nYou can also run the application using your terminal. Make sure that you have sbt 1.3.5 installed. Export the PLAY_SECRET_KEY if you had not done so previously, then run the application using sbt.\n```\nsbt version\n\nexport PLAY_SECRET_KEY={PLAY_SECRET_KEY}\n\nsbt run\n```\n\n## Data format\n\nTrigger words and their corrective suggestions are pulled from CSV files.  The first value in a row is the trigger word.  The second value is the suggestion.  Values beyond the second are ignored and you must provide at least two values for the service to consider the row.  You may provide multiple suggestions for any given trigger by repeating the trigger in a new row and using a new suggestion.  Those suggestions are collated to use the same trigger.  The service will choose a random suggestion from the list associated with those triggers.  Suggestions are uniqued and you may not weight a suggestion list by repeating individual suggestions.\n\nSupport for multiple languages is also configured via a CSV file.  When the service starts, it will check for a CSV file at a given URL.  That CSV file may contain multiple rows.  The first value in each row is the supported language (or language and region) as specified by an ISO 639-1 code (eg. \"en\" or \"en_US\").  You may provide support for multiple regions for any given language as well as a default base language data set.  The second column is a URL to a CSV file containing the trigger words and suggestions as documented above.\n\nAt this time, the canonical source for both the configuration and trigger words+suggestions data sets is a Google Sheet.  The first tab of the Google Sheet is the configuration and the other tabs are language support.  The URL for the first tab in the Google Sheet is embedded in the application in the `application.conf` file.  In the current implementation, the configuration is self-referencing in that the language data sets are other tabs within that same Sheet.  If you wanted to add a new language, you could create a new tab, add data to it, and then create a new entry in the \"supported languages\" tab.  You would use the ISO 639-1 code for the supported language in the first column.  The second column would be a URL that uniquely referenced your newly created tab.  You can locate that URL by clicking `File -\u003e Publish to the web` from the Sheet's toolbar, selecting the tab in the `Link` section of the modal window, changing the type to \"Comma-separated values (.csv)\" (default is \"Web Page\"), and copying the link below those selectors.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillowtreeapps%2Fcatalyst-bias-correct-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillowtreeapps%2Fcatalyst-bias-correct-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillowtreeapps%2Fcatalyst-bias-correct-service/lists"}