Review



Review of Hugging face, a Transformers library 🤗

I recently had the opportunity to explore the Huging face repository, and I wanted to share my experience and thoughts. It is a repository I have explored and applied during my PhD and it may help many other who want to try their own transformer models.

Overview

The Hugging face is a fantastic open-source project that aims to use pre-trained NLP models. It provides a user-friendly interface and powerful features to help individuals and teams take advantages of others’ model or even share their own.

In addition, this repo offers solutions for classification, information extraction, question answering, summarization, translation, text generation, among other tasks in more than 100 languages.

As they textually say in their repo…

Transformers provides APIs to quickly download and use those pretrained models on a given text, fine-tune them on your own datasets and then share them with the community on our model hub. At the same time, each python module defining an architecture is fully standalone and can be modified to enable quick research experiments.

and…

Transformers is backed by the three most popular deep learning libraries — Jax, PyTorch and TensorFlow — with a seamless integration between them. It’s straightforward to train your models with one before loading them for inference with the other.

It seems to be a perfect tool for NLP. Here I expose my thoughts!

Pros

Cons

Suggestions

Examples

Some code lines examples in Python of the easy-to-use tool are the following:

config = AutoConfig.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelWithLMHead.from_pretrained(model_name, config=config)

where you only have to choose the type of model class (for example AutoModelWithLMHead) and the pretrained model in the web. You can search by task, topic, type of transformers, etc!

Conclusion✨

Overall, I had a positive experience exploring the Hugging face repository. It offers a well-designed solution for NLP projects, and with some minor improvements, it has the potential to become even more powerful and widely adopted.

See the whole documentation in the following link.

image

For more details and code examples, you can check out my repository with one of my PhD models: NoRBERT.

Kudos to the maintainers for creating such a useful tool!