Question Answering Using Llamaindex
azure-openai-samplesBasic_Samplesdotnetembeddingscsharp
Export
Question answering using fusion retriever architecture
This notebook builds ontop of Question answering using embeddings-based search but the data will be loaded from wikipedia using llamaindex
Installation
Install the Azure Open AI SDK using the below command.
[1]
[ ]
Run this cell, it will prompt you for the apiKey, endPoint, and chatDeployment
[3]
Import namesapaces and create an instance of OpenAiClient using the azureOpenAIEndpoint and the azureOpenAIKey
[4]
[5]
1. Prepare search data
We need to use python to load and idnex data. First we need to connect a Python Kernel
[6]
Kernel added: #!python3
[8]
[9]
Now we need to setup the python kernel.
- import llama_index
- use llamahub to load
[10]
Loading documents from wikipedia using LlamaIndex loading
[11]
[12]
Now we use a pipeline to create a set of nodes and compute embeddings.
[152]
[153]
[154]
[155]
[156]
[158]
[146]
Generated queries: 1. What countries bid for the 2022 winter Olympics? 2. Who won the bid for the 2022 winter Olympics? 3. How many cities were considered for the 2022 winter Olympics? 4. What were the criteria for selecting the host city for the 2022 winter Olympics? 5. What were the venues used for the 2022 winter Olympics? 6. How many athletes participated in the 2022 winter Olympics? 7. Who were the medal winners at the 2022 winter Olympics? 8. What were the most popular sports at the 2022 winter Olympics? 9. How did the 2022 winter Olympics impact the host city's economy? 10. What were the controversies surrounding the 2022 winter Olympics? 11. What were the highlights of the 2022 winter Olympics?
The 2022 Winter Olympics took place in Beijing, China.
[151]
Generated queries: 1. List of countries participating in the 2022 winter Olympics 2. Winter Olympics 2022: Which countries participated? 3. Complete list of nations involved in the 2022 winter Olympics 4. Countries competing in the 2022 winter Olympics 5. Winter Olympics 2022: Participating countries 6. Which nations took part in the 2022 winter Olympics? 7. 2022 winter Olympics: Full list of participating countries 8. Countries represented in the 2022 winter Olympics 9. Winter Olympics 2022: Countries involved 10. List of all the countries that participated in the 2022 winter Olympics 11. 2022 winter Olympics: Nations that took part
I could not find an answer.
[147]
Generated queries: 1. List of countries participating in the 2022 winter Olympics 2. Winter Olympic countries in 2022 3. Which nations competed in the 2022 winter Olympics? 4. Countries involved in the 2022 winter Olympics 5. 2022 winter Olympics participants by country 6. What countries were represented in the 2022 winter Olympics? 7. Nations that took part in the 2022 winter Olympics 8. 2022 winter Olympics: participating countries 9. Countries that competed in the 2022 winter Olympics 10. Winter Olympic nations in 2022 11. List of countries and months for the 2022 winter Olympics
The countries that took part in the 2022 Winter Olympics were not mentioned in the provided articles. However, it is mentioned that Norway led the total medal standings with 39 medals, Germany had 31 medals, Canada had 29 medals, and South Korea won 17 medals. The Winter Olympics were held between 4 and 20 February 2022.