-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Onboarding docs with contribution guidelines #115
Draft
sabinevidal
wants to merge
11
commits into
unicef:main
Choose a base branch
from
sabinevidal:onboarding-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ddb3e94
Adding 'contributing' section to docs website and spelling
sabinevidal ed83034
Merge branch 'unicef:main' into onboarding-docs
sabinevidal ff2503d
DOCS: adding overview and start of index
sabinevidal c04e958
Merge branch 'unicef:main' into onboarding-docs
sabinevidal a071e0b
WIP: Contribution overview and api
sabinevidal 4e26c36
WIP: workflow overview and technical index
sabinevidal 8376b89
Kindly docs overview
sabinevidal be67415
Update overview.md
sabinevidal 8ecfe59
Merge branch 'unicef:main' into onboarding-docs
sabinevidal 2f108e5
Updates to contributing docs
sabinevidal de8398e
Update overview.md
sabinevidal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
.yarn | ||
|
||
# Misc | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 7 | ||
sidebar_position: 8 | ||
--- | ||
|
||
# 🙏 Acknowledgements | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 6 | ||
sidebar_position: 7 | ||
--- | ||
|
||
# 📄 API Documentation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"label": "🤝 Contributing", | ||
"position": 6 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# 🧩 API integration | ||
|
||
**If you'd like to add the Kindly API to a project you're working on, get in touch with us!** | ||
|
||
There is currently one available endpoint for Kindly :`'/detect'`. | ||
To read more in-depth, go check out our [API development docs](../api.md). | ||
|
||
## For those who are new to integrating APIs into your own project, here's some guidance! | ||
|
||
You'll be accessing the `/detect` endpoint in order to check whether some input text has cyberbullying intent. | ||
To integrate Kindly into your project you will need a couple of things to get started: | ||
- text input functionality where there is a trigger to send the text as a request to an endpoint. | ||
- see the client development site for an example of this on the [index page](https://github.com/unicef/kindly/blob/main/client/pages/index.vue) | ||
- input text that's in json format | ||
```PAYLOAD``` | ||
``` | ||
{ | ||
"text":"this movie is great" | ||
} | ||
``` | ||
- authorization headers and/or token keys | ||
|
||
Test basic functionality and integration with your project by setting up the api on your local development environment. Follow the instructions on the [development docs](../technical/development.md) to get the API up and running. You won't need the web client and can just send requests to the endpoint on your local environment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# 🛠 Project contributions | ||
Keep an eye on our Github Repos for [Kindly](https://github.com/unicef/kindly) and the [Kindly website](https://github.com/unicef/kindly-website) for any issues which come up that you think you'll be able to help with. Remember to comment so we can assign the issue to you! | ||
|
||
Check out the [development docs](../technical/development) to see how to set up a development environment so you can work on the Kindly repo. | ||
Our backend is set up as an API, so you can also make calls to this on Postman or with `curl`. We also have a [website](https://kindly.unicef.io) where you can check phrases with Kindly, alternatively once you've set up the development environment you can use the [web client](../overview#web-client) to test phrases. | ||
|
||
## Contribution Guidelines | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# 🤝 Contributing | ||
|
||
There are multiple ways to contribute to, and work with, the Kindly project: | ||
|
||
## Training Data | ||
We are collecting training data from children on the [Kindly website](https://kindly.unicef.io/contribute). These contributions will be added to the [training dataset](ml-model/training-data) which are classified as either `offensive` or `non-offensive` to improve the model's accuracy. See the [training data docs](../ml-model/training-data) for a more technical overview. See our [Privacy and Terms of Use](https://kindly.unicef.io/legal) page for information on privacy, how we use data and terms of usage. | ||
|
||
## [Project Maintenance](project-maintenance) | ||
Kindly is built as an open-source solution, and is a certified [DPG](https://digitalpublicgoods.net/registry/kindly.html). We are on [GitHub](https://github.com/unicef/kindly) and will welcome your help whatever your skills. Check out [this page](project-maintenance) to learn more about our contribution guidelines. | ||
|
||
## [API Integration](api-integration) | ||
Integrate the Kindly API with your own program. | ||
The [API docs](../api.md) contain all the available endpoints. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# 🗺 Overview | ||
|
||
This is a broad overview of the Kindly App and how all the components fit together. There are currently 2 GitHub repos associated with Kindly - the [Kindly](https://github.com/unicef/kindly) repo which contains the API, web client and ML training server, and the [Kindly Website](https://github.com/unicef/kindly-website) repo which contains the front-facing [website](https://kindly.unicef.io) which includes details, contact info, and the contribution form. | ||
|
||
## Kindly | ||
The [Kindly API repo](https://github.com/unicef/kindly) contains the [API](https://github.com/unicef/kindly/tree/main/api), the [web client](https://github.com/unicef/kindly/tree/main/client), and the [ML training server](https://github.com/unicef/kindly/tree/main/modeling). It also houses the [docs website](https://github.com/unicef/kindly/tree/main/docs-website). More information on how they fit together is below. | ||
|
||
### API | ||
The [API](https://github.com/unicef/kindly/tree/main/api) includes the [application](https://github.com/unicef/kindly/tree/main/api/api.py), where the endpoints and functions are found, as well as [unit tests](https://github.com/unicef/kindly/blob/main/api/test_api.py) which cover the endpoints. | ||
There are currently 3 endpoints, with 1 more for ML training which is yet to be completed. The `'/'` route returns the api glossary, with the functional and relevant endpoints. The `'/test-ui'` endpoint renders the [`index.html` template](https://github.com/unicef/kindly/tree/main/api/templates) for testing. The `'/detect'` endpoint is used to process input text. | ||
|
||
#### Tests | ||
The [unit tests](https://github.com/unicef/kindly/blob/main/api/test_api.py) are set up using pytest, and will run with the [`main.yml`](https://github.com/unicef/kindly/blob/main/.github/workflows/main.yml) workflow. They target the API url `localhost:8080` and test for success, 403 error, 404 error and 400 error (see [development docs](technical/development#testing) for a detailed outline). | ||
|
||
### Web Client | ||
The [web client](https://github.com/unicef/kindly/tree/main/client) is a basic frontend and is only for demo and development purposes when working on the API and is never used in production. It contains a page to [test](https://github.com/unicef/kindly/blob/main/client/pages/index.vue) the API and a page to [contribute](https://github.com/unicef/kindly/blob/main/client/pages/contribute.vue), although this is not functioning at the moment. | ||
|
||
### ML training server | ||
To learn more about how the machine learning training server, see the [ML Model docs](ml-model/overview). Kindly is currently using a [prebuilt](ml-model/prebuilt) model for detecting toxic messaging, the [twitter-roberta-base-offensive](https://huggingface.co/cardiffnlp/twitter-roberta-base-offensive) model. We are concurrently collecting new training data to [transfer learning](ml-model/prebuilt#transfer-learning), where we use an existing model to validate new training data while adapting the results to be relevant to what we need for our model, in this case, to be relevant for language used by children and young people. | ||
|
||
## Kindly Website | ||
The [Kindly Website repo](https://github.com/unicef/kindly-website) found in the [UNICEF Github organisation](https://github.com/unicef) is where the development code is stored. However, the Kindly website is actually hosted through Cloudflare, with the fork created by Victor at [lacabra/kindly-website](https://github.com/lacabra/kindly-website). The workflow [`push-downstream.yml`](https://github.com/unicef/kindly-website/blob/main/.github/workflows/push-downstream.yml) is a continuous integration solution which will push any changes committed on unicef/kindly-website downstream to lacabra/kindly-website. | ||
|
||
### The Contribution Form | ||
The [Kindly form](https://github.com/unicef/kindly-website/blob/main/src/components/KindlyForm.js) on the [contribution page](https://github.com/unicef/kindly-website/blob/main/src/Contribute.js) is linked to the Kindly API and Google Sheets to collect training data. When someone enters a phrase into the form, the input text is passed to the [`/detect` endpoint](https://github.com/unicef/kindly/blob/6a39f09eec60f8f3d0c0809e35aa9352075e46ca/api/api.py#L50) of the API and the results are returned, the user will then be prompted to confirm whether the phrase has been correctly classified as either cyberbullying or not. The phrase and the intent are then passed through to the [Google Training Sheet](https://github.com/unicef/kindly/blob/main/scripts/OutputFile.gs) as `formData` in [`handleFeedback`](https://github.com/unicef/kindly-website/blob/0556e79a3b1393a55df68e46cd663990a4d40b91/src/components/KindlyForm.js#L70). | ||
|
||
### Testing Kindly Functionality | ||
Users can test Kindly on the main page using the [Kindly form](https://github.com/unicef/kindly-website/blob/main/src/components/KindlyForm.js), which is linked only to the [`/detect` endpoint](https://github.com/unicef/kindly/blob/6a39f09eec60f8f3d0c0809e35aa9352075e46ca/api/api.py#L50) of the API. This will return a result indicating whether the submitted phrase is considered cyberbullying or not. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nathanfletcher We can maybe add the guidelines at this point? Or even a link if we're doing them somewhere else.