readyforhires

NLP & Hugging Face test (Intermediate)

30 questions · 35 minutes · Free

Text processing, embeddings and transformers with Hugging Face.

Take the NLP & Hugging Face test

What it covers

Interview format

Earn a certificate

The NLP & Hugging Face test is one of the 6 tests of the AI / LLM Engineer: Intermediate learning path. Pass it and the other 5 tests at 70% or more and readyforhires issues you a verifiable certificate in your name, with its own code and verify link to share or add to LinkedIn.

Sample learning path certificate for AI / LLM Engineer: Intermediate, made out to “Your name” and marked SAMPLE
Pass with 70% or more to earn a verifiable certificate. This is a sample: yours carries your name, the date you earned it and its own verify code.

Sample questions

5 sample questions from the NLP & Hugging Face test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.

  1. If you run the Hugging Face NER pipeline on the text 'Apple is based in San Francisco', what will be the output of the pipeline?

    1. The NER pipeline will output the entities 'Apple' and 'San Francisco' with their respective labels 'ORG' and 'LOC', and also lowercase the text.
    2. The NER pipeline will output the entities 'Apple' and 'San Francisco' with their respective labels 'ORG' and 'LOC'.
    3. The NER pipeline will output the entities 'apple' and 'san francisco' with their respective labels 'ORG' and 'LOC', and also split the text into sentences.
    4. The NER pipeline will output the entities 'Apple' and 'San Francisco' with their respective labels 'ORG' and 'LOC', and also replace the entities with their synonyms.

    Answer: B. The NER pipeline will output the entities 'Apple' and 'San Francisco' with their respective labels 'ORG' and 'LOC'.

    The Hugging Face NER pipeline identifies named entities in text. In this example, 'Apple' is recognized as an organization (ORG), and 'San Francisco' is identified as a location (LOC). The pipeline does not modify the text, so the original tokens are preserved with their predicted labels.

  2. Which of the following statements correctly describes the application of Hugging Face's named entity recognition (NER) pipeline in a realistic project scenario?

    1. The NER pipeline is only useful for processing structured data such as tables and databases.
    2. The NER pipeline can only be used for classifying text into pre-defined categories like 'positive' or 'negative'.
    3. Hugging Face's NER pipeline can be used to extract entities such as names, locations, and organizations from unstructured text in a realistic project scenario.
    4. The NER pipeline cannot be used in real-world applications because it only works on English text.

    Answer: C. Hugging Face's NER pipeline can be used to extract entities such as names, locations, and organizations from unstructured text in a realistic project scenario.

    Hugging Face's NER pipeline is specifically designed for named entity recognition and can be applied to extract relevant entities from unstructured text in real-world projects. The other options describe features or components of NLP models but are not directly related to the practical application of the NER pipeline.

  3. A developer is using Hugging Face's text classification pipeline, but the model fails to process certain inputs with out-of-vocabulary (OOV) words. What is the most likely cause of this issue?

    1. The model's hyperparameters are not optimized for the task.
    2. The model was not fine-tuned on the specific dataset being used.
    3. The model fails to handle out-of-vocabulary (OOV) words because the tokenizer was not configured to use subword tokenization.
    4. The training data was not preprocessed correctly.

    Answer: C. The model fails to handle out-of-vocabulary (OOV) words because the tokenizer was not configured to use subword tokenization.

    In Hugging Face's text classification pipeline, if the tokenizer is not set up to use subword tokenization, it may not be able to handle OOV words, leading to errors during inference. This is because subword tokenization allows the model to break down unknown words into smaller subword units, which can then be mapped to embeddings. The other options either describe unrelated issues or are not the primary cause of the error in this scenario.

  4. Which of the following is a common edge case or mistake in the NER pipeline's behavior?

    1. The NER pipeline may fail to recognize entities in a sentence where the entity is split across multiple sentences due to the lack of context.
    2. The NER pipeline cannot recognize entities in languages other than English.
    3. The NER pipeline always performs well on out-of-domain text without any training.
    4. The NER pipeline cannot process any text that contains abbreviations or acronyms.

    Answer: A. The NER pipeline may fail to recognize entities in a sentence where the entity is split across multiple sentences due to the lack of context.

    Named Entity Recognition (NER) pipelines often rely on context within a single sentence to identify entities. When an entity spans multiple sentences, the pipeline may not have enough context to correctly identify the entity, leading to potential recognition failures. Other options are either incorrect or unrelated to this specific edge case.

  5. Which of the following statements correctly describes the primary use cases of transformer decoder layers compared to encoder layers?

    1. Transformer decoder layers are used in both sequence-to-sequence and text classification tasks.
    2. Transformer decoder layers are used in sequence-to-sequence tasks, while encoder layers are used in tasks like text classification.
    3. Transformer decoder layers are used in tasks like named entity recognition, while encoder layers are used in tasks like text generation.
    4. Transformer decoder layers are used in tasks like text classification, while encoder layers are used in sequence-to-sequence tasks.

    Answer: B. Transformer decoder layers are used in sequence-to-sequence tasks, while encoder layers are used in tasks like text classification.

    Transformer decoder layers include mechanisms like masked multi-head attention, which allows the model to predict the next token in a sequence while preventing it from peeking ahead. This is essential for tasks like machine translation, where the model must generate a target sequence step-by-step. In contrast, encoder layers are used in tasks where the input is processed as a whole (e.g., text classification) and do not require the sequence generation capability of decoder layers.

Frequently asked questions

How many questions are in the NLP & Hugging Face test?
30 questions (18 multiple choice, 9 multi-answer, 3 predict-the-output), with 35 minutes to answer them.
What does the NLP & Hugging Face test cover?
Tokenisation and text preprocessing, Word embeddings, Transformer architecture and attention, Hugging Face pipelines and Trainer, Fine-tuning BERT-style models.
Is the NLP & Hugging Face test free?
Yes. It is free to take with a readyforhires account.
What level is the NLP & Hugging Face test?
Intermediate, in AI & ML.

More AI & ML tests

Roles that test these skills

Companies that test these skills

All practice tests · All AI & ML tests

Last updated