Nina
Nina

Reputation: 11

How to perform a multi label classification with tensorflow in purpose of auto tagging?

I'm new to tensorflow and would like to know if there is any tutorial or example of a multi-label classification with multiple network outputs.

I'm asking this because I have a collection of articles, in which, each article can have several tags.

Upvotes: 0

Views: 1066

Answers (1)

Maxim
Maxim

Reputation: 53758

Out of the box, tensorflow supports binary multi-label classification via tf.nn.sigmoid_cross_entropy_with_logits loss function or the like (see the complete list in this question). If your tags are binary, in other words there's a predefined set of possible tags and each one can either be present or not, you can safely go with that. A single model to classify all labels at once. There are a lot of examples of such networks, e.g. one from this question.

Unfortunately, multi-nomial multi-label classification is not supported in tensorflow. If this is your case, you'd have to build a separate classifier for each label, each using tf.nn.softmax_cross_entropy_with_logits or a similar one.

Upvotes: 1

Related Questions