How to bake some bread?
Question answering is about letting the AI automatically answer a question. Optionally, you can give some context to the AI model to help it answer the question. Generative AI models like ChatGPT, GPT-3.5, GPT-4, LLaMA 3, Yi 34B, and Mixtral 8x7B are very good at performing question answering.
For example imagine you want to ask the following question:
How to bake some bread?
The AI might answer something like this:
1. Grease a clean, dry bread pan with butter.
2. Stir 1 envelope dry active yeast to 1/4 cup warm water in a large bowl. Let the yeast bloom for 10 minutes, or until dissolved, then add 1 teaspoon salt, 1 teaspoon honey, and 1/2 cup unsalted butter.
3. Add 3 1/2 cups strong flour and mix well, then wait to process your dough for 3 minutes.
4. Add an ounce of water and mix well. If the water was not already warm enough to make a dough (i.e., it was not warm to the touch) then add a warm to hot bowl of water to the machine. Stir continuously for 3 minutes.
5. Turn your dough out onto a clean sheet of plastic wrap and fold over.
6. Cover with another piece of plastic wrap and place in a warm corner of your kitchen.
Now maybe you have specific advanced data you want to give the AI and ask a question on it (also known as "context"):
All NLP Cloud plans can be stopped anytime. You only pay for the time you used the service. In case of a downgrade, you will get a discount on your next invoice.
You might want to ask the following question:
When can plans be stopped?
And the answer would be:
Anytime
You might also want to answer questions about a large corpus of internal domain knowledge. In that case you will want to read our dedicated article about semantic search + generative AI (also known as RAG): read it here.
Question Answering can be usefully used in the "real world". Here are a couple of examples.
Chat bots are used more and more everyday, both to answer customer questions and internal collaborators questions. Imagine that a customer is asking a legal question about his contract. You could perfectly use a question answering model for that and pass the contract as a context.
Here's another chat bots related example. Imagine that a collaborator has a technical question about a product. Why not provide him with a natural language interface and make his life easier?
Generative AI can assist doctors and healthcare professionals by providing quick and accessible medical consultations or diagnostic support. By analyzing symptoms and medical history input by the user, AI can generate a list of possible conditions and suggest the next steps for treatment or recommend seeing a specialist. While not a replacement for professional medical advice, it can serve as a valuable tool for preliminary consultation, especially in underserved regions with a scarcity of healthcare providers. Additionally, it can assist medical professionals by staying up-to-date with the latest research and medical guidelines, thereby enhancing the quality of care.
In the educational sector, generative AI can serve as a personal tutor, providing students with explanations, additional study resources, and tailored feedback on their work. For subjects ranging from mathematics to language learning, AI can adapt to the student's learning pace and style, offering personalized question-answering sessions that can clarify doubts and explain concepts in different ways until the student understands. This could democratize access to personalized education, making high-quality educational support accessible to students regardless of their geographical location or financial means.
NLP Cloud proposes a question answering API that allows you to perform question answering out of the box, based on advanced models like Deepset's Roberta Base Squad 2, LLaMA 3, Mixtral 8x7B, Yi 34B, and more. These models are very good alternatives to ChatGPT, GPT-3.5, and GPT-4. The response time (latency) is very good for the Roberta model and the accuracy of generative models on this task is very impressive. You can either use the pre-trained model or train your own model, or upload your own custom models!
For more details, see our documentation about question answering here. For advanced usage, see the text generation API endpoint here. And easily test question answering on our playground.
Testing question answering locally is one thing, but using it reliably in production is another thing. With NLP Cloud you can just do both!