Penelope v0.5.0 Penelope.ML.Feature.MergeFeaturizer View Source

This sequence featurizer invokes a set of inner featurizers and merges their results into a single map per sequence element.

Example:

  features = [
    {:token_featurizer, []},
    {:regex_featurizer, [regexes: [~r/ed$/, ~r/ing$/]]},
  ]
  pipeline = [
    {:ptb_tokenizer, []},
    {:feature_merge, features},
    {:crf_tagger, []},
  ]
  Penelope.ml.pipeline.fit(%{}, x, y, pipeline)

Link to this section Summary

Functions

imports parameters from a serialized model

exports a runtime model to a serializable data structure

fits each of the configured inner featurizers

transform a list of feature sequences using the inner featurizers and merge the results into a single list per sequence element

Link to this section Functions

Link to this function compile(params) View Source
compile(params :: [map()]) :: [{atom(), any()}]

imports parameters from a serialized model

Link to this function export(model) View Source
export(model :: [{atom(), any()}]) :: [map()]

exports a runtime model to a serializable data structure

Link to this function fit(context, x, y, features) View Source
fit(
  context :: map(),
  x :: [[any()]],
  y :: [[any()]],
  features :: [{String.t() | atom(), any()}]
) :: [{atom(), any()}]

fits each of the configured inner featurizers

Link to this function transform(model, context, x) View Source
transform(model :: [{atom(), any()}], context :: map(), x :: [[any()]]) :: [
  [map()]
]

transform a list of feature sequences using the inner featurizers and merge the results into a single list per sequence element