|
virtual void | Dispose (bool disposing) |
|
◆ Close()
virtual void ailiaTokenizer.AiliaTokenizerModel.Close |
( |
| ) |
|
|
inlinevirtual |
Destroys instance.
Destroys and initializes the instance.
111 if (net != IntPtr.Zero){
112 AiliaTokenizer.ailiaTokenizerDestroy(net);
◆ Create()
bool ailiaTokenizer.AiliaTokenizerModel.Create |
( |
int |
type, |
|
|
int |
flag |
|
) |
| |
|
inline |
Create a instance.
- Parameters
-
- Returns
- If this function is successful, it returns true , or false otherwise.
41 int status = AiliaTokenizer.ailiaTokenizerCreate(ref net, type, flag);
◆ Decode()
string ailiaTokenizer.AiliaTokenizerModel.Decode |
( |
int[] |
tokens | ) |
|
|
inline |
Perform decode @pram tokens Input tokens.
- Returns
- If this function is successful, it returns string , or empty string otherwise.
262 return DecodeCore(tokens,
false);
◆ DecodeWithSpecialTokens()
string ailiaTokenizer.AiliaTokenizerModel.DecodeWithSpecialTokens |
( |
int[] |
tokens | ) |
|
|
inline |
Perform decode with special tokens @pram tokens Input tokens.
- Returns
- If this function is successful, it returns string , or empty string otherwise.
280 return DecodeCore(tokens,
true);
◆ Dispose() [1/2]
virtual void ailiaTokenizer.AiliaTokenizerModel.Dispose |
( |
| ) |
|
|
inlinevirtual |
◆ Dispose() [2/2]
virtual void ailiaTokenizer.AiliaTokenizerModel.Dispose |
( |
bool |
disposing | ) |
|
|
inlineprotectedvirtual |
◆ Encode()
int [] ailiaTokenizer.AiliaTokenizerModel.Encode |
( |
string |
utf8 | ) |
|
|
inline |
Perform encode.
- Parameters
-
- Returns
- If this function is successful, it returns array of tokens , or empty array otherwise.
226 return EncodeCore(utf8,
false);
◆ EncodeWithSpecialTokens()
int [] ailiaTokenizer.AiliaTokenizerModel.EncodeWithSpecialTokens |
( |
string |
utf8 | ) |
|
|
inline |
Perform encode with special tokens.
- Parameters
-
- Returns
- If this function is successful, it returns array of tokens , or empty array otherwise.
244 return EncodeCore(utf8,
true);
◆ GetVocab()
string ailiaTokenizer.AiliaTokenizerModel.GetVocab |
( |
int |
token | ) |
|
|
inline |
Perform encode.
- Parameters
-
- Returns
- If this function is successful, it returns string , or null otherwise.
319 IntPtr ptr = IntPtr.Zero;
320 int status = AiliaTokenizer.ailiaTokenizerGetVocab(net, token, ref ptr);
324 return Marshal.PtrToStringAnsi(ptr);
◆ GetVocabSize()
int ailiaTokenizer.AiliaTokenizerModel.GetVocabSize |
( |
| ) |
|
|
inline |
Gets the size of vocab.
- Returns
- If this function is successful, it returns the size of vocab , or -1 otherwise.
297 int status = AiliaTokenizer.ailiaTokenizerGetVocabSize(net, ref len);
◆ Open()
bool ailiaTokenizer.AiliaTokenizerModel.Open |
( |
string |
model_path = null , |
|
|
string |
dictionary_path = null , |
|
|
string |
vocab_path = null |
|
) |
| |
|
inline |
Open a model.
- Parameters
-
model_path | Path for model (don't load if null) |
dictionary_path | Path for dictionary (don't load if null) |
vocab_path | Path for vocab (don't load if null) |
- Returns
- If this function is successful, it returns true , or false otherwise.
73 if (model_path !=
null){
74 status = AiliaTokenizer.ailiaTokenizerOpenModelFile(net, model_path);
79 if (dictionary_path !=
null){
80 status = AiliaTokenizer.ailiaTokenizerOpenDictionaryFile(net, dictionary_path);
85 if (vocab_path !=
null){
86 status = AiliaTokenizer.ailiaTokenizerOpenVocabFile(net, vocab_path);
The documentation for this class was generated from the following file: