private void undoPriorInfluence(Map<String, Double> probabilites) {
   if (probabilites != null && probabilites.size() > 0) {
     model.priorDenominator--;
     for (Map.Entry<String, Double> e : model.categoryPriors.entrySet()) {
       e.setValue(e.getValue() - probabilites.get(e.getKey()));
     }
   }
 }
 private void makePriorInfluence(Map<String, Double> probabilites) {
   if (probabilites != null) {
     model.priorDenominator++;
     for (Map.Entry<String, Double> e : model.categoryPriors.entrySet()) {
       e.setValue(e.getValue() + probabilites.get(e.getKey()));
     }
   }
 }
 @Override
 public void newAssign(AssignedLabel<String> assign) {
   DatumResult dr = results.getOrCreateDatumResult(assign.getLobject());
   Map<String, Double> oldProbabilites = dr.getCategoryProbabilites();
   // update object class probabilites
   Map<String, Double> probabilities =
       getObjectClassProbabilities(assign.getLobject(), assign.getWorker());
   dr.setCategoryProbabilites(probabilities);
   results.addDatumResult(assign.getLobject(), dr);
   // update priors
   if (!data.arePriorsFixed()) {
     undoPriorInfluence(oldProbabilites);
     makePriorInfluence(probabilities);
   }
   // rebuild worker confusion matrices for all workers who assigned this object
   if (probabilities != null)
     for (AssignedLabel<String> al : data.getAssignsForObject(assign.getLobject())) {
       WorkerResult wr = results.getOrCreateWorkerResult(al.getWorker());
       for (Map.Entry<String, Double> e : probabilities.entrySet()) {
         wr.addError(e.getKey(), al.getLabel(), e.getValue());
       }
       results.addWorkerResult(al.getWorker(), wr);
     }
 }