{"id":18665974,"url":"https://github.com/medartus/loa","last_synced_at":"2025-10-25T15:33:50.705Z","repository":{"id":40967696,"uuid":"247075439","full_name":"medartus/Loa","owner":"medartus","description":"🍽🍻 Restauration \u0026 food recommendation engine and chatbot, built with React, NodeJS and Python","archived":false,"fork":false,"pushed_at":"2022-12-12T05:38:47.000Z","size":27813,"stargazers_count":11,"open_issues_count":9,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T19:37:01.152Z","etag":null,"topics":["exctract-intent","recommendation-engine","recommending-restaurants","user-demand","wit"],"latest_commit_sha":null,"homepage":"https://loabot.netlify.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/medartus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-13T13:17:31.000Z","updated_at":"2023-09-14T17:26:54.000Z","dependencies_parsed_at":"2023-01-27T14:16:01.775Z","dependency_job_id":null,"html_url":"https://github.com/medartus/Loa","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/medartus%2FLoa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medartus%2FLoa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medartus%2FLoa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medartus%2FLoa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/medartus","download_url":"https://codeload.github.com/medartus/Loa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489640,"owners_count":21112612,"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":["exctract-intent","recommendation-engine","recommending-restaurants","user-demand","wit"],"created_at":"2024-11-07T08:29:51.734Z","updated_at":"2025-10-25T15:33:49.564Z","avatar_url":"https://github.com/medartus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loa 🧙‍♀️\n\nA small AI-based conversational agent capable of providing accurate informations about U.S located restaurants, and integrated with a content-based recommendation engine.\n\nMade with ❤️ by [Alexandre ZAJAC](https://github.com/alexZajac), [Nicolas CAILLIEUX](https://github.com/Exorth98) and [Marc-Etienne Dartus](https://github.com/medartus).\n\n## Demo\n\n\u003cimg src=\"demo.gif\" alt=\"demo\" width=\"100%\" height=\"auto\" /\u003e\n\n## Table of contents:\n\n- [Loa 🧙‍♀️](#loa-%EF%B8%8F)\n  - [Demo](#demo)\n  - [Table of contents:](#table-of-contents)\n  - [🎯 Objectives](#-objectives)\n    - [Tech-Stack and Implementation](#tech-stack-and-implementation)\n      - [Front-end](#front-end)\n      - [Back-end](#back-end)\n        - [_1 - Chatbot API (NodeJS)_](#1---chatbot-api-nodejs)\n        - [_2 - Recommendation Engine API (Flask)_](#2---recommendation-engine-api-flask)\n  - [🏃‍♀️ How to test it ?](#%EF%B8%8F-how-to-test-it-)\n  - [👩‍💻 Usage (Workflows)](#-usage)\n    - [Chatbot Capabilities (Workflows)](#chatbot-capabilities-workflows)\n    - [**1 - How many restaurants**](#1---how-many-restaurants)\n      - [Example](#example)\n    - [**2 - Search restaurants**](#2---search-restaurants)\n      - [Example](#example-1)\n    - [**3 - Find the best restaurant**](#3---find-the-best-restaurant)\n      - [Example](#example-2)\n    - [**4 - Greeting**](#4---greeting)\n      - [Example](#example-3)\n    - [**5 - Example**](#5---example)\n      - [Example](#example-4)\n    - [**6 - Thanks**](#6---thanks)\n      - [Example](#example-5)\n    - [**7 - Goodbye**](#7---goodbye)\n      - [Example](#example-6)\n    - [**Recommendation Engine**](#recommendation-engine)\n      - [Example](#example-7)\n  - [📝 To do](#-to-do)\n\n## 🎯 Objectives\n\n### Tech-Stack and Implementation\n\nWe use [wit.ai](https://wit.ai) to convert user-text to intents using **Natural Language Processing**. We have trained a model with Python to recommend restaurants with respect to user queries and desires. If they do not ask for recommendation, we use the yelp API to provide information based on user-location and his query.\n\n![stack schema](https://user-images.githubusercontent.com/45569127/76697698-96401400-669a-11ea-90af-80bbfb78d9ca.JPG)\n\n#### Front-end\n\nIn this project and in like many nowadays, we chose to use **React** for the client interface.\n\n**Description**\n\nReact is a JavaScript library for building user interfaces. It is maintained by Facebook and a community of individual developers and companies. React can be used as a base in the development of single-page or mobile applications.React is only concerned with rendering data to the DOM.\n\n**How we use it**\n\nWe use React for all the frontend part. React only powers the user interface, interprets what the user wants to perform and calls our NodeJS API.\n\n#### Back-end\n\nFor the back-end, we decided to stay with NodeJS as a central service, as it's a technology we are familiar and realtively easy to integrate with other services. We also have a Python Flask API, which powers the recommendation of restaurants.\n\n##### _1 - Chatbot API (NodeJS)_\n\n**Description**\n\nNode.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside of a web browser. Node.js lets developers use JavaScript to write command line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.\n\n**How we use it**\n\nWe use it to centralize the variety of the user's requests. It almost serves as a middleware between the client, and the three various API's (wit.ai, yelp and our own recommender API). For every message that the user sends, we send the payload to wit from there, and then handle the logic of calling either YELP or our own recommender system.\n\n##### _2 - Recommendation Engine API (Flask)_\n\n**Description**\n\nFlask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. It began as a simple wrapper around Werkzeug and Jinja and has become one of the most popular Python web application frameworks.\n\n**How we use it**\n\nWe use Flask to build a basic API that will handle only one route for recommending restaurants. This API is agnostic of all the intent extracting and analysis logic, it's only made to provide an abstraction to return recommended restaurants to the NodeJS API.\n\n## 🏃‍♀️ How to test it ?\n\nYou can test the project with a live demo by going [there!](https://loabot.netlify.com/)\n\nOr, you can test this project locally with **Docker** using the following steps :\n\n1. Then **in the project folder** run:\n\n```\ndocker-compose up\n```\n\nThe project will then be available on http://DOCKER_IP_HOST url, which in most cases, will be http://localhost\n\n## 👩‍💻 Usage (Workflows)\n\n### **1 - How many restaurants**\n\nTypes of Question:\n\n- How **many** **restaurants** are in **New York** ?\n- What is the **number** of **restaurants** **around me** ?\n- What is the **number** of **restaurants** in **Colorado** ?\n\n#### Example\n\n_1 - Request :_\n\nRequesting the Node API :  \n`Endpoint :` POST /message\n\nWe call our Node API we this structure :\n\n```json\n{\n  \"message\": \"What is the number of restaurants in Colorado ?\",\n  \"user\": {\n    \"coordinates\": {\n      \"latitude\": 34.052234,\n      \"longitude\": -118.243685\n    }\n  }\n}\n```\n\n_2 - Wit.ai Intent extraction :_\n\nWit.ai will exctract intent and entities from the user question.\n\nThe question :\n\n\u003e What is the **number** of **restaurants** in **Colorado** ?\n\nWill return :\n\n|  Variable  |    Value    |\n| :--------: | :---------: |\n|  `Intent`  |   Number    |\n|  `Object`  | Restaurants |\n| `Location` |  Colorado   |\n\n_3 - Yelp API :_\n\nWith the information, we call the _Yelp API_ and use the result to build our API response :\n\n_Yelp Graphql API request :_\n\n```\n{\n  search(term: \"restaurant\", location:\"Colorado\") {\n    total\n  }\n}\n```\n\n_Yelp Graphql API response :_\n\n```json\n{\n  \"data\": {\n    \"search\": {\n      \"total\": 2952\n    }\n  }\n}\n```\n\n_4 - User reponse generation_\n\nAfter getting all the information in order to answer the user demand, **we use Natural Language Generation to display a response**.\n\nadditionally, **we display the concenred result(s) on the right side of our web application**.\n\nIn our example we want to display a map of the result and tell it to the user.\n\n_5 - Node.js API response_\n\nGathering all of these steps, our API will return a sample response :\n\n```json\n{\n  \"intent\": \"Number\",\n  \"type\": \"Restaurants\",\n  \"location\": {\n    \"name\": \"Colorado\",\n    \"coordinates\": {\n      \"latitude\": 39.55051,\n      \"longitude\": -105.782067\n    }\n  },\n  \"message\": [\n    {\n      \"type\": \"text\",\n      \"content\": \"There are 2952 restaurants in Colorado. ⏲️\"\n    }\n  ],\n  \"results\": []\n}\n```\n\n### **2 - Search restaurants**\n\nTypes of Question :\n\n- Can you **show** me the **restaurants** **around me** ?\n- Can you **show** me the **restaurants** in **Los Angeles** ?\n\n#### Example\n\n_1 - Node.js API request :_\n\nRequesting the Node API :  \n`Endpoint :` POST /message\n\nWe call our Node API we this structure :\n\n```json\n{\n  \"message\": \"Can you show me the restaurants in Los Angeles ?\",\n  \"user\": {\n    \"coordinates\": {\n      \"latitude\": 34.052234,\n      \"longitude\": -118.243685\n    }\n  }\n}\n```\n\n_2 - Wit.ai Intent extraction :_\n\nWit.ai will exctract intent and entities from the user question.\n\nThe question :\n\n\u003e Can you **show** me the **restaurants** in **Los Angeles** ?\n\nWill return :\n\n|  Variable  |    Value    |\n| :--------: | :---------: |\n|  `Intent`  |   Search    |\n|  `Object`  | Restaurants |\n| `Location` | Los Angeles |\n\n_3 - Yelp API :_\n\nWith the information, we call the _Yelp API_ and use the result to build our API response :\n\n_Yelp Graphql API request :_\n\n```\n{\n  search(term: \"restaurant\", location:\"Los Angeles\") {\n    business {\n      name\n      id\n      url\n      display_phone\n      rating\n      price\n      location {\n        address1\n        city\n        postal_code\n      }\n      coordinates {\n        latitude\n        longitude\n      }\n      photos\n    }\n  }\n}\n```\n\n_Yelp Graphql API response :_\n\n```json\n{\n  \"data\": {\n    \"search\": {\n      \"business\": [\n        {\n          \"name\": \"Howlin' Ray's\",\n          \"id\": \"7O1ORGY36A-2aIENyaJWPg\",\n          \"url\": \"https://www.yelp.com/biz/howlin-rays-los-angeles-3?adjust_creative=94DePyCeUwdjASSwoI0YbA\u0026utm_campaign=yelp_api_v3\u0026utm_medium=api_v3_graphql\u0026utm_source=94DePyCeUwdjASSwoI0YbA\",\n          \"display_phone\": \"(213) 935-8399\",\n          \"rating\": 4.5,\n          \"price\": \"$$\",\n          \"location\": {\n            \"address1\": \"727 N Broadway\",\n            \"city\": \"Los Angeles\",\n            \"postal_code\": \"90012\"\n          },\n          \"coordinates\": {\n            \"latitude\": 34.061517,\n            \"longitude\": -118.239716\n          },\n          \"photos\": [\n            \"https://s3-media2.fl.yelpcdn.com/bphoto/9hGoyECcrewigEKYEnrYTw/o.jpg\"\n          ]\n        }\n      ]\n    }\n  }\n}\n```\n\n_4 - User reponse generation_\n\nAfter getting all the information in order to answer the user demand, **we use Natural Language Generation to display a response**.\n\nadditionally, **we display the concenred result(s) on the right side of our web application**.\n\nIn our example we want to display restaurants searched by the user.\n\n_5 - Node.js API response_\n\nGathering all of these steps, our API will return a sample response :\n\n```json\n{\n  \"intent\": \"Search\",\n  \"type\": \"Restaurants\",\n  \"location\": {\n    \"name\": \"Los Angeles\",\n    \"coordinates\": {\n      \"latitude\": 34.052234,\n      \"longitude\": -118.243685\n    }\n  },\n  \"message\": [\n    {\n      \"type\": \"text\",\n      \"content\": \"You can find a selection of restaurants in Los Angeles. 🏨\"\n    }\n  ],\n  \"results\": [\n    {\n      \"name\": \"Howlin' Ray's\",\n      \"id\": \"7O1ORGY36A-2aIENyaJWPg\",\n      \"url\": \"https://www.yelp.com/biz/howlin-rays-los-angeles-3?adjust_creative=94DePyCeUwdjASSwoI0YbA\u0026utm_campaign=yelp_api_v3\u0026utm_medium=api_v3_graphql\u0026utm_source=94DePyCeUwdjASSwoI0YbA\",\n      \"display_phone\": \"(213) 935-8399\",\n      \"rating\": 4.5,\n      \"price\": \"$$\",\n      \"location\": {\n        \"address1\": \"727 N Broadway\",\n        \"city\": \"Los Angeles\",\n        \"postal_code\": \"90012\"\n      },\n      \"coordinates\": {\n        \"latitude\": 34.061517,\n        \"longitude\": -118.239716\n      },\n      \"photos\": [\n        \"https://s3-media2.fl.yelpcdn.com/bphoto/9hGoyECcrewigEKYEnrYTw/o.jpg\"\n      ]\n    }\n  ]\n}\n```\n\n### **3 - Find the best restaurant**\n\nTypes of Question\n\n- What is the **best** **restaurant** in **New York** ?\n- What is the **best** **restaurant** **around me** ?\n- Find the **best** **restaurant** in **Paris** ?\n- Find the **best** **restaurant** **near me** ?\n- Find the **best** **restaurant** near **111 8th Ave New York** ?\n\n#### Example\n\n_1 - Request :_\n\nRequesting the Node API :  \n`Endpoint :` POST /message\n\nWe call our Node API we this structure :\n\n```json\n{\n  \"message\": \"What is the best restaurant in New York ?\",\n  \"user\": {\n    \"coordinates\": {\n      \"latitude\": 34.052234,\n      \"longitude\": -118.243685\n    }\n  }\n}\n```\n\n_2 - Wit.ai Intent extraction :_\n\nWit.ai will exctract intent and entities from the user question.\n\nThe question :\n\n\u003e Can you **show** me the **restaurants** in **Los Angeles** ?\n\nWill return :\n\n|  Variable  |    Value    |\n| :--------: | :---------: |\n|  `Intent`  |    Best     |\n|  `Object`  | Restaurants |\n| `Location` |  New York   |\n\n_3 - Yelp API :_\n\nWith the information, we call the _Yelp API_ and use the result to build our API response :\n\n_Yelp Graphql API request :_\n\n```\n{\n  search(term: \"restaurant\", location:\"New York\") {\n    business {\n      name\n      id\n      url\n      display_phone\n      review_count\n      rating\n      price\n      location {\n        address1\n        city\n        postal_code\n      }\n      coordinates {\n        latitude\n        longitude\n      }\n      photos\n    }\n  }\n}\n```\n\n_Yelp Graphql API response :_\n\n```json\n{\n  \"data\": {\n    \"search\": {\n      \"business\": [\n        {\n          \"name\": \"LoveMama\",\n          \"id\": \"jjJc_CrkB2HodEinB6cWww\",\n          \"url\": \"https://www.yelp.com/biz/lovemama-new-york?adjust_creative=94DePyCeUwdjASSwoI0YbA\u0026utm_campaign=yelp_api_v3\u0026utm_medium=api_v3_graphql\u0026utm_source=94DePyCeUwdjASSwoI0YbA\",\n          \"display_phone\": \"(212) 254-5370\",\n          \"review_count\": 4988,\n          \"rating\": 4.5,\n          \"price\": \"$$\",\n          \"location\": {\n            \"address1\": \"174 2nd Ave\",\n            \"city\": \"New York\",\n            \"postal_code\": \"10003\"\n          },\n          \"coordinates\": {\n            \"latitude\": 40.7303859,\n            \"longitude\": -73.9860613\n          },\n          \"photos\": [\n            \"https://s3-media1.fl.yelpcdn.com/bphoto/bLlFKTlVuLfmF-lIDGIjZA/o.jpg\"\n          ]\n        }\n      ]\n    }\n  }\n}\n```\n\n_4 - User reponse generation_\n\nAfter getting all the information in order to answer the user demand, **we use Natural Language Generation to display a response**.\n\nadditionally, **we display the concenred result(s) on the right side of our web application**.\n\nIn our example we want to display the best results and tell it to the user.\n\n_5 - Node.js API response_\n\nGathering all of these steps, our API will return a sample response a sample response:\n\n```json\n{\n  \"intent\": \"Best\",\n  \"type\": \"Restaurants\",\n  \"location\": {\n    \"name\": \"New York\",\n    \"coordinates\": {\n      \"latitude\": 40.7122775,\n      \"longitude\": -74.005973\n    }\n  },\n  \"message\": [\n    {\n      \"type\": \"text\",\n      \"content\": \"The best restaurant in New York is LoveMama. 💯\"\n    }\n  ],\n  \"results\": [\n    {\n      \"name\": \"LoveMama\",\n      \"id\": \"jjJc_CrkB2HodEinB6cWww\",\n      \"url\": \"https://www.yelp.com/biz/lovemama-new-york?adjust_creative=94DePyCeUwdjASSwoI0YbA\u0026utm_campaign=yelp_api_v3\u0026utm_medium=api_v3_graphql\u0026utm_source=94DePyCeUwdjASSwoI0YbA\",\n      \"display_phone\": \"(212) 254-5370\",\n      \"review_count\": 4988,\n      \"rating\": 4.5,\n      \"price\": \"$$\",\n      \"location\": {\n        \"address1\": \"174 2nd Ave\",\n        \"city\": \"New York\",\n        \"postal_code\": \"10003\"\n      },\n      \"coordinates\": {\n        \"latitude\": 40.7303859,\n        \"longitude\": -73.9860613\n      },\n      \"photos\": [\n        \"https://s3-media1.fl.yelpcdn.com/bphoto/bLlFKTlVuLfmF-lIDGIjZA/o.jpg\"\n      ]\n    }, ...\n  ]\n}\n```\n\n### **4 - Greeting**\n\nTypes of Question:\n\n- **Hello**, how are you ?\n- **Good morning**!\n- **Hi**, what's up ?\n\n#### Example\n\n_1 - Node.js API request :_\n\nRequesting the Node API :  \n`Endpoint :` POST /message\n\nWe call our Node API we this structure :\n\n```json\n{\n  \"message\": \"Hi, what's up ?\",\n  \"user\": {\n    \"coordinates\": {\n      \"latitude\": 34.052234,\n      \"longitude\": -118.243685\n    }\n  }\n}\n```\n\n_2 - Wit.ai Intent extraction :_\n\nWit.ai will exctract intent and entities from the user question.\n\nThe question :\n\n\u003e **Hi**, what's up ?\n\nWill return :\n\n| Variable |  Value   |\n| :------: | :------: |\n| `Intent` | Greeting |\n\n_3 - User reponse generation_\n\nAfter getting all the information in order to answer the user demand, **we use Natural Language Generation to display a response**.\n\n_4 - Node.js API response_\n\nGathering all of these steps, our API will return a sample response :\n\n```json\n{\n  \"intent\": \"Greeting\",\n  \"type\": null,\n  \"location\": null,\n  \"message\": [\n    {\n      \"type\": \"text\",\n      \"content\": \"Hi, what's can I do for you today ? 👩\"\n    },\n    {\n      \"type\": \"gif\",\n      \"content\": \"https://media.giphy.com/media/14aa5GbbHT3bHO/source.gif\"\n    }\n  ],\n  \"results\": []\n}\n```\n\n### **5 - Example**\n\nTypes of Question:\n\n- Can I get an **example** ?\n- Can you give me an **example** of question ?\n- What can I **ask** you ?\n\n#### Example\n\n_1 - Node.js API request :_\n\nRequesting the Node API :  \n`Endpoint :` POST /message\n\nWe call our Node API we this structure :\n\n```json\n{\n  \"message\": \"Can I get an example ?\",\n  \"user\": {\n    \"coordinates\": {\n      \"latitude\": 34.052234,\n      \"longitude\": -118.243685\n    }\n  }\n}\n```\n\n_2 - Wit.ai Intent extraction :_\n\nWit.ai will exctract intent and entities from the user question.\n\nThe question :\n\n\u003e Can I get an **example** ?\n\nWill return :\n\n| Variable |  Value  |\n| :------: | :-----: |\n| `Intent` | Example |\n\n_3 - User reponse generation_\n\nAfter getting all the information in order to answer the user demand, **we use Natural Language Generation to display a response**.\n\n_4 - Node.js API response_\n\nGathering all of these steps, our API will return a sample response :\n\n```json\n{\n  \"intent\": \"Example\",\n  \"type\": null,\n  \"location\": null,\n  \"message\": [\n    {\n      \"type\": \"text\",\n      \"content\": \"Here's some examples: 📝 - Can you recommend me an italian restaurant ?\\n     - What is the number of restaurants in    Seattle ?   - Can you show me the restaurants around me ?\\n   - What is the best restaurant in Los Angeles ?\\n\"\n    },\n    {\n      \"type\": \"gif\",\n      \"content\": \"https://media.giphy.com/media/szeVLlECC8ThC/source.gif\"\n    }\n  ],\n  \"results\": []\n}\n```\n\n### **6 - Thanks**\n\nTypes of Sentence:\n\n- **Thanks** for helping me\n- **Thank you** for your help\n- **Thank you** for your responses\n\n#### Example\n\n_1 - Node.js API request :_\n\nRequesting the Node API :  \n`Endpoint :` POST /message\n\nWe call our Node API we this structure :\n\n```json\n{\n  \"message\": \"Thanks for helping me\",\n  \"user\": {\n    \"coordinates\": {\n      \"latitude\": 34.052234,\n      \"longitude\": -118.243685\n    }\n  }\n}\n```\n\n_2 - Wit.ai Intent extraction :_\n\nWit.ai will exctract intent and entities from the user question.\n\nThe question :\n\n\u003e **Thanks** for helping me\n\nWill return :\n\n| Variable | Value  |\n| :------: | :----: |\n| `Intent` | Thanks |\n\n_3 - User reponse generation_\n\nAfter getting all the information in order to answer the user demand, **we use Natural Language Generation to display a response**.\n\n_4 - Node.js API response_\n\nGathering all of these steps, our API will return a sample response :\n\n```json\n{\n  \"intent\": \"Thanks\",\n  \"type\": null,\n  \"location\": null,\n  \"message\":  [\n    {\n      \"type\": \"text\",\n      \"content\": \"Don't worry, I'm very happy to help you ! 🤗 Need more help ?\"\n    },\n    {\n      \"type\": \"gif\",\n      \"content\": \"https://media.giphy.com/media/LrQkEUJ3s8hLmO9fGH/source.gif\"\n    }\n  ],\n  \"results\": []\n}\n```\n\n### **7 - Goodbye**\n\nTypes of Sentence:\n\n- **Goodbye**\n- See you **soon** !\n- I'm going to **leave**, bye !\n\n#### Example\n\n_1 - Node.js API request :_\n\nRequesting the Node API :  \n`Endpoint :` POST /message\n\nWe call our Node API we this structure :\n\n```json\n{\n  \"message\": \"Goodbye\",\n  \"user\": {\n    \"coordinates\": {\n      \"latitude\": 34.052234,\n      \"longitude\": -118.243685\n    }\n  }\n}\n```\n\n_2 - Wit.ai Intent extraction :_\n\nWit.ai will exctract intent and entities from the user question.\n\nThe sentence :\n\n\u003e **Goodbye**\n\nWill return :\n\n| Variable |  Value  |\n| :------: | :-----: |\n| `Intent` | Goodbye |\n\n_3 - User reponse generation_\n\nAfter getting all the information in order to answer the user demand, **we use Natural Language Generation to display a response**.\n\n_4 - Node.js API response_\n\nGathering all of these steps, our API will return a sample response :\n\n```json\n{\n  \"intent\": \"Goodbye\",\n  \"type\": null,\n  \"location\": null,\n  \"message\": [\n    {\n      \"type\": \"text\",\n      \"content\": \"I was a pleasure to help you, goodbye ! 😀\"\n    },\n    {\n      \"type\": \"gif\",\n      \"content\": \"https://media.giphy.com/media/ZA5DTtqkU8bQDHuu16/source.gif\"\n    }\n  ],\n  \"results\": []\n}\n```\n\n### **Recommendation Engine**\n\nAs said above, we decided to build our own API and recommender system with Python, to be able to **recommend restaurants to users**.\n\nThe technique we have used is more vastly acknowledge as **collaborative filtering**:\n\nWe have used ratings from users on a subset of US-based restaurants to predict the rating of a restaurant unseen by the user, let's deep dive into how we trained a model to do that.\n\nAfter having collected the user data with reviews and ratings, we also collected items (the restaurants) and determined **user profiles**.\n\nTo obtain the profile matrices we follewed the same routine:\n\n- **Combine** the reviews/descriptions\n- **Remove** noisy data (stopwords, punctuation, ...)\n- **TF-IDF Feature vector extraction** on each of the items/users.\n\nThen with a sample input from the user: \"I want to eat italain pizza\", the system recommends the items that matches the most this review/description.\n\n**Here is how it works under the hood:**\n\nTypes of Sentence:\n\n- I want to eat some **italian pizza**!\n- Recommend me restaurants with **fresh pasta**.\n- Can you show me restaurants with **outstanding views** ?\n\n#### Example\n\n_1 - Node.js API request :_\n\nRequesting the Node API :  \n`Endpoint :` POST /message\n\nWe call our Node API we this structure :\n\n```json\n{\n  \"message\": \"I want to eat some italian pizza!\",\n  \"user\": {\n    \"coordinates\": {\n      \"latitude\": 34.052234,\n      \"longitude\": -118.243685\n    }\n  }\n}\n```\n\n_2 - Wit.ai Intent extraction :_\n\nWit.ai will exctract intent and entities from the user question.\n\nThe sentence :\n\n\u003e I want to eat some **italian pizza**!\n\nWill return :\n\n| Variable |     Value     |\n| :------: | :-----------: |\n| `Intent` |   Recommend   |\n| `Desire` | Italian pizza |\n\n_3 - User reponse generation_\n\nAfter getting all the information in order to answer the user demand, **we use Natural Language Generation to display a response**.\n\n_4 - Node.js API response_\n\nGathering all of these steps, our API will return a sample response :\n\n```json\n{\n  \"intent\": \"Recommend\",\n  \"type\": null,\n  \"location\": null,\n  \"message\": [\n    {\n      \"type\": \"text\",\n      \"content\": \"Oh, italian pizza is a good idea! Let me recommend you these restaurants. 🔮\"\n    }\n  ],\n  \"results\": [\n    {\n      \"name\": \"I want to eat some **italian pizza**!\",\n      \"id\": \"jjJc_CrkB2HodEinB6xWww\",\n      \"url\": \"https://www.yelp.com/biz/venezias-new-york-style-pizzeria-tempe-4?adjust_creative=94DePyCeUwdjASSwoI0YbA\u0026utm_campaign=yelp_api_v3\u0026utm_medium=api_v3_graphql\u0026utm_source=94DePyCeUwdjASSwoI0YbA\",\n      \"display_phone\": \"(212) 254-5370\",\n      \"review_count\": 714,\n      \"rating\": 4,\n      \"price\": \"$\",\n      \"location\": {\n        \"address1\": \"174 2nd Ave\",\n        \"city\": \"Tempe\",\n        \"postal_code\": \"85282\"\n      },\n      \"coordinates\": {\n        \"latitude\": 40.7303859,\n        \"longitude\": -73.9860613\n      },\n      \"photos\": [\n        \"https://s3-media4.fl.yelpcdn.com/bphoto/kblyz8LxF5FCGuMvLeJFqg/o.jpg\"\n      ]\n    }, ...\n  ]\n}\n```\n## 📝 To do\n\n- [x] Desing \u0026 Prototype on Figma\n- [x] Define constraints and objectives\n- [x] Implement basic front-end interface\n- [x] Train wit.ai agent on our intents\n- [x] Design and Connect Node API to wit.ai\n- [x] Gather data and design Recommendation Engine\n- [x] Serve our APIS as services and host them\n- [x] Finish front-end interface\n- [x] Test along the way\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedartus%2Floa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmedartus%2Floa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedartus%2Floa/lists"}