try {
// Build topology
TridentTopology toppology = new TridentTopology();
// "Training" stream
TridentState classifierState = toppology.newStream("reutersData", new ReutersBatchSpout())
// Transform raw data to text instance
.each(new Fields("label", "text"), new TextInstanceCreator<Integer>(), new Fields("instance"))
// Update text classifier
.partitionPersist(new MemoryMapState.Factory(), new Fields("instance"), new TextClassifierUpdater<Integer>("newsClassifier", new KLDClassifier(9)));