JeSuisPatate
JeSuisPatate

Reputation: 5

How to use Neural Network to map keywords?

I am new to machine learning and neural network. I have a situation where, for house providing, we study the cases of a candidate and of a housing in order to predict the answer of the candidate. I have been given an exemple looking like this :

Input1:

['male', '+60yo', 'health reasons', 'domestic abuse reasons','asked with elevator', 'already denied without elevator', ...]

Input2:

['60m²', 'city_name', 'without elevator']

Hidden layers:

['+60yo', 'health reasons'], ['asked with elevator'], ['already denied without elevator'], [etc.]

Output:

'Denied without elevator'

So, I'd like to use ANN to simulate this situation, but the tools I'm using works only with numbers data, not key words. I'm actually doing it on php with the PHP-ML library and think of using the Multilayer Perceptron Classifier method.

Does somebody know something that could help me?

PS: Since I don't know yet how to do such a thing, I've been training only with numerical data leading to a label, and for this here is how it looks:

// $labels is an array with all the unique possible output
$labels = ['a','b','c'];
$mlp = new MLPClassifier(4, [2], $labels);
$mlp->train(
    $samples = [[1, 0, 0, 0], [0, 1, 1, 0], [1, 1, 1, 1], [0, 0, 0, 0]],
    $targets = ['a', 'a', 'b', 'c']
);
$mlp->predict([[1, 1, 1, 1], [0, 0, 0, 0]]);
// return ['b', 'c'];

Upvotes: 1

Views: 137

Answers (0)

Related Questions