blob: 5c02c9a2f4263edafccf000a9b57677edcafac50 [file] [log] [blame]
#-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#-------------------------------------------------------------
F1 = federated(type="frame", addresses=list($in_X1, $in_X2, $in_X3),
ranges=list(list(0, 0), list(3, $cols), list(3, 0), list(6, $cols),
list(6, 0), list(9, $cols)));
max_token = 2000;
# Example spec:
jspec = "{algo:ngram, algo_params: {min_gram: 1,max_gram: 3}, out:hash, out_params:
{num_features: 128}, format_wide: true, id_cols: [2,1], tokenize_col: 3}";
F2 = tokenize(target=F1[,2:4], spec=jspec, max_tokens=max_token);
jspec2 = "{ids: true, recode: [1,2]}";
[X, M] = transformencode(target=F2, spec=jspec2);
write(X, $out_R);