Iris is an application that helps users generate code without typing anything. Any user can just speak into the application and the application will generate code related to that. The best thing is, you can talk in free-form (natural language) and we parse everything to generate the code! Currently we support only English to Python.
The approach we adopt is quite simple. We get speech from user, pass it to Google Speech API and get the text back, pass that text through to Microsoft Luis for intent classification, get back the JSON response, and parse the response for appropriate code generation. The code generation and processing is handled through our custom VS Code extension (written in Typescript).
intents | intents | intents |
---|---|---|
add_function | add_main_function | delete_line |
add_class | add_try_catch | goto_line |
add_if_else | add_variables | run_file |
add_newline | add_while | save_file |
add_breakpoint | call_function | undo_changes |
The main modules needed to setup the application and get everything running are:
- Electron JS Application
- Message Broker + Speech to code/action engine.
- VS Code Extension
You will need Python (preferably Python3), all packages listed in requirements.txt, and npm package for Electron app.
The Python package requirements (pip) are (also available in requirements.txt for easy install):
pika==0.12.0
requests==2.19.1
SpeechRecognition==3.8.1
google==2.0.1
google-api-core==1.4.1
google-api-python-client==1.7.4
google-auth==1.5.1
google-auth-httplib2==0.0.3
google-cloud-speech==0.36.0
google-cloud-texttospeech==0.2.0
googleapis-common-protos==1.5.3
Run pip install -r path/to/requirements.txt
for easy install.
The following steps are to run the package:
- Make sure you have RabbitMQ installed on your machine.
- Run
rabbitmq-server
or you can use brew to start the broker server by runningbrew services start rabbitmq
. This will start the message-broker server on portlocalhost:15672
on Unix machines. - Next, go to the project directory and start the message broker script, message_broker.py by typing in
python3 message_broker.py
. This will start the engine listening for jobs published in the queue by any process. - Next go to the directory of the electron app. You can find the code for the application here..
- Run
npm install
to installed the required packages. - Once the dependencies are installed, run
npm start
to start the application. - Click on Click & Speak to start coding through speech!
NOTE:
- To get the VS Code extension working
Please use VSCode Insiders to build the extension. Normal VSCode does not build the extension for the development build.
For testing,
- Open VSCode Insiders repo and click debug. This creates a new VSCode window where our extension is enabled (due to not being in production).
- Open Command Pallete (
cmd+shit+P
) and enable our extension. - Run
message_broker.py
. - Run
npm start
inside ElectronJS application folder. - ???
- Profit!
Current issues include:
- The audio quality when recording to
speech_recognizer
can be improved to send a better quality audio to Google Speech API. - Ambient noise needs to be better handled in order to enable a more complete experience.
Made at HackHarvard 2018.
Devpost submission: Link
Made with <3 by LitLabs.