I am learning machine learning and I'm trying to implement a solution for a real problem: predict from a human sentence what programming function he/she is trying to do.
I have a series of programming functions related with a series of descriptions (there can be n > 0 descriptions for each unique function).
I created a neural network and a bag of words model trying to convert a human sentence "we get the data from the database" to a programming function. So far it works with very easy examples but not with my real data.
Something like this works:
"description" | programming function lala lolo lulu ka | function1 lala lolo lulu ke | function1 lala lolo lulu ko | function1 lala lele lili ka | function2 lala lele lili ki | function2 lala lele lili ko | function2
Every word in the description is converted to an neuron-input (with value of 1 if present and 0 if not present) and every possible function is converted to a neuron-output.
I'm using pyBrain with back propagation and an error threshold of 0.005. The neural network has three layers, and the middle one has lenght: number of possible words + number of possible programming functions (this is kind of arbitrary).
I know full text search or auto-complete is probably a better alternative for this task, but I'm just experimenting with machine learning and I'd like this to work if possible. In my real data I have 1000 descriptions related with ~500 functions.
So my question is:
- Is bag of words + neural networks a good approach for solving this?
- Maybe Word2vec is a better option?
- If neither is good, is there any known machine learning approach that could work with something like that?