I would like to train an LSTM neural network to either "approve" or "reject" a string based on the word-type sequence. For instance: "Mike's Airplane" would output "approved", but "Airplane Mike's" would output "reject". My method for doing this is to decompose the string into an array of words. eg.
["Mike's", "Airplane"]
, then convert the array of words to an array of word-types since the actual word is irrelevant. The word types (pronoun, noun, adjective etc.) are defined constants having numerical values. eg.
const wordtypes={propernoun:1, adjective:2, noun:3, ownername:4};
console.log(wordtypes.propernoun); // 1
Mike's Fast Airplane is
["Mike's", "Fast", "Airplane"]
which becomes:
input:[properNoun, adjective, noun]
output: "approve"
properNoun represents the first word(Mike's), adjective the second word(Fast), and noun the third word(Airplane).
I would then like to use this array to train a Neural Network so that it can approve/reject other word-type sequences.
I am concerned with the methodology/algorithm rather than the syntax; I'm extremely new to Machine Learning and Artificial Neural Networks, so, I am using brain.js and NodeJS because they're relatively easy to use.
I would like to input multiple parameters for a single word because many words have multiple word types (depending on the context). For example, a word can be both a "noun" and a "verb". How do I represent this input?
Is this a good application for LSTM? Or is there a better-suited ML
algorithm? My dilemma is in deriving the proper inputs & methodology to effectively train the Neural Network.How is my methodology for accomplishing this approval system?