I'm using brain js for text classification. The problem that I face is the speed of training is incredibly slow. The below code takes 15-20 minutes to execute. I've read about a couple of simple projects which seem to face the same issue. Some of the authors do something very interesting-they convert the text to numbers. My question is how to convert the strings into digits in order to increase learning speed and then present output identical to mine's now?
//Simple emotion detetction
var net = new brain.recurrent.LSTM();
net.train([
{input: "Feeling good.", output: "positive"},
{input: "Overall well.", output: "positive"},
{input: "Extremely happy.", output: "positive"},
{input: "I'm feeling joyful.", output: "positve"},
{input: "She is in an outstanding mood.", output: "positive"},
{input: "He is feeling inspiration", output: "positive."},
{input: "Today will be my day.", output: "positive"},
{input: "I know that I’m winner.", output: "positive"},
{input: "Yes ,I can do it, I know I can.", output: "positive"},
{input: "Tomorrow is next chance.", output: "positve"},
{input: "Henna can do it.", output: "positive"},
{input: "I like vegetables.", output: "positive."},
{input: "I'm feeling worse than ever.", output: "negative"},
{input: "She seems a little distracted.", output: "negative"},
{input: "This behaviour is unacceptable.", output: "negative"},
{input: "Rober is feeling depressed.", output: "negative"},
{input: "They are feeling miserable.", output: "negative"},
{input: "Robert is in bad mood.", output: "negative"},
{input: "I'm feeling pity for m action.", output: "negative"}
]);
alert(net.run("I'm feeling pretty bad."));