LiqFit is an easy-to-use framework for few-shot learning of cross-encoder models. Such models were trained to distinguish whether two statements entail, contradict each other, or are neutral. Such task setting is universal for many information extraction tasks, starting from text classification and ending with named entity recognition and question-answering. With LiqFit, you can achieve competitive results by having just 8 examples per label.

For detailed information and access to its code, visit the GitHub repository.

Key features

  • 🔢 A small number of examples are required - LiqFit can significantly improve the accuracy of the default zero-shot classifier having just 8 examples;

  • 📝 Can solve many different information-extraction tasks - Natural language inference is a universal task that can be applied as a setting for many other information extraction tasks, like named entity recognition of question&answering;

  • 🌈 Can work for other classes not presented in the training set - It's not mandatory to have all needed classes in a training set. Because of pre-finetuning on large massive of NLI and classification tasks, a model will save generalisability to other classes;

  • ⚙️ Support of a variety of cross-encoder realizations - LiqFit supports different types of cross-encoders including conventional, binary, and encoder-decoder architectures;

  • ⚖️ Stable to unbalanced datasets - LiqFit uses normalization techniques that allow work well even in the cases of unbalanced data;

  • 🏷️ Multi-label classification support - The approach can be applied for both multi-class and multi-label classification;


  • 🤔 It’s required to run N times transformers feedforward pass, where N is the amount of labels;

Last updated