languagechange.models.type package

languagechange.models.type.type_classification module

class languagechange.models.type.type_classification.ChangeTypeClassifier(model_name='ChangeIsKey/change-type-classifier', max_length=512)[source]

Bases: object

predict(definitions, all_scores=False, labels=True)[source]

Takes as input pairs of definitions and returns the types of semantic relationship (hyponymy, hypernymy, co-hyponymy, antonymy or homonymy) between the definitions of each pair. :param definitions: a list of examples, each containing a tuple of definitions. :type definitions: [str] :param all_scores: determines whether to return the logit values for all classes or just the predicted class. :type all_scores: bool :param labels: determines whether to return the label(s) or the id(s) for each prediction. :type labels: bool

Parameters:

definitions (List[tuple[str]])

id2label(id)[source]
ids2labels(ids)[source]
label2id(label)[source]
labels2ids(labels)[source]

Module contents