Hugging Face Experiment

"distilbert-base-cased-distilled-squad" model

This is a simple HTML response from FastAPI.

Using the Swagger UI for the Chatbot

  1. Go to the Swagger UI by visiting this link.
  2. Scroll down to the /chatbot POST method section.
  3. Click on the Try it out button.
  4. In the question field, enter: "What is the capital of France?"
  5. In the context field, enter: "France is a country in Western Europe. It has several beautiful cities, including Paris, which is its capital. France is known for its wine, sophisticated cuisine, and landmarks like the Eiffel Tower."
  6. Click the Execute button to submit the request.
  7. Scroll down to see the server response, where you will find the answer.

Try it out with different questions and contexts to see how the chatbot responds!

About the Chatbot Model

The chatbot is powered by the 'distilbert-base-cased-distilled-squad' model from Hugging Face's Transformers library. This model is a distilled version of BERT, optimized for question-answering tasks. It has been trained on the SQuAD dataset (Stanford Question Answering Dataset), which consists of questions posed by crowdworkers on a set of Wikipedia articles, where the answer to every question is a segment of text from the corresponding reading passage.

What sets this model apart is its ability to provide context-based answers. For the model to accurately answer a question, it requires a context — a paragraph or text where the answer is likely to be found. The model uses this context to understand the question and extract the relevant answer. Without sufficient context, the model may not provide accurate or relevant answers.

Therefore, when using the chatbot, it's important to provide a well-defined question along with a comprehensive context that contains the information needed to answer the question. The example of finding the capital of France illustrates this: the context provided gives the model enough information to identify 'Paris' as the correct answer.

FastAPI ReDoc Documentation

For an alternative documentation format, you can view the ReDoc documentation of the chatbot API. ReDoc provides a more visual and organized layout of the API endpoints and their descriptions. This can be especially helpful for understanding the structure and capabilities of the API in a more user-friendly format.

Access the ReDoc documentation by clicking here.