MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / SampleEncode

Method SampleEncode

external/sentencepiece/src/sentencepiece_processor.cc:472–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472util::Status SentencePieceProcessor::SampleEncode(
473 absl::string_view input, int nbest_size, float alpha,
474 std::vector<std::string> *pieces) const {
475 CHECK_OR_RETURN_STATUS_STL(pieces);
476
477 SentencePieceText spt;
478 RETURN_IF_ERROR(SampleEncode(input, nbest_size, alpha, &spt));
479 pieces->reserve(spt.pieces().size());
480 for (const auto &sp : spt.pieces()) {
481 pieces->emplace_back(sp.piece());
482 }
483
484 return util::OkStatus();
485}
486
487util::Status SentencePieceProcessor::SampleEncode(absl::string_view input,
488 int nbest_size, float alpha,

Callers

nothing calls this directly

Calls 14

OkStatusFunction · 0.85
LogSumFunction · 0.85
GetRandomGeneratorFunction · 0.85
sizeMethod · 0.45
piecesMethod · 0.45
idMethod · 0.45
NormalizeMethod · 0.45
EncodeMethod · 0.45
NBestEncodeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected