0
$\begingroup$

So I have a task to classify the relation between 2 texts (4 classes possible) and one of the requirements is to preprocess them with TfidfVectorizer or CountVectorizer.

Since every sample has 2 strings, I figured it would be useful to make a CNN with a 1D conv layer so that it captures the relation between feature1 from the first string (vectorizer output for word 1 from the vocabulary or max_features if used) and feature1 from the second string (so the shape would be n_samples x n_features x 2).

Can anyone guide me on how I should create the layers after the first CONV1D input layer?

Also, I should add that the dataset is imbalanced (2k 2k 25k 25k aprox samples per classes) so I will use class_weights and also a dropout layer and earlystopping would also help on regularization

Thanks in advance for any tips!

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.