code: public Map<String, Double> getFMeasureForLabels()
      {
          Map<String, Double> fMeasure = new LinkedHashMap<>();
  
          Map<String, Double> precisionForLabels = getPrecisionForLabels();
          Map<String, Double> recallForLabels = getRecallForLabels();
  
          for (String label : allGoldLabels) {
              double p = precisionForLabels.get(label);
              double r = recallForLabels.get(label);
  
              double fm = 0;
  
              if ((p + r) > 0) {
                  fm = (2 * p * r) / (p + r);
              }
  
              fMeasure.put(label, fm);
          }
  
          return fMeasure;
      }
docs: Returns F-measure for categories; see See http://en.wikipedia.org/wiki/F1_score
  
  @return double