| get_n_chunks {aifeducation} | R Documentation |
Get the number of chunks/sequences for each case
Description
Function for calculating the number of chunks/sequences for every case
Usage
get_n_chunks(text_embeddings, features, times)
Arguments
text_embeddings |
|
features |
|
times |
|
Value
Namedvector of integers representing the number of chunks/sequences
for every case.
See Also
Other Auxiliary Functions:
array_to_matrix(),
calc_standard_classification_measures(),
check_embedding_models(),
clean_pytorch_log_transformers(),
create_iota2_mean_object(),
create_synthetic_units(),
generate_id(),
get_coder_metrics(),
get_folds(),
get_stratified_train_test_split(),
get_synthetic_cases(),
get_train_test_split(),
is.null_or_na(),
matrix_to_array_c(),
split_labeled_unlabeled(),
summarize_tracked_sustainability(),
to_categorical_c()
Examples
test_array<-array(data=c(1,1,1,0,0,0,0,0,0,
2,1,1,2,5,6,0,0,0,
1,2,5,6,1,2,0,4,2),
dim=c(3,3,3))
test_array
#test array has shape (batch,times,features) with
#times=3 and features=3
#Slices where all values are zero are padded.
get_n_chunks(text_embeddings=test_array,features=3,times=3)
#The length of case 1 is 1, case 2 is 3, and case 3 is 2.
[Package aifeducation version 0.3.3 Index]