Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fearlesssolutions/pdh22-hackinghate
Source code for sexist comment detection in slack messages
https://github.com/fearlesssolutions/pdh22-hackinghate
Last synced: 25 days ago
JSON representation
Source code for sexist comment detection in slack messages
- Host: GitHub
- URL: https://github.com/fearlesssolutions/pdh22-hackinghate
- Owner: FearlessSolutions
- Created: 2022-12-15T06:52:13.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-26T16:15:16.000Z (10 months ago)
- Last Synced: 2024-11-06T02:13:37.436Z (2 months ago)
- Language: Kotlin
- Size: 2.39 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hacking Hate Speech
This repository contains source code for several google cloud functions as well as a workflow which orchestrates them. These
all come together to form an AI powered sexist speech detector in slack.## Running a function locally
You can run cloud functions locally using the `runFunction` task for its respective gradle subproject. Example commands
you could run are:- `./gradlew SlackMessageExtractor:runFunction`
The function should output the port it's running on in the logs, and then you can send HTTP requests to the running server.
These requests are HTTP POST messages containing some JSON.For example, you could send this message to the slack message extractor:
```http request
POST localhost:8080
Content-Type: application/json{
"channel": "C12345678"
}
```## Building and deploying a function
The cloud functions' source code can be built with the following command:
```shell
./gradlew buildFunction
```This will output staging folders for each function which can then be deployed to Google Cloud with
`gcloud functions deploy FUNCTION-NAME --source ./STAGING-FOLDER --gen2 --trigger-http`. The staging folders
have the naming convention `deploy-MODULE_NAME`.## Deploying the cloud workflow
The cloud workflow described in [HackingHateWorkflow.yaml](./HackingHateWorkflow.yaml) can be deployed with the
google cloud CLI: `gcloud workflows deploy WORKFLOW-NAME --source ./HackingHateWorkflow.yaml`