Neural network training - 2 input parameter to 1 output result training

1 view (last 30 days)
im stuck at training net with 2 parameter.
right now im trying to clasify test data. by using example "Classify Text Data Using Deep Learning".
for that example if i want to have "description" and "category" as training input and "resolution" as target output.
which part of code in the example that i have to change.
i need help

Accepted Answer

Madhav Thakker
Madhav Thakker on 8 Sep 2020
Edited: Madhav Thakker on 8 Sep 2020
Hi Ridza,
I understand that you want to train the LSTM network using description and category values instead of just description. As the preprocessText function, tokenization of input data is taking place. One simple way of training the network on both these values is to just prepend category data and continue with the procedure in the same way.
Note that you will have to change the target length of your training data by visualizing the histogram of the document length.
sequenceLength = %new Sequence Length;
XTrain = doc2sequence(enc,documentsTrain,'Length',sequenceLength);
Attaching code snippet for better explanation.
documentsTrain = preprocessText(dataTrain.Description + " " + dataTrain.Category);
documentsValidation = preprocessText(dataValidation.Description + " " + dataValidation.Category);
YTrain = categorical(dataTrain.Resolution);
YValidation = categorical(dataValidation.Resolution);
Refer this example for details -
Hope this helps.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!