@Test public void testExecuteToSequence() { Schema schema = new Schema.Builder() .addColumnsString("action") .build(); Map<Character,Integer> m = defaultCharIndex(); TransformProcess transformProcess = new TransformProcess.Builder(schema) .removeAllColumnsExceptFor("action") .convertToSequence() .transform(new TextToCharacterIndexTransform("action", "action_sequence", m, true)) .build(); String s = "in text"; List<Writable> input = Collections.<Writable>singletonList(new Text(s)); List<List<Writable>> expSeq = new ArrayList<>(s.length()); for( int i = 0; i<s.length(); i++) { expSeq.add(Collections.<Writable>singletonList(new IntWritable(m.get(s.charAt(i))))); } List<List<Writable>> out = transformProcess.executeToSequence(input); assertEquals(expSeq, out); }
public List<List<Writable>> executeToSequence(List<Writable> inputExample){ return execute(inputExample, null).getRight(); }
TransformProcess implements Serializable { public List<List<Writable>> executeToSequence(List<Writable> inputExample){ return execute(inputExample, null).getRight(); } }
TransformProcess implements Serializable { public List<List<Writable>> executeToSequence(List<Writable> inputExample){ return execute(inputExample, null).getRight(); } TransformProcess(@JsonProperty("initialSchema") Schema initialSchema,
                            @JsonProperty("actionList") List<DataAction> actionList); private  TransformProcess(Builder builder); }
TransformProcess implements Serializable { public List<List<Writable>> executeToSequence(List<Writable> inputExample){ return execute(inputExample, null).getRight(); } TransformProcess(@JsonProperty("initialSchema") Schema initialSchema,
                            @JsonProperty("actionList") List<DataAction> actionList); private  TransformProcess(Builder builder); List<DataAction> getActionList(); Schema getFinalSchema(); Schema getSchemaAfterStep(int step); List<Writable> execute(List<Writable> input); List<List<Writable>> executeSequenceToSequence(List<List<Writable>> input); List<List<Writable>> executeSequence(List<List<Writable>> inputSequence); List<List<List<Writable>>> executeToSequenceBatch(List<List<Writable>> inputExample); List<List<Writable>> executeToSequence(List<Writable> inputExample); List<Writable> executeSequenceToSingle(List<List<Writable>> inputSequence); String toJson(); String toYaml(); static TransformProcess fromJson(String json); static TransformProcess fromYaml(String yaml); static List<String> inferCategories(RecordReader recordReader,int columnIndex); static Map<Integer,List<String>> inferCategories(RecordReader recordReader,int[] columnIndices); List<List<Writable>> transformRawStringsToInputSequence(List<List<String>> sequence); List<Writable> transformRawStringsToInputList(List<String> values); List<Writable> transformRawStringsToInput(String... values); }
TransformProcess implements Serializable { public List<List<Writable>> executeToSequence(List<Writable> inputExample){ return execute(inputExample, null).getRight(); } TransformProcess(@JsonProperty("initialSchema") Schema initialSchema,
                            @JsonProperty("actionList") List<DataAction> actionList); private  TransformProcess(Builder builder); List<DataAction> getActionList(); Schema getFinalSchema(); Schema getSchemaAfterStep(int step); List<Writable> execute(List<Writable> input); List<List<Writable>> executeSequenceToSequence(List<List<Writable>> input); List<List<Writable>> executeSequence(List<List<Writable>> inputSequence); List<List<List<Writable>>> executeToSequenceBatch(List<List<Writable>> inputExample); List<List<Writable>> executeToSequence(List<Writable> inputExample); List<Writable> executeSequenceToSingle(List<List<Writable>> inputSequence); String toJson(); String toYaml(); static TransformProcess fromJson(String json); static TransformProcess fromYaml(String yaml); static List<String> inferCategories(RecordReader recordReader,int columnIndex); static Map<Integer,List<String>> inferCategories(RecordReader recordReader,int[] columnIndices); List<List<Writable>> transformRawStringsToInputSequence(List<List<String>> sequence); List<Writable> transformRawStringsToInputList(List<String> values); List<Writable> transformRawStringsToInput(String... values);  }