nessie.models.tagging.handcrafted_crf_sequence_tagger

Module Contents

Classes

CrfSequenceTagger

Helper class that provides a standard way to create an ABC using

class nessie.models.tagging.handcrafted_crf_sequence_tagger.CrfSequenceTagger(all_possible_transitions: bool = False)

Bases: nessie.models.SequenceTagger

Helper class that provides a standard way to create an ABC using inheritance.

fit(self, X: nessie.types.RaggedStringArray, y: nessie.types.RaggedStringArray)
label_encoder(self) sklearn.preprocessing.LabelEncoder

Returns a label encoder that can be used to map labels to ints and vice versa

predict(self, X: nessie.types.RaggedStringArray) awkward.Array
predict_proba(self, X: nessie.types.RaggedStringArray) awkward.Array

Returns a distribution over labels for each instance.

Parameters

X – The token sequences to predict on

Returns

A (num_sentences, num_tokens, num_labels) ragged array

score(self, X: nessie.types.RaggedStringArray) awkward.Array

Returns the best score for each item