Wit.ai Guideline
Wit.ai is like a super smart tool that helps you teach your apps to understand what people are saying in a natural way. It's great for making chatbots or apps that you can talk to like a real person. Wit.ai uses fancy machine learning to figure out what users mean and how to respond in a cool and human-like manner. It can recognize different things in a sentence (entities), understand what the user wants (intents), and even manage conversations smoothly.
Getting Started
Build Your Wit App
- Sign up with Meta
Go to the Wit.ai home page and sign in with your Meta account.
- Create a Wit app
Click the New App button on the Welcome to Wit.ai page. Creating a new app is very simple: you just need to name your app, and choose a language. Then click Create.
Setup Wit.ai in XRCC
- Find the server token in your Wit.ai app
- Open a XRCC project and go to behaviour Panel
- Open the Wit.ai panel
- Add a new token to the token list, specifying both your server app token and a token name
- Your Wit.ai app is now ready for use within XRCC
Example of Wit.ai Usage
- Create a new app called "movecube" in Wit.ai
- Type "Move right" in utterance and create a new intent called "move"
- Highlight "right" text and create a new entity called "direction", and click "Train and Validate" button to start trainning
-
Repeat steps 2 and 3 to create a new utterance "Move left"
-
In XRCC, create a new project and add a cube to the scene, then select the cube
- Add the app server token to Wit.ai panel in XRCC
- Add a new WitAI Data variable named "WitaiData"
- Add a "Click" behaviour block and a "Listen for Intents" behaviour block to enable voice command recording when the cube is clicked.
- Utilize the "Get WitAI Data" and "Get Entities Text" behaviour blocks to extract the entities from the recorded command. Additionally, employ the "Get Intent Text" block to determine the intent from the recorded command. Verify if the extracted entities match "right" for direction and the intent matches "move".
- If the condition is met, move the cube 1 meter to the right; otherwise, move it 1 meter to the left.
- Then test the project in the debug mode.