title: Error arising during implementing BERT on classifying text problem
body: <p>Recently Matlab has launched BERT in their git repository. There's an example of classifying text data using BERT. I am trying to run this code as it is.</p>
  <p>Here, I am struck at a point where data fails to partitioned into test data.</p>
  <p>The code block I am trying is following:</p>
  <pre><code>%% 
  mdl = bert;
  %% 
  tokenizer = mdl.Tokenizer
  %% 
  filename = &quot;factoryReports.csv&quot;;
  data = readtable(filename,&quot;TextType&quot;,&quot;string&quot;);
  head(data)
  %% 
  data.Category = categorical(data.Category);
  classes = categories(data.Category);
  numClasses = numel(classes)
  %% 
  data.Tokens = encode(tokenizer, data.Description);
  %% 
  cvp = cvpartition(data.Category,&quot;Holdout&quot;,0.2);
  dataTrain = data(training(cvp),:);
  dataValidation = data(test(cvp),:);
  </code></pre>
  <p>The error is showing on the last line of the execution and the error is following:</p>
  <pre><code>Unable to use a value of type cvpartition as an index.
  Error in Untitled (line 18)
  dataValidation = data(test(cvp),:);
  </code></pre>
  <p>What might be the reason of this and how to resolve this issue? I am looking for your advice.</p>