Package com.google.genai.proto
Class SentencepieceModel.NormalizerSpec
-
- All Implemented Interfaces:
-
com.google.genai.proto.SentencepieceModel.NormalizerSpecOrBuilder,com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,java.io.Serializable
public final class SentencepieceModel.NormalizerSpec extends GeneratedMessageV3.ExtendableMessage<MessageT> implements SentencepieceModel.NormalizerSpecOrBuilder
Protobuf typeNormalizerSpec encodes a various parameters for string normalizationcom.google.genai.proto.NormalizerSpec
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSentencepieceModel.NormalizerSpec.Builder
Protobuf typeNormalizerSpec encodes a various parameters for string normalizationcom.google.genai.proto.NormalizerSpec
-
Field Summary
Fields Modifier and Type Field Description public final static intNAME_FIELD_NUMBERpublic final static intPRECOMPILED_CHARSMAP_FIELD_NUMBERpublic final static intADD_DUMMY_PREFIX_FIELD_NUMBERpublic final static intREMOVE_EXTRA_WHITESPACES_FIELD_NUMBERpublic final static intESCAPE_WHITESPACES_FIELD_NUMBERpublic final static intNORMALIZATION_RULE_TSV_FIELD_NUMBERpublic final static Parser<SentencepieceModel.NormalizerSpec>PARSER
-
Method Summary
Modifier and Type Method Description final static Descriptors.DescriptorgetDescriptor()booleanhasName()name of normalization rule.optional string name = 1;StringgetName()name of normalization rule.optional string name = 1;ByteStringgetNameBytes()name of normalization rule.optional string name = 1;booleanhasPrecompiledCharsmap()Pre-compiled normalization rule created by Builder::GetPrecompiledCharsMap() or Builder::CompileCharsMap() method. Usually this field is set by Builder::GetNormalizerSpec() method.optional bytes precompiled_charsmap = 2;ByteStringgetPrecompiledCharsmap()Pre-compiled normalization rule created by Builder::GetPrecompiledCharsMap() or Builder::CompileCharsMap() method. Usually this field is set by Builder::GetNormalizerSpec() method.optional bytes precompiled_charsmap = 2;booleanhasAddDummyPrefix()Adds dummy whitespace at the beginning of text in order to treat "world" in "world" and "hello world" in the same way.optional bool add_dummy_prefix = 3 [default = true];booleangetAddDummyPrefix()Adds dummy whitespace at the beginning of text in order to treat "world" in "world" and "hello world" in the same way.optional bool add_dummy_prefix = 3 [default = true];booleanhasRemoveExtraWhitespaces()Removes leading, trailing, and duplicate internal whitespace.optional bool remove_extra_whitespaces = 4 [default = true];booleangetRemoveExtraWhitespaces()Removes leading, trailing, and duplicate internal whitespace.optional bool remove_extra_whitespaces = 4 [default = true];booleanhasEscapeWhitespaces()Replaces whitespace with meta symbol. This field must be true to train sentence piece model.optional bool escape_whitespaces = 5 [default = true];booleangetEscapeWhitespaces()Replaces whitespace with meta symbol. This field must be true to train sentence piece model.optional bool escape_whitespaces = 5 [default = true];booleanhasNormalizationRuleTsv()Custom normalization rule file in TSV format. https://github.com/google/sentencepiece/blob/master/doc/normalization.md This field is only used in SentencePieceTrainer::Train() method, which compiles the rule into the binary rule stored in `precompiled_charsmap`.optional string normalization_rule_tsv = 6;StringgetNormalizationRuleTsv()Custom normalization rule file in TSV format. https://github.com/google/sentencepiece/blob/master/doc/normalization.md This field is only used in SentencePieceTrainer::Train() method, which compiles the rule into the binary rule stored in `precompiled_charsmap`.optional string normalization_rule_tsv = 6;ByteStringgetNormalizationRuleTsvBytes()Custom normalization rule file in TSV format. https://github.com/google/sentencepiece/blob/master/doc/normalization.md This field is only used in SentencePieceTrainer::Train() method, which compiles the rule into the binary rule stored in `precompiled_charsmap`.optional string normalization_rule_tsv = 6;final booleanisInitialized()voidwriteTo(CodedOutputStream output)intgetSerializedSize()booleanequals(Object obj)inthashCode()static SentencepieceModel.NormalizerSpecparseFrom(ByteBuffer data)static SentencepieceModel.NormalizerSpecparseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)static SentencepieceModel.NormalizerSpecparseFrom(ByteString data)static SentencepieceModel.NormalizerSpecparseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)static SentencepieceModel.NormalizerSpecparseFrom(Array<byte> data)static SentencepieceModel.NormalizerSpecparseFrom(Array<byte> data, ExtensionRegistryLite extensionRegistry)static SentencepieceModel.NormalizerSpecparseFrom(InputStream input)static SentencepieceModel.NormalizerSpecparseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)static SentencepieceModel.NormalizerSpecparseDelimitedFrom(InputStream input)static SentencepieceModel.NormalizerSpecparseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)static SentencepieceModel.NormalizerSpecparseFrom(CodedInputStream input)static SentencepieceModel.NormalizerSpecparseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)SentencepieceModel.NormalizerSpec.BuildernewBuilderForType()static SentencepieceModel.NormalizerSpec.BuildernewBuilder()static SentencepieceModel.NormalizerSpec.BuildernewBuilder(SentencepieceModel.NormalizerSpec prototype)SentencepieceModel.NormalizerSpec.BuildertoBuilder()static SentencepieceModel.NormalizerSpecgetDefaultInstance()static Parser<SentencepieceModel.NormalizerSpec>parser()Parser<SentencepieceModel.NormalizerSpec>getParserForType()SentencepieceModel.NormalizerSpecgetDefaultInstanceForType()-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.ExtendableMessage
getAllFields, getAllFieldsRaw, getExtension, getExtensionCount, getField, getRepeatedField, getRepeatedFieldCount, hasExtension, hasField -
Methods inherited from class com.google.protobuf.GeneratedMessageV3
getDescriptorForType, getOneofFieldDescriptor, getUnknownFields, hasOneof -
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, toString -
Methods inherited from class com.google.protobuf.AbstractMessageLite
toByteArray, toByteString, writeDelimitedTo -
Methods inherited from class com.google.protobuf.Message
getParserForType -
Methods inherited from class com.google.protobuf.MessageLite
getParserForType -
Methods inherited from class com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getDescriptor
final static Descriptors.Descriptor getDescriptor()
-
hasName
boolean hasName()
name of normalization rule.optional string name = 1;- Returns:
Whether the name field is set.
-
getNameBytes
ByteString getNameBytes()
name of normalization rule.optional string name = 1;- Returns:
The bytes for name.
-
hasPrecompiledCharsmap
boolean hasPrecompiledCharsmap()
Pre-compiled normalization rule created by Builder::GetPrecompiledCharsMap() or Builder::CompileCharsMap() method. Usually this field is set by Builder::GetNormalizerSpec() method.optional bytes precompiled_charsmap = 2;- Returns:
Whether the precompiledCharsmap field is set.
-
getPrecompiledCharsmap
ByteString getPrecompiledCharsmap()
Pre-compiled normalization rule created by Builder::GetPrecompiledCharsMap() or Builder::CompileCharsMap() method. Usually this field is set by Builder::GetNormalizerSpec() method.optional bytes precompiled_charsmap = 2;- Returns:
The precompiledCharsmap.
-
hasAddDummyPrefix
boolean hasAddDummyPrefix()
Adds dummy whitespace at the beginning of text in order to treat "world" in "world" and "hello world" in the same way.optional bool add_dummy_prefix = 3 [default = true];- Returns:
Whether the addDummyPrefix field is set.
-
getAddDummyPrefix
boolean getAddDummyPrefix()
Adds dummy whitespace at the beginning of text in order to treat "world" in "world" and "hello world" in the same way.optional bool add_dummy_prefix = 3 [default = true];- Returns:
The addDummyPrefix.
-
hasRemoveExtraWhitespaces
boolean hasRemoveExtraWhitespaces()
Removes leading, trailing, and duplicate internal whitespace.optional bool remove_extra_whitespaces = 4 [default = true];- Returns:
Whether the removeExtraWhitespaces field is set.
-
getRemoveExtraWhitespaces
boolean getRemoveExtraWhitespaces()
Removes leading, trailing, and duplicate internal whitespace.optional bool remove_extra_whitespaces = 4 [default = true];- Returns:
The removeExtraWhitespaces.
-
hasEscapeWhitespaces
boolean hasEscapeWhitespaces()
Replaces whitespace with meta symbol. This field must be true to train sentence piece model.optional bool escape_whitespaces = 5 [default = true];- Returns:
Whether the escapeWhitespaces field is set.
-
getEscapeWhitespaces
boolean getEscapeWhitespaces()
Replaces whitespace with meta symbol. This field must be true to train sentence piece model.optional bool escape_whitespaces = 5 [default = true];- Returns:
The escapeWhitespaces.
-
hasNormalizationRuleTsv
boolean hasNormalizationRuleTsv()
Custom normalization rule file in TSV format. https://github.com/google/sentencepiece/blob/master/doc/normalization.md This field is only used in SentencePieceTrainer::Train() method, which compiles the rule into the binary rule stored in `precompiled_charsmap`.optional string normalization_rule_tsv = 6;- Returns:
Whether the normalizationRuleTsv field is set.
-
getNormalizationRuleTsv
String getNormalizationRuleTsv()
Custom normalization rule file in TSV format. https://github.com/google/sentencepiece/blob/master/doc/normalization.md This field is only used in SentencePieceTrainer::Train() method, which compiles the rule into the binary rule stored in `precompiled_charsmap`.optional string normalization_rule_tsv = 6;- Returns:
The normalizationRuleTsv.
-
getNormalizationRuleTsvBytes
ByteString getNormalizationRuleTsvBytes()
Custom normalization rule file in TSV format. https://github.com/google/sentencepiece/blob/master/doc/normalization.md This field is only used in SentencePieceTrainer::Train() method, which compiles the rule into the binary rule stored in `precompiled_charsmap`.optional string normalization_rule_tsv = 6;- Returns:
The bytes for normalizationRuleTsv.
-
isInitialized
final boolean isInitialized()
-
writeTo
void writeTo(CodedOutputStream output)
-
getSerializedSize
int getSerializedSize()
-
hashCode
int hashCode()
-
parseFrom
static SentencepieceModel.NormalizerSpec parseFrom(ByteBuffer data)
-
parseFrom
static SentencepieceModel.NormalizerSpec parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
-
parseFrom
static SentencepieceModel.NormalizerSpec parseFrom(ByteString data)
-
parseFrom
static SentencepieceModel.NormalizerSpec parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
-
parseFrom
static SentencepieceModel.NormalizerSpec parseFrom(Array<byte> data)
-
parseFrom
static SentencepieceModel.NormalizerSpec parseFrom(Array<byte> data, ExtensionRegistryLite extensionRegistry)
-
parseFrom
static SentencepieceModel.NormalizerSpec parseFrom(InputStream input)
-
parseFrom
static SentencepieceModel.NormalizerSpec parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
-
parseDelimitedFrom
static SentencepieceModel.NormalizerSpec parseDelimitedFrom(InputStream input)
-
parseDelimitedFrom
static SentencepieceModel.NormalizerSpec parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
-
parseFrom
static SentencepieceModel.NormalizerSpec parseFrom(CodedInputStream input)
-
parseFrom
static SentencepieceModel.NormalizerSpec parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
-
newBuilderForType
SentencepieceModel.NormalizerSpec.Builder newBuilderForType()
-
newBuilder
static SentencepieceModel.NormalizerSpec.Builder newBuilder()
-
newBuilder
static SentencepieceModel.NormalizerSpec.Builder newBuilder(SentencepieceModel.NormalizerSpec prototype)
-
toBuilder
SentencepieceModel.NormalizerSpec.Builder toBuilder()
-
getDefaultInstance
static SentencepieceModel.NormalizerSpec getDefaultInstance()
-
parser
static Parser<SentencepieceModel.NormalizerSpec> parser()
-
getParserForType
Parser<SentencepieceModel.NormalizerSpec> getParserForType()
-
getDefaultInstanceForType
SentencepieceModel.NormalizerSpec getDefaultInstanceForType()
-
-
-
-