Retriever, ranker, question answering¶
The purpose of this notebook is to create a straightforward pipeline for the extractive question answering task. The pipeline includes a retriever, a ranker, and a question-answering model, with the retriever serving as the initial filter in this architecture. Following that, the ranker filters the documents again based on the semantic similarity between the question and the documents. Finally, we'll utilize a question-answering model to extract the answer from the filtered documents.
Due to the slow nature of extractive question answering, even with document filtering, utilizing a GPU for this type of pipeline that employs QA models would be advantageous.
from cherche import data, rank, retrieve, qa
from sentence_transformers import SentenceTransformer
from transformers import pipeline
We can use the towns
corpus for this example: we can ask questions about the cities of Bordeaux, Toulouse, Paris and Lyon.
documents = data.load_towns()
documents[:4]
[{'id': 0, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'Paris (French pronunciation: \u200b[paʁi] (listen)) is the capital and most populous city of France, with an estimated population of 2,175,601 residents as of 2018, in an area of more than 105 square kilometres (41 square miles).'}, {'id': 1, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': "Since the 17th century, Paris has been one of Europe's major centres of finance, diplomacy, commerce, fashion, gastronomy, science, and arts."}, {'id': 2, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The City of Paris is the centre and seat of government of the region and province of Île-de-France, or Paris Region, which has an estimated population of 12,174,880, or about 18 percent of the population of France as of 2017.'}, {'id': 3, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The Paris Region had a GDP of €709 billion ($808 billion) in 2017.'}]
We start by creating a retriever whose mission will be to quickly filter the documents. This retriever will find documents based on the title and content of the article using on
parameter.
retriever = retrieve.TfIdf(
key="id", on=["title", "article"], documents=documents, k=100
)
We then add a ranker to the pipeline to filter the results according to the semantic similarity between the query and the retrieved documents. similarity between the query and the retriever's output documents. The ranker will be based on the content of the article.
ranker = rank.Encoder(
key="id",
on=["title", "article"],
encoder=SentenceTransformer("sentence-transformers/all-mpnet-base-v2").encode,
k=30,
)
question_answering = qa.QA(
model=pipeline(
"question-answering",
model="deepset/roberta-base-squad2",
tokenizer="deepset/roberta-base-squad2",
),
on="article",
)
We initialise the pipeline and ask the retrievers to index the documents and the ranker to pre-compute the document embeddings. This step can take some time if you have a lot of documents. A GPU could speed up the process. Also the question answering model needs the documents fields and not only ids. To map ids to documents, we add the documents
to our pipeline.
search = retriever + ranker + documents + question_answering
search.add(documents)
Encoder ranker: 100%|████████| 2/2 [00:02<00:00, 1.34s/it]
TfIdf retriever key : id on : title, article documents: 105 Encoder ranker key : id on : title, article normalize : True embeddings: 105 Mapping to documents Question Answering on: article
Paris Saint Germain is the name of the biggest football team of Paris. The Question Answering Pipeline provides the ranking-related similarity score called similarity
and the question answering task-related score qa_score
. The higher the qa_score
the more likely the answer is. The answers are sorted from the most likely to the least likely.
search("What is the name of the football club of Paris?")
Question answering: 100%|████| 1/1 [00:01<00:00, 1.70s/it]
[{'id': 20, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The football club Paris Saint-Germain and the rugby union club Stade Français are based in Paris.', 'similarity': 0.7104821, 'score': 0.9848365783691406, 'start': 18, 'end': 37, 'answer': 'Paris Saint-Germain', 'question': 'What is the name of the football club of Paris?'}, {'id': 21, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The 80,000-seat Stade de France, built for the 1998 FIFA World Cup, is located just north of Paris in the neighbouring commune of Saint-Denis.', 'similarity': 0.46161494, 'score': 0.8121969103813171, 'start': 16, 'end': 31, 'answer': 'Stade de France', 'question': 'What is the name of the football club of Paris?'}, {'id': 40, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'The city\'s unique architecture made of pinkish terracotta bricks has earned Toulouse the nickname La Ville Rose ("The Pink City").', 'similarity': 0.37491357, 'score': 0.16557253897190094, 'start': 76, 'end': 84, 'answer': 'Toulouse', 'question': 'What is the name of the football club of Paris?'}, {'id': 41, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon or Lyons (UK: , US: , French: [ljɔ̃] (listen); Arpitan: Liyon, pronounced [ʎjɔ̃]) is the third-largest city and second-largest urban area of France.', 'similarity': 0.43718058, 'score': 0.15580952167510986, 'start': 0, 'end': 4, 'answer': 'Lyon', 'question': 'What is the name of the football club of Paris?'}, {'id': 51, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'It is also known for its light festival, the Fête des Lumières, which begins every 8 December and lasts for four days, earning Lyon the title of "Capital of Lights".', 'similarity': 0.35435817, 'score': 0.08197779208421707, 'start': 127, 'end': 131, 'answer': 'Lyon', 'question': 'What is the name of the football club of Paris?'}, {'id': 63, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'The term "Bordelais" may also refer to the city and its surrounding region.', 'similarity': 0.38600546, 'score': 0.025884564965963364, 'start': 10, 'end': 19, 'answer': 'Bordelais', 'question': 'What is the name of the football club of Paris?'}, {'id': 16, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'Paris received 12.', 'similarity': 0.46774143, 'score': 0.015906406566500664, 'start': 15, 'end': 17, 'answer': '12', 'question': 'What is the name of the football club of Paris?'}, {'id': 104, 'title': 'Montreal', 'url': 'https://en.wikipedia.org/wiki/Montreal', 'article': 'It is also home to ice hockey team Montreal Canadiens, the franchise with the most Stanley Cup wins.', 'similarity': 0.34670672, 'score': 0.0028171883895993233, 'start': 35, 'end': 53, 'answer': 'Montreal Canadiens', 'question': 'What is the name of the football club of Paris?'}, {'id': 7, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': "Opened in 1900, the city's subway system, the Paris Métro, serves 5.", 'similarity': 0.40217242, 'score': 0.002542218891903758, 'start': 46, 'end': 51, 'answer': 'Paris', 'question': 'What is the name of the football club of Paris?'}, {'id': 57, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Bordeaux ( bor-DOH, French: [bɔʁdo] (listen); Gascon Occitan: Bordèu [buɾˈðɛw]) is a port city on the river Garonne in the Gironde department, Southwestern France.', 'similarity': 0.3889441, 'score': 0.000859599094837904, 'start': 0, 'end': 8, 'answer': 'Bordeaux', 'question': 'What is the name of the football club of Paris?'}, {'id': 6, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'Paris is a major railway, highway, and air-transport hub served by two international airports: Paris–Charles de Gaulle (the second-busiest airport in Europe) and Paris–Orly.', 'similarity': 0.3775912, 'score': 0.0005627072532661259, 'start': 162, 'end': 172, 'answer': 'Paris–Orly', 'question': 'What is the name of the football club of Paris?'}, {'id': 1, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': "Since the 17th century, Paris has been one of Europe's major centres of finance, diplomacy, commerce, fashion, gastronomy, science, and arts.", 'similarity': 0.39131272, 'score': 0.0002991863002534956, 'start': 24, 'end': 29, 'answer': 'Paris', 'question': 'What is the name of the football club of Paris?'}, {'id': 55, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'According to the Globalization and World Rankings Research Institute, Lyon is considered a Beta city, as of 2018.', 'similarity': 0.34211817, 'score': 0.00024206833040807396, 'start': 70, 'end': 74, 'answer': 'Lyon', 'question': 'What is the name of the football club of Paris?'}, {'id': 3, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The Paris Region had a GDP of €709 billion ($808 billion) in 2017.', 'similarity': 0.38708982, 'score': 0.00012191522546345368, 'start': 4, 'end': 9, 'answer': 'Paris', 'question': 'What is the name of the football club of Paris?'}, {'id': 13, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The Musée Rodin and Musée Picasso exhibit the works of two noted Parisians.', 'similarity': 0.3348205, 'score': 0.00010052858851850033, 'start': 65, 'end': 75, 'answer': 'Parisians.', 'question': 'What is the name of the football club of Paris?'}, {'id': 2, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The City of Paris is the centre and seat of government of the region and province of Île-de-France, or Paris Region, which has an estimated population of 12,174,880, or about 18 percent of the population of France as of 2017.', 'similarity': 0.41702062, 'score': 9.009212226374075e-05, 'start': 4, 'end': 8, 'answer': 'City', 'question': 'What is the name of the football club of Paris?'}, {'id': 39, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Sernin, the largest remaining Romanesque building in Europe, designated in 1998 along with the former hospital Hôtel-Dieu Saint-Jacques because of their significance to the Santiago de Compostela pilgrimage route.', 'similarity': 0.33389583, 'score': 8.280130714410916e-05, 'start': 0, 'end': 6, 'answer': 'Sernin', 'question': 'What is the name of the football club of Paris?'}, {'id': 24, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The 1938 and 1998 FIFA World Cups, the 2007 Rugby World Cup, as well as the 1960, 1984 and 2016 UEFA European Championships were also held in the city.', 'similarity': 0.42733788, 'score': 7.101883238647133e-05, 'start': 96, 'end': 151, 'answer': 'UEFA European Championships were also held in the city.', 'question': 'What is the name of the football club of Paris?'}, {'id': 35, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': "According to the rankings of L'Express and Challenges, Toulouse is the most dynamic French city.", 'similarity': 0.3657912, 'score': 5.10705795022659e-05, 'start': 55, 'end': 63, 'answer': 'Toulouse', 'question': 'What is the name of the football club of Paris?'}, {'id': 23, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The city hosted the Olympic Games in 1900, 1924 and will host the 2024 Summer Olympics.', 'similarity': 0.36762083, 'score': 3.203179585398175e-05, 'start': 66, 'end': 87, 'answer': '2024 Summer Olympics.', 'question': 'What is the name of the football club of Paris?'}, {'id': 0, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'Paris (French pronunciation: \u200b[paʁi] (listen)) is the capital and most populous city of France, with an estimated population of 2,175,601 residents as of 2018, in an area of more than 105 square kilometres (41 square miles).', 'similarity': 0.43164164, 'score': 2.7218264222028665e-05, 'start': 29, 'end': 35, 'answer': '\u200b[paʁi', 'question': 'What is the name of the football club of Paris?'}, {'id': 14, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The historical district along the Seine in the city centre has been classified as a UNESCO World Heritage Site since 1991; popular landmarks there include the Cathedral of Notre Dame de Paris on the Île de la Cité, now closed for renovation after the 15 April 2019 fire.', 'similarity': 0.36198646, 'score': 2.5467967134318314e-05, 'start': 172, 'end': 191, 'answer': 'Notre Dame de Paris', 'question': 'What is the name of the football club of Paris?'}, {'id': 33, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'The air route between Toulouse–Blagnac and the Parisian airports is the busiest in France, transporting 3.', 'similarity': 0.36112642, 'score': 1.3854595636075828e-05, 'start': 22, 'end': 38, 'answer': 'Toulouse–Blagnac', 'question': 'What is the name of the football club of Paris?'}, {'id': 67, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'It is a central and strategic hub for the aeronautics, military and space sector, home to international companies such as Dassault Aviation, Ariane Group, Safran and Thalès.', 'similarity': 0.34512353, 'score': 1.3446222510538064e-05, 'start': 122, 'end': 172, 'answer': 'Dassault Aviation, Ariane Group, Safran and Thalès', 'question': 'What is the name of the football club of Paris?'}, {'id': 37, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'It is now the capital of the Occitanie region, the second largest region in Metropolitan France.', 'similarity': 0.33124608, 'score': 1.067540688381996e-05, 'start': 89, 'end': 95, 'answer': 'France', 'question': 'What is the name of the football club of Paris?'}, {'id': 32, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'The University of Toulouse is one of the oldest in Europe (founded in 1229) and, with more than 103,000 students, it is the fourth-largest university campus in France, after the universities of Paris, Lyon and Lille.', 'similarity': 0.36503303, 'score': 2.1875375750823878e-06, 'start': 201, 'end': 205, 'answer': 'Lyon', 'question': 'What is the name of the football club of Paris?'}, {'id': 56, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': "It ranked second in France and 40th globally in Mercer's 2019 liveability rankings.", 'similarity': 0.43785292, 'score': 9.458052545596729e-07, 'start': 20, 'end': 26, 'answer': 'France', 'question': 'What is the name of the football club of Paris?'}, {'id': 22, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'Paris hosts the annual French Open Grand Slam tennis tournament on the red clay of Roland Garros.', 'similarity': 0.36557713, 'score': 6.266361083362426e-07, 'start': 83, 'end': 97, 'answer': 'Roland Garros.', 'question': 'What is the name of the football club of Paris?'}, {'id': 8, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': '23 million passengers daily; it is the second-busiest metro system in Europe after the Moscow Metro.', 'similarity': 0.36415952, 'score': 1.0279434548010613e-07, 'start': 87, 'end': 100, 'answer': 'Moscow Metro.', 'question': 'What is the name of the football club of Paris?'}, {'id': 25, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'Every July, the Tour de France bicycle race finishes on the Avenue des Champs-Élysées in Paris.', 'similarity': 0.38520125, 'score': 8.300106912884075e-08, 'start': 89, 'end': 95, 'answer': 'Paris.', 'question': 'What is the name of the football club of Paris?'}]
Toulouse in France is known as "The Pink City".
search("What is the color of Toulouse?")
Question answering: 100%|████| 1/1 [00:01<00:00, 1.57s/it]
[{'id': 40, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'The city\'s unique architecture made of pinkish terracotta bricks has earned Toulouse the nickname La Ville Rose ("The Pink City").', 'similarity': 0.640329, 'score': 0.5257010459899902, 'start': 39, 'end': 46, 'answer': 'pinkish', 'question': 'What is the color of Toulouse?'}, {'id': 64, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Crossed by the Garonne River and bordering the Atlantic Coast, the metropolis, a perfect example of the Age of Enlightment, has been showcasing since the 18th century its blond and golden facades, its courtyards and monumental squares, as well as its lively streets accompanied by its French-style gardens.', 'similarity': 0.41179663, 'score': 0.36229389905929565, 'start': 171, 'end': 176, 'answer': 'blond', 'question': 'What is the color of Toulouse?'}, {'id': 35, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': "According to the rankings of L'Express and Challenges, Toulouse is the most dynamic French city.", 'similarity': 0.43199244, 'score': 0.33106717467308044, 'start': 84, 'end': 90, 'answer': 'French', 'question': 'What is the color of Toulouse?'}, {'id': 81, 'title': 'Montreal', 'url': 'https://en.wikipedia.org/wiki/Montreal', 'article': "French is the city's official language and in 2016 was the only home language of 53.", 'similarity': 0.3581546, 'score': 0.033816203474998474, 'start': 0, 'end': 6, 'answer': 'French', 'question': 'What is the color of Toulouse?'}, {'id': 26, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Toulouse ( too-LOOZ, French: [tuluz] (listen); Occitan: Tolosa [tuˈluzɔ]; Latin: Tolosa [tɔˈloːsa]) is the prefecture of the French department of Haute-Garonne and of the larger region of Occitanie.', 'similarity': 0.57575536, 'score': 0.024280602112412453, 'start': 11, 'end': 35, 'answer': 'too-LOOZ, French: [tuluz', 'question': 'What is the color of Toulouse?'}, {'id': 63, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'The term "Bordelais" may also refer to the city and its surrounding region.', 'similarity': 0.43531418, 'score': 0.010926609858870506, 'start': 10, 'end': 19, 'answer': 'Bordelais', 'question': 'What is the color of Toulouse?'}, {'id': 27, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'The city is on the banks of the River Garonne, 150 kilometres (93 miles) from the Mediterranean Sea, 230 km (143 mi) from the Atlantic Ocean and 680 km (420 mi) from Paris.', 'similarity': 0.48132837, 'score': 0.001753090531565249, 'start': 32, 'end': 45, 'answer': 'River Garonne', 'question': 'What is the color of Toulouse?'}, {'id': 41, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon or Lyons (UK: , US: , French: [ljɔ̃] (listen); Arpitan: Liyon, pronounced [ʎjɔ̃]) is the third-largest city and second-largest urban area of France.', 'similarity': 0.39131057, 'score': 0.0004565822018776089, 'start': 0, 'end': 4, 'answer': 'Lyon', 'question': 'What is the color of Toulouse?'}, {'id': 28, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'It is the fourth-largest commune in France, with 479,553 inhabitants within its municipal boundaries (as of January 2017), after Paris, Marseille and Lyon, ahead of Nice; it has a population of 1,360,829 within its wider metropolitan area (also as of January 2017).', 'similarity': 0.5390336, 'score': 0.0002655640128068626, 'start': 165, 'end': 169, 'answer': 'Nice', 'question': 'What is the color of Toulouse?'}, {'id': 57, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Bordeaux ( bor-DOH, French: [bɔʁdo] (listen); Gascon Occitan: Bordèu [buɾˈðɛw]) is a port city on the river Garonne in the Gironde department, Southwestern France.', 'similarity': 0.40526178, 'score': 0.0001682575821178034, 'start': 0, 'end': 8, 'answer': 'Bordeaux', 'question': 'What is the color of Toulouse?'}, {'id': 37, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'It is now the capital of the Occitanie region, the second largest region in Metropolitan France.', 'similarity': 0.54804677, 'score': 0.0001560609816806391, 'start': 29, 'end': 38, 'answer': 'Occitanie', 'question': 'What is the color of Toulouse?'}, {'id': 48, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': "The city is recognised for its cuisine and gastronomy, as well as historical and architectural landmarks; as such, the districts of Old Lyon, the Fourvière hill, the Presqu'île and the slopes of the Croix-Rousse are inscribed on the UNESCO World Heritage List.", 'similarity': 0.35850886, 'score': 0.00015423276636283845, 'start': 136, 'end': 140, 'answer': 'Lyon', 'question': 'What is the color of Toulouse?'}, {'id': 62, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Its inhabitants are called "Bordelais" (for men) or "Bordelaises" (women).', 'similarity': 0.41753897, 'score': 0.00013673467037733644, 'start': 28, 'end': 47, 'answer': 'Bordelais" (for men', 'question': 'What is the color of Toulouse?'}, {'id': 36, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Founded by the Romans, the city was the capital of the Visigothic Kingdom in the 5th century and the capital of the province of Languedoc in the Late Middle Ages and early modern period (provinces were abolished during the French Revolution), making it the unofficial capital of the cultural region of Occitania (Southern France).', 'similarity': 0.5121455, 'score': 0.00010824214405147359, 'start': 322, 'end': 328, 'answer': 'France', 'question': 'What is the color of Toulouse?'}, {'id': 29, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Toulouse is the centre of the European aerospace industry, with the headquarters of Airbus (formerly EADS), the SPOT satellite system, ATR and the Aerospace Valley.', 'similarity': 0.39126396, 'score': 8.086419984465465e-05, 'start': 30, 'end': 38, 'answer': 'European', 'question': 'What is the color of Toulouse?'}, {'id': 32, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'The University of Toulouse is one of the oldest in Europe (founded in 1229) and, with more than 103,000 students, it is the fourth-largest university campus in France, after the universities of Paris, Lyon and Lille.', 'similarity': 0.44059187, 'score': 4.404589344630949e-05, 'start': 160, 'end': 166, 'answer': 'France', 'question': 'What is the color of Toulouse?'}, {'id': 33, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'The air route between Toulouse–Blagnac and the Parisian airports is the busiest in France, transporting 3.', 'similarity': 0.44097584, 'score': 2.8188960641273297e-05, 'start': 22, 'end': 38, 'answer': 'Toulouse–Blagnac', 'question': 'What is the color of Toulouse?'}, {'id': 51, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'It is also known for its light festival, the Fête des Lumières, which begins every 8 December and lasts for four days, earning Lyon the title of "Capital of Lights".', 'similarity': 0.38153768, 'score': 2.5527337129460648e-05, 'start': 25, 'end': 62, 'answer': 'light festival, the Fête des Lumières', 'question': 'What is the color of Toulouse?'}, {'id': 16, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'Paris received 12.', 'similarity': 0.3566119, 'score': 3.2625996482238406e-06, 'start': 15, 'end': 18, 'answer': '12.', 'question': 'What is the color of Toulouse?'}, {'id': 38, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Toulouse counts three UNESCO World Heritage Sites: the Canal du Midi (designated in 1996 and shared with other cities), and the Basilica of St.', 'similarity': 0.4401517, 'score': 1.537480898150534e-06, 'start': 0, 'end': 8, 'answer': 'Toulouse', 'question': 'What is the color of Toulouse?'}, {'id': 73, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': "In June 2007, the Port of the Moon in historic Bordeux were inscribed on the UNESCO World Heritage List, for its outstanding architecture and urban ensemble and in recognition of Bordeux's international ijmportance over the last 2000 years.", 'similarity': 0.3526206, 'score': 1.3830921261615003e-06, 'start': 47, 'end': 54, 'answer': 'Bordeux', 'question': 'What is the color of Toulouse?'}, {'id': 34, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': '2 million passengers in 2019.', 'similarity': 0.48204136, 'score': 1.3364382311920053e-06, 'start': 0, 'end': 29, 'answer': '2 million passengers in 2019.', 'question': 'What is the color of Toulouse?'}, {'id': 70, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Bordeaux is an international tourist destination for its architectural and cultural heritage with more than 350 historic monuments, making it, after Paris, the city with the most listed or registered monuments in France.', 'similarity': 0.36267632, 'score': 1.1475751762191067e-06, 'start': 0, 'end': 8, 'answer': 'Bordeaux', 'question': 'What is the color of Toulouse?'}, {'id': 93, 'title': 'Montreal', 'url': 'https://en.wikipedia.org/wiki/Montreal', 'article': '4% of the population able to speak both English and French.', 'similarity': 0.358346, 'score': 8.207165365092806e-07, 'start': 52, 'end': 59, 'answer': 'French.', 'question': 'What is the color of Toulouse?'}, {'id': 31, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Thales Alenia Space, ATR, SAFRAN, Liebherr-Aerospace and Airbus Defence and Space also have a significant presence in Toulouse.', 'similarity': 0.39821905, 'score': 6.988089467085956e-07, 'start': 118, 'end': 126, 'answer': 'Toulouse', 'question': 'What is the color of Toulouse?'}, {'id': 30, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': "It also hosts the European headquarters of Intel and the CNES's Toulouse Space Centre (CST), the largest space centre in Europe.", 'similarity': 0.40180072, 'score': 5.210671361055574e-07, 'start': 121, 'end': 127, 'answer': 'Europe', 'question': 'What is the color of Toulouse?'}, {'id': 20, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The football club Paris Saint-Germain and the rugby union club Stade Français are based in Paris.', 'similarity': 0.3795408, 'score': 1.7200987656451616e-07, 'start': 91, 'end': 97, 'answer': 'Paris.', 'question': 'What is the color of Toulouse?'}, {'id': 0, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'Paris (French pronunciation: \u200b[paʁi] (listen)) is the capital and most populous city of France, with an estimated population of 2,175,601 residents as of 2018, in an area of more than 105 square kilometres (41 square miles).', 'similarity': 0.35670274, 'score': 8.119992855881719e-08, 'start': 29, 'end': 35, 'answer': '\u200b[paʁi', 'question': 'What is the color of Toulouse?'}, {'id': 39, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Sernin, the largest remaining Romanesque building in Europe, designated in 1998 along with the former hospital Hôtel-Dieu Saint-Jacques because of their significance to the Santiago de Compostela pilgrimage route.', 'similarity': 0.40986514, 'score': 3.506784196360968e-08, 'start': 30, 'end': 40, 'answer': 'Romanesque', 'question': 'What is the color of Toulouse?'}, {'id': 49, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon was historically an important area for the production and weaving of silk.', 'similarity': 0.38565272, 'score': 1.6559930315906968e-08, 'start': 0, 'end': 79, 'answer': 'Lyon was historically an important area for the production and weaving of silk.', 'question': 'What is the color of Toulouse?'}]
Bordeaux is known worldwide for its wine.
search("What is the speciality of Bordeaux ?")
Question answering: 100%|████| 1/1 [00:01<00:00, 1.61s/it]
[{'id': 65, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': "Bordeaux is a world capital of wine, with its castles and vineyards of the Bordeaux region that stand on the hillsides of the Gironde and is home to the world's main wine fair, Vinexpo.", 'similarity': 0.64157647, 'score': 0.7739061713218689, 'start': 31, 'end': 35, 'answer': 'wine', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 74, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Bordeaux is also ranked as a Sufficiency city by the Globalization and World Cities Research Network.', 'similarity': 0.5668111, 'score': 0.7677939534187317, 'start': 29, 'end': 40, 'answer': 'Sufficiency', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 68, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'The link with aviation dates back to 1910, the year the first airplane flew over the city.', 'similarity': 0.45792317, 'score': 0.6874910593032837, 'start': 14, 'end': 22, 'answer': 'aviation', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 59, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Bordeaux is the centre of Bordeaux Métropole that has a population of 796,273 (2019), the sixth-largest in France after Paris, Lyon, Marseille, Toulouse and Lille with its immediate suburbs and closest satellite towns.', 'similarity': 0.5395987, 'score': 0.4667576551437378, 'start': 26, 'end': 44, 'answer': 'Bordeaux Métropole', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 66, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Bordeaux is also one of the centers of gastronomy and business tourism for the organization of international congresses.', 'similarity': 0.63723767, 'score': 0.43909284472465515, 'start': 39, 'end': 49, 'answer': 'gastronomy', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 72, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'The metropolis has also received awards and rankings by international organizations such as in 1957, Bordeaux was awarded the Europe Prize for its efforts in transmitting the European ideal.', 'similarity': 0.4994722, 'score': 0.4337575435638428, 'start': 158, 'end': 189, 'answer': 'transmitting the European ideal', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 48, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': "The city is recognised for its cuisine and gastronomy, as well as historical and architectural landmarks; as such, the districts of Old Lyon, the Fourvière hill, the Presqu'île and the slopes of the Croix-Rousse are inscribed on the UNESCO World Heritage List.", 'similarity': 0.45109624, 'score': 0.4090783894062042, 'start': 31, 'end': 53, 'answer': 'cuisine and gastronomy', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 57, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Bordeaux ( bor-DOH, French: [bɔʁdo] (listen); Gascon Occitan: Bordèu [buɾˈðɛw]) is a port city on the river Garonne in the Gironde department, Southwestern France.', 'similarity': 0.6325322, 'score': 0.3996892273426056, 'start': 85, 'end': 89, 'answer': 'port', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 67, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'It is a central and strategic hub for the aeronautics, military and space sector, home to international companies such as Dassault Aviation, Ariane Group, Safran and Thalès.', 'similarity': 0.5798279, 'score': 0.3809475898742676, 'start': 42, 'end': 80, 'answer': 'aeronautics, military and space sector', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 70, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Bordeaux is an international tourist destination for its architectural and cultural heritage with more than 350 historic monuments, making it, after Paris, the city with the most listed or registered monuments in France.', 'similarity': 0.5996214, 'score': 0.3765573799610138, 'start': 57, 'end': 92, 'answer': 'architectural and cultural heritage', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 40, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'The city\'s unique architecture made of pinkish terracotta bricks has earned Toulouse the nickname La Ville Rose ("The Pink City").', 'similarity': 0.38761497, 'score': 0.19654542207717896, 'start': 18, 'end': 64, 'answer': 'architecture made of pinkish terracotta bricks', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 64, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Crossed by the Garonne River and bordering the Atlantic Coast, the metropolis, a perfect example of the Age of Enlightment, has been showcasing since the 18th century its blond and golden facades, its courtyards and monumental squares, as well as its lively streets accompanied by its French-style gardens.', 'similarity': 0.52706313, 'score': 0.17074397206306458, 'start': 285, 'end': 305, 'answer': 'French-style gardens', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 73, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': "In June 2007, the Port of the Moon in historic Bordeux were inscribed on the UNESCO World Heritage List, for its outstanding architecture and urban ensemble and in recognition of Bordeux's international ijmportance over the last 2000 years.", 'similarity': 0.50383896, 'score': 0.15214470028877258, 'start': 189, 'end': 214, 'answer': 'international ijmportance', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 62, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Its inhabitants are called "Bordelais" (for men) or "Bordelaises" (women).', 'similarity': 0.52885556, 'score': 0.1171083152294159, 'start': 44, 'end': 47, 'answer': 'men', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 52, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Economically, Lyon is a major centre for banking, as well as for the chemical, pharmaceutical and biotech industries.', 'similarity': 0.40036455, 'score': 0.08858604729175568, 'start': 41, 'end': 48, 'answer': 'banking', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 69, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'A crossroads of knowledge through university research, it is home to one of the only two megajoule lasers in the world, as well as a university population of nearly 100,000 students within the Bordeaux metropolis.', 'similarity': 0.4822334, 'score': 0.052133411169052124, 'start': 16, 'end': 53, 'answer': 'knowledge through university research', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 58, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'The municipality (commune) of Bordeaux proper has a population of 257,804 (2019).', 'similarity': 0.5038713, 'score': 0.04493545740842819, 'start': 18, 'end': 25, 'answer': 'commune', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 93, 'title': 'Montreal', 'url': 'https://en.wikipedia.org/wiki/Montreal', 'article': '4% of the population able to speak both English and French.', 'similarity': 0.35953513, 'score': 0.03135840594768524, 'start': 0, 'end': 58, 'answer': '4% of the population able to speak both English and French', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 49, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon was historically an important area for the production and weaving of silk.', 'similarity': 0.44937736, 'score': 0.027099115774035454, 'start': 74, 'end': 78, 'answer': 'silk', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 56, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': "It ranked second in France and 40th globally in Mercer's 2019 liveability rankings.", 'similarity': 0.4140333, 'score': 0.014323828741908073, 'start': 62, 'end': 73, 'answer': 'liveability', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 61, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'It is the capital of the Nouvelle-Aquitaine region, as well as the prefecture of the Gironde department.', 'similarity': 0.5252466, 'score': 0.012730337679386139, 'start': 0, 'end': 50, 'answer': 'It is the capital of the Nouvelle-Aquitaine region', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 63, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'The term "Bordelais" may also refer to the city and its surrounding region.', 'similarity': 0.62718254, 'score': 0.012131016701459885, 'start': 10, 'end': 74, 'answer': 'Bordelais" may also refer to the city and its surrounding region', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 26, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Toulouse ( too-LOOZ, French: [tuluz] (listen); Occitan: Tolosa [tuˈluzɔ]; Latin: Tolosa [tɔˈloːsa]) is the prefecture of the French department of Haute-Garonne and of the larger region of Occitanie.', 'similarity': 0.4185983, 'score': 0.00626229215413332, 'start': 0, 'end': 8, 'answer': 'Toulouse', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 37, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'It is now the capital of the Occitanie region, the second largest region in Metropolitan France.', 'similarity': 0.3949396, 'score': 0.005843970458954573, 'start': 29, 'end': 45, 'answer': 'Occitanie region', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 71, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'The "Pearl of Aquitaine" has been voted European Destination of the year in a 2015 online poll.', 'similarity': 0.5632974, 'score': 0.0008770654676482081, 'start': 0, 'end': 23, 'answer': 'The "Pearl of Aquitaine', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 60, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'The larger metropolitan area has a population of 1,247,977 (2017).', 'similarity': 0.51093805, 'score': 0.0007982160313986242, 'start': 11, 'end': 23, 'answer': 'metropolitan', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 39, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Sernin, the largest remaining Romanesque building in Europe, designated in 1998 along with the former hospital Hôtel-Dieu Saint-Jacques because of their significance to the Santiago de Compostela pilgrimage route.', 'similarity': 0.35952526, 'score': 0.0003476233105175197, 'start': 30, 'end': 40, 'answer': 'Romanesque', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 47, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon became a major economic hub during the Renaissance.', 'similarity': 0.3632738, 'score': 0.00029291369719430804, 'start': 20, 'end': 28, 'answer': 'economic', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 35, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': "According to the rankings of L'Express and Challenges, Toulouse is the most dynamic French city.", 'similarity': 0.39081496, 'score': 0.00011482322588562965, 'start': 76, 'end': 83, 'answer': 'dynamic', 'question': 'What is the speciality of Bordeaux ?'}, {'id': 41, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon or Lyons (UK: , US: , French: [ljɔ̃] (listen); Arpitan: Liyon, pronounced [ʎjɔ̃]) is the third-largest city and second-largest urban area of France.', 'similarity': 0.3792387, 'score': 2.2786307454225607e-05, 'start': 0, 'end': 4, 'answer': 'Lyon', 'question': 'What is the speciality of Bordeaux ?'}]
Every year there is a silk festival in Lyon.
search("What is the speciality of Lyon ?")
Question answering: 100%|████| 1/1 [00:01<00:00, 1.58s/it]
[{'id': 52, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Economically, Lyon is a major centre for banking, as well as for the chemical, pharmaceutical and biotech industries.', 'similarity': 0.69942987, 'score': 0.6367450952529907, 'start': 41, 'end': 48, 'answer': 'banking', 'question': 'What is the speciality of Lyon ?'}, {'id': 53, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'The city contains a significant software industry with a particular focus on video games; in recent years it has fostered a growing local start-up sector.', 'similarity': 0.5620864, 'score': 0.5953128933906555, 'start': 77, 'end': 88, 'answer': 'video games', 'question': 'What is the speciality of Lyon ?'}, {'id': 48, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': "The city is recognised for its cuisine and gastronomy, as well as historical and architectural landmarks; as such, the districts of Old Lyon, the Fourvière hill, the Presqu'île and the slopes of the Croix-Rousse are inscribed on the UNESCO World Heritage List.", 'similarity': 0.60598767, 'score': 0.4346011281013489, 'start': 31, 'end': 53, 'answer': 'cuisine and gastronomy', 'question': 'What is the speciality of Lyon ?'}, {'id': 55, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'According to the Globalization and World Rankings Research Institute, Lyon is considered a Beta city, as of 2018.', 'similarity': 0.5154138, 'score': 0.3933768570423126, 'start': 91, 'end': 100, 'answer': 'Beta city', 'question': 'What is the speciality of Lyon ?'}, {'id': 50, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon played a significant role in the history of cinema: it is where Auguste and Louis Lumière invented the cinematograph.', 'similarity': 0.5905135, 'score': 0.37524232268333435, 'start': 49, 'end': 55, 'answer': 'cinema', 'question': 'What is the speciality of Lyon ?'}, {'id': 67, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'It is a central and strategic hub for the aeronautics, military and space sector, home to international companies such as Dassault Aviation, Ariane Group, Safran and Thalès.', 'similarity': 0.44267184, 'score': 0.37140029668807983, 'start': 42, 'end': 80, 'answer': 'aeronautics, military and space sector', 'question': 'What is the speciality of Lyon ?'}, {'id': 49, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon was historically an important area for the production and weaving of silk.', 'similarity': 0.6723434, 'score': 0.34435904026031494, 'start': 74, 'end': 78, 'answer': 'silk', 'question': 'What is the speciality of Lyon ?'}, {'id': 46, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Former capital of the Gauls at the time of the Roman Empire, Lyon is the seat of an archbishopric whose holder bears the title of Primate of the Gauls.', 'similarity': 0.4933558, 'score': 0.3046538829803467, 'start': 84, 'end': 97, 'answer': 'archbishopric', 'question': 'What is the speciality of Lyon ?'}, {'id': 51, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'It is also known for its light festival, the Fête des Lumières, which begins every 8 December and lasts for four days, earning Lyon the title of "Capital of Lights".', 'similarity': 0.52886266, 'score': 0.2726683020591736, 'start': 25, 'end': 39, 'answer': 'light festival', 'question': 'What is the speciality of Lyon ?'}, {'id': 43, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'The City of Lyon proper had a population of 516,092 in 2017 within its small municipal territory of 48 km2 (19 sq mi), but together with its suburbs and exurbs the Lyon metropolitan area had a population of 2,323,221 that same year, the second-most populated in France.', 'similarity': 0.5234837, 'score': 0.22288426756858826, 'start': 237, 'end': 268, 'answer': 'second-most populated in France', 'question': 'What is the speciality of Lyon ?'}, {'id': 47, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon became a major economic hub during the Renaissance.', 'similarity': 0.6418806, 'score': 0.16321411728858948, 'start': 20, 'end': 28, 'answer': 'economic', 'question': 'What is the speciality of Lyon ?'}, {'id': 69, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'A crossroads of knowledge through university research, it is home to one of the only two megajoule lasers in the world, as well as a university population of nearly 100,000 students within the Bordeaux metropolis.', 'similarity': 0.4157374, 'score': 0.11405184864997864, 'start': 16, 'end': 53, 'answer': 'knowledge through university research', 'question': 'What is the speciality of Lyon ?'}, {'id': 41, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon or Lyons (UK: , US: , French: [ljɔ̃] (listen); Arpitan: Liyon, pronounced [ʎjɔ̃]) is the third-largest city and second-largest urban area of France.', 'similarity': 0.6103668, 'score': 0.09764698892831802, 'start': 132, 'end': 142, 'answer': 'urban area', 'question': 'What is the speciality of Lyon ?'}, {'id': 63, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'The term "Bordelais" may also refer to the city and its surrounding region.', 'similarity': 0.4286503, 'score': 0.09355312585830688, 'start': 10, 'end': 19, 'answer': 'Bordelais', 'question': 'What is the speciality of Lyon ?'}, {'id': 29, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Toulouse is the centre of the European aerospace industry, with the headquarters of Airbus (formerly EADS), the SPOT satellite system, ATR and the Aerospace Valley.', 'similarity': 0.38397413, 'score': 0.06821610033512115, 'start': 39, 'end': 57, 'answer': 'aerospace industry', 'question': 'What is the speciality of Lyon ?'}, {'id': 44, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon and 58 suburban municipalities have formed since 2015 the Metropolis of Lyon, a directly elected metropolitan authority now in charge of most urban issues, with a population of 1,385,927 in 2017.', 'similarity': 0.5153016, 'score': 0.06548945605754852, 'start': 147, 'end': 159, 'answer': 'urban issues', 'question': 'What is the speciality of Lyon ?'}, {'id': 93, 'title': 'Montreal', 'url': 'https://en.wikipedia.org/wiki/Montreal', 'article': '4% of the population able to speak both English and French.', 'similarity': 0.38949788, 'score': 0.04390397667884827, 'start': 0, 'end': 58, 'answer': '4% of the population able to speak both English and French', 'question': 'What is the speciality of Lyon ?'}, {'id': 54, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon hosts the international headquarters of Interpol, the International Agency for Research on Cancer, as well as Euronews.', 'similarity': 0.56943977, 'score': 0.04046850651502609, 'start': 115, 'end': 123, 'answer': 'Euronews', 'question': 'What is the speciality of Lyon ?'}, {'id': 45, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'Lyon is the prefecture of the Auvergne-Rhône-Alpes region and seat of the Departmental Council of Rhône (whose jurisdiction, however, no longer extends over the Metropolis of Lyon since 2015).', 'similarity': 0.55201995, 'score': 0.016977420076727867, 'start': 74, 'end': 103, 'answer': 'Departmental Council of Rhône', 'question': 'What is the speciality of Lyon ?'}, {'id': 26, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Toulouse ( too-LOOZ, French: [tuluz] (listen); Occitan: Tolosa [tuˈluzɔ]; Latin: Tolosa [tɔˈloːsa]) is the prefecture of the French department of Haute-Garonne and of the larger region of Occitanie.', 'similarity': 0.3841616, 'score': 0.01222841814160347, 'start': 0, 'end': 8, 'answer': 'Toulouse', 'question': 'What is the speciality of Lyon ?'}, {'id': 42, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': 'It is located at the confluence of the rivers Rhône and Saône, about 470 km (292 mi) southeast of Paris, 320 km (199 mi) north of Marseille and 56 km (35 mi) northeast of Saint-Étienne.', 'similarity': 0.5372427, 'score': 0.011921494267880917, 'start': 0, 'end': 45, 'answer': 'It is located at the confluence of the rivers', 'question': 'What is the speciality of Lyon ?'}, {'id': 35, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': "According to the rankings of L'Express and Challenges, Toulouse is the most dynamic French city.", 'similarity': 0.3902865, 'score': 0.010680731385946274, 'start': 76, 'end': 83, 'answer': 'dynamic', 'question': 'What is the speciality of Lyon ?'}, {'id': 1, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': "Since the 17th century, Paris has been one of Europe's major centres of finance, diplomacy, commerce, fashion, gastronomy, science, and arts.", 'similarity': 0.437737, 'score': 0.0035781192127615213, 'start': 111, 'end': 121, 'answer': 'gastronomy', 'question': 'What is the speciality of Lyon ?'}, {'id': 30, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': "It also hosts the European headquarters of Intel and the CNES's Toulouse Space Centre (CST), the largest space centre in Europe.", 'similarity': 0.3905908, 'score': 0.00046677718637511134, 'start': 105, 'end': 128, 'answer': 'space centre in Europe.', 'question': 'What is the speciality of Lyon ?'}, {'id': 66, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Bordeaux is also one of the centers of gastronomy and business tourism for the organization of international congresses.', 'similarity': 0.4227606, 'score': 0.00044891092693433166, 'start': 39, 'end': 49, 'answer': 'gastronomy', 'question': 'What is the speciality of Lyon ?'}, {'id': 56, 'title': 'Lyon', 'url': 'https://en.wikipedia.org/wiki/Lyon', 'article': "It ranked second in France and 40th globally in Mercer's 2019 liveability rankings.", 'similarity': 0.6205231, 'score': 0.00029419001657515764, 'start': 62, 'end': 73, 'answer': 'liveability', 'question': 'What is the speciality of Lyon ?'}, {'id': 74, 'title': 'Bordeaux', 'url': 'https://en.wikipedia.org/wiki/Bordeaux', 'article': 'Bordeaux is also ranked as a Sufficiency city by the Globalization and World Cities Research Network.', 'similarity': 0.413479, 'score': 0.00025896544684655964, 'start': 29, 'end': 40, 'answer': 'Sufficiency', 'question': 'What is the speciality of Lyon ?'}, {'id': 20, 'title': 'Paris', 'url': 'https://en.wikipedia.org/wiki/Paris', 'article': 'The football club Paris Saint-Germain and the rugby union club Stade Français are based in Paris.', 'similarity': 0.38333356, 'score': 6.305298302322626e-05, 'start': 46, 'end': 57, 'answer': 'rugby union', 'question': 'What is the speciality of Lyon ?'}, {'id': 32, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'The University of Toulouse is one of the oldest in Europe (founded in 1229) and, with more than 103,000 students, it is the fourth-largest university campus in France, after the universities of Paris, Lyon and Lille.', 'similarity': 0.3976636, 'score': 2.2592739696847275e-05, 'start': 178, 'end': 190, 'answer': 'universities', 'question': 'What is the speciality of Lyon ?'}, {'id': 31, 'title': 'Toulouse', 'url': 'https://en.wikipedia.org/wiki/Toulouse', 'article': 'Thales Alenia Space, ATR, SAFRAN, Liebherr-Aerospace and Airbus Defence and Space also have a significant presence in Toulouse.', 'similarity': 0.406978, 'score': 6.35207470622845e-06, 'start': 0, 'end': 19, 'answer': 'Thales Alenia Space', 'question': 'What is the speciality of Lyon ?'}]