class Cadmium::Classifier::Viterbi
- Cadmium::Classifier::Viterbi
- Reference
- Object
Overview
TODO : add Kneser-Ney smoothing This is a Hidden Markov Model classifier which uses the Viterbi algorithm. It is efficient in predicting a state given prior observations matched to states. In NLP, it is often used to attribut POS tags to words of a text. As such it is used by Cadmium::POSTagger.
Included Modules
- Apatite
Defined in:
cadmium/classifier/viterbi.crConstructors
Instance Method Summary
- #classify(sequence_of_observations : Array(String)) : Hash(String, String)
- #emission_matrix : Matrix(Float64)
- #epsilon : Float64
- #label_count : Hash(String, Int32)
- #load_model(filename : String = "model.zip")
- #lookup_table : Hash(String, Int32)
- #ngram_label_count : Hash(Array(String), Int32)
-
#ngrams_size : Int32
property initial_probabilities
- #observation_space : Set(String)
- #predicted_states : Array(String)
- #prior_ngram_label_count : Hash(Array(String), Int32)
- #save_model(filename : String = "model.zip")
- #sequence_of_ngrams : Array(Array(Tuple(String, String)))
- #sequence_of_observations : Array(String)
- #sequence_of_prior_ngrams : Array(Array(Tuple(String, String)))
- #state_space : Set(String)
-
#token_count : Hash(String, Int32)
observation_space, state_space, initial_probabilities, sequence_of_observations, transition_matrix, emission_matrix
- #token_label_count : Hash(Tuple(String, String), Int32)
- #train(training_data : Array(Tuple(String, String)))
- #training_data : Array(Tuple(String, String))
- #transition_matrix : Matrix(Float64)
Constructor Detail
Instance Method Detail
def token_count : Hash(String, Int32)
#
observation_space, state_space, initial_probabilities, sequence_of_observations, transition_matrix, emission_matrix