{"id":23093149,"url":"https://github.com/crispengari/farb","last_synced_at":"2026-04-10T01:56:46.589Z","repository":{"id":141094511,"uuid":"578567382","full_name":"CrispenGari/FARB","owner":"CrispenGari","description":"🤖🤖🥇 First Aid Recommendation Bot (FARB) is a REST and GraphQL API that exposes a virtual assistant bot built from using Deep Learning Techniques. In this repository I will show by example how to integrate with these API's by building a web and mobile application tool.","archived":false,"fork":false,"pushed_at":"2022-12-16T03:28:35.000Z","size":1961,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T17:02:41.998Z","etag":null,"topics":["ariadne","chatbot","flask","graphql","natural-language-processing","nextjs","python","pytorch","react","react-native","torchtext"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrispenGari.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-15T11:11:43.000Z","updated_at":"2023-02-08T19:44:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"7189da1e-17fe-4516-a623-7c6aea296593","html_url":"https://github.com/CrispenGari/FARB","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FFARB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FFARB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FFARB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FFARB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrispenGari","download_url":"https://codeload.github.com/CrispenGari/FARB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247061242,"owners_count":20877166,"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":["ariadne","chatbot","flask","graphql","natural-language-processing","nextjs","python","pytorch","react","react-native","torchtext"],"created_at":"2024-12-16T21:46:34.833Z","updated_at":"2025-10-25T12:07:16.840Z","avatar_url":"https://github.com/CrispenGari.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### First Aid Recommendation Bot (FARB)\n\n`FARB` is a simple machine learning graphql and rest API build to do basic virtual assistance in first aid treatments. So I present the `FARB` that helps human in recommending the first aid treatments.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"logo.png\" alt=\"logo\" width=\"30%\"/\u003e\n\u003cp\u003e\n\n`First Aid Recommendation Bot (FARB)` is an BOT API for recommending `First Aid Treatments` to human beings.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"cover.webp\" alt=\"cover\" width=\"100%\"/\u003e\n\u003cp\u003e\n\n### FARB Tool\n\n`FARB` tools were built for both mobile applications and web applications using `react-native` and `next.js` respectively.\n\n1. mobile\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"mobile0.jpeg\" alt=\"cover\" width=\"200\"/\u003e\n\u003cimg src=\"mobile1.jpeg\" alt=\"cover\" width=\"200\"/\u003e\n\u003cimg src=\"mobile2.jpeg\" alt=\"cover\" width=\"200\"/\u003e\n\n\u003cp\u003e\n\n2. web\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"web1.jpg\" alt=\"cover\" width=\"80%\"/\u003e\n\u003cimg src=\"web2.jpg\" alt=\"cover\" width=\"80%\"/\u003e\n\u003cimg src=\"web0.jpg\" alt=\"cover\" width=\"80%\"/\u003e\n\u003cp\u003e\n\n### API\n\n`FARB` api is a simple rest api that is served at `http://localhost:3001/api/v1/ask` and is able to predict tags in the message and give you better recommendations for your `First Aid Treatment`.\n\n### API response\n\nIf a proper `POST` request is sent to the server at `http://localhost:3001/api/v1/ask` we will be able to get `~99.11%` accurate predictions of tags from the `farb` bot model and with the correct request body you will be able to get the predictions of the `tag` together with the `recommendations` from the bot on your `First Aid` query.\n\n### Rest request\n\nRest API is exposed at `http://localhost:3001/api/v1/ask` using the `POST` method only. So you can use any client such as:\n\n1. Thunder Client\n2. Postman\n3. cURL\n4. Axios (javascript)\n5. Fetch API (javascript)\n6. etc\n\nTo make a post request to the server at `http://localhost:3001/api/v1/ask` with a json body that looks as follows:\n\n```json\n{\n  \"message\": \"What to do if I have splinters?\"\n}\n```\n\nThe server will respond with the `API` response which looks as follows:\n\n```json\n{\n  \"prediction\": {\n    \"confidence\": 1.0,\n    \"pattern\": \"what to do if i have splinters?\",\n    \"tag\": \"splinter\",\n    \"tagId\": 10\n  },\n  \"response\": {\n    \"message\": \"1. SOAK IT IN EPSOM SALTS. Dissolve a cup of the salts into a warm bath and soak whatever part of the body has the splinter. Failing that, you can also put some of the salts onto a bandage pad and leave it covered for a day; this will eventually help bring the splinter to the surface. 2. VINEGAR OR OIL. Another simple way to draw out that stubborn splinter is to soak the affected area in oil (olive or corn) or white vinegar. Just pour some in a bowl and soak the area for around 20 to 30 minutes,\"\n  },\n  \"success\": true\n}\n```\n\n### GraphQL endpoint\n\nGraphQL endpoint is served at `http://localhost:3001/graphql` sending a graphql request at this endpoint that looks as follows:\n\n```\nfragment ErrorFragment on Error {\n  field\n  message\n}\nfragment BotResponseFragment on BotResponse {\n  message\n}\nfragment BotPredictionFragement on BotPrediction {\n  confidence\n  tag\n  tagId\n  pattern\n}\n\nfragment AskBotResponse on AskBotResponse {\n  error {\n    ...ErrorFragment\n  }\n  success\n  response {\n    ...BotResponseFragment\n  }\n  prediction {\n    ...BotPredictionFragement\n  }\n}\nmutation AskBot($input: AskBotInput!) {\n  askBot(input: $input) {\n    ...AskBotResponse\n  }\n}\n\n```\n\nWith the following variables:\n\n```json\n{\n  \"input\": {\n    \"message\": \"What to do if I have splinters?\"\n  }\n}\n```\n\nWill yield the results that looks as follows:\n\n```json\n{\n  \"data\": {\n    \"askBot\": {\n      \"error\": null,\n      \"prediction\": {\n        \"confidence\": 1,\n        \"pattern\": \"what to do if i have splinters?\",\n        \"tag\": \"splinter\",\n        \"tagId\": 10\n      },\n      \"response\": {\n        \"message\": \"1. SOAK IT IN EPSOM SALTS. Dissolve a cup of the salts into a warm bath and soak whatever part of the body has the splinter. Failing that, you can also put some of the salts onto a bandage pad and leave it covered for a day; this will eventually help bring the splinter to the surface. 2. VINEGAR OR OIL. Another simple way to draw out that stubborn splinter is to soak the affected area in oil (olive or corn) or white vinegar. Just pour some in a bowl and soak the area for around 20 to 30 minutes,\"\n      },\n      \"success\": true\n    }\n  }\n}\n```\n\n### Languages\n\nIn this project the following languages was used:\n\n```shell\n- typescript(javascript)\n- python\n```\n\n### Notebooks\n\nThe notebooks for training the model that is being used to intents classification wan be found [here](https://github.com/CrispenGari/nlp-pytorch/blob/main/09_FIRST_AID_RECOMENTATION_BOT/01_FIRST_AID_RECOMENTATION_BOT.ipynb).\n\n### intents.json\n\nThis file also contain responses for the `Bot`. Not that from the original dataset from `kaggle` this file was missing responses for other tags so i went ehead and fill that up and you can find the final `intents.json` file in the `server/api/models/static` folder.\n\n### License\n\nIn this simple AI tool i'm using `MIT` license which read as follows:\n\n```shell\nMIT License\n\nCopyright (c) 2022 crispengari\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrispengari%2Ffarb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrispengari%2Ffarb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrispengari%2Ffarb/lists"}