<code>
.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata text_classification_details = 9;
</code>
4625
public com.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata
      getTextClassificationDetails() {
    if (detailsCase_ == 9) {
      return (com.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata
        .getDefaultInstance();
  }
152580
@Exported
    public String getDescription() {
        Set<Node> nodes = getNodes();
        if(nodes.isEmpty()) {
            Set<Cloud> clouds = getClouds();
            if(clouds.isEmpty())
                return Messages.Label_InvalidLabel();

            return Messages.Label_ProvisionedFrom(toString(clouds));
        }

        if(nodes.size()==1)
            return nodes.iterator().next().getNodeDescription();

        return Messages.Label_GroupOf(toString(nodes));
    }
365057
public Category classify(String text) {
		StringTokenizer itr = new StringTokenizer(text);
		Map<Category, Double> scorePerCategory = new HashMap<Category, Double>();
		double bestScore = Double.NEGATIVE_INFINITY;
		Category bestCategory = null;
		while(itr.hasMoreTokens()) {
			String token = NaiveBayesGenerate.normalizeWord(itr.nextToken());
			for(Category category : Category.values()) {
				int count = MapUtils.getInteger(wordCountPerCategory.get(category), token, 0) + 1;
				double wordScore  = Math.log(count / (double) (tokensPerCategory.get(category) + V));
				double totalScore = MapUtils.getDouble(scorePerCategory, category, 0.) + wordScore;
				if(totalScore > bestScore) {
					bestScore = totalScore;
					bestCategory = category;
				}
				scorePerCategory.put(category, totalScore);
			}
		}
		return bestCategory;
	}
153990
public com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata
      getAudioTranscriptionDetails() {
    if (detailsCase_ == 10) {
      return (com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata
        .getDefaultInstance();
  }
233650
@Override
  public Map<String, Double> scoreMap(String[] text) {
    Map<String, Double> probDist = new HashMap<>();

    double[] categorize = classifyProb(text);
    int catSize = getNumberOfLabels();
    for (int i = 0; i < catSize; i++) {
      String category = getLabel(i);
      probDist.put(category, categorize[getIndex(category)]);
    }
    return probDist;
  }
542296
private TSMeta parseTSMetaQS(final HttpQuery query) {
    final String tsuid = query.getQueryStringParam("tsuid");
    final TSMeta meta;
    if (tsuid != null && !tsuid.isEmpty()) {
      meta = new TSMeta(tsuid);
    } else {
      meta = new TSMeta();
    }
    
    final String display_name = query.getQueryStringParam("display_name");
    if (display_name != null) {
      meta.setDisplayName(display_name);
    }
  
    final String description = query.getQueryStringParam("description");
    if (description != null) {
      meta.setDescription(description);
    }
    
    final String notes = query.getQueryStringParam("notes");
    if (notes != null) {
      meta.setNotes(notes);
    }
    
    final String units = query.getQueryStringParam("units");
    if (units != null) {
      meta.setUnits(units);
    }
    
    final String data_type = query.getQueryStringParam("data_type");
    if (data_type != null) {
      meta.setDataType(data_type);
    }
    
    final String retention = query.getQueryStringParam("retention");
    if (retention != null && !retention.isEmpty()) {
      try {
        meta.setRetention(Integer.parseInt(retention));
      } catch (NumberFormatException nfe) {
        throw new BadRequestException("Unable to parse 'retention' value");
      }
    }
    
    final String max = query.getQueryStringParam("max");
    if (max != null && !max.isEmpty()) {
      try {
        meta.setMax(Float.parseFloat(max));
      } catch (NumberFormatException nfe) {
        throw new BadRequestException("Unable to parse 'max' value");
      }
    }
    
    final String min = query.getQueryStringParam("min");
    if (min != null && !min.isEmpty()) {
      try {
        meta.setMin(Float.parseFloat(min));
      } catch (NumberFormatException nfe) {
        throw new BadRequestException("Unable to parse 'min' value");
      }
    }
    
    return meta;
  }
195270
private static MeanMagnitudes getLayerMeanMagnitudes(int layerIdx, TrainModuleUtils.GraphInfo gi,
                    List<Persistable> updates, List<Integer> iterationCounts, ModelType modelType) {
        if (gi == null) {
            return new MeanMagnitudes(Collections.emptyList(), Collections.emptyMap(), Collections.emptyMap(),
                            Collections.emptyMap());
        }

        String layerName = gi.getVertexNames().get(layerIdx);
        if (modelType != ModelType.CG) {
            //Get the original name, for the index...
            layerName = gi.getOriginalVertexName().get(layerIdx);
        }
        String layerType = gi.getVertexTypes().get(layerIdx);
        if ("input".equalsIgnoreCase(layerType)) { //TODO better checking - other vertices, etc
            return new MeanMagnitudes(Collections.emptyList(), Collections.emptyMap(), Collections.emptyMap(),
                            Collections.emptyMap());
        }

        List<Integer> iterCounts = new ArrayList<>();
        Map<String, List<Double>> ratioValues = new HashMap<>();
        Map<String, List<Double>> outParamMM = new HashMap<>();
        Map<String, List<Double>> outUpdateMM = new HashMap<>();

        if (updates != null) {
            int pCount = -1;
            for (Persistable u : updates) {
                pCount++;
                if (!(u instanceof StatsReport))
                    continue;
                StatsReport sp = (StatsReport) u;
                if (iterationCounts != null) {
                    iterCounts.add(iterationCounts.get(pCount));
                } else {
                    int iterCount = sp.getIterationCount();
                    iterCounts.add(iterCount);
                }


                //Info we want, for each parameter in this layer: mean magnitudes for parameters, updates AND the ratio of these
                Map<String, Double> paramMM = sp.getMeanMagnitudes(StatsType.Parameters);
                Map<String, Double> updateMM = sp.getMeanMagnitudes(StatsType.Updates);
                for (String s : paramMM.keySet()) {
                    String prefix;
                    if (modelType == ModelType.Layer) {
                        prefix = layerName;
                    } else {
                        prefix = layerName + "_";
                    }

                    if (s.startsWith(prefix)) {
                        //Relevant parameter for this layer...
                        String layerParam = s.substring(prefix.length());
                        double pmm = paramMM.getOrDefault(s, 0.0);
                        double umm = updateMM.getOrDefault(s, 0.0);
                        if (!Double.isFinite(pmm)) {
                            pmm = NAN_REPLACEMENT_VALUE;
                        }
                        if (!Double.isFinite(umm)) {
                            umm = NAN_REPLACEMENT_VALUE;
                        }
                        double ratio;
                        if (umm == 0.0 && pmm == 0.0) {
                            ratio = 0.0; //To avoid NaN from 0/0
                        } else {
                            ratio = umm / pmm;
                        }
                        List<Double> list = ratioValues.get(layerParam);
                        if (list == null) {
                            list = new ArrayList<>();
                            ratioValues.put(layerParam, list);
                        }
                        list.add(ratio);

                        List<Double> pmmList = outParamMM.get(layerParam);
                        if (pmmList == null) {
                            pmmList = new ArrayList<>();
                            outParamMM.put(layerParam, pmmList);
                        }
                        pmmList.add(pmm);

                        List<Double> ummList = outUpdateMM.get(layerParam);
                        if (ummList == null) {
                            ummList = new ArrayList<>();
                            outUpdateMM.put(layerParam, ummList);
                        }
                        ummList.add(umm);
                    }
                }
            }
        }

        return new MeanMagnitudes(iterCounts, ratioValues, outParamMM, outUpdateMM);
    }
972497
public NamedEntities entity_stats() {
		NamedEntities res = new NamedEntities();
		CoreLabel c;
		for (int classifierId = 0; classifierId < classifiers.size(); classifierId++) {
			System.err.printf("-- Classifier-%d\n", classifierId);
			
			String lastGold = "O", lastGuess = "O";
			int goldIndex = 0, guessIndex = 0;
			String goldString = "", guessString = "";
			String goldLemmaString = "", guessLemmaString = "";
			for (int i = 0; i < document.size(); i++) {
				c = document.get(i);
				String gold = c.getString(NamedEntityTagGoldAnnotation.class);
				String guess = c.get(AnswersAnnotation.class).get(classifierId);
				
				// continue current gold string
				if (lastGold.equals(gold) && !lastGold.equals("O")) {
					goldString += " " + c.word();
					goldLemmaString += " " + c.lemma();
				}
				
				// continue current guess string
				if (lastGuess.equals(guess) && !lastGuess.equals("O")) {
					guessString += " " + c.word();
					guessLemmaString += " " + c.lemma();
				}
				
				if (!lastGold.equals(gold) && !lastGold.equals("O")) {
					String t = "|" + lastGold + "|" + lastGuess;
				    if (lastGuess.equals(lastGold) && !lastGuess.equals(guess) &&
				    		goldIndex == guessIndex) {
				    	// TP 0/0 1/1 0/0
				    	//System.err.printf("TP %s\n", goldString);
				    	res.incTp(goldLemmaString + t, goldString + t);
				    } else {
				    	// FN 0/0 1/0 1/0 0/0; 0/0 1/1 1/0 0/0
						//System.err.printf("FN %s\n", goldString);
						res.incFn(goldLemmaString + t, goldString + t);
				    }
				}
				
				if (!lastGuess.equals(guess) && !lastGuess.equals("O")) {
					if (lastGuess.equals(lastGold) && !lastGuess.equals(guess) &&
							goldIndex == guessIndex && !lastGold.equals(gold)) {
						// already TP
					} else {
						// FP 
						String t = "|" + lastGold + "|" + lastGuess;
						res.incFp(guessLemmaString + t, guessString + t);
						System.err.printf("FP %s\n", guessString);
					}
				}
				
				if (!lastGold.equals(gold)) {
					lastGold = gold;
					goldIndex = i;
					goldString = c.word();
					goldLemmaString = c.lemma();
				}

				if (!lastGuess.equals(guess)) {
					lastGuess = guess;
					guessIndex = i;
					guessString = c.word();
					guessLemmaString = c.lemma();
				}
			}
				
			if (!lastGold.equals("O")) {
				String t = "|" + lastGold + "|" + lastGuess;
				if (lastGold.equals(lastGuess) && goldIndex == guessIndex) {
					// System.err.printf("TP %s\n", goldString);
					res.incTp(goldLemmaString + t, goldString + t);
				} else {
					// System.err.printf("FN %s\n", goldString);
					res.incFn(goldLemmaString + t, goldString + t);
				}
			}
			
			if (!lastGuess.equals("O")) {
				if (lastGold.equals(lastGuess) && goldIndex == guessIndex) {
					// OK
				} else {
					String t = "|" + lastGold + "|" + lastGuess;
					res.incFn(guessLemmaString + t, guessString + t);
				}
			}
		}
		return res;
	}
754302
public com.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata
      getImageBoundingBoxDetails() {
    if (detailsCase_ == 4) {
      return (com.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata
        .getDefaultInstance();
  }
999409
public com.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata
      getVideoClassificationDetails() {
    if (detailsCase_ == 5) {
      return (com.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata
        .getDefaultInstance();
  }
807265
private void printInfo(CqlMetadata metadata) throws CharacterCodingException
    {

        Iterator<ByteBuffer> nameIter = metadata.getName_types().keySet().iterator();
        Iterator<ByteBuffer> valueIter = metadata.getValue_types().keySet().iterator();

        while (nameIter.hasNext())
        {
            ByteBuffer key = nameIter.next();
            System.out.format(ByteBufferUtil.string(key) + " \t\t " + metadata.getName_types().get(key));
            System.out.format("\n");
        }

        System.out.format("Column Name: \t\t  Column Value type");
        System.out.format("\n");
        while (valueIter.hasNext())
        {
            ByteBuffer key = valueIter.next();
            System.out.format(ByteBufferUtil.string(key) + " \t\t " + metadata.getValue_types().get(key));
            System.out.format("\n");
        }
        System.out.format("\n");
    }
849756
public com.google.api.ads.admanager.axis.v201902.ContentStatusDefinedBy getStatusDefinedBy() {
        return statusDefinedBy;
    }
815512
public com.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata
      getImageOrientedBoundingBoxDetails() {
    if (detailsCase_ == 14) {
      return (com.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata
        .getDefaultInstance();
  }
1185696
@Override
  public void buildClassifier(Database database, Relation<? extends ClassLabel> labelrep) {
    Object2IntOpenHashMap<ClassLabel> count = new Object2IntOpenHashMap<>();
    for(DBIDIter iter = labelrep.iterDBIDs(); iter.valid(); iter.advance()) {
      count.addTo(labelrep.get(iter), 1);
    }
    int max = Integer.MIN_VALUE;
    double size = labelrep.size();

    distribution = new double[count.size()];
    labels = new ArrayList<>(count.size());
    ObjectIterator<Entry<ClassLabel>> iter = count.object2IntEntrySet().fastIterator();
    for(int i = 0; iter.hasNext(); ++i) {
      Entry<ClassLabel> entry = iter.next();
      distribution[i] = entry.getIntValue() / size;
      labels.add(entry.getKey());
      if(entry.getIntValue() > max) {
        max = entry.getIntValue();
        prediction = entry.getKey();
      }
    }
  }
737352
public String setClassification(String classificationType) {
        Metadata metadata = new Metadata().add(Metadata.CLASSIFICATION_KEY, classificationType);
        Metadata classification = null;

        try {
            classification = this.createMetadata(Metadata.CLASSIFICATION_TEMPLATE_KEY, "enterprise", metadata);
        } catch (BoxAPIException e) {
            if (e.getResponseCode() == 409) {
                metadata = new Metadata("enterprise", Metadata.CLASSIFICATION_TEMPLATE_KEY);
                metadata.replace(Metadata.CLASSIFICATION_KEY, classificationType);
                classification = this.updateMetadata(metadata);
            } else {
                throw e;
            }
        }

        return classification.getString(Metadata.CLASSIFICATION_KEY);
    }
253352
public com.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadataOrBuilder
      getVideoObjectTrackingDetailsOrBuilder() {
    if (detailsCase_ == 7) {
      return (com.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata
        .getDefaultInstance();
  }
145615
public com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadataOrBuilder
      getAudioTranscriptionDetailsOrBuilder() {
    if (detailsCase_ == 10) {
      return (com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata
        .getDefaultInstance();
  }