classifying newswiresa multiclass classification example getting started with neural networks in the previous sectionyou saw how to classify vector inputs into two mutually exclusive classes using densely connected neural network but what happens when you have more than two classesin this sectionyou'll build network to classify reuters newswires into mutually exclusive topics because you have many classesthis problem is an instance of multiclass classificationand because each data point should be classified into only one categorythe problem is more specifically an instance of single-labelmulticlass classification if each data point could belong to multiple categories (in this casetopics)you' be facing multilabelmulticlass classification problem the reuters dataset you'll work with the reuters dataseta set of short newswires and their topicspublished by reuters in it' simplewidely used toy dataset for text classification there are different topicssome topics are more represented than othersbut each topic has at least examples in the training set like imdb and mnistthe reuters dataset comes packaged as part of keras let' take look listing loading he reut ers dat aset from keras datasets import reuters (train_datatrain_labels)(test_datatest_labelsreuters load_datanum_words= as with the imdb datasetthe argument num_words= restricts the data to the , most frequently occurring words found in the data you have , training examples and , test exampleslen(train_data len(test_data as with the imdb reviewseach example is list of integers (word indices)train_data[ [ here' how you can decode it back to wordsin case you're curious listing decoding newswires back ext word_index reuters get_word_index(reverse_word_index dict([(valuekeyfor (keyvaluein word_index items()]decoded_newswire join([reverse_word_index get( '?'for in train_data[ ]]note that the indices are offset by because and are reserved indices for padding,start of sequence,and unknown licensed to