6 #ifndef TURI_FE_WORD_COUNTER_H_ 7 #define TURI_FE_WORD_COUNTER_H_ 8 #include <model_server/lib/toolkit_class_macros.hpp> 9 #include <toolkits/feature_engineering/transformer_base.hpp> 10 #include <toolkits/feature_engineering/transform_utils.hpp> 11 #include <core/export.hpp> 15 namespace feature_engineering {
17 class EXPORT word_counter:
public transformer_base {
19 static constexpr
size_t WORD_COUNTER_VERSION = 0;
23 std::map<std::string, flex_type_enum> feature_types;
24 std::vector<std::string> feature_columns;
25 flexible_type unprocessed_features;
26 flexible_type delimiters;
29 transform_utils::string_filter_list string_filters;
31 void set_string_filters();
39 virtual inline ~word_counter() {}
48 void init_options(
const std::map<std::string, flexible_type>&_options)
override;
54 size_t get_version()
const override;
70 void init_transformer(
const std::map<std::string,
71 flexible_type>& _options)
override;
78 void fit(gl_sframe data)
override;
90 gl_sframe
transform(gl_sframe data)
override;
99 gl_sframe fit_transform(gl_sframe data) {
116 word_counter::get_default_options);
118 word_counter::get_value_from_state,
#define BEGIN_CLASS_MEMBER_REGISTRATION(python_facing_classname)
#define REGISTER_CLASS_MEMBER_FUNCTION(function,...)
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
#define END_CLASS_MEMBER_REGISTRATION
#define REGISTER_NAMED_CLASS_MEMBER_FUNCTION(name, function,...)
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.
void transform(S &&input, T &&output, TransformFn transformfn, std::set< size_t > constraint_segments=std::set< size_t >())