Question Answering Using Llamaindex
azure-openai-samplesBasic_Samplespolyglotdotnetembeddings
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 index data. Read the guide to get started with python in Polyglot Notebooks and this doc on how to connect.
First we need to connect a Python Kernel, in this example we are using Anaconda based deployment and a conda environment called AI.
The environment retuires the following packages:
[6]
Kernel added: #!python3
[17]
[18]
Exporting values to python3 kernel
[7]
[8]
Now we need to setup the python kernel.
- import llama_index
- use llamahub to load
[9]
Loading documents from wikipedia using LlamaIndex loading
[10]
Now we use a pipeline to create a set of nodes and compute embeddings.
[11]
[12]
[19]
[20]
[21]
Generated queries: 1. Location of 2022 Winter Olympics 2. City that hosted 2022 Winter Olympics 3. Country where 2022 Winter Olympics were held 4. Venues of 2022 Winter Olympics 5. 2022 Winter Olympics host city details 6. Information about the place where 2022 Winter Olympics took place 7. 2022 Winter Olympics location history 8. Details about the 2022 Winter Olympics location 9. Where were the 2022 Winter Olympics held? 10. Host city of the 2022 Winter Olympics 11. 2022 Winter Olympics host country 12. Location and venues of 2022 Winter Olympics 13. Information on 2022 Winter Olympics host city 14. 2022 Winter Olympics location and details 15. Which city hosted the 2022 Winter Olympics?
The 2022 Winter Olympics took place in Beijing, China.
[22]
Generated queries: 1. List of all countries that participated in the 2022 Winter Olympics 2. Which nations competed in the 2022 Winter Olympics? 3. Full list of countries in the 2022 Winter Olympics 4. Names of countries that took part in the 2022 Winter Olympics 5. How many countries participated in the 2022 Winter Olympics? 6. Participating nations in the 2022 Winter Olympics 7. Countries that competed in the 2022 Winter Olympics 8. Complete list of 2022 Winter Olympics participating countries 9. All countries that were in the 2022 Winter Olympics 10. 2022 Winter Olympics participants by country 11. Countries that sent athletes to the 2022 Winter Olympics 12. Which countries were represented in the 2022 Winter Olympics? 13. List of nations that competed in the 2022 Winter Olympics 14. Countries that took part in the 2022 Winter Olympics 15. Full roster of countries in the 2022 Winter Olympics.
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.