Extractors
Section of internal API reference related to creation, manipulation and usage of extractors.
Index
JsonGrinder.extractempty
JsonGrinder.ExtractEmpty
JsonGrinder.extract_missing_bag
JsonGrinder.extractscalar
JsonGrinder.make_empty_bag
Internal functions
JsonGrinder.make_empty_bag
— Functionreturns empty bag of 0 observations
JsonGrinder.ExtractEmpty
— Typestruct ExtractEmpty end
Concrete type to dispatch on for extraction of empty samples.
JsonGrinder.extractempty
— Constantextractempty
A singleton of type ExtractEmpty
is used to signal downstream extractors that they should extract an empty sample.
JsonGrinder.extract_missing_bag
— Functionreturns missing bag of 1 observation
JsonGrinder.extractscalar
— Functionextractscalar(Type{String}, n = 3, b = 256, m = 2053)
represents strings as ngrams with
n
(the degree of ngram),b
base of string,m
modulo on index of the token to reduce dimension
extractscalar(Type{Number}, m = 0, s = 1)
extracts number subtracting m
and multiplying by s
Example
julia> JsonGrinder.extractscalar(String, 3, 256, 2053, true)("5")
2053×1 ArrayNode{NGramMatrix{Union{Missing, String}, Vector{Union{Missing, String}}, Union{Missing, Int64}}, Nothing}:
"5"
julia> JsonGrinder.extractscalar(Int32, 3, 256, true)("5")
1×1 ArrayNode{Matrix{Union{Missing, Int32}}, Nothing}:
512
julia> JsonGrinder.extractscalar(String, 3, 256, 2053, false)("5")
2053×1 ArrayNode{NGramMatrix{String, Vector{String}, Int64}, Nothing}:
"5"
julia> JsonGrinder.extractscalar(Int32, 3, 256, false)("5")
1×1 ArrayNode{Matrix{Int32}, Nothing}:
512