├── .github └── workflows │ ├── explore_the_world-data.yml │ ├── explore_the_world-deploy.yaml │ └── explore_the_world.yml ├── .gitignore ├── LICENSE ├── README.md ├── airgapped-rest_api ├── Dockerfile ├── README.md ├── airgapped-test-data │ ├── 0.txt │ ├── 1.txt │ └── 2.txt ├── docker-compose.yml ├── retriever_reader.yml └── test_docker.sh ├── chat_with_website_hayhooks ├── .gitignore ├── README.md ├── add-ui-connection.png ├── chat-completion-streaming.gif ├── examples │ ├── chat_with_website │ │ ├── chat_with_website.yml │ │ └── pipeline_wrapper.py │ └── chat_with_website_streaming │ │ ├── chat_with_website.yml │ │ └── pipeline_wrapper.py └── swagger.png ├── explore_the_world ├── Dockerfile ├── LICENSE ├── README.md ├── data │ ├── Dockerfile.elasticsearch │ ├── build.sh │ └── dataset │ │ ├── 0_Minsk.txt │ │ ├── 0_Montenegro.txt │ │ ├── 0_Taiwan.txt │ │ ├── 100_Ankara.txt │ │ ├── 100_Hungary.txt │ │ ├── 101_Amsterdam.txt │ │ ├── 101_Haiti.txt │ │ ├── 102_Athens.txt │ │ ├── 102_Honduras.txt │ │ ├── 103_Anbar__town_.txt │ │ ├── 103_Iceland.txt │ │ ├── 104_Algiers.txt │ │ ├── 104_Italy.txt │ │ ├── 105_Berlin.txt │ │ ├── 105_India.txt │ │ ├── 106_Baghdad.txt │ │ ├── 106_Holy_See.txt │ │ ├── 106_Republic_of_Ireland.txt │ │ ├── 107_Bishkek.txt │ │ ├── 107_Indonesia.txt │ │ ├── 108_Baku.txt │ │ ├── 108_Iran.txt │ │ ├── 109_Brasília.txt │ │ ├── 109_Japan.txt │ │ ├── 10_Ashgabat.txt │ │ ├── 10_Papua_New_Guinea.txt │ │ ├── 110_Copenhagen.txt │ │ ├── 110_Jamaica.txt │ │ ├── 111_Cairo.txt │ │ ├── 111_Kazakhstan.txt │ │ ├── 112_Cape_Town.txt │ │ ├── 112_Kiribati.txt │ │ ├── 113_Dublin.txt │ │ ├── 113_Latvia.txt │ │ ├── 114_Diego_Garcia.txt │ │ ├── 114_Luxembourg.txt │ │ ├── 115_Damascus.txt │ │ ├── 115_Libya.txt │ │ ├── 116_Guatemala_City.txt │ │ ├── 116_Lithuania.txt │ │ ├── 117_Helsinki.txt │ │ ├── 117_Laos.txt │ │ ├── 118_Jerusalem.txt │ │ ├── 118_Lebanon.txt │ │ ├── 119_Jakarta.txt │ │ ├── 119_Lesotho.txt │ │ ├── 11_Antananarivo.txt │ │ ├── 11_Panama.txt │ │ ├── 120_Gitega.txt │ │ ├── 120_Liberia.txt │ │ ├── 121_Liechtenstein.txt │ │ ├── 121_Tarawa.txt │ │ ├── 122_Madagascar.txt │ │ ├── 122_Raqqa.txt │ │ ├── 123_Hargeisa.txt │ │ ├── 123_Malawi.txt │ │ ├── 124_Maldives.txt │ │ ├── 124_Stepanakert.txt │ │ ├── 125_Djibouti__city_.txt │ │ ├── 125_Mali.txt │ │ ├── 126_Bairiki.txt │ │ ├── 126_Malta.txt │ │ ├── 127_Marshall_Islands.txt │ │ ├── 127_South_Tarawa.txt │ │ ├── 128_Avarua.txt │ │ ├── 128_Mauritius.txt │ │ ├── 129_Moldova.txt │ │ ├── 129_Road_Town.txt │ │ ├── 12_Nur-Sultan.txt │ │ ├── 12_Portugal.txt │ │ ├── 130_Alofi.txt │ │ ├── 130_Monaco.txt │ │ ├── 131_Fakaofo.txt │ │ ├── 131_Mongolia.txt │ │ ├── 132_King_Edward_Point.txt │ │ ├── 132_Morocco.txt │ │ ├── 133_Flying_Fish_Cove.txt │ │ ├── 133_Mozambique.txt │ │ ├── 134_Juba.txt │ │ ├── 134_Myanmar.txt │ │ ├── 135_Kingston__Norfolk_Island.txt │ │ ├── 135_Tajikistan.txt │ │ ├── 136_Naypyidaw.txt │ │ ├── 136_Tanzania.txt │ │ ├── 137_Lobamba.txt │ │ ├── 137_Thailand.txt │ │ ├── 138_Mata_Utu.txt │ │ ├── 138_Togo.txt │ │ ├── 139_Mamoudzou.txt │ │ ├── 139_Tonga.txt │ │ ├── 13_Bamako.txt │ │ ├── 13_Pakistan.txt │ │ ├── 140_Honiara.txt │ │ ├── 140_Tunisia.txt │ │ ├── 141_Tegucigalpa.txt │ │ ├── 141_Tuvalu.txt │ │ ├── 142_Doha.txt │ │ ├── 142_United_Kingdom.txt │ │ ├── 143_Capital_of_Indonesia.txt │ │ ├── 143_Ukraine.txt │ │ ├── 144_European_Youth_Capital.txt │ │ ├── 144_Uganda.txt │ │ ├── 145_Kokufu.txt │ │ ├── 145_Uruguay.txt │ │ ├── 146_Madrid.txt │ │ ├── 146_Uzbekistan.txt │ │ ├── 147_Abbasid_Samarra.txt │ │ ├── 147_Member_states_of_the_United_Nations.txt │ │ ├── 148_Delap-Uliga-Djarrit.txt │ │ ├── 148_Venezuela.txt │ │ ├── 149_Ghazni_under_the_Ghaznavids.txt │ │ ├── 149_Vanuatu.txt │ │ ├── 14_Bandar_Seri_Begawan.txt │ │ ├── 14_Palau.txt │ │ ├── 150_Singhapala.txt │ │ ├── 150_Zimbabwe.txt │ │ ├── 151_Stockholm.txt │ │ ├── 151_Zambia.txt │ │ ├── 152_Georgia__country_.txt │ │ ├── 152_Sarajevo.txt │ │ ├── 153_Ivory_Coast.txt │ │ ├── 153_Singapore.txt │ │ ├── 154_St._John_s__Antigua_and_Barbuda.txt │ │ ├── 154_The_Gambia.txt │ │ ├── 155_Skopje.txt │ │ ├── 155_United_Arab_Emirates.txt │ │ ├── 156_Democratic_Republic_of_the_Congo.txt │ │ ├── 156_Tokyo.txt │ │ ├── 157_Denmark.txt │ │ ├── 157_Tirana.txt │ │ ├── 158_Kyrgyzstan.txt │ │ ├── 158_Tripoli.txt │ │ ├── 159_Peru.txt │ │ ├── 159_Tallinn.txt │ │ ├── 15_Bangkok.txt │ │ ├── 15_Paraguay.txt │ │ ├── 160_Nepal.txt │ │ ├── 160_Vilnius.txt │ │ ├── 161_Ethiopia.txt │ │ ├── 161_Warsaw.txt │ │ ├── 162_Kenya.txt │ │ ├── 162_Wellington.txt │ │ ├── 163_Turkmenistan.txt │ │ ├── 163_Yamoussoukro.txt │ │ ├── 164_Budapest.txt │ │ ├── 164_Vietnam.txt │ │ ├── 165_Bucharest.txt │ │ ├── 165_Solomon_Islands.txt │ │ ├── 166_Cambodia.txt │ │ ├── 166_Kingston__Jamaica.txt │ │ ├── 167_Beirut.txt │ │ ├── 167_Saudi_Arabia.txt │ │ ├── 168_Delhi.txt │ │ ├── 168_Yemen.txt │ │ ├── 169_Aden.txt │ │ ├── 169_Bhutan.txt │ │ ├── 16_Bangui.txt │ │ ├── 16_Philippines.txt │ │ ├── 170_Montevideo.txt │ │ ├── 170_United_States.txt │ │ ├── 171_Tbilisi.txt │ │ ├── 171_Trinidad_and_Tobago.txt │ │ ├── 172_Ljubljana.txt │ │ ├── 172_Malaysia.txt │ │ ├── 173_La_Paz.txt │ │ ├── 173_Mexico.txt │ │ ├── 174_Australia.txt │ │ ├── 174_Suva.txt │ │ ├── 175_Spain.txt │ │ ├── 175_Sucre.txt │ │ ├── 176_Dakar.txt │ │ ├── 176_Switzerland.txt │ │ ├── 177_Bloemfontein.txt │ │ ├── 177_Sri_Lanka.txt │ │ ├── 178_Amman.txt │ │ ├── 178_Suriname.txt │ │ ├── 179_Kinshasa.txt │ │ ├── 179_Slovakia.txt │ │ ├── 17_Basseterre.txt │ │ ├── 17_Russia.txt │ │ ├── 180_Pyongyang.txt │ │ ├── 180_South_Korea.txt │ │ ├── 181_Malabo.txt │ │ ├── 181_Saint_Kitts_and_Nevis.txt │ │ ├── 182_Dili.txt │ │ ├── 182_Saint_Lucia.txt │ │ ├── 183_Havana.txt │ │ ├── 183_Saint_Vincent_and_the_Grenadines.txt │ │ ├── 184_Bern.txt │ │ ├── 184_Samoa.txt │ │ ├── 185_Islamabad.txt │ │ ├── 185_San_Marino.txt │ │ ├── 186_Riyadh.txt │ │ ├── 186_Senegal.txt │ │ ├── 187_Santiago.txt │ │ ├── 187_Seychelles.txt │ │ ├── 188_New_Delhi.txt │ │ ├── 188_Sierra_Leone.txt │ │ ├── 189_Phnom_Penh.txt │ │ ├── 189_Singapore.txt │ │ ├── 18_Belmopan.txt │ │ ├── 18_Romania.txt │ │ ├── 190_Nouakchott.txt │ │ ├── 190_Slovenia.txt │ │ ├── 191_Lilongwe.txt │ │ ├── 191_Somalia.txt │ │ ├── 192_Luxembourg_City.txt │ │ ├── 192_Sudan.txt │ │ ├── 193_Eswatini.txt │ │ ├── 193_Majuro.txt │ │ ├── 194_Malé.txt │ │ ├── 194_Serbia.txt │ │ ├── 195_Managua.txt │ │ ├── 196_Maputo.txt │ │ ├── 197_Maseru.txt │ │ ├── 198_Mbabane.txt │ │ ├── 199_Muscat.txt │ │ ├── 19_Bissau.txt │ │ ├── 19_Rwanda.txt │ │ ├── 1_Canberra.txt │ │ ├── 1_Norway.txt │ │ ├── 1_Somaliland.txt │ │ ├── 200_N_Djamena.txt │ │ ├── 201_Niamey.txt │ │ ├── 202_Nicosia.txt │ │ ├── 203_Lomé.txt │ │ ├── 204_Nukuʻalofa.txt │ │ ├── 205_Panama_City.txt │ │ ├── 206_Paramaribo.txt │ │ ├── 207_Port_Louis.txt │ │ ├── 208_Port_Moresby.txt │ │ ├── 209_Port_Vila.txt │ │ ├── 20_Burkina_Faso.txt │ │ ├── 20_Saint-Pierre__Saint_Pierre_and_Miquelon.txt │ │ ├── 210_Port-au-Prince.txt │ │ ├── 211_Port_of_Spain.txt │ │ ├── 212_Porto-Novo.txt │ │ ├── 213_Praia.txt │ │ ├── 214_Rabat.txt │ │ ├── 215_Roseau.txt │ │ ├── 216_Tashkent.txt │ │ ├── 217_San_Salvador.txt │ │ ├── 218_Sofia.txt │ │ ├── 219_St._George_s__Grenada.txt │ │ ├── 21_Colombia.txt │ │ ├── 21_Westside__Gibraltar.txt │ │ ├── 220_Taipei.txt │ │ ├── 221_Tehran.txt │ │ ├── 222_Thimphu.txt │ │ ├── 223_Tunis.txt │ │ ├── 224_Valletta.txt │ │ ├── 225_Windhoek.txt │ │ ├── 226_Yaoundé.txt │ │ ├── 227_Charlotte_Amalie__U.S._Virgin_Islands.txt │ │ ├── 228_San_Juan__Puerto_Rico.txt │ │ ├── 229_Pago_Pago.txt │ │ ├── 22_Czech_Republic.txt │ │ ├── 22_Tifariti.txt │ │ ├── 230_Yaren_District.txt │ │ ├── 231_Bridgetown.txt │ │ ├── 232_Chișinău.txt │ │ ├── 233_Conakry.txt │ │ ├── 234_Dhaka.txt │ │ ├── 235_Dodoma.txt │ │ ├── 236_Dushanbe.txt │ │ ├── 237_Freetown.txt │ │ ├── 238_Gaborone.txt │ │ ├── 239_Hanoi.txt │ │ ├── 23_Comoros.txt │ │ ├── 240_Harare.txt │ │ ├── 241_Kampala.txt │ │ ├── 242_Kigali.txt │ │ ├── 243_Georgetown__Guyana.txt │ │ ├── 244_Abuja.txt │ │ ├── 245_Accra.txt │ │ ├── 246_Asmara.txt │ │ ├── 247_Apia.txt │ │ ├── 248_Asunción.txt │ │ ├── 249_Kuwait_City.txt │ │ ├── 24_China.txt │ │ ├── 24_Sukhumi.txt │ │ ├── 250_Libreville.txt │ │ ├── 25_Cameroon.txt │ │ ├── 25_Fagatogo.txt │ │ ├── 26_Central_African_Republic.txt │ │ ├── 26_Gibraltar.txt │ │ ├── 27_Bazarak.txt │ │ ├── 27_Chad.txt │ │ ├── 28_Chile.txt │ │ ├── 28_West_Island__Cocos__Keeling__Islands.txt │ │ ├── 29_Capital_of_Korea.txt │ │ ├── 29_Costa_Rica.txt │ │ ├── 2_Addis_Ababa.txt │ │ ├── 2_North_Korea.txt │ │ ├── 2_Northern_Cyprus.txt │ │ ├── 30_Croatia.txt │ │ ├── 30_Pristina.txt │ │ ├── 31_Beijing.txt │ │ ├── 31_Cyprus.txt │ │ ├── 32_Dominican_Republic.txt │ │ ├── 32_Sanaa.txt │ │ ├── 33_Bratislava.txt │ │ ├── 33_Ecuador.txt │ │ ├── 34_Abu_Dhabi.txt │ │ ├── 34_El_Salvador.txt │ │ ├── 35_Equatorial_Guinea.txt │ │ ├── 35_Seoul.txt │ │ ├── 36_Finland.txt │ │ ├── 36_Funafuti.txt │ │ ├── 37_Fiji.txt │ │ ├── 37_Lusaka.txt │ │ ├── 38_Federated_States_of_Micronesia.txt │ │ ├── 38_Vientiane.txt │ │ ├── 39_Germany.txt │ │ ├── 39_Ngerulmud.txt │ │ ├── 3_Brazzaville.txt │ │ ├── 3_Namibia.txt │ │ ├── 3_South_Ossetia.txt │ │ ├── 40_Kabul.txt │ │ ├── 40_New_Zealand.txt │ │ ├── 41_Cuba.txt │ │ ├── 41_Kuala_Lumpur.txt │ │ ├── 42_Canada.txt │ │ ├── 42_Kathmandu.txt │ │ ├── 43_Khartoum.txt │ │ ├── 43_Sweden.txt │ │ ├── 44_France.txt │ │ ├── 44_London.txt │ │ ├── 45_Lisbon.txt │ │ ├── 45_Syria.txt │ │ ├── 46_Kuwait.txt │ │ ├── 46_Luanda.txt │ │ ├── 47_Iraq.txt │ │ ├── 47_Mexico_City.txt │ │ ├── 48_Jordan.txt │ │ ├── 48_Moscow.txt │ │ ├── 49_Egypt.txt │ │ ├── 49_Monaco.txt │ │ ├── 4_Nauru.txt │ │ ├── 4_Nuuk.txt │ │ ├── 4_Transnistria.txt │ │ ├── 50_Manama.txt │ │ ├── 50_Qatar.txt │ │ ├── 51_Israel.txt │ │ ├── 51_Nairobi.txt │ │ ├── 52_Armenia.txt │ │ ├── 52_Ottawa.txt │ │ ├── 53_Oslo.txt │ │ ├── 53_State_of_Palestine.txt │ │ ├── 53_Turkey.txt │ │ ├── 54_Dominica.txt │ │ ├── 54_Paris.txt │ │ ├── 55_Djibouti.txt │ │ ├── 55_Prague.txt │ │ ├── 56_Guatemala.txt │ │ ├── 56_Pretoria.txt │ │ ├── 57_Eritrea.txt │ │ ├── 57_Rome.txt │ │ ├── 58_Grenada.txt │ │ ├── 58_Riga.txt │ │ ├── 59_Guyana.txt │ │ ├── 59_Reykjavík.txt │ │ ├── 5_Caracas.txt │ │ ├── 5_Nicaragua.txt │ │ ├── 5_Republic_of_Artsakh.txt │ │ ├── 60_South_Africa.txt │ │ ├── 60_Vaduz.txt │ │ ├── 61_Andorra_la_Vella.txt │ │ ├── 61_Mauritania.txt │ │ ├── 62_Bahrain.txt │ │ ├── 62_Mogadishu.txt │ │ ├── 63_Kingdom_of_the_Netherlands.txt │ │ ├── 63_Ulaanbaatar.txt │ │ ├── 64_Argentina.txt │ │ ├── 64_Banjul.txt │ │ ├── 65_Cape_Verde.txt │ │ ├── 65_Metro_Manila.txt │ │ ├── 66_East_Timor.txt │ │ ├── 66_Lima.txt │ │ ├── 67_Palikir.txt │ │ ├── 67_Republic_of_the_Congo.txt │ │ ├── 68_São_Tomé_and_Príncipe.txt │ │ ├── 68_Washington__D.C..txt │ │ ├── 69_Burundi.txt │ │ ├── 69_Las_Palmas.txt │ │ ├── 6_Abkhazia.txt │ │ ├── 6_Niger.txt │ │ ├── 6_Vienna.txt │ │ ├── 70_North_Macedonia.txt │ │ ├── 70_Podgorica.txt │ │ ├── 71_Austria.txt │ │ ├── 71_European_Capital_of_Culture.txt │ │ ├── 72_Estonia.txt │ │ ├── 72_Manila.txt │ │ ├── 73_Funchal.txt │ │ ├── 73_South_Sudan.txt │ │ ├── 74_Islamic_Republic_of_Afghanistan.txt │ │ ├── 74_Stanley__Falkland_Islands.txt │ │ ├── 75_Algeria.txt │ │ ├── 75_Saipan.txt │ │ ├── 76_Andorra.txt │ │ ├── 76_Quito.txt │ │ ├── 77_Angola.txt │ │ ├── 77_Bogotá.txt │ │ ├── 78_Afghanistan.txt │ │ ├── 78_San_José__Costa_Rica.txt │ │ ├── 79_Albania.txt │ │ ├── 79_Buenos_Aires.txt │ │ ├── 7_Belgrade.txt │ │ ├── 7_Nigeria.txt │ │ ├── 7_Sahrawi_Arab_Democratic_Republic.txt │ │ ├── 80_Azerbaijan.txt │ │ ├── 80_Monrovia.txt │ │ ├── 81_Antigua_and_Barbuda.txt │ │ ├── 81_Moroni__Comoros.txt │ │ ├── 82_Belgium.txt │ │ ├── 82_Hagåtña__Guam.txt │ │ ├── 83_Brazil.txt │ │ ├── 83_São_Tomé.txt │ │ ├── 84_Bulgaria.txt │ │ ├── 84_Santa_Cruz_de_Tenerife.txt │ │ ├── 85_Saint-Denis__Réunion.txt │ │ ├── 85_The_Bahamas.txt │ │ ├── 86_Adamstown__Pitcairn_Islands.txt │ │ ├── 86_Bangladesh.txt │ │ ├── 87_Barbados.txt │ │ ├── 87_Laayoune.txt │ │ ├── 88_Belarus.txt │ │ ├── 88_City_of_San_Marino.txt │ │ ├── 89_Belize.txt │ │ ├── 89_Nouméa.txt │ │ ├── 8_Donetsk_People_s_Republic.txt │ │ ├── 8_Oman.txt │ │ ├── 8_Zagreb.txt │ │ ├── 90_Benin.txt │ │ ├── 90_Papeete.txt │ │ ├── 91_Bolivia.txt │ │ ├── 91_Capital_of_Japan.txt │ │ ├── 92_Bosnia_and_Herzegovina.txt │ │ ├── 92_Cayenne.txt │ │ ├── 93_Botswana.txt │ │ ├── 94_Brunei.txt │ │ ├── 94_Sri_Jayawardenepura_Kotte.txt │ │ ├── 95_City_of_Brussels.txt │ │ ├── 95_Gabon.txt │ │ ├── 96_Ghana.txt │ │ ├── 96_Kyiv.txt │ │ ├── 97_Greece.txt │ │ ├── 97_Jamestown__Saint_Helena.txt │ │ ├── 98_Guinea.txt │ │ ├── 98_Victoria__Seychelles.txt │ │ ├── 99_Guinea-Bissau.txt │ │ ├── 99_Hamilton__Bermuda.txt │ │ ├── 9_Luhansk_People_s_Republic.txt │ │ ├── 9_Ouagadougou.txt │ │ └── 9_Poland.txt ├── deploy │ ├── docker-compose.prod.yml │ └── ec2-autoscaling-group.yaml ├── docker-compose.yml ├── pyproject.toml ├── screenshot.png ├── screenshot_eval_mode.png ├── test │ ├── __init__.py │ └── test_ui_utils.py └── ui │ ├── __about__.py │ ├── __init__.py │ ├── eval_labels_example.csv │ ├── utils.py │ └── webapp.py ├── healthcare ├── Dockerfile ├── LICENSE ├── README.md ├── Slides - How to Build a QA Application With Haystack.pdf ├── docker-compose.yml ├── haystack-api │ └── pipelines_biobert.haystack-pipeline.yml ├── pyproject.toml └── ui │ ├── __about__.py │ ├── __init__.py │ ├── eval_labels_example.csv │ ├── utils.py │ └── webapp.py └── qdrant_indexing ├── Dockerfile ├── README.md ├── docker-compose.yml ├── docs └── pipelines.png ├── pipelines ├── qdrant_indexing │ └── pipeline_wrapper.py └── qdrant_query │ └── pipeline_wrapper.py └── test_file.txt /.github/workflows/explore_the_world-data.yml: -------------------------------------------------------------------------------- 1 | name: explore_the_world-data 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - 'explore_the_world/data/**' 10 | 11 | env: 12 | IMAGE_NAME: deepset/elasticsearch-countries-and-capitals 13 | 14 | jobs: 15 | build-push: 16 | name: Build and Push data image 17 | runs-on: ubuntu-latest 18 | timeout-minutes: 90 19 | steps: 20 | - name: Checkout 21 | uses: actions/checkout@v3 22 | 23 | - name: Set up QEMU 24 | uses: docker/setup-qemu-action@v2 25 | 26 | - name: Set up Docker Buildx 27 | uses: docker/setup-buildx-action@v2 28 | 29 | - name: Login to DockerHub 30 | uses: docker/login-action@v2 31 | with: 32 | username: ${{ secrets.DOCKER_HUB_USER }} 33 | password: ${{ secrets.DOCKER_HUB_TOKEN }} 34 | 35 | - name: Create driver 36 | run: | 37 | docker buildx create --use --name multi-builder --platform linux/amd64,linux/arm64 38 | 39 | - name: Build and push amd64 image 40 | working-directory: explore_the_world/data 41 | env: 42 | DATA_IMAGE_PLATFORM: linux/amd64 43 | DATA_IMAGE_PUSH: true 44 | HAYSTACK_IMAGE_NAME: deepset/haystack:cpu-v1.11.1 45 | run: | 46 | ./build.sh 47 | 48 | - name: Build and push arm64 image 49 | working-directory: explore_the_world/data 50 | env: 51 | DATA_IMAGE_PLATFORM: linux/arm64 52 | DATA_IMAGE_PUSH: true 53 | HAYSTACK_IMAGE_NAME: deepset/haystack:cpu-v1.11.1 54 | run: | 55 | ./build.sh 56 | 57 | - name: Push manifest 58 | run: | 59 | docker manifest create $IMAGE_NAME:latest $IMAGE_NAME:linux_amd64 $IMAGE_NAME:linux_arm64 60 | docker manifest push $IMAGE_NAME:latest -------------------------------------------------------------------------------- /.github/workflows/explore_the_world-deploy.yaml: -------------------------------------------------------------------------------- 1 | name: explore_the_world-deploy 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | env: 7 | AWS_REGION: eu-west-1 8 | STACK_NAME: haystack-demo-production-instance 9 | ENVIRONMENT: production 10 | TEMPLATE_FILE: explore_the_world/deploy/ec2-autoscaling-group.yaml 11 | VPC_STACK: haystack-demo-production-vpc 12 | INSTANCE_TYPE: g4dn.2xlarge 13 | 14 | permissions: 15 | id-token: write 16 | contents: read 17 | 18 | jobs: 19 | deploy: 20 | runs-on: ubuntu-20.04 21 | steps: 22 | - uses: actions/checkout@v3 23 | 24 | - name: AWS Authentication 25 | uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 26 | with: 27 | aws-region: ${{ env.AWS_REGION }} 28 | role-to-assume: ${{ secrets.EXPLORE_THE_W_AWS_DEPLOY_ROLE }} 29 | 30 | - name: Deploy demo 31 | env: 32 | CF_KEY_NAME: ${{ secrets.EXPLORE_THE_W_CF_KEY_NAME }} 33 | CF_IMAGE_ID: ${{ secrets.EXPLORE_THE_W_CF_IMAGE_ID }} 34 | CF_IAM_INSTANCE_PROFILE: ${{ secrets.EXPLORE_THE_W_CF_IAM_INSTANCE_PROFILE }} 35 | run: | 36 | echo -e "\n* Deploying CloudFormation Stack ${STACK_NAME}" 37 | 38 | start_ts=$(date +"%s") 39 | 40 | # Deploy the CloudFormation stack as a background process 41 | aws cloudformation deploy \ 42 | --template-file "${TEMPLATE_FILE}" \ 43 | --stack-name ${STACK_NAME} \ 44 | --parameter-overrides \ 45 | "Environment=${ENVIRONMENT}" \ 46 | "VPCStack=${VPC_STACK}" \ 47 | "GitRepositoryURL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" \ 48 | "GitBranchName=${GITHUB_REF_NAME}" \ 49 | "GitCommitHash=${{ github.sha }}" \ 50 | "InstanceType=${INSTANCE_TYPE}" \ 51 | "KeyName=${CF_KEY_NAME}" \ 52 | "ImageId=${CF_IMAGE_ID}" \ 53 | "IamInstanceProfile=${CF_IAM_INSTANCE_PROFILE}" \ 54 | --capabilities CAPABILITY_IAM > /dev/null & 55 | 56 | # Save the pid for the background deploy process 57 | deploy_pid=$! 58 | 59 | echo -e "\n** Progress of deployment for CloudFormation Stack ${STACK_NAME}" 60 | 61 | # Show stack events while the background deploy process is still running 62 | touch stack-events.prev 63 | while kill -0 $deploy_pid 2>/dev/null 64 | do 65 | sleep 2 66 | 67 | aws cloudformation describe-stack-events --stack-name ${STACK_NAME} 2>/dev/null \ 68 | | jq -r --arg start_ts ${start_ts} '.StackEvents[] | (.Timestamp | sub("(?T\\d+:\\d+:\\d+).*$"; "\(.x)Z") | fromdate) as $dt | select($dt >= ($start_ts|tonumber)) | "\($dt|todateiso8601)\t\(.LogicalResourceId)\t\(.ResourceStatus)\t\(.ResourceStatusReason // "")"' \ 69 | | column -t -s $'\t' \ 70 | | tac > stack-events.new 71 | 72 | # describe-stack-events dumps all the events history but 73 | # we are only interested in printing only the new ones on each iteration 74 | tail -n $(($(wc -l < stack-events.new) - $(wc -l < stack-events.prev))) stack-events.new 75 | mv stack-events.new stack-events.prev 76 | done 77 | 78 | LogGroupName=$(aws cloudformation describe-stacks \ 79 | --stack-name ${STACK_NAME} \ 80 | --query 'Stacks[0].Outputs[?OutputKey==`LogGroupName`].OutputValue' \ 81 | --output text) 82 | LogGroupURL="https://${AWS_REGION}.console.aws.amazon.com/cloudwatch/home?region=${AWS_REGION}#logsV2:log-groups/log-group/$(echo ${LogGroupName} | sed 's#/#$252F#g')" 83 | echo -e "\n* EC2 instance CloudWatch logs can be found at ${LogGroupURL}" 84 | 85 | # wait will exit with the same exit code as the background deploy process 86 | # so we pass or fail the CI job based on the result of the deployment 87 | wait $deploy_pid 88 | -------------------------------------------------------------------------------- /.github/workflows/explore_the_world.yml: -------------------------------------------------------------------------------- 1 | name: explore_the_world 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - main 8 | paths: 9 | - 'explore_the_world/ui/*' 10 | 11 | env: 12 | IMAGE_NAME: deepset/demo-explore-the-world 13 | 14 | jobs: 15 | build-push: 16 | name: Build and Push UI image 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v3 21 | 22 | - name: Set up QEMU 23 | uses: docker/setup-qemu-action@v2 24 | 25 | - name: Set up Docker Buildx 26 | uses: docker/setup-buildx-action@v2 27 | 28 | - name: Login to DockerHub 29 | uses: docker/login-action@v2 30 | with: 31 | username: ${{ secrets.DOCKER_HUB_USER }} 32 | password: ${{ secrets.DOCKER_HUB_TOKEN }} 33 | 34 | - name: Create driver 35 | run: | 36 | docker buildx create --use --name multi-builder --platform linux/amd64,linux/arm64 37 | 38 | - name: Build and push amd64 image 39 | working-directory: explore_the_world 40 | run: | 41 | docker buildx build -o type=docker -t $IMAGE_NAME:linux_amd64 --platform linux/amd64 -f Dockerfile . 42 | docker push $IMAGE_NAME:linux_amd64 43 | 44 | - name: Build and push arm64 image 45 | working-directory: explore_the_world 46 | run: | 47 | docker buildx build -o type=docker -t $IMAGE_NAME:linux_arm64 --platform linux/arm64 -f Dockerfile . 48 | docker push $IMAGE_NAME:linux_arm64 49 | 50 | - name: Push manifest 51 | run: | 52 | docker manifest create $IMAGE_NAME:latest $IMAGE_NAME:linux_amd64 $IMAGE_NAME:linux_arm64 53 | docker manifest push $IMAGE_NAME:latest -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # pdm 105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 106 | #pdm.lock 107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 108 | # in version control. 109 | # https://pdm.fming.dev/#use-with-ide 110 | .pdm.toml 111 | 112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 113 | __pypackages__/ 114 | 115 | # Celery stuff 116 | celerybeat-schedule 117 | celerybeat.pid 118 | 119 | # SageMath parsed files 120 | *.sage.py 121 | 122 | # Environments 123 | .env 124 | .venv 125 | env/ 126 | venv/ 127 | ENV/ 128 | env.bak/ 129 | venv.bak/ 130 | .DS_Store 131 | 132 | # Spyder project settings 133 | .spyderproject 134 | .spyproject 135 | 136 | # Rope project settings 137 | .ropeproject 138 | 139 | # mkdocs documentation 140 | /site 141 | 142 | # mypy 143 | .mypy_cache/ 144 | .dmypy.json 145 | dmypy.json 146 | 147 | # Pyre type checker 148 | .pyre/ 149 | 150 | # pytype static type analyzer 151 | .pytype/ 152 | 153 | # Cython debug symbols 154 | cython_debug/ 155 | 156 | # PyCharm 157 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 158 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 159 | # and can be added to the global gitignore or merged into this file. For a more nuclear 160 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 161 | #.idea/ 162 | 163 | # vscode 164 | .history 165 | .vscode 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Haystack Demos 2 | 3 |
4 | Green logo of a stylized white 'H' with the text 'Haystack, by deepset. Haystack 2.0 is live 🎉' Abstract green and yellow diagrams in the background. 5 |
6 | 7 | [**Haystack**](https://github.com/deepset-ai/haystack) is an open source framework by [**deepset**](https://deepset.ai) for building production-ready **LLM applications**, **retrieval-augmented generative pipelines** and **state-of-the-art search systems** that work intelligently over large document collections. It lets you quickly try out the latest models in natural language processing (NLP) while being flexible and easy to use. 8 | 9 | This repository contains **fully functional applications** that demonstrate how to use Haystack for implementing a range of NLP use cases, from **advanced LLM-driven solutions** to **practical natural language processing tasks**. Some of these applications are available online, while all of them can be run locally. For more details, visit [Haystack Demos](https://haystack.deepset.ai/overview/demo). 10 | 11 | To build your own Haystack demo, you can use the [👾 Template for Haystack Apps with Streamlit](https://github.com/deepset-ai/haystack-streamlit-app). 12 | 13 | ## Demo apps 14 | 15 | ### In this repository 16 | | Name | Use case | Available online | Haystack Version | 17 | | ------------------------------------------- | ------------------ | ---------------------------------------- | -----------------| 18 | | [Explore the world](./explore_the_world/) | Question Answering | :x: | 1.0 | 19 | | [Air-gapped rest_api](./airgapped-rest_api) | Deployment | :x: | 1.0 | 20 | | [Healthcare](./healthcare) | Question Answering | :x: | 1.0 | 21 | | [Qdrant Indexing](./qdrant_indexing) | Question Answering | :x: | 2.0 | 22 | 23 | ### Other cool demos 😎 24 | | Name | Use case | Available online | 25 | | ----------------------------------------------------------------------------------------------- | ------------------ | ----------------------------------------------------------------- | 26 | | [🧑‍🏫 AutoQuizzer](https://github.com/anakin87/autoquizzer) | Content Generation | [Link](https://huggingface.co/spaces/deepset/autoquizzer) | 27 | | [Hacker News Post Summaries 🧡](https://github.com/TuanaCelik/hackernews-summaries) | Summarization | [Link](https://huggingface.co/spaces/Tuana/hackernews-summaries) | 28 | | [Captionate 📸](https://huggingface.co/spaces/bilgeyucel/captionate/tree/main) | Image-to-Text | [Link](https://huggingface.co/spaces/bilgeyucel/captionate) | 29 | | [Fact Checking 🎸 Rocks!](https://github.com/anakin87/fact-checking-rocks) | Entailment Check | [Link](https://huggingface.co/spaces/anakin87/fact-checking-rocks)| 30 | | [Should I Follow on Mastodon? 🐤](https://github.com/TuanaCelik/should-i-follow) | Content Generation | [Link](https://huggingface.co/spaces/deepset/should-i-follow) | 31 | | [Search All Docs 🔎](https://github.com/silvanocerza/search-all-the-docs) | RAG | [Link](https://huggingface.co/spaces/deepset/search-all-the-docs) | 32 | -------------------------------------------------------------------------------- /airgapped-rest_api/Dockerfile: -------------------------------------------------------------------------------- 1 | # NOTE: This is a sample dockerfile for creating airgapped docker images for deploying 2 | # a Haystack pipeline. Follow the comments and make suitable changes for your use-case. 3 | # 4 | # Use-case showcased here: 5 | # Air-gapped Dockerfile for a Reader-Retriever pipeline. 6 | # 7 | # The reader is a custom trained locally available FARM Model. 8 | # The retriever is a simple TF-IDF retriever. 9 | # 10 | # We also show how to cache HuggingFace models; both public and private. More details in the comments. 11 | # CAUTION: Do not use `huggingface-cli login` inside the docker as it store the access token locally. 12 | # Here we prefer passing access token as an `ARG` because 13 | # we only need to use access token to cache required model. 14 | # Also, do not create an ENV variable containing access token, 15 | # as ENV variable remains active inside docker for its entire lifecycle. 16 | # To know further: https://huggingface.co/docs/hub/security-tokens#best-practices 17 | 18 | # Use a base image providing the desired Haystack version (e.g. `cpu-v1.14.0`) 19 | ARG HAYSTACK_BASE_IMAGE 20 | FROM $HAYSTACK_BASE_IMAGE 21 | 22 | # Haystack collects anonymous usage statistics for improvement purposes. 23 | # The container won't have access to the internet, so we disable the telemetry service altogether. 24 | ENV HAYSTACK_TELEMETRY_ENABLED=False 25 | 26 | # `hf_model_names` should be a list of strings containing the model names as they appear in HuggingFace hub, 27 | # for example: "['deepset/roberta-base-squad2']" or "['deepset/minilm-uncased-squad2', 'bert-base-uncased']" 28 | ARG hf_model_names 29 | 30 | # The following instruction will download the models listed in `hf_models_names`. If one or more models 31 | # in the list are private, remove or comment the following line and see below what to do instead. 32 | RUN python3 -c "from haystack.utils.docker import cache_models;cache_models($hf_model_names)" 33 | 34 | # If one or more models listed in `hf_model_names` is private, we need to provide a valid HuggingFace API token. 35 | # Uncomment the following two lines and be sure to pass the `hf_token` argument to the `docker build` command: 36 | #ARG hf_token='' 37 | #RUN python3 -c "from haystack.utils.docker import cache_models;cache_models($hf_model_names, $hf_token)" 38 | 39 | # The following lines will copy the models we downloaded previously into the Docker image. We need to specify 40 | # both the local path containing the model (`local_model_path') and the path inside the Docker image where 41 | # we want to copy it (`container_model_path`). 42 | # NOTE: make sure to use the same value you passed to `container_model_path` 43 | # for the `model_path` field inside the pipeline definition file (in this case, `retriever_reader.yml`) 44 | ARG local_model_path 45 | ARG container_model_path 46 | COPY $local_model_path $container_model_path 47 | 48 | # The following lines will copy the pipeline definition file into the Docker image. 49 | # The logic is the same as for the models. 50 | ARG local_pipeline_path 51 | ARG container_pipeline_path 52 | COPY $local_pipeline_path $container_pipeline_path 53 | 54 | # Haystack will read this environment variable to load the appropriate pipeline when the container starts: 55 | ENV PIPELINE_YAML_PATH=$container_pipeline_path 56 | 57 | # The following line will start the Haystack API server when the container starts. 58 | CMD ["gunicorn", "rest_api.application:app", "-b", "0.0.0.0", "-k", "uvicorn.workers.UvicornWorker", "--workers", "1", "--timeout", "180"] 59 | -------------------------------------------------------------------------------- /airgapped-rest_api/README.md: -------------------------------------------------------------------------------- 1 | This folder contains a Dockerfile and a minimal pipeline setup to showcase an example of how to use Haystack in an airgapped environment. 2 | 3 | ### Important points to note: 4 | 5 | 1. While the container can run in an air-gapped environment, Internet access is required to build the container itself. 6 | 2. The number and size of the models used in the pipeline will increase the size of the resulting Docker image. 7 | 3. This is an overly simplistic Dockerfile provided for reference, some changes are expected to suit realistic use cases. 8 | 9 | ### Docker build process: 10 | 11 | For the example here, you need [`docker compose`](https://docs.docker.com/compose/install/) installed on your system. 12 | 13 | You’ll also need to clone the `haystack-demos` repository and run the following commands. 14 | 15 | 1. Read the `docker-compose.yml` , `Dockerfile` , and `retriever-reader.yml` files carefully. 16 | 2. Make any appropriate change: choose the desired pipeline and components, add or remove unnecessary commands from the `Dockerfile`. 17 | 3. `cd haystack-demos/airgapped-rest_api` 18 | 4. `docker compose build` 19 | 20 | After building the Docker image, it should be possible to run the container without internet access. 21 | 22 | ### Docker run command: 23 | 24 | `docker compose up` 25 | 26 | ### Sending requests to Docker: 27 | 28 | To find Airgapped Docker’s IP address: 29 | 30 | ```bash 31 | docker inspect | grep IPAddress 32 | ``` 33 | 34 | You will need to replace the IP address in the commands below. 35 | 36 | To index the test data through REST APIs: 37 | 38 | ```bash 39 | find ./airgapped-test-data -name '*.txt' -exec curl --request POST --url http://:8000/file-upload --header 'accept: application/json' --header 'content-type: multipart/form-data' --form files="@{}" --form meta=null \; 40 | ``` 41 | 42 | To verify if the data is written in the DocumentStore: 43 | 44 | ```bash 45 | curl --request POST --url http://:8000/documents/get_by_filters --header 'accept: application/json' --header 'content-type: application/json' --data '{"filters": {}}' 46 | ``` 47 | 48 | Sample Query through REST API: 49 | ```bash 50 | curl --request POST --url http://:8000/query --header 'accept: application/json' --header 'content-type: application/json' --data '{"query": "what is my name?"}' 51 | ``` -------------------------------------------------------------------------------- /airgapped-rest_api/airgapped-test-data/0.txt: -------------------------------------------------------------------------------- 1 | His name is John. 2 | -------------------------------------------------------------------------------- /airgapped-rest_api/airgapped-test-data/1.txt: -------------------------------------------------------------------------------- 1 | Her name is Jane. 2 | -------------------------------------------------------------------------------- /airgapped-rest_api/airgapped-test-data/2.txt: -------------------------------------------------------------------------------- 1 | My name is Haystack. 2 | -------------------------------------------------------------------------------- /airgapped-rest_api/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | 4 | elasticsearch: 5 | image: "docker.elastic.co/elasticsearch/elasticsearch:7.9.2" 6 | ports: 7 | - 9200:9200 8 | restart: on-failure 9 | environment: 10 | - discovery.type=single-node 11 | - "ES_JAVA_OPTS=-Xms1024m -Xmx1024m" 12 | healthcheck: 13 | test: curl --fail http://localhost:9200/_cat/health || exit 1 14 | interval: 10s 15 | timeout: 1s 16 | retries: 10 17 | 18 | haystack-airgapped: 19 | image: haystack_airgapped 20 | build: 21 | context: ../../haystack-demos 22 | args: 23 | HAYSTACK_BASE_IMAGE: deepset/haystack:cpu-v1.14.0 24 | # In case you want to download private models, please add the HF token in the line below. 25 | # You will also need to change the Dockerfile accordingly, for more details see Dockerfile. 26 | # hf_token='' 27 | hf_model_names: "['sentence-transformers/all-MiniLM-L6-v2']" 28 | 29 | # If you are using local models to build the image, remember to set the `context` correctly 30 | # or move your models to `haystack-demos` folder before you use the below variables 31 | local_model_path: local_farm_minilm 32 | container_model_path: /opt/models/fine-tuned-reader 33 | 34 | local_pipeline_path: airgapped-rest_api/retriever_reader.yml 35 | container_pipeline_path: /opt/haystack_pipelines/reader_retriever.yml 36 | 37 | dockerfile: airgapped-rest_api/Dockerfile 38 | ports: 39 | - 8000:8000 40 | restart: on-failure 41 | environment: 42 | - DOCUMENTSTORE_PARAMS_HOST=elasticsearch 43 | depends_on: 44 | elasticsearch: 45 | condition: service_healthy 46 | -------------------------------------------------------------------------------- /airgapped-rest_api/retriever_reader.yml: -------------------------------------------------------------------------------- 1 | components: 2 | - name: DocumentStore 3 | type: ElasticsearchDocumentStore 4 | - name: Retriever 5 | params: 6 | document_store: DocumentStore 7 | type: TfidfRetriever 8 | - name: Reader 9 | params: 10 | # set model_name_or_path to reflect local model_path or HF model_name 11 | model_name_or_path: /opt/models/fine-tuned-reader 12 | # here we have used a base-cpu image 13 | use_gpu: false 14 | # for airgapped image, we should load models from local 15 | local_files_only: true 16 | type: FARMReader 17 | - name: TextFileConverter 18 | type: TextConverter 19 | pipelines: 20 | - name: query 21 | nodes: 22 | - inputs: [Query] 23 | name: Retriever 24 | - inputs: [Retriever] 25 | name: Reader 26 | - name: indexing 27 | nodes: 28 | - name: TextFileConverter 29 | inputs: [File] 30 | - name: Retriever 31 | inputs: [TextFileConverter] 32 | - name: DocumentStore 33 | inputs: [Retriever] 34 | version: ignore 35 | -------------------------------------------------------------------------------- /airgapped-rest_api/test_docker.sh: -------------------------------------------------------------------------------- 1 | curl --request POST --url http://0.0.0.0:8000/query \ 2 | --header 'accept: application/json' \ 3 | --header 'content-type: application/json' \ 4 | --data '{"query": "what is my name"}' 5 | -------------------------------------------------------------------------------- /chat_with_website_hayhooks/.gitignore: -------------------------------------------------------------------------------- 1 | pipelines -------------------------------------------------------------------------------- /chat_with_website_hayhooks/README.md: -------------------------------------------------------------------------------- 1 | # Chat with a Website using Hayhooks and Open WebUI 2 | 3 | This demo shows how to build a chatbot that interacts with website content using [Haystack](https://haystack.deepset.ai/), [Hayhooks](https://github.com/deepset-ai/hayhooks), and [Open WebUI](https://docs.openwebui.com/). The chatbot extracts information from webpages and answers user queries in real time. 4 | 5 | ![Chat Completion Streaming Example](chat-completion-streaming.gif) 6 | 7 | ## 🚀 Run the Demo 8 | 9 | ### 1️⃣ Clone the Repository 10 | ```sh 11 | git clone git@github.com:deepset-ai/haystack-demos.git 12 | cd haystack-demos/chat_with_website_hayhooks 13 | ``` 14 | 15 | ### 2️⃣ Install Dependencies 16 | ```sh 17 | pip install hayhooks trafilatura 18 | ``` 19 | 20 | ### 3️⃣ Configure Environment Variables 21 | Create a `.env` file and add the following variables: 22 | ```ini 23 | # OpenAI API Key (Required) 24 | OPENAI_API_KEY= 25 | 26 | # FastAPI Configuration 27 | HAYHOOKS_HOST="localhost" 28 | HAYHOOKS_PORT=1416 29 | HAYHOOKS_ROOT_PATH="" 30 | HAYHOOKS_PIPELINES_DIR="pipelines" 31 | HAYHOOKS_ADDITIONAL_PYTHON_PATH="" 32 | HAYHOOKS_DISABLE_SSL=false # Set to true to disable SSL verification 33 | HAYHOOKS_SHOW_TRACEBACKS=false # Set to true to show errors 34 | ``` 35 | 🔗 **More details on configuration:** [Hayhooks Documentation](https://github.com/deepset-ai/hayhooks?tab=readme-ov-file#configuration) 36 | 37 | ### 4️⃣ Start the Hayhooks Server 38 | ```sh 39 | hayhooks run 40 | ``` 41 | Check if Hayhooks is running: 42 | ```sh 43 | hayhooks status 44 | ``` 45 | 46 | ### 5️⃣ Deploy the Chat Pipeline 47 | Deploy with streaming support: 48 | ```sh 49 | hayhooks pipeline deploy-files -n chat_with_website_streaming examples/chat_with_website_streaming 50 | ``` 51 | Deploy without streaming: 52 | ```sh 53 | hayhooks pipeline deploy-files -n chat_with_website examples/chat_with_website 54 | ``` 55 | When deployment is successful, run `hayhooks status` and you'll see output like: 56 | ```sh 57 | ╭───────────────────────────────────────────────────────────────╮ 58 | │ ✓ Hayhooks server is up and running at: http://localhost:1416 │ 59 | ╰───────────────────────────────────────────────────────────────╯ 60 | 61 | Deployed Pipelines 62 | ╭───┬─────────────────────────────┬───────────╮ 63 | │ № │ Pipeline Name │ Status │ 64 | ├───┼─────────────────────────────┼───────────┤ 65 | │ 1 │ chat_with_website_streaming │ 🟢 Active │ 66 | ╰───┴─────────────────────────────┴───────────╯ 67 | ``` 68 | 69 | ### 6️⃣ Test the API 70 | Swagger docs: [http://localhost:1416/docs](http://localhost:1416/docs) 71 | 72 | Test with `curl`: 73 | ```sh 74 | curl -X 'POST' \ 75 | 'http://localhost:1416/chat_with_website_streaming/run' \ 76 | -H 'accept: application/json' \ 77 | -H 'Content-Type: application/json' \ 78 | -d '{ 79 | "urls": ["https://ssi.inc"], 80 | "question": "Who founded SSI?" 81 | }' 82 | ``` 83 | Response: 84 | ```json 85 | {"result":"The founders of Safe Superintelligence Inc. (SSI) are Ilya Sutskever, Daniel Gross, and Daniel Levy."} 86 | ``` 87 | 88 | ## 🖥️ Connect to Open WebUI 89 | 90 | ### 1️⃣ Start Open WebUI 91 | **Official Quick Start:** [Open WebUI Docs](https://docs.openwebui.com/) 92 | 93 | Run Open WebUI using Docker: 94 | ```sh 95 | docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway \ 96 | -e WEBUI_AUTH=False -v open-webui:/app/backend/data \ 97 | --name open-webui ghcr.io/open-webui/open-webui:main 98 | ``` 99 | ⚠️ **Disables authentication.** If you have Open WebUI authentication enabled, delete existing Docker volumes before running this command. 100 | 101 | Once running, open: [http://localhost:3000/](http://localhost:3000/) 102 | 103 | ### 2️⃣ Connect Open WebUI to the REST API 104 | 1. Go to **Settings** → **Admin Settings** → **Connections** in the Open WebUI 105 | 2. Add `http://host.docker.internal:1416` to OpenAI API connections, fill in a placeholder string as "Key" 106 | 3. Select a pipeline as the "model" for chat 107 | 108 | ![Add Connection](add-ui-connection.png) 109 | 110 | ### 3️⃣ Start Chatting in Open WebUI 111 | ![Chat Completion Streaming Example](chat-completion-streaming.gif) 112 | 113 | ## 🔧 Customizing the Chatbot 114 | Modify `chat_with_website.yml` and `chat_with_website_streaming.yml` files to update pipelines for different use cases: 115 | - Check out [Haystack Tutorials](https://haystack.deepset.ai/tutorials) for ideas. 116 | - Explore [Haystack Cookbook](https://haystack.deepset.ai/cookbook) for advanced recipes. 117 | - Learn about [different deployment options](https://github.com/deepset-ai/hayhooks?tab=readme-ov-file#deploy-a-pipeline). 118 | 119 | --- 120 | 121 | Enjoy building your own chat-powered applications with Haystack, Hayhooks, and Open WebUI! 🚀 122 | 123 | -------------------------------------------------------------------------------- /chat_with_website_hayhooks/add-ui-connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepset-ai/haystack-demos/b2cd2f19c893d7df301eb16891cbcd2c5890ca2e/chat_with_website_hayhooks/add-ui-connection.png -------------------------------------------------------------------------------- /chat_with_website_hayhooks/chat-completion-streaming.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepset-ai/haystack-demos/b2cd2f19c893d7df301eb16891cbcd2c5890ca2e/chat_with_website_hayhooks/chat-completion-streaming.gif -------------------------------------------------------------------------------- /chat_with_website_hayhooks/examples/chat_with_website/chat_with_website.yml: -------------------------------------------------------------------------------- 1 | components: 2 | converter: 3 | type: haystack.components.converters.html.HTMLToDocument 4 | init_parameters: 5 | extraction_kwargs: null 6 | 7 | fetcher: 8 | init_parameters: 9 | raise_on_failure: true 10 | retry_attempts: 2 11 | timeout: 3 12 | user_agents: 13 | - haystack/LinkContentFetcher/2.0.0b8 14 | type: haystack.components.fetchers.link_content.LinkContentFetcher 15 | 16 | llm: 17 | init_parameters: 18 | api_base_url: null 19 | api_key: 20 | env_vars: 21 | - OPENAI_API_KEY 22 | strict: true 23 | type: env_var 24 | generation_kwargs: {} 25 | model: gpt-4o-mini 26 | streaming_callback: null 27 | system_prompt: null 28 | type: haystack.components.generators.openai.OpenAIGenerator 29 | 30 | prompt: 31 | init_parameters: 32 | template: | 33 | "According to the contents of this website: 34 | {% for document in documents %} 35 | {{document.content}} 36 | {% endfor %} 37 | Answer the given question: {{query}} 38 | Answer: 39 | " 40 | type: haystack.components.builders.prompt_builder.PromptBuilder 41 | 42 | connections: 43 | - receiver: converter.sources 44 | sender: fetcher.streams 45 | - receiver: prompt.documents 46 | sender: converter.documents 47 | - receiver: llm.prompt 48 | sender: prompt.prompt 49 | 50 | metadata: {} 51 | -------------------------------------------------------------------------------- /chat_with_website_hayhooks/examples/chat_with_website/pipeline_wrapper.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | from typing import Generator, List, Union 3 | from haystack import Pipeline 4 | from hayhooks import get_last_user_message, BasePipelineWrapper, log 5 | 6 | 7 | URLS = ["https://haystack.deepset.ai", "https://www.redis.io", "https://ssi.inc"] 8 | 9 | 10 | class PipelineWrapper(BasePipelineWrapper): 11 | def setup(self) -> None: 12 | pipeline_yaml = (Path(__file__).parent / "chat_with_website.yml").read_text() 13 | self.pipeline = Pipeline.loads(pipeline_yaml) 14 | 15 | def run_api(self, urls: List[str], question: str) -> str: 16 | log.trace(f"Running pipeline with urls: {urls} and question: {question}") 17 | result = self.pipeline.run({"fetcher": {"urls": urls}, "prompt": {"query": question}}) 18 | return result["llm"]["replies"][0] 19 | 20 | def run_chat_completion(self, model: str, messages: List[dict], body: dict) -> Union[str, Generator]: 21 | log.trace(f"Running pipeline with model: {model}, messages: {messages}, body: {body}") 22 | 23 | question = get_last_user_message(messages) 24 | log.trace(f"Question: {question}") 25 | 26 | # Plain pipeline run, will return a string 27 | result = self.pipeline.run({"fetcher": {"urls": URLS}, "prompt": {"query": question}}) 28 | return result["llm"]["replies"][0] 29 | -------------------------------------------------------------------------------- /chat_with_website_hayhooks/examples/chat_with_website_streaming/chat_with_website.yml: -------------------------------------------------------------------------------- 1 | components: 2 | converter: 3 | type: haystack.components.converters.html.HTMLToDocument 4 | init_parameters: 5 | extraction_kwargs: null 6 | 7 | fetcher: 8 | init_parameters: 9 | raise_on_failure: true 10 | retry_attempts: 2 11 | timeout: 3 12 | user_agents: 13 | - haystack/LinkContentFetcher/2.0.0b8 14 | type: haystack.components.fetchers.link_content.LinkContentFetcher 15 | 16 | llm: 17 | init_parameters: 18 | api_base_url: null 19 | api_key: 20 | env_vars: 21 | - OPENAI_API_KEY 22 | strict: true 23 | type: env_var 24 | generation_kwargs: {} 25 | model: gpt-4o-mini 26 | streaming_callback: null 27 | system_prompt: null 28 | type: haystack.components.generators.openai.OpenAIGenerator 29 | 30 | prompt: 31 | init_parameters: 32 | template: | 33 | "According to the contents of this website: 34 | {% for document in documents %} 35 | {{document.content}} 36 | {% endfor %} 37 | Answer the given question: {{query}} 38 | Answer: 39 | " 40 | type: haystack.components.builders.prompt_builder.PromptBuilder 41 | 42 | connections: 43 | - receiver: converter.sources 44 | sender: fetcher.streams 45 | - receiver: prompt.documents 46 | sender: converter.documents 47 | - receiver: llm.prompt 48 | sender: prompt.prompt 49 | 50 | metadata: {} 51 | -------------------------------------------------------------------------------- /chat_with_website_hayhooks/examples/chat_with_website_streaming/pipeline_wrapper.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | from typing import Generator, List, Union 3 | from haystack import Pipeline 4 | from hayhooks import get_last_user_message, BasePipelineWrapper, log, streaming_generator 5 | 6 | 7 | URLS = ["https://haystack.deepset.ai", "https://www.redis.io", "https://ssi.inc"] 8 | 9 | 10 | class PipelineWrapper(BasePipelineWrapper): 11 | def setup(self) -> None: 12 | pipeline_yaml = (Path(__file__).parent / "chat_with_website.yml").read_text() 13 | self.pipeline = Pipeline.loads(pipeline_yaml) 14 | 15 | def run_api(self, urls: List[str], question: str) -> str: 16 | log.trace(f"Running pipeline with urls: {urls} and question: {question}") 17 | result = self.pipeline.run({"fetcher": {"urls": urls}, "prompt": {"query": question}}) 18 | return result["llm"]["replies"][0] 19 | 20 | def run_chat_completion(self, model: str, messages: List[dict], body: dict) -> Union[str, Generator]: 21 | log.trace(f"Running pipeline with model: {model}, messages: {messages}, body: {body}") 22 | 23 | question = get_last_user_message(messages) 24 | log.trace(f"Question: {question}") 25 | 26 | # Streaming pipeline run, will return a generator 27 | return streaming_generator( 28 | pipeline=self.pipeline, 29 | pipeline_run_args={"fetcher": {"urls": URLS}, "prompt": {"query": question}}, 30 | ) 31 | -------------------------------------------------------------------------------- /chat_with_website_hayhooks/swagger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepset-ai/haystack-demos/b2cd2f19c893d7df301eb16891cbcd2c5890ca2e/chat_with_website_hayhooks/swagger.png -------------------------------------------------------------------------------- /explore_the_world/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10-slim 2 | 3 | # copy code 4 | COPY . /ui 5 | 6 | # install as a package 7 | RUN pip install --upgrade pip && \ 8 | pip install /ui/ 9 | 10 | WORKDIR /ui 11 | EXPOSE 8501 12 | 13 | # cmd for running the API 14 | CMD ["python", "-m", "streamlit", "run", "ui/webapp.py"] 15 | -------------------------------------------------------------------------------- /explore_the_world/README.md: -------------------------------------------------------------------------------- 1 | ## Explore the World 2 | 3 | This is a streamlit-based NLP application powering the [Explore the World demo](https://haystack-demo.deepset.ai), it's easy to change and extend and can be used to try out Haystack's capabilities. 4 | 5 | ![Screenshot](https://raw.githubusercontent.com/deepset-ai/haystack-demos/main/explore_the_world/screenshot.png) 6 | 7 | To get started with Haystack please visit the [README](https://github.com/deepset-ai/haystack/tree/main#key-components) or check out our [tutorials](https://haystack.deepset.ai/tutorials/first-qa-system). 8 | 9 | ## Usage 10 | 11 | The easiest way to run the application is through [Docker compose](https://docs.docker.com/compose/). 12 | From this folder, just run: 13 | 14 | ```sh 15 | docker-compose up -d 16 | ``` 17 | 18 | Docker will start three containers: 19 | - `elasticsearch`, running an Elasticsearch instance with some data pre-loaded. 20 | - `haystack-api`, running a pre-loaded Haystack pipeline behind a RESTful API. 21 | - `ui`, running the streamlit application showing the UI and querying Haystack under the hood. 22 | 23 | Once all the containers are up and running, you can open the user interface pointing your 24 | browser to [http://localhost:8501](http://localhost:8501). 25 | 26 | ## Evaluation Mode 27 | 28 | The evaluation mode leverages the feedback REST API endpoint of haystack. The user has the options 29 | "Wrong answer", "Wrong answer and wrong passage" and "Wrong answer and wrong passage" to give 30 | feedback. 31 | 32 | In order to use the UI in evaluation mode, you need an ElasticSearch instance with pre-indexed files 33 | and the Haystack REST API. You can set the environment up via docker images. For ElasticSearch, you 34 | can check out our [documentation](https://haystack.deepset.ai/usage/document-store#initialisation) 35 | and for setting up the REST API this [link](https://github.com/deepset-ai/haystack/blob/main/README. 36 | md#7-rest-api). 37 | 38 | To enter the evaluation mode, select the checkbox "Evaluation mode" in the sidebar. The UI will load 39 | the predefined questions from the file [`eval_labels_examples`](https://raw.githubusercontent.com/ 40 | deepset-ai/haystack/main/ui/ui/eval_labels_example.csv). The file needs to be prefilled with your 41 | data. This way, the user will get a random question from the set and can give his feedback with the 42 | buttons below the questions. To load a new question, click the button "Get random question". 43 | 44 | The file just needs to have two columns separated by semicolon. You can add more columns but the UI 45 | will ignore them. Every line represents a questions answer pair. The columns with the questions needs 46 | to be named “Question Text” and the answer column “Answer” so that they can be loaded correctly. 47 | Currently, the easiest way to create the file is manually by adding question answer pairs. 48 | 49 | The feedback can be exported with the API endpoint `export-doc-qa-feedback`. To learn more about 50 | finetuning a model with user feedback, please check out our [docs](https://haystack.deepset.ai/usage/ 51 | domain-adaptation#user-feedback). 52 | 53 | ![Screenshot](https://raw.githubusercontent.com/deepset-ai/haystack-demos/main/explore_the_world/screenshot_eval_mode.png) 54 | 55 | ## Query different data 56 | 57 | If you want to use this application to query a different corpus, the easiest way is to build the 58 | Elasticsearch image, load your own text data and then use the same Compose file to run all the 59 | three containers needed. This will require [Docker](https://docs.docker.com/get-docker/) to be 60 | properly installed on your machine. 61 | 62 | The build script supports the following environment variables which you can set for your 63 | own deployment: 64 | 65 | | Var | Use | 66 | | ------------------- | ------------------------------------------------------------------------------- | 67 | | DATA_IMAGE_NAME | Elastic docker image, default is `deepset/elasticsearch-countries-and-capitals` | 68 | | DATASET_DIR | Data/Corpus directory, default is `dataset` | 69 | | HAYSTACK_IMAGE_NAME | Haystack build image, default is `deepset/haystack:cpu-main` | 70 | | NETWORK | Docker network name, default is `explore_the_world` | 71 | 72 | First of all, replace all the content in the `./data/dataset` folder or create a separate directory 73 | with all of the text files you want to query and specify the `DATASET` directory. 74 | You can read about how it's better to organize your data in [this section of the Haystack docs](https://docs.haystack.deepset.ai/docs/optimization#document-length) 75 | 76 | Once the text files are in place, from the `./data` folder you can just run: 77 | ```sh 78 | DATA_IMAGE_NAME=my-docker-acct/elasticsearch-custom DATASET_DIR=dataset NETWORK=explore_the_world ./build.sh 79 | ``` 80 | 81 | This will build a new Docker image locally, pre-filled with your data. The script will start all 82 | the required services and index the text files one by one; this process might take a while, depending 83 | on the number and size of your corpus and the overall performance of your computer. 84 | 85 | ### Running your custom build 86 | 87 | Once done, modify the `elasticsearch` section in the `docker-compose.yml` file, changing this line: 88 | ```yaml 89 | image: "deepset/elasticsearch-countries-and-capitals" 90 | ``` 91 | 92 | to: 93 | 94 | ```yaml 95 | image: "my-docker-acct/elasticsearch-custom" 96 | ``` 97 | 98 | Finally, run the compose file as usual: 99 | ```sh 100 | docker-compose up 101 | ``` 102 | 103 | ## Development 104 | 105 | If you want to change the streamlit application, you need to setup your Python environment first. 106 | From a virtual environment, run: 107 | ```sh 108 | pip install -e . 109 | ``` 110 | 111 | The app requires the Haystack RESTful API to be ready and accepting connections at `http://localhost:8000`, you can use Docker compose to start only the required containers: 112 | 113 | ```sh 114 | docker-compose up elasticsearch haystack-api 115 | ``` 116 | 117 | At this point you should be able to make changes and run the streamlit application with: 118 | 119 | ``` 120 | streamlit run ui/webapp.py 121 | ``` 122 | -------------------------------------------------------------------------------- /explore_the_world/data/Dockerfile.elasticsearch: -------------------------------------------------------------------------------- 1 | FROM elasticsearch:7.17.6 2 | 3 | ENV discovery.type="single-node" 4 | ENV ES_JAVA_OPTS="-Xms1024m -Xmx1024m" 5 | 6 | HEALTHCHECK --interval=10s --timeout=1s --retries=10 CMD curl --fail http://localhost:9200/_cat/health || exit 1 7 | -------------------------------------------------------------------------------- /explore_the_world/data/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -o pipefail 4 | 5 | # Build can be customized using env vars: 6 | # 7 | # - DATA_IMAGE_NAME is the name of the Docker image containing the indexed data, it defaults 8 | # to deepset/elasticsearch-countries-and-capitals 9 | # - DATA_IMAGE_PLATFORM is the target platform, defaults to current platform if not set. It must 10 | # be a valid string that can be passed to --platform, for example linux/amd64 or linux/arm64 11 | # - DATA_IMAGE_PUSH if set, image will be pushed to Docker Hub 12 | # 13 | 14 | # STEP 0: initialize config variables 15 | : "${DATA_IMAGE_NAME:=deepset/elasticsearch-countries-and-capitals}" 16 | : "${HAYSTACK_IMAGE_NAME:=deepset/haystack:cpu-main}" 17 | : "${DATASET_DIR:=dataset}" 18 | : "${NETWORK:=explore_the_world}" 19 | 20 | if [ -z "$DATA_IMAGE_PLATFORM" ] 21 | then 22 | image_name=$DATA_IMAGE_NAME 23 | build_cmd="docker build -t $DATA_IMAGE_NAME -f Dockerfile.elasticsearch ." 24 | else 25 | # If you're building multi-platform images locally, setup docker driver before running this script, 26 | # something like: 27 | # docker buildx create --use --name multi-builder --platform linux/amd64,linux/arm64 28 | 29 | # replace any / char with _ in DATA_IMAGE_PLATFORM to use it as Docker tag 30 | image_name=$DATA_IMAGE_NAME:${DATA_IMAGE_PLATFORM//\//_} 31 | build_cmd="docker buildx build -o type=docker -t $image_name --platform $DATA_IMAGE_PLATFORM -f Dockerfile.elasticsearch ." 32 | fi 33 | 34 | # STEP 1: build the empty Elasticsearch container for the target platform 35 | echo "Building Elasticsearch container: ${build_cmd}" 36 | $build_cmd 37 | 38 | # STEP 2: create a Docker network to let Haystack talk to Elasticsearch. This is what 39 | # docker-compose does under the hood, but we do it manually in this script. The command 40 | # won't do anything if the network already exists (see the "|| true"). 41 | echo "Creating dedicated network..." 42 | docker network create ${NETWORK} || true 43 | 44 | # STEP 3: run the Elasticsearch container and wait until it can actually accept connections. 45 | echo "Running Elasticsearch..." 46 | docker rm -f elasticsearch 47 | es_id=`docker run -d --name elasticsearch -p 9200:9200 --network ${NETWORK} $image_name` 48 | until [ `docker inspect -f {{.State.Health.Status}} $es_id` = "healthy" ]; do 49 | echo "Waiting for Elasticsearch to be ready..." 50 | sleep 5; 51 | done; 52 | 53 | # STEP 4: run Haystack behind the rest_api from the official Docker image and wait for it to be ready 54 | echo "Running Haystack..." 55 | # We can use the name of the elasticsearch container as the hostname because on the same Docker network 56 | export DOCUMENTSTORE_PARAMS_HOST=elasticsearch 57 | # Select one of the default pipelines 58 | export PIPELINE_YAML_PATH=/opt/venv/lib/python3.10/site-packages/rest_api/pipeline/pipelines_dpr.haystack-pipeline.yml 59 | # Increase the timeout to account for the first request that needs more time to setup the models 60 | export GUNICORN_CMD_ARGS="--timeout=300" 61 | hs_id=`docker run -d -p 8000:8000 --network ${NETWORK} -e "DOCUMENTSTORE_PARAMS_HOST=${DOCUMENTSTORE_PARAMS_HOST}" -e "PIPELINE_YAML_PATH=${PIPELINE_YAML_PATH}" ${HAYSTACK_IMAGE_NAME}` 62 | until [ "`curl -s --fail --max-time 1 http://localhost:8000/health || exit 0`" != "" ]; do 63 | echo "Waiting for Haystack to be ready..." 64 | sleep 5; 65 | docker logs --since=2s $hs_id 66 | done; 67 | 68 | # STEP 5: upload all the .txt files in the ./dataset folder 69 | echo "Uploading dataset..." 70 | for filename in ${DATASET_DIR}/*.txt; do 71 | [ -e "$filename" ] || continue 72 | echo "Uploading $filename..." 73 | curl -s -X POST -H 'Accept: application/json' -F files="@$PWD/$filename" http://127.0.0.1:8000/file-upload > /dev/null 74 | done 75 | 76 | # STEP 6: stop the containers, we're done 77 | echo "Stopping containers..." 78 | docker stop $es_id 79 | docker stop $hs_id 80 | 81 | # STEP 7: make the changes to the Elasticsearch image persistent so we don't need to re-index the dataset 82 | # again 83 | echo "Saving changes to a new Docker image..." 84 | docker commit $es_id $image_name 85 | docker image ls --digests 86 | 87 | # STEP 8: push the image to Docker Hub, authentication is needed 88 | if [ ! -z "$DATA_IMAGE_PUSH" ] 89 | then 90 | echo "Pushing $image_name to Docker Hub..." 91 | docker push $image_name 92 | fi 93 | 94 | echo "Done" 95 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/103_Anbar__town_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | '''Anbar''' (, ,) also known by its original ancient name, '''Peroz-Shapur''' (), was an ancient and medieval town in central Iraq. It played a role in the Roman–Persian Wars of the 3rd–4th centuries, and briefly became the capital of the Abbasid Caliphate before the founding of Baghdad in 762. It remained a moderately prosperous town through the 10th century, but quickly declined thereafter. As a local administrative centre, it survived until the 14th century, but was later abandoned. 6 | 7 | Its ruins are near modern Fallujah. The city gives its name to the Al-Anbar Governorate. 8 | 9 | == History == 10 | === Origins === 11 | Assyrian wall relief showing a scribe and a horseman trampling enemies. From Anah, al-Anbar Governorate, Iraq. 9th-7th century BCE. Iraq Museum 12 | The city is located on the left bank of the Middle Euphrates, at the junction with the Nahr Isa canal, the first of the navigable canals that link the Euphrates to the River Tigris to the east. The origins of the city are unknown, but ancient, perhaps dating to the Babylonian era and even earlier: the local artificial mound of Tell Aswad dates to . 13 | 14 | === Sasanian period === 15 | The town was originally known as '''Misiche''' (Greek: ), '''Mesiche''' (), or '''Massice''' ( mšyk; mšyk). As a major crossing point of the Euphrates, and occupying the northernmost point of the complex irrigation network of the Sawad, the town was of considerable strategic significance. As the western gate to central Mesopotamia, it was fortified by the Sasanian ruler Shapur I () to shield his capital, Ctesiphon, from the Roman Empire. After his decisive defeat of the Roman emperor Gordian III at the Battle of Misiche in 244, Shapur renamed the town to '''Peroz-Shapur''' (''Pērōz-Šāpūr'' or ''Pērōz-Šābuhr'', from , meaning "victorious Shapur"; in ; in ). It became known as '''Pirisapora''' or '''Bersabora''' () to the Greeks and Romans. 16 | 17 | The city was fortified by a double wall, possibly through the use of Roman prisoner labour; it was sacked and burned after an agreement with its garrison in March 363 by the Roman emperor Julian during his invasion of the Sasanian Empire. It was rebuilt by Shapur II. By 420, it is attested as a bishopric, both for the Church of the East and for the Syriac Orthodox Church. The town's garrison was Persian, but it also contained sizeable Arab and Jewish populations. Anbar was adjacent or identical to the Babylonian Jewish center of Nehardea (), and lies a short distance from the present-day town of Fallujah, formerly the Babylonian Jewish center of Pumbedita (). 18 | 19 | === Islamic period === 20 | The city fell to the Rashidun Caliphate in July 633, after a fiercely fought siege. The Arabs retained the name (''Fīrūz Shābūr'') for the surrounding district, but the town itself became known as '''Anbar''' (Middle Persian word for "granary" or "storehouse") from the granaries in its citadel, a name that had appeared already during the 6th century. According to Baladhuri, the third mosque to be built in Iraq was erected in the city by Sa'd ibn Abi Waqqas. Ibn Abi Waqqas initially considered Anbar as a candidate for the location of one of the first Muslim garrison towns, but the fever and fleas endemic in the area persuaded him otherwise. 21 | 22 | According to medieval Arabic sources, most of the inhabitants of the town migrated north to found the city of Hdatta south of Mosul. The famous governor al-Hajjaj ibn Yusuf cleared the canals of the city. 23 | 24 | Abu'l-Abbas as-Saffah (), the founder of the Abbasid Caliphate, made it his capital in 752, constructing a new town half a ''farsakh'' () to the north for his Khurasani troops. There he died and was buried at the palace he had built. His successor, al-Mansur (), remained in the city until the founding of Baghdad in 762. The Abbasids also dug the great Nahr Isa canal to the south of the city, which carried water and commerce east to Baghdad. Thee Nahr al-Saqlawiyya or Nahr al-Qarma canal, which branches off from the Euphrates to the west of the city, is sometimes erroneously held to be the Nahr Isa, but it is more likely that it is to be identified with the pre-Islamic Nahr al-Rufayl. 25 | 26 | It continued to be a place of much importance throughout the Abbasid period. Caliph Harun al-Rashid () stayed at the town in 799 and in 803. The town's prosperity was founded on agricultural activities, but also on trade between Iraq and Syria. The town was still prosperous in the early 9th century, but the decline of Abbasid authority during the later 9th century exposed it to Bedouin attacks in 882 and 899. In 927, the Qarmatians under Abu Tahir al-Jannabi sacked the city, and the devastation was compounded by another Bedouin attack two years later. The town's decline accelerated after that: while the early 10th-century geographer Istakhri still calls the town modest but populous, with the ruins of the buildings of as-Saffah still visible, Ibn Hawqal and al-Maqdisi, who wrote a generation later, attest to its decline, and the diminution of its population. 27 | 28 | The town was sacked again in 1262 by the Mongols under Kerboka. The Ilkhanids retained Anbar as an administrative centre, a role it retained until the first half of the 14th century; the Ilkhanid minister Shams al-Din Juvayni had a canal dug from the city to Najaf, and the city was surrounded by a wall of sun-dried bricks. 29 | 30 | == Ecclesiastical history == 31 | Anbar used to host an Assyrian community from the fifth century: the town was the seat of a bishopric of the Church of the East. The names of fourteen of its bishops of the period 486–1074 are known, three of whom became Chaldean Patriarchs of Babylon. 32 | * Narses 33 | * Simeon 34 | * Salibazachi 35 | * Paul 36 | * Theodosius 37 | * John 38 | * Enos 890 39 | * Elias 40 | * Jaballaha 41 | * Sebarjesus 42 | * Elias II 43 | * Unnamed bishop 44 | * Mundar 45 | * Maris 46 | * Zacharias 47 | 48 | === Titular see === 49 | Anbar is listed by the Catholic Church as a titular see of the Chaldean Catholic Church, established as titular bishopric in 1980. 50 | 51 | It has had the following incumbents: 52 | * Titular Archbishop Stéphane Katchou (1980.10.03 – 1981.11.10), as Coadjutor Archeparch of Bassorah of the Chaldeans (Iraq) (1980.10.03 – 1981.11.10) 53 | * Titular Bishop Ibrahim Namo Ibrahim (1982.01.11 – 1985.08.03), as Apostolic Exarch in the United States of America (1982.01.11 – 1985.08.03) 54 | * Titular Bishop Shlemon Warduni (since 2001.01.12), Curial Bishop of the Chaldean Catholic Church 55 | 56 | == Today == 57 | It is now entirely deserted, occupied only by mounds of ruins, whose great number indicate the city's former importance. Its ruins are northwest of Fallujah, with a circumference of some . The remains include traces of the late medieval wall, a square fortification, and the early Islamic mosque. 58 | 59 | == Citations == 60 | 61 | 62 | == General sources == 63 | * 64 | * 65 | * 66 | * 67 | * 68 | * 69 | * GCatholic, with titular incumbent biography links 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/120_Gitega.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | '''Gitega''' (), formerly '''Kitega''', is the capital of Burundi. Located in the centre of the country, in the Burundian central plateau roughly east of Bujumbura (the largest city and former capital), Gitega (the second largest city) was the seat of the Kingdom of Burundi until its abolition in 1966. In late December 2018, Burundian president Pierre Nkurunziza announced that he would follow on a 2007 promise to return Gitega its former political capital status, with Bujumbura remaining as economic capital and centre of commerce. A vote in the Parliament of Burundi made the change official on 16 January 2019, with all branches of government expected to move in over three years. 6 | 7 | ==Geography== 8 | Gitega is also the capital of Gitega Province, one of the eighteen provinces of Burundi. It is located in the middle of the country, at roughly the same distance between the commercial capital, Bujumbura on Lake Tanganyika to the west, the Tanzanian border to the east—both at around —and the Rwandan border, about to the north. 9 | It lies on a broad plateau surrounded by hills, a few kilometres southwest of the confluence of the Ruvyironza and Rurubu Rivers. Ruvubu National Park, the country's biggest, lies to the east. 10 | 11 | ==History== 12 | A street in Gitega 13 | 14 | Gitega was at one time the seat of the Kingdom of Burundi and remained as capital of the kings of Burundi (''mwami'') until 1966. 15 | 16 | The Germans founded the town of Gitega in 1912. 17 | 18 | In March 2007, President of Burundi Pierre Nkurunziza announced that Burundi was planning to bring back its capital city to Gitega, saying that it is in a better location for a capital than Bujumbura. 19 | 20 | On 24 December 2018, it was announced by Nkurunziza that Gitega was to become the capital city of Burundi, pending only Parliament approval. The expected parliamentary assent (given the President's CNDD-FFD party comfortable majority in both chambers) arrived through a vote on 16 January 2019, with some ministries already starting the move two days later. 21 | 22 | == Education == 23 | The Polytechnic University of Gitega was founded in 2014. 24 | 25 | ==Culture== 26 | It is the home of Burundi's National Museum of Gitega. Several ''karyenda'' royal drum sanctuaries are located in the area, as well as the ''ibwami'' (royal court). On 29 April 1972, Ntare V of Burundi, the country's last ''Mwami'' (King), was killed in Gitega. 27 | 28 | == Places of worship == 29 | Among the places of worship, they are predominantly Christian churches and temples: Roman Catholic Archdiocese of Gitega (Catholic Church), Province of the Anglican Church of Burundi (Anglican Communion), Union of Baptist Churches in Burundi (Baptist World Alliance), Assemblies of God. There are also Muslim mosques. 30 | 31 | ==Transportation== 32 | Gitega was served by Gitega Airport, which is now defunct. Gitega is served by four National Roads (''Routes Nationales'', RN): RN2 connects it with Bujumbura through the northwest, via Muramvya and Bujumbura Rural provinces. RN15 leads to the north of country, towards Ngozi and continuing on to Rwanda, while passing through the ancient royal court of Gishora; RN12, which separates from RN15 on the outskirts of Gitega, heads northeast to serve the provinces of Karuzi and Muyinga. The last is RN3, which heads towards the southwest towards Rumonge and Lake Tanganyika. 33 | 34 | ==See also== 35 | 36 | *Commune of Gitega 37 | 38 | ==Notes== 39 | 40 | 41 | ==References== 42 | 43 | 44 | ==Further reading== 45 | * 46 | 47 | ==External links== 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/126_Bairiki.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | '''Bairiki''' is a settlement in South Tarawa of Kiribati. The State House, the National Stadium, the High Commissions of Australia and New Zealand as well as the embassy of China, and most of the Government Ministries are based in Bairiki. Bairiki is administered by the '''Teinainano Urban Council''' or '''TUC'''. As at the 2010 Census the population of Bairiki was 3,524. 4 | 5 | ==Overview== 6 | Bairiki was sometimes considered the capital of Kiribati because at one time both the Parliament and the Presidency (and main administrative offices) were located there. However Parliament moved to Ambo in 2000, and the various ministries are scattered throughout South Tarawa, from Betio to Bikenibeu. 7 | 8 | == Geography == 9 | Bairiki is an islet near the Western end of South Tarawa. It is joined to Betio by the Nippon Causeway, which opened in 1989, and is also joined to Naanekai by a causeway, forming part of a continuous road which links South Tarawa from Betio in the West to Bonriki International Airport in the East. 10 | 11 | Bairiki is a small islet, with a land area of less than half a square km. Much of the land is occupied by the Government itself, including the Bairiki National Stadium and the main offices of many of the Government ministries, and by foreign High Commissions with their associated residences. The village community of Bairiki lives in very crowded conditions, and rapid population growth is causing significant problems. 12 | 13 | ==Education== 14 | 15 | King George V School, a secondary school for boys, opened in Bairiki in 1922. It later moved to Abemama. 16 | 17 | ==Transport== 18 | 19 | The city has road connections to Betio and Nanikai 20 | 21 | 22 | 23 | 24 | 25 | Census 26 | 27 | 1978 28 | 29 | 2005 30 | 31 | 2010 32 | 33 | 34 | 35 | Bairiki 36 | 37 | 1,956 38 | 39 | 2,766 40 | 41 | 3,524 42 | 43 | 44 | 45 | == See also == 46 | *Bairiki National Stadium 47 | 48 | == References == 49 | 50 | 51 | == External links == 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/128_Avarua.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | '''Avarua''' (meaning "Two Harbours" in Cook Islands Māori) is a town and district in the north of the island of Rarotonga, and is the national capital of the Cook Islands. 7 | 8 | The town is served by Rarotonga International Airport (IATA Airport Code: RAR) and Avatiu Harbour. 9 | 10 | The population of Avarua District is 4,906 (census of 2016). 11 | 12 | ==Sub-districts== 13 | 14 | 15 | 16 | CICC church 17 | 18 | 19 | 20 | Main street of Avarua looking towards the Bank of the Cook Islands (BCI) building (director is Vaine Nooana-Arioka) 21 | 22 | 23 | 24 | The district of Avarua is subdivided into 19 tapere (traditional sub-districts) out of 54 for Rarotonga, grouped into 6 Census Districts, listed from west to east. Census figures are not available on the tapere level, but only for the so-called Census Districts, also listed from west to east: 25 | 26 | # Nikao-Panama (1,373 inhabitants), covering the taperes of: 27 | ## Pokoinu, 28 | ## Nikao (seat of Cook Islands parliament), and 29 | ## Puapuautu; 30 | # Avatiu-Ruatonga (951 inhabitants), covering the taperes of: 31 | ## Areanu, 32 | ## Kaikaveka, 33 | ## Atupa, 34 | ## Avatiu (commercial port), and 35 | ## Ruatonga; 36 | # Tutakimoa-Teotue (314 inhabitants), covering the tapere of: 37 | ## Tutakimoa; 38 | # Takuvaine-Parekura (786 inhabitants), covering the taperes of: 39 | ## Tauae 40 | ## Takuvaine (downtown Avarua, seat of Cook Islands government, with Avarua fishing harbour) 41 | # Tupapa-Maraerenga (531 inhabitants), covering the taperes of: 42 | ## Ngatipa, and 43 | ## Vaikai; 44 | # Pue-Matavera (1,490 inhabitants), covering the taperes of: 45 | ## Tapae-I-Uta, 46 | ## Tapae 47 | ## Pue, 48 | ## Punamaia, 49 | ## Kiikii, and 50 | ## Tupapa. 51 | 52 | ==Climate== 53 | Avarua has a tropical rainforest climate (''Af'') according to the Köppen climate classification with high temperatures and rainfall throughout the year. Although there are no true wet or dry seasons, there is a noticeably wetter stretch from December to April. 54 | 55 | 56 | 57 | ==References== 58 | 59 | 60 | ==External links== 61 | * 62 | * Photo of Government Radio Station Rarotonga c1950 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/129_Road_Town.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | '''Road Town''', located on Tortola, is the capital of the British Virgin Islands. It is situated on the horseshoe-shaped Road Harbour in the centre of the island's south coast. The population was about 15,000 in 2018. 5 | 6 | The name is derived from the nautical term "the roads", a place less sheltered than a harbour but which ships can easily get to. A development called Wickham's Cay, consisting of two areas that were reclaimed from the sea and a marina, have enabled Road Town to emerge as a haven for yacht chartering and a centre of tourism. This area is the newest part of the city and the hub for the new commercial and administrative buildings of the BVI. The oldest building in Road Town, HM Prison on Main Street, was built in 1774. 7 | 8 | ==Climate== 9 | 10 | 11 | The British Virgin Islands enjoy a tropical climate, moderated by trade winds. Temperatures vary little throughout the year. In the capital, Road Town, typical daily maxima are around in the summer and in the winter. Typical daily minima are around in the summer and in the winter. Rainfall averages about per year, higher in the hills and lower on the coast. Rainfall can be quite variable, but the wettest months on average are September to November and the driest months on average are February and March. Hurricanes occasionally hit the islands, with the hurricane season running from June to November. 12 | 13 | 14 | 15 | ==Transportation and tourism== 16 | Road Town is one of the principal centres for bareboating (self-hire yacht chartering) in the Caribbean. Many successful yacht-charter businesses operate from Road Town. Cruise ships can be often seen docked here as well. 17 | 18 | The Harbour is a popular jumping-off point for many of the ferries servicing the island. The ferry terminal is located at the north-west end of Road Town. Ferries run during the day every day of the week, but rarely at night: it is important to consult an up-to-date ferry timetable in advance. 19 | 20 | Road Town is served by the British Virgin Islands' only major airport, Terrance B. Lettsome International Airport (IATA: EIS, ICAO: TUPJ), at Beef Island, within a short drive of the city. Only short haul flights are available from this airport, long-distance flights are served by Cyril E. King Airport in the US Virgin Islands (IATA: STT ICAO: TIST). 21 | 22 | "Buses" in Tortola refers to full-sized passenger vans or large modified open-air pick-up trucks with bench seating and a canvas top: these are known locally as "safaris". Traveling by bus can be less expensive than having a taxi to oneself, and is often an option when travelling from the airport to Road Town, or from town to either end of the island. 23 | 24 | ==History== 25 | 26 | On 1 August 1834, the Slavery Abolition Act was read at the Sunday Morning Well. 27 | 28 | In 1853, a town-wide fire destroyed nearly every building in Road Town. The fire spread because of angry rioters who protested an increase on the cattle tax. Rioters eventually set fire to most of the plantations across the island. 29 | 30 | On September 4, 2017, the most intense tropical cyclone to hit the British Virgin Islands, Hurricane Irma, hit and devastated the islands leaving behind multiple casualties . 31 | 32 | ==Geographical limits== 33 | There is some ambiguity as to the precise geographical extent of Road Town. Approaching the town from the west, a sign at the bottom of Slaney Hill greets visitors to Road Town. But traditionalists assert that the town itself only starts from Road Reef and Fort Burt, and that Prospect Reef Hotel (which covers almost all the land in between) is not technically in Road Town. 34 | 35 | Approaching Road Town from the east, there is similar ambiguity if Road Town begins at the Port Purcell roundabout below Fort George, or whether it also includes Baughers' Bay. 36 | 37 | Fort Burt and Fort George were the historical markers of the western and eastern limits of the town which benefitted from the protection of the Crown. 38 | 39 | ==Gallery== 40 | 41 | 42 | ==See also== 43 | * Government House, the official residence of the Governor of the British Virgin Islands located in Road Town 44 | 45 | ==Notes== 46 | 47 | 48 | ==External links== 49 | 50 | 51 | * article from Encyclopædia Britannica 52 | * Real Travel/Frommer's Travel Guide to Road Town 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/130_Alofi.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | '''Alofi''' is the capital of the Pacific Ocean island nation of Niue. With a population of 597 in 2017, Alofi has the distinction of being the second smallest national capital city in terms of population (after Ngerulmud, capital of Palau). It consists of the two villages: '''Alofi North''' and '''Alofi South''' where the government headquarters are located. 7 | 8 | ==History== 9 | In January 2004, Niue was hit by the fierce tropical storm Cyclone Heta which killed two people and did extensive damage to the entire island. Many of Alofi's buildings were destroyed, including the hospital. Government buildings were shifted to a less exposed site inland from the west coast, named '''Fonuakula''', after the storm. This site is still within the village boundaries of Alofi South. 10 | 11 | ==Geography== 12 | ===Overview=== 13 | It is located at the centre of Alofi Bay on the west coast of the island, close to the only break in the coral reef that surrounds Niue. The bay stretches for 30% of the island's length (about seven kilometres) from Halagigie Point in the south to Makapu Point in the north. 14 | 15 | The council's territory borders with Avatele, Hakupu, Lakepa, Liku, Makefu, Mutalau, Tamakautoga and Tuapa. 16 | 17 | ===Climate=== 18 | 19 | Alofi features a tropical rainforest climate under the Köppen climate classification, with no discernible dry season. The city has a noticeably drier stretch from June through September. However, all of these months average more than of rain, the limit for a dry season month. Average temperatures vary slightly throughout the course of the year in Alofi hovering at around , during the warmest month (February) and at around during the coolest months (July and August) . 20 | 21 | 22 | ==Transport== 23 | The town is serviced by Niue International Airport, and there are numerous roads, both paved and dirt, that crisscross the town. 24 | 25 | ==Personalities== 26 | *Dalton Tagelagi (b. 1968), politician 27 | *Sam Pata Emani Tagelagi (1935–2011), politician 28 | 29 | ==See also== 30 | *Niue High School 31 | *List of villages in Niue 32 | *Huanaki Cultural Centre & Museum 33 | 34 | ==References== 35 | ===Notes=== 36 | 37 | 38 | ===Sources=== 39 | * 40 | * 41 | * 42 | * 43 | 44 | ==External links== 45 | 46 | * History of Niue 47 | * Cyclone aftermath pictures 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/131_Fakaofo.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | '''Fakaofo''', formerly known as ''Bowditch Island'', is a South Pacific Ocean atoll located in the Tokelau Group. The actual land area is only about 3 km2 (1.1 sq mi), consisting of islets on a coral reef surrounding a central lagoon of some 45 km2. According to the 2006 census 483 people officially live on Fakaofo (however just 370 were present at census night). Of those present 70% belong to the Congregational Church and 22% to the Catholic Church. 4 | 5 | == Geography and government == 6 | Village square 7 | The main settlement on the island is Fale on Fale Islet, towards the western side of the atoll. Located two kilometres to the west of it is the relatively large Fenua Fala Islet, where a second settlement was established in 1960. Other islets in the group include Teafua, Nukumatau, Nukulakia, Fenua Loa, Saumatafanga, Motu Akea, Matangi, Lalo, and Mulifenua. 8 | 9 | Fakaofo's Council of Elders is made up of citizens over the age of 60. 10 | 11 | ==History== 12 | Natives of Fakaofo; engraving after a drawing by Alfred Thomas Agate 13 | The island was sighted by the whale ship ''General Jackson'' in 1835, which returned in 1839. 14 | 15 | The island was named ''Bowditch'' (after Nathaniel Bowditch), this island was visited by the American ship which was part of the first American voyage of discovery – The United States Exploring Expedition (also known as "the Ex Ex" or "the Wilkes Expedition"), 1838–1842, United States Navy Lieutenant Charles Wilkes commanding. Nathaniel Bowditch (1773–1838) was a noted American navigator who wrote a famous two-volume encyclopedia of navigation and sailing that is still used and published today by the Defense Mapping Agency Topographic Center (DMATC). 16 | In ''Twenty Years Before The Mast'', Charles Erskine wrote "The people found on this island had no knowledge of fire, which I believe, is the only instance of the kind on record." 17 | 18 | In a village on the island is a coral slab monument personifying Tui Tokelau, a god once worshiped in the islands. 19 | 20 | Between 1856 and 1979, the United States claimed that it held sovereignty over the island and the other Tokelauan atolls. In 1979, the U.S. conceded that Tokelau was under New Zealand sovereignty, and a maritime boundary between Tokelau and American Samoa was established by the Treaty of Tokehega. 21 | 22 | ==Climate crisis== 23 | Five metre high concrete walls surround one of Fakaofo's atolls, that were constructed by residents to protect the islet from rising sea levels. 24 | 25 | ==List of islands== 26 | 27 | # Mulifenua 28 | # Vini 29 | # Motu Pelu 30 | # Avaono 31 | # Talapeka 32 | # Te Lafu 33 | # Olokalaga 34 | # Palea 35 | # Manumea 36 | # Ofuna 37 | # Kavivave 38 | # Heketai 39 | # Motuloa 40 | # Motu Akea 41 | # Motu Iti 42 | # Niue 43 | # Fugalei 44 | # Manuafe 45 | # Otafi Loto 46 | # Otafi Loa 47 | # Kaivai 48 | # Nukuheheke 49 | # Nukamahaga Lahi 50 | # Nukamahaga Iti 51 | # Tenki 52 | # Pagai 53 | # Matakitoga 54 | # Vaiaha 55 | # Falatutahi 56 | # Lapa 57 | # Hugalu 58 | # Logotaua 59 | # Tafolaelo 60 | # Otano 61 | # Akegamutu 62 | # Te Loto 63 | # Kapiomotu 64 | # Metu 65 | # Hakea Mahaga 66 | # Pukava 67 | # Hakea 68 | # Te Kau Afua o Humu 69 | # Nukulakia 70 | # Te Papaloa 71 | # Pataliga 72 | # Nukumatau 73 | # Fale 74 | # Te Afua tau Lua 75 | # Fenua Fala 76 | 77 | 78 | == Notes == 79 | 80 | 81 | ==See also== 82 | *List of Guano Island claims 83 | 84 | ==References== 85 | 86 | * Pacific Island travel 87 | 88 | ==External links== 89 | 90 | * Fakaofo - Chiefly island of Tokelau 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/132_King_Edward_Point.txt: -------------------------------------------------------------------------------- 1 | 2 | Southeast view from Cumberland East Bay, with Grytviken in the left background 3 | '''King Edward Point''' (also known as '''KEP''') is a permanent British Antarctic Survey research station on South Georgia island and is the capital of the British Overseas Territory of South Georgia and the South Sandwich Islands. It is situated in Cumberland East Bay on the northeastern coast of the island. The settlement is the smallest capital in the world by population. It is sometimes confusingly referred to as Grytviken, which is the site of the disused whaling station, nearby at the head of King Edward Cove. 4 | 5 | ==History== 6 | 7 | 8 | The area was explored by the Swedish Antarctic Expedition of 1901-04 under Otto Nordenskiöld. It was named around 1906 after King Edward VII of the United Kingdom. Since 1909, King Edward Point has been the residence of a British Magistrate administering the island. In 1925, the government of the United Kingdom established Discovery House, a marine laboratory for Discovery Investigations. 9 | 10 | ==Research station== 11 | On 1 January 1950, the station ownership was assumed by the Falkland Islands Dependencies Survey. The station was manned from 1 January 1952 to 13 November 1969. The British Antarctic Survey provided the British presence at the station until 1982. 12 | 13 | At the beginning of the Falklands War on 3 April 1982, Argentine forces occupied South Georgia and closed the station. They were soon expelled during Operation Paraquet later the same month and British military forces retook the point. A series of civilian Marine Officers was appointed to carry out customs and fisheries duties for the South Georgia Government from 1991, and were billeted with the small garrison. 14 | 15 | On 22 March 2001, the British Antarctic Survey reopened the station on behalf of the Government of South Georgia and the South Sandwich Islands (GSGSSI). Most of the old, dilapidated (and arguably historic) buildings were destroyed to make way for new ones, with the exception of Discovery House (1925) and the Gaol (1912). 16 | 17 | Currently twelve BAS personnel overwinter at the station, rising to around 22 in summer. Two Government Officers plus partners are stationed on KEP, overlapping by about three months during the busy winter fishing season. Summer staff from the Museum at Grytviken are also accommodated at KEP. 18 | 19 | The continued occupation of the station serves a political purpose as well: it helps to maintain British sovereignty against Argentina's claim for ownership of the territory. 20 | 21 | The chief activities of the station are applied fisheries research on behalf of the Government of South Georgia and South Sandwich Islands, to assist its policies for sustainable management of the commercial fishery, and to provide logistic support for the Government Officer(s). 22 | ==See also== 23 | * List of Antarctic research stations 24 | * List of Antarctic field camps 25 | 26 | ==References== 27 | 28 | 29 | ==External links== 30 | 31 | 32 | * King Edward Point 33 | * British Antarctic Survey Research Station King Edward Point, South Georgia 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/133_Flying_Fish_Cove.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 250px 4 | '''Flying Fish Cove''' (, ) is the capital city and main settlement of Australia's Christmas Island. Although it was originally named after British survey-ship ''Flying-Fish'', many maps simply label it "'''The Settlement'''". It was the first British settlement on the island, established in 1888. 5 | 6 | About a third of the territory's total population of 1,600 lives in Flying Fish Cove, which lies near the north-eastern tip of the island. There is a small harbour which serves tourists with yachts. It is possible to carry out recreational diving at the settlement's beach.Map of Christmas Island showing the location of Flying Fish Cove 'The Settlement' 7 | 8 | == Heritage == 9 | 10 | The settlement is listed on the Australian Commonwealth Heritage List, citing the following aspects of significance: 11 | :The buildings that make up the residential precinct are of architectural significance, relatively intact and display considerable unity in a style derived from the British experience in Singapore/Malaya. This unity combines with consistent garden planting and ornamentation and the linear nexus of Gaze Road to create a strong streetscape. The presence of semi-detached servants' quarters are also of historic importance and are indicative of the social and economic stratification which prevailed on the island during the colonial period. The residential area is also historically significant as a reminder of the phase of Christmas Island history when the island came under the control of the British Phosphate Commission and the mining industry and the supporting community, underwent substantial expansion. The Services precinct is of social and historic significance. It includes a number of early Chinese terraced houses as well as a range of structures representing each of the various phases of phosphate mining, including one of the oldest structures on the Island. It was also the Island's main meeting place where Asian workers and European staff came together through a common reliance on retail, health, recreational and other services. The precinct contains a number of buildings of special significance to the community and, along with the three cemeteries, strongly reflects the mixed racial origins of the Island. 12 | 13 | The historic Malay Kampong precinct within the town, the Industrial and Administrative Group precinct overlooking the town and the Administrator's House 1.5 km east of the town are also listed on the Commonwealth Heritage List. 14 | 15 | ==References== 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/135_Kingston__Norfolk_Island.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | '''Kingston''' (Norf'k: ''Daun a'Taun'') is the administrative centre of the Australian external territory of Norfolk Island. The Norfolk Island Regional Council is based in Kingston. The settlement is the second-oldest in Australia, founded a little over a month after Sydney. It is part of the Kingston and Arthur's Vale Historic Area World Heritage site. 5 | 6 | ==Geography== 7 | Kingston is located on the east–west aligned Kingston Plain which rises from the coast to about above sea level in the foothills of the Kingston escarpment. The plain is long by about wide, with calcareous lime sands to the south along the coast and basaltic clays to the north along the foothills. The western end of the plain is marked by the high Flagstaff Hill. Watermill Creek traverses the plain after leaving Arthur's Vale to the north-west, and is joined by Town Creek and several minor tributaries to form the Kingston swamps before draining into Emily Bay. Most of the accessible beaches on the island are located along the Kingston foreshores. Southwards, Emily Bay and Slaughter Bay open into the Kingston lagoon and reefs and the broad expanse of Sydney Bay. Eastwards, Cemetery Bay opens directly into the South Pacific Ocean. 8 | 9 | == History == 10 | The town was founded on 6 March 1788 by Lieutenant Philip Gidley King and 22 settlers (including 9 male and 6 female convicts) who landed that day from ''HMS Supply''. They had sailed from Port Jackson just a few weeks after the establishment of the British colony of New South Wales. The settlement was initially known as Sidney or Sydney Bay, and by 1796 was being called the Town of Sydney, in honour of Viscount Sydney, British Home Secretary and patron of the First Fleet. King established a house on the hill over the town, but the mass of roots in the ground caused him to call it "rooty hill", which name was also later transferred to Rooty Hill, New South Wales when King later established a house there. 11 | 12 | == Urban form == 13 | The old town dating from 1788 occupies several winding irregular lanes at the head of Kingston Pier. The modern town, as laid out by the Royal Engineers during the 1830s, consists of a Roman-style grid plan. There are two long east west roads: Bay Street along the foreshore and Quality Row, the town's principal thoroughfare, along the foothills. These two boulevards are connected by short cross streets of Pier Street, Bounty Street, and the former Bligh Street (now part of the drive to Government House). Stone bridges carry these streets across Watermill Creek. Four roads wind upcountry from the edges of the grid: Country Road, Middlegate Road, Rooty Hill Road, and Driver Christian Road. All the buildings are located either in the old town or along the Quality Row, with the exception of Government House which is located on a small knoll called Dove's Plot Hill. The middle and west of the plain forms the Kingston Common and Kingston Recreation Ground, with the golf links occupying the eastern end, and Kingston Cemetery in the northeast. This broad greensward with the Kingston swamp in its centre separates the two long boulevards. 14 | 15 | == Municipal governance == 16 | Municipal government functions on Norfolk Island are the responsibility of the Norfolk Island Regional Council, based in the New Military Barracks in Kingston. 17 | 18 | == Nearby towns and hamlets== 19 | The town of Burnt Pine, the main commercial and population centre of the island, is about to the northwest, and the hamlet of Middlegate is about to the north. The uninhabited Nepean Island and Phillip Island are prominent in the sea view from Kingston. 20 | 21 | == Notable sites in Kingston and nearby == 22 | * Causeway to ''HMS Sirius'' wrecksite, 1790 (exposed at low tide) 23 | * Marine Barracks 1792, now Civil Hospital ruins 1831 24 | * Swamp Canal 1795 25 | * Stone building 1796, now the Guardhouse 1826 26 | * Government House 1804 27 | * Piper's Boatshed 1808, now the Double Boatshed 1826 28 | * Kingston Cemetery 1825 29 | * Commissariat Granary 1827, now the Crankmill ruin 30 | * Prisoner's Barracks 1829, now the Compound 1960s 31 | * The Officer's Bath 1832 32 | * Old Military Barracks 1832, home of the Legislative Assembly 1979-2005 33 | * Bounty Street Bridge 1832 34 | * Pier Street Bridge 1834 35 | * Commissariat Store 1835, now All Saints Church 1874 36 | * New Military Barracks 1836, now the Administration Offices 1926 37 | * Kingston Pier 1839 38 | * New Gaol ruins 1847 39 | * Salt House ruins 1848 40 | * Royal Engineer's Office 1851, now REO Cafe 1984 41 | * Queen Elizabeth Lookout 1974 42 | * Kingston Common 43 | * Emily Bay 44 | * Slaughter Bay 45 | * Cemetery Bay 46 | * Lone Pine and Point Hunter 47 | * Flagstaff Hill 48 | * Arthur's Vale 49 | 50 | == Gallery == 51 | 52 | File:Norfolk Island jetty2.jpg|Kingston Pier, with launch towing a lighter with cargo from ship moored off-shore 53 | File:Norfolk Island Kingston.jpg|Old lighters at the Kingston boatsheds 54 | File:Norfolk Island jetty.jpg|Crane on Kingston Pier unloading cargo from a lighter 55 | 56 | 57 | == References == 58 | 59 | 60 | == External links == 61 | 62 | * Kingston and Arthurs Vale Historic Area 63 | * Kingston 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/138_Mata_Utu.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | '''Mata Utu''' (; ʻUvean: '''Matāutu''', ) is the capital city of Wallis and Futuna, an overseas collectivity of France. It is located on the island of Uvéa (Uvea), in the district of Hahake, of which it is also the capital. It is one of two ports in Wallis and Futuna, the other being at Leava on Futuna. Hihifo Airport, the main airport accessing the island and city, is to the northwest. Its population was 1,029 in 2018, up from 815 in 1998. 5 | 6 | The most prominent landmarks in the town are the Matâ'Utu Cathedral, the palace next to it and backdrop of the Mt. Lulu Fakahega where there is an old chapel. 7 | 8 | ==History== 9 | In medieval times, Tuʻi Tonga invaders waged war against the islanders and took control. They installed their first chief and called him the Uveas which became ruling dynasty of the two islands; they are based at Mata-Utu even today. The fortifications which were built by the Tongans at that time have been unearthed at nearby Talierumu and Malama Tagata, during recent archaeological excavations of the area. 10 | 11 | Catholic missionaries who came to the island in 1837 ensured that the entire population of the islands was converted to Christianity in a short period of 5 years. During this period, the missionaries not only protected the islanders from the highhandedness of the Europeans but also ensured that a number of churches were built not only at Mata-Utu but also at Mu’a and Vaitupu islands. 12 | 13 | When the Mata-Utu was developed into a town from a small native village by the French who built most of Wallis and Futuna's major facilities here. Historically, pigs, poultry, yams, bananas, and coconut were available to arriving boats. During World War II, the Free French sloop ''Chevreuil'' landed a detachment of French Marines at Mata-Utu. A small battle took place here after which they captured Vichy French dissidents and took the island's radio communication centre. Francis Fox Parry of the 1st Battalion of the 11th Marines also landed here. 14 | 15 | ==Geography== 16 | Mata-Utu is the largest urban centre on Wallis Island, which lies between Tahiti and Nouméa. Uvea or Wallis island with Mata’Utu as its capital has an area of 60 km2 and is part of the larger Wallis archipelago. It is surrounded by coral reefs. Mata’Utu is the administrative headquarters and business capital of the Wallis islands. It is located on the eastern coast, along the main coast road RT1. The north-south RT1 and RT3, coming from the west, intersect in the town centre. Mata-Utu is one of two ports in Wallis and Futuna, the other being at Leava. There are several small islets in the lagoon offshore beyond Mata-Utu Bay (Baie de Mata'utu), including Luaniva, Fugalei, Nukuhione, and Nukuhifala; the islets are a good place for ships to anchor as the shore at Mata-Utu Bay is not adequate for this purpose. Mata Utu Bay lies about to the northeast of Mua Bay. 17 | 18 | ==Climate== 19 | 20 | 21 | ==Cityscape== 22 | Downtown Mata-Utu is dominated by the Matâ'Utu Cathedral, a French national monument, which bears the royal insignia of Wallis, a Maltese cross between its towers. The cathedral is also known as the called "Our Lady of Good Hope Cathedral", which overlooks the lagoon. Within its vicinity there are, as well as several restaurants, the Au Bon Marche and Oceania market, hotels and the post office, and the simple Palace of the King of Uvéa, which features two-storey verandas adjoining the church. 23 | 24 | There is also a platform known locally as ''Fale Fono'' on the opposite side of the wharf which was used by the chief of the local tribes to address people. The hill known as the Mt. Lulu Fakahega, which rises to a height of 145 m, forms the backdrop of the village. It has an old chapel at the top. This site is accessed by a short and narrow road and the view from the top of the hill is particularly scenic. 25 | Throne in Matâ'Utu Cathedral 26 | The town contains the rugby stadium Stade Laione Rugby, Stade Lomipeau, Stade de Kafika in the western suburbs and Sia Hospital. There are no street names in Mata-Utu. Telephone facilities, banking facilities and other essential services are all available in the town. 27 | 28 | ==Economy== 29 | The economy of the island is dependent on its chief produce of copra, cassava, yams, taro roots, and bananas. Livestock consists of 25,000 pigs and 7,000 goats. The unit of currency is the CFP franc. The balance of imports is not favorable to the islands as imports exceed exports. 30 | 31 | ==Services== 32 | The magistrate's court of Wallis and Futuna is located in Mata-Utu. Radio Wallis et Futuna is broadcast from Mata-Utu. A short distance out of town are the police station and shopping mall. There is also a branch of the Indosuez Bank in Mata-Utu, and a thermal power station. The Uvéa Shop sells cassettes of the music of the Wallisian singer and composer Palisio Tuauli of the band Talamohe. The town lacks a tourist information center. 33 | 34 | A cargo shipping service connects to Mata’Utu on Wallis and Leava on Futuna with Nouméa. As of 1995, there were eight cargo vessels with a total capacity of 146128 DWT. The Hihifo Airport serves Mata’Utu and Wallis Island is northwest of the town. 35 | 36 | ==Culture== 37 | Dancers from Wallis and Futuna performing the 'Plantation' 38 | 39 | The cultural identity of the Wallis's islanders is Wallisian, an offshoot of Polynesian culture. The language spoken in the town and on the island is 'Uvean, a derivative of Western Polynesian with close affinity to Tongan. In Wallis island, Wallisians use 'Uvean as their everyday language, while French is the language of the administration. 40 | 41 | Assumption Day is celebrated in Mata-Utu on August 15. 42 | 43 | Near Mata-Utu are two important archaeological sites, Talietumu and Tonga Toto. 44 | 45 | ==References== 46 | 47 | 48 | ==External links== 49 | 50 | * Map showing the location of Matâ'Utu 51 | * Picture of the lagoon of Matâ'Utu ( Archived 2009-11-01) 52 | * Picture of Matâ'Utu Cathedral 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/139_Mamoudzou.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | '''Mamoudzou''' (; ''Momojou'') is the capital of Mayotte, overseas region and department in the Indian Ocean. Mamoudzou is the most populated commune (municipality) of Mayotte. It is located on Grande-Terre (or Maoré), the main island of Mayotte. 5 | 6 | ==History== 7 | The former capital of Mayotte was Dzaoudzi, on the small island of Petite-Terre (or Pamanzi), but Mamoudzou was chosen as the capital in 1977. In the 1985 census, 12,026 people were recorded in the main town. 8 | 9 | There have been environment concerns about marine pollution in the area; "important degradation in the quality of the coastal waters" between 1977 and 2007 has been reported in the Coral Reef Lagoon in the Mamoudzou–Dzaoudzi strait, and in the Mamoudzou–Majikavo conurbation. 10 | 11 | ==Administration== 12 | Mamoudzou City Hall 13 | The commune is composed of 6 villages in addition to its central habitation, also called Mamoudzou. These are: Kawéni, Mtsapéré, Passamainti, Vahibé, Tsoundzou I and Tsoundzou II. 14 | 15 | The commune is also subdivided into 3 cantons: Mamoudzou-1, Mamoudzou-2 and Mamoudzou-3. 16 | 17 | The government owns the radio station in Mamoudzou and broadcasts in French and Mahorian. The government departments, including Agriculture and Forestry, Education, Health and Social Security, Public Works, Work, Employment and training and Youth and Sports are situated on the Rue Mariaze in the town. The government departments have been based in the town since before it became the capital, from World War II. France Télécom operates in the town. 18 | 19 | ==Population== 20 | 21 | 22 | 23 | 24 | 25 | 26 | Village Populations 27 | 28 | Village 29 | 30 | 1997 31 | 32 | 2002 33 | 34 | 35 | 36 | Kavani 37 | 38 | 3 948 39 | 40 | 5 488 41 | 42 | 43 | 44 | Kaweni 45 | 46 | 6 206 47 | 48 | 9 604 49 | 50 | 51 | 52 | '''Mamoudzou''' 53 | 54 | 5 666 55 | 56 | 6 533 57 | 58 | 59 | 60 | Mtsapéré 61 | 62 | 6 979 63 | 64 | 10 495 65 | 66 | 67 | 68 | Passamainty 69 | 70 | 5 173 71 | 72 | 6 008 73 | 74 | 75 | 76 | Tsountsou 1 77 | 78 | 2 093 79 | 80 | 3 058 81 | 82 | 83 | 84 | Tsountsou 2 85 | 86 | 574 87 | 88 | 1 063 89 | 90 | 91 | 92 | Vahibé 93 | 94 | 2 135 95 | 96 | 3 236 97 | 98 | 99 | 100 | Statistics accurate as of 1997 101 | 102 | 103 | 104 | ==Economy== 105 | Place du Marché 106 | 107 | Mamoudzou has a bank and shopping centre. The economic centre of the town is the Place du Marche, where the bank, Air France and Ewa Air offices, and the tourist office are located. The headquarters of the magazine ''Jana na Leo'', "primarily concerned with articles on social life of the island of Mahore", is published in Mamoudzou. Noteworthy restaurants in Mamoudzou include the ''Les Terrasses'', ''Hotel Restaurant Isijiva'', ''Le Barfly'' and ''Mamoudzou La Kaz. 108 | 109 | Ferry in motion between Dzaoudzi and Mamoudzou 110 | A ferry service is provided for tourists to the island of Petite Terre. 111 | 112 | ==References== 113 | 114 | 115 | ==External links== 116 | 117 | * Official website 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/144_European_Youth_Capital.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Turin (2010) 5 | Antwerp (2011) 6 | Braga (2012) 7 | Maribor (2013) 8 | Thessaloniki (2014) 9 | Cluj-Napoca (2015) 10 | Ganja (2016) 11 | 12 | The ''' European Youth Capital''' (abbreviated '''EYC''') is the title awarded by the European Youth Forum to a European city, designed to empower young people, boost youth participation and strengthen European identity through projects focused on youth-related cultural, social, political and economic life and development. The 13 | European Youth Capital is an initiative by the European Youth Forum and is awarded for a period of one year. The first capital was chosen in 2009. Since 2014, the Congress of Local and Regional Authorities of the Council of Europe is an official endorsing partner the European Youth Capital title. The current, capital for the 2021 calendar year is Klaipeda. 14 | 15 | ==Goals== 16 | The European Youth Capital aims in promoting intra-European co-operation between young people. Among the most important aspects of the institution is the betterment of everyday life of the youth in the city selected as youth capital, not just for the duration of the festivities, but in the long term. Additionally, participation of the youth in the design and implementation of the plans for each capital of youth is encouraged by the EYC. Ensuring that the youth are informed and actively involved in society and given opportunities for a better future is also a priority for the EYC initiative. Tourism and increased international prestige are some of the additional benefits of being named European Youth Capital. 17 | 18 | ==Capitals (2009–2023)== 19 | Since 2009, there have been next European Youth Capitals: 20 | 21 | 22 | 23 | +European Youth Capital 24 | 25 | Year 26 | 27 | City 28 | 29 | Country 30 | 31 | Notes 32 | 33 | 34 | 35 | 2009 36 | 37 | Rotterdam 38 | 39 | Netherlands 40 | 41 | 42 | 43 | 44 | 45 | 2010 46 | 47 | Turin 48 | 49 | Italy 50 | 51 | 52 | 53 | 54 | 55 | 2011 56 | 57 | Antwerp 58 | 59 | Belgium 60 | 61 | 62 | 63 | 64 | 65 | 2012 66 | 67 | Braga 68 | 69 | Portugal 70 | 71 | Info 72 | 73 | 74 | 75 | 2013 76 | 77 | Maribor 78 | 79 | Slovenia 80 | 81 | Info 82 | 83 | 84 | 85 | 2014 86 | 87 | Thessaloniki 88 | 89 | Greece 90 | 91 | Info 92 | finalists: Ivanovo, Heraklion, 93 | other candidates: Barcelona, Konya, Perm, Trabzon 94 | 95 | 96 | 97 | 2015 98 | 99 | Cluj-Napoca 100 | 101 | Romania 102 | 103 | Info 104 | finalists: Ivanovo, Vilnius, Varna 105 | other candidates: Katowice, La Laguna, Badajoz, Ganja, Lecce and Perm 106 | 107 | 108 | 109 | 2016 110 | 111 | Ganja 112 | 113 | Azerbaijan 114 | 115 | other candidates: Varna, Vilnius, La Laguna and Badajoz 116 | 117 | 118 | 119 | 2017 120 | 121 | Varna 122 | 123 | Bulgaria 124 | 125 | other candidates: Cascais, Galway, Newcastle and Perugia 126 | 127 | 128 | 129 | 2018 130 | 131 | Cascais 132 | 133 | Portugal 134 | 135 | other candidates: Kecskemét, Manchester, Novi Sad and Perugia 136 | 137 | 138 | 139 | 2019 140 | 141 | Novi Sad 142 | 143 | Serbia 144 | 145 | other candidates: Amiens, Derry/Strabane, Galway, Manchester and Perugia 146 | 147 | 148 | 149 | 2020 150 | 151 | Amiens 152 | 153 | France 154 | 155 | other candidates: Chișinău, Klaipėda, Timișoara and Villach 156 | 157 | 158 | 159 | 2021 160 | 161 | Klaipėda 162 | 163 | Lithuania 164 | 165 | other candidates: Chișinău, Greater Nicosia, Varaždin and Yaroslavl 166 | 167 | 168 | 169 | 2022 170 | 171 | Tirana 172 | 173 | Albania 174 | 175 | other candidates: Baia Mare, Kazan, Poznań and Varaždin 176 | 177 | 178 | 179 | 2023 180 | 181 | Lublin 182 | 183 | Poland 184 | 185 | other candidates: Baia Mare, Kazan, İzmir, Lviv and Poznań 186 | 187 | 188 | 189 | ==See also== 190 | *European Youth Forum 191 | *European Capital of Culture 192 | *European Region of Gastronomy 193 | 194 | ==References== 195 | 196 | 197 | ==External links== 198 | * 199 | * Braga - European Youth Capital 2012 200 | * Thessaloniki- European Youth Capital 2014 201 | * Cluj-Napoca - European Youth Capital 2015 202 | Novi Sad (2019) 203 | Lublin (2023) 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/145_Kokufu.txt: -------------------------------------------------------------------------------- 1 | are the capitals of the historical Provinces of Japan. 2 | 3 | == History == 4 | As part of the Taika Reform (645) which aimed at a centralization of the administration following the Chinese model (''ritsuryō''), the kokufu and with it the office of the kokushi, replacing the older ''Kuni no miyatsuko'', developed in the 660s. 5 | 6 | The ''Wamyō Ruijushō'' (Collection of Japanese Names) from 935 contains the earliest listing of the capitals of the provinces and their location. The location of the original capitals of the 8th and 9th century are not passed down. 7 | 8 | When during the Muromachi Period, starting in the 14th century, the functions of the kokushi were increasingly transferred to military governors (''shugo''), the provincial governments (''kokuga'') lost their importance. 9 | 10 | == Organisation == 11 | In the center of the kokufu lay the provincial government (''kokuga'') with its offices (administration, farming, finance, police and military) and the official building of the kokushi, known as . In the periphery there was the provincial school (''kokugaku''), the garrison and storehouses for taxes which were paid in kind. 12 | 13 | When the shugo replaced the kokushi, their administration, the was occasionally found in or near the buildings of the kokuga. In these cases their administration was also referred to as . 14 | 15 | With their square layout, the kokufu followed that of the Capital of Japan, first Fujiwara-kyō and then Heijō-kyō, which in turn were modelled on the Tang capital Chang'an. However, with exception of Dazaifu, which held a special position, these capitals were relatively small. For instance, the capital of Suō Province occupied an area of 1 km², that of Bizen Province 850 m×850 m. 16 | 17 | Inside or near the kokufu, there were also the most important religious sites of the province, the Buddhist provincial temples, ''kokubun-ji'', one each for monks and nuns as well as the highest ranked Shinto shrine, ''Ichinomiya''. 18 | 19 | ==References== 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/148_Delap-Uliga-Djarrit.txt: -------------------------------------------------------------------------------- 1 | Marshall Islands capitol building in Delap-Uliga-Djarrit 2 | Town center 3 | Harbour of Delap-Uliga-Djarrit 4 | Laura. 5 | '''Delap-Uliga-Djarrit''' ('''DUD''') is the capital and the largest city of the Marshall Islands with 20,301 people (2012 census). The town is located in Majuro Atoll. 6 | 7 | == History == 8 | Majuro Atoll was claimed by the German Empire with the rest of the Marshall Islands in 1884, and the Germans established a trading outpost. As with the rest of the Marshalls, Majuro was captured by the Imperial Japanese Navy in 1914 during World War I and mandated to the Empire of Japan by the League of Nations in 1920. The island then became a part of the Japanese mandated territory of the South Seas Mandate; although the Japanese had established a government in the mandate, local affairs were mostly left in the hands of traditional local leaders until the start of World War II. 9 | 10 | U.S. Fifth Fleet at Majuro Atoll 1944. 11 | On January 30, 1944, United States troops invaded. In 1986, Marshall Islands become an independent nation and Delap-Uliga-Djarrit become the country's capital. 12 | 13 | == Demographics == 14 | In 2012, the population of Delap-Uliga-Djarrit was 20,301. 15 | 16 | == Famous places == 17 | Alele Museum is located in Delap-Uliga-Djarrit. The Cathedral of the Assumption of the Roman Catholic Apostolic Prefecture of the Marshall Islands and Baet-Ul-Ahad Mosque are located in town center. 18 | 19 | == Economy == 20 | On September 15, 2007, Witon Barry, of the Tobolar Copra processing plant in the Marshall Islands' capital of Majuro, said power authorities, private companies and entrepreneurs had been experimenting with coconut oil as an alternative to diesel fuel for vehicles, power generators and ships. Coconut trees abound in the Pacific's tropical islands. Copra from 6 to 10 coconuts makes 1 litre of oil. 21 | 22 | The town has a port, shopping district, hotels, and an international airport. 23 | 24 | == Education == 25 | 26 | Students at the Majuro Cooperative School raise the Republic of Marshall Islands flag at a ceremony during a Pacific Partnership 2009 community service project 27 | 28 | Located in Delap-Uliga-Djarrithe are the College of the Marshall Islands, Assumption High School, and Uliga Elementary School where English is taught to all students. 29 | 30 | The Marshall Islands High School is near the north end of the town. 31 | 32 | The University of South Pacific has a presence on Delap-Uliga-Djarrit. 33 | 34 | Delap-Uliga-Djarrit has the Seventh Day Adventist High School and Elementary School where English is taught to all students. 35 | 36 | ==Health== 37 | The town has a hospital. It has 81 beds. It is the main hospital for Delap-Uliga-Djarrit, as well as many of the outer islands. 38 | 39 | ==References== 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/149_Ghazni_under_the_Ghaznavids.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Ghazni is a city in southeastern Afghanistan, which served as the capital of the Ghaznavid Empire from 977 to 1163. 5 | 6 | == Etymology == 7 | The toponym Ghazni is known to have existed prior to the Islamic period. It is derived from the Iranian word ''Ganzak'' ("treasury"). Classical authors mention the name in various forms, including the Greek Gázaca (), and the Chinese Ho(k)-si(k)-na. 8 | 9 | == History of the Ghaznavid city == 10 | ===Background=== 11 | Although not a member of the Ghaznavid family, the foundation of the Ghazni as a Ghaznavid city can be attributed to the Turkic slave commander of the Samanid Empire, Alp-Tegin, who after his unsuccessful attempt to put the Samanid prince Nasr on the throne, was forced to flee from the court in Bukhara. In 963, Alp-Tegin accompanied by his personal guard of Turkic slave-soldiers and group of Iranian ''ghazis'' left for Ghazni, which was a small town in Zabulistan ruled by the local Lawik dynasty. He seized Ghazni from Abu Bakr Lawik, a kinsman of the Kabulshah, and secured his position by receiving an investiture from the Samanids as the governor of Ghazni. 12 | 13 | Alp-Tegin died a few months later (September 963) and was succeeded by his son Abu Ishaq Ibrahim, who briefly lost control of Ghazni after an invasion by its former ruler, Abu Bakr Lawik. However, he managed to regain it with Samanid aid. Some time later, Abu Ishaq Ibrahim died and was succeeded by a Turkic slave commander named Bilgetegin. 14 | 15 | ===Under the Ghaznavid rulers=== 16 | Dirham of Mahmud minted in Ghazni in 1024, with Caliph al-Qadir's name 17 | Ferdowsi with the other poets from the court of Ghazni. 18 | In 1052, the rebellious slave-soldier (''ghulam'') Toghrul seized Ghazni, had Abd al-Rashid killed, and had the sultan's men jailed in a stronghold. However, Toghrul's reign lasted only 15 days; he was defeated and killed by Ghaznavid loyalists, who put Farrukh-zad (r. 1053–1059) on the throne. 19 | 20 | The city's good fortune came to an unexpected and ruthless end when it was sacked and set on fire in 1151 by the Ghurid Sultan Ala al-Din Husayn (r. 1149-1161). All the tombs of the Ghaznavid rulers, with the exception of Mahmud, Mas'ud I and Ibrahim, were broken open and the remains burned. From these events, Ala ad-Din Husayn gained the nickname, ''Jahānsūz'' (meaning the ''World Burner''). 21 | 22 | == Monuments and inscriptions == 23 | Sultan Mas'ūd III of Ghazni built one of the Ghazni Minarets and the Palace of Sultan Mas'ūd III. 24 | 25 | == References == 26 | 27 | 28 | == Sources == 29 | * 30 | * 31 | * 32 | * 33 | * 34 | * 35 | * 36 | * 37 | 38 | 39 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/150_Singhapala.txt: -------------------------------------------------------------------------------- 1 | '''Singhapala''' (Baybayin: , , , Old Malay: ''Kota Singapura'') was an ancient fortified city or a region, the capital of the Indianized Rajahnate of Cebu. The location of this ancient city is what is now the modern Barangay Mabolo in the northern district of Cebu City. Founded by Sri Lumay or ''Raja Muda Lumaya'', a half-Tamil prince from Sumatra. 2 | 3 | 4 | 5 | ==Background== 6 | ===Etymology=== 7 | The name ''Singhapaha'' comes from Sanskrit word via Tamil ''Singam'' (சிங்கம்) become ''Singa'' in Old Malay which means (Lion), and ''Puram'' (புரம்) (Town or a City) which become ''Pura'' in Old Malay and then ''Pala'' in Philippine languages, it's variation of the sanskritized Singa-Puram, ''Singapura'' literally means "Lion city" from ''Singapur'' (சிங்கப்பூர்), the same root name of the country of Singapore. 8 | 9 | ===Location=== 10 | 11 | Aerial view of Cebu City North district. 12 | The location of ancient Singhapala was said to be in what is now the currently part of the Northern district in modern day barangay Mabolo in Cebu City, with estimated population of 21,842 in 2010. while the modern Cebu City where comprises 80 barangays. These are grouped into two congressional districts, with 46 barangays in the northern district and 34 in the southern district. 13 | 14 | ===As a trading center=== 15 | During Rajah Humabon's reign, the region had since become an important trading center where agricultural products were bartered. From Japan, perfume and glass utensils were usually traded for native goods. Ivory products, leather, precious and semi-precious stones and ''śarkarā''(Sarkarai in Tamil) (sugar) mostly came from India traders and Burmese people traders. The harbors of Sugbu and the capital Singhapala became known colloquially as ''sinibuayng hingpit'' ("the place for trading"), shortened to ''sibu'' or ''sibo'' ("to trade"), from which the modern Castilian name "Cebú" originates. It was also during Humabon's reign that Lapu-Lapu arrived from Borneo, and was granted by Humabon the region of Mandawili (now Mandaue), including the island known as Opong or Opon (later known as Mactan). First contact with the Spanish also occurred during Humabon's reign, resulting in the death of Ferdinand Magellan. 16 | 17 | ==Foundation== 18 | 19 | According to ''Aginid, Bayok sa atong Tawarik'', a Visayan folk story, prior to the coming of the Spanish conquistadores, rajahnate was the common form of state or government of Cebu island. This rajahnate was established by Sri Lumay (c. 1400 CE.), who was a prince of Chola Dynasty that ruled Sumatra then who settled in Cebu with his son, Sri Alho, they ruled the south known as Sialo which included Valladolid, Carcar, up to Santander. 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ==During the Spanish period== 34 | 35 | An illustration depicting what the Fort San Pedro may have looked like in 1565. 36 | Singhapala might continued to exist until 1565, when the Rajahnate was dissolved during the reign of Rajah Tupas by the forces of conquistador Miguel López de Legazpi in the battle of Cebu. Singhapala and the areas which is now composed of the modern Cebu City has incorporated in Spanish rule, and Miguel López de Legazpi 's party named the new city ''Villa de San Miguel de Cebú'' (later renamed "Ciudad del Santísimo Nombre de Jesús)." In 1567, the Cebu garrison was reinforced with the arrival of 2,100 soldiers from New Spain (Mexico). The growing colony was then fortified by Fort San Pedro. 37 | 38 | ==See also== 39 | * Rajah Humabon 40 | * Lapu-Lapu 41 | * Ferdinand Magellan 42 | * Miguel López de Legazpi 43 | * Sri Lumay - founder of Rajahnate of Cebu. 44 | * Sinhapura 45 | * Rajahnate of Cebu 46 | * Kedatuan of Madja-as 47 | * Cebu City 48 | * Cebu 49 | * History of the Philippines (900-1521) 50 | * Chola Dynasty 51 | 52 | ==References== 53 | 54 | 55 | ==External links== 56 | * http://www.cebu-bluewaters.com/early-cebu-history.html 57 | * https://thebulwaganfoundation.wordpress.com/ 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/154_St._John_s__Antigua_and_Barbuda.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | '''St. John's''' is the capital and largest city of Antigua and Barbuda, part of the West Indies in the Caribbean Sea. With a population of 22,219, St. John's is the commercial centre of the nation and the chief port of the island of Antigua. 10 | 11 | ==History== 12 | 13 | The settlement of St. John's has been the administrative centre of Antigua and Barbuda since the islands were first colonised in 1632, and it became the seat of government when the nation achieved independence in 1981. 14 | 15 | ==Economy== 16 | 17 | 18 | St. John's is one of the most developed and cosmopolitan municipalities in the Lesser Antilles. The city is famous for its shopping malls as well as boutiques throughout the city, selling designer jewellery and haute-couture clothing. 19 | 20 | St. John's attracts tourists from the resorts on the island and from the cruise ships which dock in its harbour at Heritage Quay and Redcliffe Quay several times a week. 21 | 22 | The investment banking industry has a strong presence in the city. Major world financial institutions have offices in St. John's. 23 | 24 | There is a market on the southwestern edge of the city where fresh produce, meats, and fresh fish are sold daily. 25 | 26 | The Antigua Rum Distillery is located at the Citadel and is the only rum distillery on the island. 27 | 28 | ==Demographics== 29 | 30 | 31 | The majority of the population of St. John's reflects that of the rest of Antigua: people of African and mixed European-African ancestry, with a European minority, including British and Portuguese. There is a population of Levantine Christian Arabs. 32 | Downtown St. John's 33 | 34 | ==Government== 35 | Antigua and Barbuda Parliament Building 36 | St John's is the home of the Parliament of Antigua and Barbuda. 37 | 38 | The Eastern Caribbean Civil Aviation Authority has its headquarters on Factory Road in St. John's. 39 | 40 | St John's is twinned with Waltham Forest borough in London, England. 41 | 42 | ==Culture== 43 | There are several museums, including the Museum of Antigua and Barbuda and the Museum of Marine Art, a small facility containing fossilised bedrock, volcanic stones, petrified wood, a collection of more than 10,000 shells, and artefacts from English shipwrecks. 44 | 45 | St. John's Cricket Ground 46 | Just east of St. John's is the Sir Vivian Richards Stadium, a multi-use stadium in North Sound, that was created mostly for cricket matches, and has hosted the matches during the 2007 Cricket World Cup. The Antigua Recreation Ground, Antigua and Barbuda's national stadium, is located in St. John's. 47 | 48 | ==Geography== 49 | Nearby villages and settlements include St. Johnston. 50 | 51 | ==Main sights== 52 | The city's skyline is dominated by the white baroque towers of St. John's Cathedral. 53 | 54 | The Botanical Garden is near the intersection of Factory Road and Independence Avenue. This small park's shaded benches and gazebo provide a quiet refuge from the bustle of activity of St. John's. 55 | 56 | Sandy Island Light 57 | Sandy Island is a Lighthouse located on a small island about 5 km off the coast leading the way to St. John's harbour. 58 | 59 | Fort James stands at the entrance to St. John's harbour. Other nearby forts include Fort George, Fort Charles, Fort Shirley, Fort Berkeley and Fort Barrington. 60 | 61 | Government House is the Governor's residence, originally a 19th-century parsonage building. It is included on the World Monuments Fund's 2018 list of monuments at risk, following exposure to severe weather events. 62 | 63 | ==Transportation== 64 | 65 | St. John's is served by the V. C. Bird International Airport. 66 | 67 | ==Education== 68 | St. John's is home to two medical schools – the American University of Antigua and University of Health Sciences Antigua. Secondary schools include Christ the King High School, Princess Margaret School and the Antigua Girls High School. Private grade schools include St. John's Lutheran School of the WELS. 69 | 70 | ==Climate== 71 | St. John's has a Tropical savanna climate (Koppen: Aw) with summer-like weather year-round, with hot days and warm nights. Rainfall is at its highest during the months of September to November due to hurricane activity. 72 | 73 | 74 | ==References== 75 | 76 | 77 | 78 | ==External links== 79 | 80 | * 81 | * Street map of St John's Antigua From Paradise Islands (non-commercial site) 82 | * Map of St. John's at Caribbean-On-Line.com 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/163_Yamoussoukro.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | '''Yamoussoukro''' (; , locally ) is the ''de jure'' capital of Ivory Coast and an autonomous district. As of the 2014 census, Yamoussoukro is the fifth most populous city in Ivory Coast with a population of 355,573 inhabitants. Located north-west of Abidjan, Yamoussoukro covers among rolling hills and plains. 5 | 6 | Yamoussoukro became the legal capital of the Ivory Coast in 1983, although the former capital Abidjan retains several political functions. Prior to 2011, what is now the district of Yamoussoukro was part of Lacs Region. The district was created in 2011 and is split into the departments of Attiégouakro and Yamoussoukro. In total, the district contains 169 settlements. Yamoussoukro is a sub-prefecture in Yamoussoukro Department and is also a commune: since 2012, the city of Yamoussoukro has been the sole commune in the autonomous district of Yamoussoukro. 7 | 8 | ==History== 9 | 10 | 11 | ===Prehistory=== 12 | 13 | Stone tools found in the country from hundreds of thousands of years ago show that the area around Yamoussoukro has been occupied since ancient times. Due to the desertification of the Sahara, many moved south to avoid the harsh conditions. 14 | 15 | ===Colonial period=== 16 | Queen Yamoussou, the niece of Kouassi N'Go, ran the city of ''N'Gokro'' in 1929 at the time of French colonization. The village of N'Gokro was renamed Yamoussoukro, the suffix ''Kro'' meaning town in Baoule. 17 | 18 | Diplomatic and commercial relations were then established, but in 1909, on the orders of the Chief of Djamlabo, the Akoué revolted against the administration. Bonzi station, from Yamoussoukro on the Bouaflé road, was set on fire, and the French administrator, Simon Maurice, was spared only by the intervention of Kouassi N'Go. 19 | 20 | As the situation got worse, Maurice, judging that Bonzi had become safe, decided to transfer the French military station to Yamoussoukro, where the French Administration built a pyramid to the memory of Kouassi N'Go, Chief of the Akoué, who was assassinated in 1910 by Akoué rebels, accusing him of being too close to the French. 21 | 22 | In 1919, the civil station of Yamoussoukro was removed. Félix Houphouët-Boigny became the leader of the village in 1939. A long period passed wherein Yamoussoukro, still a small agricultural town, remained in the shadows. This continued until after the Second World War, which saw the creation of the African Agricultural Union, as well as the first conferences of its chief. However, it was only with independence that Yamoussoukro finally started to rise. 23 | 24 | In 1950, the village comprised 500 inhabitants. 25 | 26 | ===Since independence=== 27 | After 1964, the President Félix Houphouët-Boigny made ambitious plans and started to build. One day in 1965, later called the Great Lesson of Yamoussoukro, he visited the plantations with the leaders of the county, inviting them to transpose to their own villages the efforts and agricultural achievements of the region. On 21 July 1977, Houphouët offered his plantations to the State. 28 | 29 | In March 1983, President Houphouët-Boigny made Yamoussoukro the political and administrative capital of Ivory Coast, as the city was his birthplace. This marked the fourth movement of the country's capital city in a century. Ivory Coast's previous capital cities were Grand-Bassam (1893), Bingerville (1900), and Abidjan (1933). The majority of economic activity still takes place in Abidjan, and it is officially designated as the "economic capital" of the country. 30 | 31 | Yamoussoukro is the seat of Yamoussoukro Department and the neighbouring Bélier Region, but Yamoussoukro itself is not part of the region. 32 | 33 | ==Governance== 34 | Location of the autonomous district of Yamoussoukro 35 | Beginning in 2001, the city was governed as part of the Yamoussoukro Department and incorporated into Lacs Region. In 2011, the department was abolished and the autonomous district of Yamoussoukro was created and separated from the rest of Lacs, which became a separate district. 36 | 37 | Unlike most districts of the country, the autonomous district of Yamoussoukro is not subdivided into regions. The district, however, is divided into departments, sub-prefectures and a commune. The district consists of the departments of Attiégouakro and Yamoussoukro. The departments further divided into the sub-prefectures of Attiégouakro, Kossou, Lolobo, and Yamoussoukro. There is one commune, which is also named Yamoussoukro, and it shares the same borders as the district. In 2011, the position of Mayor of Yamoussoukro was replaced with a district governor appointed by the head of state. 38 | 39 | == Architecture == 40 | Also noteworthy are the Kossou Dam, the PDCI-RDA House, the schools of the Félix Houphouët-Boigny National Polytechnic Institute, the Town Hall, the Protestant Temple, the Mosque, and the Palace of Hosts. The international airport had an average of six hundred passengers and 36 flights in 1995. It is one of two airports in Africa (with Gbadolite) that could accommodate the Concorde. 41 | 42 | == Places of worship == 43 | Among the places of worship are predominantly Christian churches and temples: Roman Catholic Diocese of Yamoussoukro (Catholic Church), United Methodist Church Ivory Coast (World Methodist Council), Union of Missionary Baptist Churches in Ivory Coast (Baptist World Alliance), Assemblies of God. There are also Muslim mosques. 44 | 45 | Basilica of Our Lady of Peace 46 | Yamoussoukro is the site of the largest Christian church in the world: The Basilica of Our Lady of Peace, consecrated by Pope John Paul II on 10 September 1990. 47 | 48 | == Transport == 49 | Street vendors surrounding a bus in Yamoussoukro 50 | The city is served by Yamoussoukro International Airport. 51 | 52 | == Economy == 53 | The main activities in the city are fishing, forestry, and perfume industries. 54 | 55 | ==Climate== 56 | Yamoussoukro features a tropical wet and dry climate (Aw) under the Köppen-Geiger climate classification system. The city features a lengthy wet season covering the months of March through October, and a shorter dry season that covers the remaining four months. Like many other cities in West Africa, Yamoussoukro is affected by the harmattan, which serves as a primary source of the city's dry season. Despite the lengthy wet season, Yamoussoukro does not see the level of rainfall experienced in Abidjan. Yamoussoukro on average sees roughly of precipitation annually. 57 | 58 | 59 | == Education == 60 | The Institut National Polytechnique Félix Houphouët-Boigny was founded in 1996. 61 | 62 | == References == 63 | 64 | 65 | ==External links== 66 | 67 | 68 | * Yamossoukro photo gallery 69 | * 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/198_Mbabane.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | '''Mbabane''' (; , ) is a city in Eswatini (previously called Swaziland), and is one of the two capitals (along with Lobamba), serving as the executive capital. 5 | 6 | With an estimated population of 94,874 (2010), it is located on the Mbabane River and its tributary the Polinjane River in the Mdzimba Mountains. It is located in the Hhohho Region, of which it is also the capital. The average elevation of the city is 1243 meters. It lies on the MR3 road. 7 | 8 | ==History== 9 | The town grew after the nation's administrative centre moved from Bremersdorp (now called Manzini) in 1902. 10 | It derives its name from a chief, Mbabane Kunene, who lived in the area when British settlers arrived. 11 | 12 | Mbabane was founded in 1887 by Mickey Wells, on the spot where the Transvaal-to-Mozambique route crossed the Mbabane river. It was declared the capital of the new Protectorate of Swaziland in 1902. During this time, Mbabane consisted of a few shops, churches and schools founded by white settlers. Black Africans were not allowed to live in the town and had to reside in nearby rural districts. By the 1930s, Mbabane had electricity, running water, telephone connection and a hospital. 13 | 14 | Prior to the Second World War, most Swazis lived in rural districts and worked outside Eswatini, which prevented the town from growing. 15 | 16 | After the war, the creation of trade schools in the city, the arrival of the railway connecting Maputo to the mines in South Africa, and foreign investment resources within Eswatini (particularly sugar) all contributed to the city's growth. Mbabane became the central hub for development in the Hhohho district. 17 | 18 | In the years following independence, governmental buildings such as the British Consulate were built in Mbabane. Further growth has been achieved through the growth of the tourism industry in Eswatini, of which Mbabane has become the centre. Mbabane today is home to many hotels and recreational sites such as clubs and golf courses tending to tourists. 19 | 20 | ==Economy== 21 | Mbabane's closest border crossing to South Africa is Ngwenya-Oshoek, and though siSwati is the primary language, English is widespread. Mbabane, and Eswatini itself, depend on tourism and sugar exports. It is also a commercial hub for the surrounding region, while tin and iron were mined nearby. The city has two sites for light industries. 22 | 23 | ==Education== 24 | Mbabane is the home of the Waterford-Kamhlaba United World College of Southern Africa, as well as one of the three campuses of the University of Eswatini. Limkokwing University of Creative Technology is a private international university that lies by the South African-Eswatini border with several university candidates from Eswatini. 25 | 26 | == Culture == 27 | Indingilizi Gallery is an art gallery in Mbabane, established in 1982 and showcases a range of Swazi art, including sculptures, paintings, batiks, mohair, ethnic jewellery and pottery. 28 | 29 | == Places of worship == 30 | Among the places of worship, they are predominantly Christian churches and temples: Roman Catholic Diocese of Manzini (Catholic Church), Swaziland Reformed Church (World Communion of Reformed Churches), Zion Christian Church. There are also Muslim mosques. 31 | 32 | == Geography == 33 | Mbabane is located in the district of Hhohho, of which it is also the capital, and lies on the Mbabane River and its tributary the Polinjane River in the Mdzimba Mountains. The average elevation of the city is 1243 metres. Neighbourhoods and suburbs include Mbangweni, Sidwashini, Kent Rock, Sandla, Westridge Park, Malunge, New Checkers, Msunduza and Vukutentele. 34 | 35 | === Climate === 36 | Due to its altitude, Mbabane features a moderate subtropical highland climate (Köppen'': Cwb''). The city has a mild climate and snow is a rare event, which has occurred only three times since 1900. The city averages only four days of frost a year. The average temperature is in July and in January. The thermal range is low, but the winter night is cold for a subtropical climate in general. Most of the precipitation is concentrated in the summer. The difference in the driest month (June) and the wettest (January) is 210 mm. 37 | 38 | 39 | 40 | View of Mbabane 41 | 42 | Portable market hut in Mbabane, 1979 43 | 44 | ==International relations== 45 | 46 | 47 | ===Twin towns – sister cities=== 48 | Mbabane is twinned with: 49 | * Fort Worth, Texas, US 50 | * Taipei, Taiwan 51 | * Mersing, Malaysia 52 | * Melilla, Spain 53 | * Maputo, Mozambique 54 | 55 | ==References== 56 | 57 | 58 | ==Bibliography== 59 | * 60 | 61 | ==External links== 62 | * 63 | * 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/203_Lomé.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | '''Lomé''' is the capital and largest city of Togo. It has an urban population of 837,437 while there were 1,477,660 permanent residents in its metropolitan area as of the 2010 census. Located on the Gulf of Guinea at the southwest corner of the country, with its entire western border along the easternmost point of Ghana's Volta Region, Lomé is the country's administrative and industrial center, which includes an oil refinery. It is also the country's chief port, from where it exports coffee, cocoa, copra, and oil palm kernels. 8 | 9 | ==History== 10 | 11 | Lomé in 1903. 12 | Alley leading to the Governor's Palace (1904). 13 | The city was founded by the Ewes and thereafter in the 19th century by German, British and African traders, becoming the capital of Togoland in 1897. 14 | 15 | ==Climate== 16 | Owing to its location in the Dahomey Gap, Lomé has a tropical savanna climate (Köppen climate classification ''Aw'') despite its latitude close to the equator. The capital of Togo is relatively dry with an annual average rainfall of and on average 59 rainy days per year. Despite this, the city experiences heavy fog most of the year and receives a total of 2,330 bright sunshine hours annually. 17 | 18 | The annual mean temperature is about but heat is constant as monthly mean temperatures range from in July, the least hot month of the year to in February and in April, the hottest months of the year. 19 | 20 | 21 | 22 | 23 | 24 | 25 | +Lomé mean sea temperature 26 | 27 | 28 | 29 | Jan 30 | 31 | Feb 32 | 33 | Mar 34 | 35 | Apr 36 | 37 | May 38 | 39 | Jun 40 | 41 | Jul 42 | 43 | Aug 44 | 45 | Sep 46 | 47 | Oct 48 | 49 | Nov 50 | 51 | Dec 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | ==International agreements== 82 | 83 | ===Lomé Convention=== 84 | 85 | The Lomé Convention is a trade and aid agreement between the European Union (EU) and 71 African, Caribbean, and Pacific (ACP) countries. It was first signed on 28 February 1975, in Lomé. 86 | 87 | ===Lomé Peace Accord=== 88 | 89 | The Lomé Peace Accord between the warring parties in the civil war in Sierra Leone was signed in Lomé. With the assistance of the international community, Sierra Leone President Ahmad Tejan Kabbah and Revolutionary United Front leader Foday Sankoh signed the Peace Accord on 7 July 1999. However, the agreement did not last and the Sierra Leone Civil War continued for two more years. 90 | 91 | ==Demographics== 92 | 93 | 94 | == Culture == 95 | The Togo National Museum is in the Palais de Congrès. The museum contains collections, jewelry, musical instruments, dolls, pottery, weapons and many other objects showing the arts and traditions. 96 | 97 | == Places of worship == 98 | 99 | File: Cathedral Lome ext.jpg |Sacred Heart Cathedral, Lomé (Catholic Church) 100 | File: Église Baptiste le Sauveur de Lomé.jpg| The Savior Baptist Church in Lomé (Togo Baptist Convention) 101 | 102 | Among the places of worship, they are predominantly Christian churches and temples : Roman Catholic Archdiocese of Lomé (Catholic Church), Evangelical Presbyterian Church of Togo (World Communion of Reformed Churches), Togo Baptist Convention (Baptist World Alliance), Living Faith Church Worldwide, Redeemed Christian Church of God, Assemblies of God. There are also Muslim mosques. 103 | 104 | ==Education== 105 | Entrance of University of Lomé 106 | The University of Lomé (previously called University of Benin), located in Lomé Tokoin, was founded in 1970. 107 | 108 | Schools located in the city include American International School of Lomé, British School of Lomé, Ecole Internationale Arc-en-Ciel and Lycée Français de Lomé. 109 | 110 | ==Twin towns – sister cities== 111 | 112 | Lomé is twinned with: 113 | * Duisburg, Germany (2010) 114 | * Shenzhen, China (1997) 115 | * Taipei, Taiwan (1966) 116 | 117 | ==Notable people== 118 | *Emmanuel Adebayor, footballer for Togo and the Paraguan side Olympia Asuncion 119 | *Kangni Alem, writer 120 | *Gnimdéwa Atakpama, journalist and writer 121 | *Yaovi Aziabou, Togolese professional footballer 122 | *Nicole Coste, Air France flight attendant, mother of Alexandre Coste (the son of Albert II, Prince of Monaco) 123 | *Christiane Akoua Ekué, writer 124 | *Emmanuel Kavi, artist 125 | *King Mensah, popular Afropop musician 126 | *Amadou Morou, Togolese- Polish footballer 127 | *Davide-Christelle Sanvee, Swiss performance artist of Togolese origin 128 | *Marie Madoé Sivomey, first female mayor in Togo, served as mayor of Lomé from 1967 to 1974 129 | 130 | ==References== 131 | 132 | 133 | ==Bibliography== 134 | 135 | 136 | ==External links== 137 | 138 | 139 | * The Olympio family 140 | * Map of Lomé 141 | * Togo Woezon Tourism 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/20_Saint-Pierre__Saint_Pierre_and_Miquelon.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | '''Saint-Pierre''' is the capital of the French overseas collectivity of Saint Pierre and Miquelon, off the coast of the Canadian island of Newfoundland. Saint-Pierre is the more populated of the two communes (municipalities) making up Saint Pierre and Miquelon. 6 | 7 | ==Geography== 8 | The commune of Saint-Pierre is made up of the island of Saint-Pierre proper and several nearby smaller islands, such as L'Île-aux-Marins. Although containing nearly 90% of the inhabitants of Saint Pierre and Miquelon, the commune of Saint-Pierre is considerably smaller than the commune of Miquelon-Langlade, which lies to its northwest on Miquelon Island. 9 | 10 | The main settlement and communal seat is situated on the north side of a harbour called ''Barachois'', which faces the Atlantic Ocean, on the Saint-Pierre Island's east coast. The mouth of the harbour is guarded by a small chain of islands. 11 | 12 | ==History== 13 | Jacques Cartier claimed the islands for France in 1536, after they were discovered by the Portuguese in 1520. At the end of the Seven Years' War in 1763, the islands were turned over to Britain, only to be given back to France in 1816. 14 | 15 | St. Pierre was an outpost used by Al Capone to transport alcohol from Canada to the United States during Prohibition. 16 | 17 | Until 1945, there existed a third commune in Saint Pierre and Miquelon: L'Île-aux-Marins. The commune of L'Île-aux-Marins was annexed by the commune of Saint-Pierre in 1945. 18 | 19 | ==Demographics== 20 | The legal population of Saint-Pierre in 2017 was 5,406, many of whom are of Basque, Breton, Norman or Acadian descent. All inhabitants in the commune (municipality) live on the island of Saint-Pierre proper. 21 | 22 | ==Government== 23 | 24 | The commune is led by a mayor and a council. 25 | 26 | Saint-Pierre under snow. 27 | Saint-Pierre on a cloudy day. 28 | 29 | ==Landmarks== 30 | Close to the centre of the harbour's edge lie the Post office and Custom House (staffed by Directorate-General of Customs and Indirect Taxes), behind which is General Charles de Gaulle Square, the town's centre. 31 | 32 | Other prominent landmarks in Saint-Pierre include the cathedral, to the north of the square, rebuilt in the early twentieth century after a major fire, and the Pointe aux Canons Lighthouse, at the mouth of the harbour. Further north, close to the town's former hospital, is the Fronton Zazpiak Bat - an arena for the traditional Basque sport of pelota. 33 | 34 | 35 | File:Place du General de Gaulle square, St Pierre.JPG|General Charles de Gaulle Square 36 | File:Cathedral in St Pierre.JPG|The Cathedral in Saint-Pierre 37 | File:Cannons that Defended the Harbour Against The English.JPG|Pointe aux Canons Lighthouse in Saint Pierre 38 | File:Arena For That Basque Game St Pierre.JPG|Fronton Zazpiak Bat arena in Saint-Pierre 39 | 40 | 41 | ==Services== 42 | 43 | Hospitalier François Dunan (opened 2011) is the only hospital (84 bed facility) in St. Pierre et Miquelon with additional health care needs at the seniors residence at Maison de Retraite Eglantine. 44 | 45 | ==Transportation== 46 | Saint-Pierre Airport, the international airport of Saint-Pierre and Miquelon, is located south of the settlement of Saint-Pierre and is served by Air Saint-Pierre with flights both to Miquelon Airport, five Canadian airports and seasonal service to Paris, France. 47 | 48 | ==Radio and television== 49 | * Radio France Outremer 50 | * Radio Atlantique 51 | * CBC/Radio-Canada 52 | 53 | ==Education== 54 | Public primary schools in the commune: 55 | * École maternelle Ile aux Enfants (preschool/nursery) - As of 2014 it had 62 students. 56 | * École primaire Henriette Bonin - As of 2014 it had 62 students 57 | * École élémentaire du Feu Rouge - As of 2014 it had 163 students As of 2016 it had 172 students. It is in the downtown and is one nautical cable from the Ile aux Enfants nursery. 58 | 59 | Lycée-Collège d'État Émile Letournel is the public secondary school in the commune, with junior high, vocational high, and general senior high/sixth-form programmes. 60 | 61 | Private schools: 62 | * École maternelle Saint-Louis de Gonzague (preschool/nursery) 63 | * École élémentaire Sainte-Croisine - It opened on November 4, 1925 64 | * École élémentaire Sainte-Odile 65 | * Collège Saint Christophe (junior high school) 66 | 67 | ==Twin towns – sister cities== 68 | Saint-Pierre is twinned with: 69 | * France Port-en-Bessin-Huppain (France), since 1976. 70 | 71 | ==See also== 72 | *Miquelon-Langlade 73 | 74 | ==References== 75 | 76 | 77 | ==External links== 78 | 79 | 80 | * Official website 81 | * Tourism and Travel Resources for St Pierre & Miquelon 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/21_Westside__Gibraltar.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | '''Westside''' is the largest city and ''de facto'' capital of Gibraltar. It lies between the western slopes of the Rock of Gibraltar and the eastern shores of the Bay of Gibraltar. In 2012 it was inhabited by 26,572 people and contained over 98% of the territory's population. 6 | 7 | == Division == 8 | The city is divided into six Major Residential Areas: North District, Reclamation Areas, Sandpits, South District, Town Area, and Upper Town. 9 | 10 | == Demographics == 11 | 12 | 13 | 14 | Residential area 15 | 16 | Population 2012 17 | 18 | Population 2001 19 | 20 | 21 | 22 | North District 23 | 24 | 4,267 25 | 26 | 4,116 27 | 28 | 29 | 30 | Reclamation Areas 31 | 32 | 13,356 33 | 34 | 9,599 35 | 36 | 37 | 38 | Sandpits 39 | 40 | 2,053 41 | 42 | 2,207 43 | 44 | 45 | 46 | South District 47 | 48 | 5,681 49 | 50 | 4,257 51 | 52 | 53 | 54 | Town Area 55 | 56 | 3,264 57 | 58 | 3,588 59 | 60 | 61 | 62 | Upper Town 63 | 64 | 2,457 65 | 66 | 2,805 67 | 68 | 69 | Gibraltar Harbour, North Mole 70 | 71 | ==References== 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/230_Yaren_District.txt: -------------------------------------------------------------------------------- 1 | Map of Yaren 2 | Nauru International Airport 3 | 4 | '''Yaren''' (in earlier times '''Makwa/Moqua'''), is a district of the Pacific nation of Nauru. It is the ''de facto'' capital of Nauru and is coextensive with Yaren Constituency. 5 | 6 | ==History== 7 | The district was created in 1968. Its original name, Makwa (or Moqua), refers to Moqua Well, an underground lake and primary source of drinking water for Nauruan people. 8 | 9 | ==Geography== 10 | Yaren is located in the south of the island. Its area is , and its elevation was . To the north of Yaren is Buada, to the east is Meneng and to the west is Boe. 11 | 12 | ==Administration== 13 | Yaren (and sometimes Aiwo) is usually listed as the capital of Nauru. However, this is incorrect; the republic does not have cities or an official capital. Yaren is accepted by the United Nations as the "main district". 14 | 15 | English and Nauruan, the official languages of Nauru, are spoken in the district. 16 | 17 | ===Government and administrative buildings=== 18 | The following government offices are located in this district: 19 | 20 | *the Parliament House 21 | *the earth station 22 | *the administration offices 23 | *the police station 24 | *the fire station 25 | *the National Stadium 26 | *the Australian High Commission and Taiwanese Embassy 27 | *the Nauru International Airport, air terminal, and head office of Nauru Airlines 28 | 29 | ===Constituency=== 30 | 31 | Yaren also constitutes a political constituency. It returns two members to the Parliament of Nauru. 32 | 33 | ==Main sights== 34 | *The Moqua Well is situated in Yaren. 35 | 36 | ==Education== 37 | 38 | The primary and secondary schools serving all of Nauru are Yaren Primary School in Yaren District (Years 1–3), Nauru Primary School in Meneng District (Years 4–6), Nauru College in Denigomodu District (Years 7–9), and Nauru Secondary School (Years 10–12) in Yaren District. 39 | 40 | The Nauru Learning Village in Yaren houses the University of the South Pacific Nauru Campus, the Nauru Technical & Vocational Education Training Centre, and Nauru Secondary. 41 | 42 | ==Personalities== 43 | *Kieren Keke (born 1971), politician and medical doctor 44 | *Charmaine Scotty, politician 45 | *Dominic Tabuna (born 1980), politician 46 | 47 | ==See also== 48 | *List of settlements in Nauru 49 | *Moqua caves 50 | *Nauru Museum 51 | 52 | ==References== 53 | 54 | 55 | ==External links== 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/27_Bazarak.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | '''Bāzārak''' is the provincial capital of Panjshir Province, in the Panjshir Valley of northeastern Afghanistan. It is also the capital of the National Resistance Front of Afghanistan. It is a small city with a total population of 24,723 and has only three police districts (nahias). The total land area of Bazarak city is 9,122 hectares, while there are 2,747 total number of dwellings in the city. It is formed of six villages: Khanez, Jangalak, Malaspa, Parandeh and Rahmankhel. The tomb of Ahmad Shah Massoud, known as the "Lion of Panjshir", is located in Bazarak. 4 | 5 | ==History== 6 | During the Taliban rule of Afghanistan from 1996 to 2001, Bazarak and the Panjshir Valley region was a stronghold for the anti-Taliban Northern Alliance group of former mujahideen, led by town native Ahmad Shah Massoud. 7 | 8 | Bazarak is classified as an Urban Village. Developed land such as housing, institutions and agriculture is clustered along the Panjshir River. Institutional land accounts for almost 30% of built-up land area, but the large majority of the total land is barren (84%). 9 | 10 | Following the 2021 Taliban offensive, Bazarak became the only provincial capital not to fall under Taliban rule, becoming the headquarters of the National Resistance Front of Afghanistan. However, the Taliban claimed to have captured the city on 5 September 2021. 11 | 12 | On 6 September 2021, Taliban senior spokesperson Zabiullah Mujahid claimed to have captured all of Panjshir, including the provincial capital, on Twitter, and pictures on social media showed Taliban fighters standing in front of the gate of the Panjshir provincial governor's compound. The Taliban hoisted their flag at a government building there. However, despite reports, the extent of the Taliban's control in Panjshir was disputed by the NRF spokesman and foreign relations head Ali Maisam Nazary, who claimed on 9 September 2021 that despite making "tactical" withdrawals from some areas, 60% of the province was still under control of the NRF. Tasnim News Agency reporters who visited the area on 11 September 2021 also confirmed the presence of not only Taliban fighters but also NRF fighters in Panjshir. Around late October, a subsequent visit by Radio Télévision Suisse and Journeyman Pictures into Bazarak would report an armed confrontation between the Taliban and the NRF occurring in an undisclosed location in the mountains surrounding Bazarak, reporting that resistance forces gained the upper hand, thus confirming that the NRF is still active near Bazarak and in Panjshir despite claims of inactivity by local Taliban officials. 13 | 14 | ==See also== 15 | * Panjshir Province 16 | 17 | == References == 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/28_West_Island__Cocos__Keeling__Islands.txt: -------------------------------------------------------------------------------- 1 | 2 | '''West Island''' (Malay: Pulau Panjang, Cocos Malay: Pulu Panjang), part of the South Keeling Islands, is the capital of the Cocos (Keeling) Islands, an Australian external territory in the Indian Ocean. The population is roughly 120 making it the third smallest capital in the world, and consists mainly of Europeans. It is less populous than Home Island, the only other inhabited island. 3 | 4 | West Island was part of the Clunies-Ross plantation and an airstrip was built here during World War II. As well as all the government buildings, it contains the airport, a general store and tourist accommodation. In November 2013 it was revealed that the Australian Signals Directorate operates a listening station on West Island. 5 | 6 | ==Education== 7 | Cocos Islands District High School operates a primary and secondary campus on West Island. Most of the students of that campus originate from the Australian continent. 8 | 9 | == Heritage listings == 10 | West Island contains a number of heritage-listed sites, including: 11 | * Morea Close: Administration Building Forecourt 12 | * Air Force Road: Direction Island Houses 13 | * Qantas Close: Government House 14 | * Sydney Highway: Qantas Huts 15 | * RAAF Memorial 16 | * Air Force Road: Type 2 Residences 17 | * William Keeling Crescent: Type T Houses Precinct 18 | * Orion Close: West Island Elevated Houses 19 | * Air Force Road: West Island Housing Precinct 20 | * Alexander Street: West Island Mosque 21 | 22 | == See also == 23 | * Direction Island, Cocos (Keeling) Islands 24 | * Home Island 25 | * Horsburgh Island 26 | * North Keeling 27 | 28 | ==References== 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/29_Capital_of_Korea.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | '''Korea''' has had a number of capitals. Korea is a peninsula in East Asia, currently the peninsula is divided into two countries: North Korea's capital is Pyongyang, and South Korea's capital is Seoul. 5 | 6 | ==During Gojoseon== 7 | Gojoseon: 8 | * Asadal — (legend, unknown) 9 | * Wanggeom (modern Pyongyang) — Second capital (post 400 BCE) 10 | 11 | ==During the Three Kingdoms of Korea== 12 | * Jolbon — first capital of Goguryeo 13 | * Gungnae City — second capital of Goguryeo 14 | * Pyongyang — third capital of Goguryeo 15 | * Wiryeseong (modern Seoul) — first capital of Baekje 16 | * Ungjin (modern Gongju) — second capital of Baekje 17 | * Sabi (modern Buyeo County) — third capital of Baekje 18 | * Gyeongju — capital of Silla 19 | 20 | ==During the North–South States Period== 21 | North–South States Period: 22 | * Gyeongju — capital of Silla 23 | * Dongmo Mountain — first capital of Balhae 24 | * Junggyeong — second capital of Balhae 25 | * Sanggyeong — third capital of Balhae 26 | 27 | ==During the Later Three Kingdoms== 28 | Later Three Kingdoms: 29 | * Gyeongju — capital of Silla 30 | * Wansanju (modern Jeonju) — capital of Later Baekje 31 | * Songak (modern Kaesong) — first capital of Taebong 32 | * Cheorwon (modern Cheorwon County) — second capital of Taebong 33 | 34 | ==During Goryeo== 35 | Goryeo 36 | * Gaegyeong (modern Kaesong) 37 | 38 | ==During Joseon== 39 | Joseon and Korean Empire 40 | * Hanseong (Seoul) 41 | 42 | ==Modern capitals== 43 | * Seoul — capital of South Korea a.k.a. ''Republic of Korea'' (ROK) 44 | * Pyongyang — capital of North Korea a.k.a. ''Democratic People's Republic of Korea'' (DPRK) 45 | 46 | ==References== 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/39_Ngerulmud.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | '''Ngerulmud''' is the seat of government of the Republic of Palau, an island nation in the Pacific Ocean. It replaced Koror City, Palau's largest city, as capital in 2006. The settlement is located in the state of Melekeok on Babeldaob, the country's largest island, located northeast of Koror City and northwest of Melekeok City. 5 | It is the least-populous capital city of a sovereign nation in the world. 6 | 7 | ==Etymology== 8 | The name Ngerulmud precedes the area's designation as capital. It refers to the hill, overlooking the ocean, that dominates the site. 9 | 10 | ''Ngerulmud'' is derived from a Palauan phrase meaning "place of fermented angelfish". The last syllable, ''mud'', is the Palauan word for ''Centropyge tibicen'', also known as the keyhole angelfish. In the past, under a local tradition, women gathered on the hill to offer fermented angelfish to the gods. 11 | 12 | ==History== 13 | The previous capital of Palau was located provisionally in Koror. The country's constitution, ratified in 1979, directed the Palau National Congress to establish a permanent capital in Babeldaob within ten years of the constitution's effective date. The new capital's planning began in 1986, when a contract for the construction of the capitol complex was assigned to a Hawaii-based architecture firm, Architects Hawaii Ltd. (AHL), which had previously designed the capitol complex of the Federated States of Micronesia, located at Palikir. Progress was slow, as Palau lacked engineers and architects, and most of the construction materials had to be imported. 14 | 15 | Further work was not begun until the early 2000s when Palau secured a $20 million loan from Taiwan as part of efforts to enhance relations between the two countries and secure Palau's diplomatic recognition of Taiwan. Containing separate buildings for the ''Olbiil era Kelulau'' (the country's legislature), and also the judicial and executive branches, connected via a central open plaza, the complex cost over US$45 million, and was officially opened on 7 October 2006, with over 5,000 people in attendance. Government officials moved their offices from Koror to Ngerulmud shortly after. 16 | 17 | A 2013 piece in ''The Wall Street Journal'' reported that the capitol building, which was "unsuited to the local climate", had put Palau in debt, and a fault in the ventilation system had recently caused a mold infestation. In April 2013, Ngerulmud's post office was closed permanently, as part of cost-cutting measures implemented by the postmaster, Tommy Sinsak. It had been established in December 2011, following an ''Olbiil era Kelulau'' resolution, and was one of only two in the country (the other being in Koror). During its 16 months of operation, expenses had exceeded US$30,000, while revenues, mainly from stamps, were less than $2,000. Ngerulmud is the only settlement in Palau to have its own ZIP code (96939), with the rest of the country using 96940 – the United States Postal Service services Palau as part of the Compact of Free Association with the United States. 18 | 19 | In July 2014, Ngerulmud hosted the official opening of the 45th Pacific Islands Forum. However, the majority of events at the forum were held in Koror, with the leader's retreat held in Peleliu State. In February 2016, Ngerulmud hosted the 16th Micronesian Presidents' Summit, which was attended by the presidents of Palau, the Marshall Islands, and the Federated States of Micronesia. 20 | 21 | ==Gallery== 22 | 23 | 24 | ==See also== 25 | * List of purpose-built national capitals 26 | 27 | == References == 28 | 29 | 30 | == External links == 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/44_London.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | '''London''' is the capital and largest city of England and the United Kingdom. It stands on the River Thames in south-east England at the head of a estuary down to the North Sea, and has been a major settlement for two millennia. The City of London, its ancient core and financial centre, was founded by the Romans as ''Londinium'' and retains boundaries close to its medieval ones. Since the 19th century, "London" has also referred to the metropolis around this core, historically split between the counties of Middlesex, Essex, Surrey, Kent, and Hertfordshire, which largely makes up Greater London, the region governed by the Greater London Authority. The City of Westminster, to the west of the City, has for centuries held the national government and parliament. 10 | 11 | London, as one of the world's global cities, exerts strong influence on its arts, commerce, education, entertainment, fashion, finance, health care, media, tourism and communications. Its GDP (€801.66 billion in 2017) makes it the biggest urban economy in Europe and one of the major financial centres in the world. In 2019 it had the second highest number of ultra high-net-worth individuals in Europe after Paris and the second-highest number of billionaires of any city in Europe after Moscow. With Europe's largest concentration of higher education institutions, it includes Imperial College London in natural and applied sciences, the London School of Economics in social sciences, and the comprehensive University College London. The city is home to the most 5-star hotels of any city in the world. In 2012, London became the first city to host three Summer Olympic Games. 12 | 13 | London's diverse cultures mean over 300 languages are spoken. The mid-2018 population of Greater London of about 9 million, made it Europe's third-most populous city. It accounts for 13.4 per cent of the UK population. Greater London Built-up Area is the fourth most populous in Europe, after Istanbul, Moscow and Paris, with 9,787,426 inhabitants at the 2011 census. The London metropolitan area is the third-most populous in Europe after Istanbul's and Moscow's, with 14,040,163 inhabitants in 2016. 14 | 15 | London has four World Heritage Sites: the Tower of London; Kew Gardens; the Palace of Westminster, along with Westminster Abbey, and St Margaret's Church; and the historic settlement in Greenwich, where the Royal Observatory, Greenwich defines the Prime Meridian (0° longitude) and Greenwich Mean Time. Other landmarks include Buckingham Palace, the London Eye, Piccadilly Circus, St Paul's Cathedral, Tower Bridge and Trafalgar Square. It has numerous museums, galleries, libraries and sporting venues, including the British Museum, National Gallery, Natural History Museum, Tate Modern, British Library and West End theatres. The London Underground is the oldest rapid transit system in the world. 16 | 17 | ==Toponymy== 18 | 19 | ''London'' is an ancient name, already attested in the first century AD, usually in the Latinised form ; for example, handwritten Roman tablets recovered in the city originating from AD 65/70–80 include the word ('in London'). 20 | 21 | Over the years, the name has attracted many mythicising explanations. The earliest attested appears in Geoffrey of Monmouth's , written around 1136. -------------------------------------------------------------------------------- /explore_the_world/data/dataset/64_Banjul.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | '''Banjul''' (, ), officially the '''City of Banjul''', is the capital and fourth largest city of The Gambia. It is the centre of the eponymous administrative division which is home to an estimated 400,000 residents, making it The Gambia's largest and most densely populated metropolitan area. Banjul is on St Mary's Island (Banjul Island), where the Gambia River enters the Atlantic Ocean. The population of the city proper is 31,301, with the '''Greater Banjul Area''', which includes the City of Banjul and the Kanifing Municipal Council, at a population of 413,397 (2013 census). The island is connected to the mainland to the west and the rest of Greater Banjul Area via bridges. There are also ferries linking Banjul to the mainland at the other side of the river. 6 | 7 | ==Etymology== 8 | 9 | Banjul takes its name from the Mandinka people who gathered specific fibres on the island, which were used in the manufacture of ropes. ''Bang julo'' is the Mandinka word for rope fibre. 10 | 11 | ==History== 12 | A sketch of Bathurst, published in 1824 13 | Arch 22 at the entrance to Banjul. The statue of the former president was removed following democratic elections in 2016. 14 | 15 | In 1651 Banjul was leased by the Duke of Courland and Semigallia (German: ''Herzog von Kurland und Semgallen'') from the King of Kombo, as part of the Couronian colonization. 16 | 17 | On 23 April 1816, the King of Kombo ceded Banjul Island to Alexander Grant, the British commandant. Grant founded Banjul as a trading post and base, constructing houses and barracks for controlling entrance to the Gambia estuary and suppressing the slave trade. The British renamed Banjul Island as St. Mary's Island and named the new town Bathurst, after the 3rd Earl Bathurst, Secretary of State for War and the Colonies at the time. Streets were laid out in a modified grid pattern, and named after Allied generals at the Battle of Waterloo. The town became the centre of British activity in the Gambia Colony and Protectorate. 18 | 19 | After independence, the town's name was changed to Banjul in 1973. On 22 July 1994, Banjul was the scene of a bloodless military coup d'état in which President Dawda Jawara was overthrown and replaced by Yahya Jammeh. To commemorate this event, Arch 22 was built as an entrance portal to the capital. The gate is 35 metres tall and stands at the centre of an open square. It houses a textile museum. 20 | 21 | == Culture == 22 | Attractions in the city include the Gambian National Museum, the Albert Market, Banjul State House, Banjul Court House, African Heritage Museum. 23 | 24 | == Sport == 25 | Banjul is the destination of the Plymouth-Banjul Challenge, a charity road rally. 26 | 27 | ==Economy== 28 | 29 | Banjul is the country's economic and administrative centre and includes the Central Bank of the Gambia. Peanut processing is the country's principal industry, but beeswax, palm wood, palm oil, and skins and hides are also shipped from the port of Banjul. 30 | 31 | Banjul is also the home of the Gambia Technical Training Institute. GTTI is engaged in a partnership with non-profit organization Power Up Gambia to develop a solar energy training program. 32 | 33 | 34 | File:1014046-Banjul Albert Market-The Gambia.jpg|Albert Market 35 | File:Gambia Banjul 0012.jpg|A street in Banjul 36 | File:Banjul, The Gambia.JPG|Banjul from the International Space Station 37 | 38 | 39 | ==Climate== 40 | Banjul has a hot climate year round. Under the Köppen climate classification, Banjul features a tropical wet and dry climate (AW). The city features a lengthy dry season, spanning from November to May and a relatively short wet season covering the remaining five months. However, during those five months, Banjul tends to see heavy rainfall. August is usually the rainiest month, with on average of rainfall. Temperatures are somewhat constant, though it tends to be warmer during the wet season than the dry season. 41 | 42 | According to a Gambian government minister, Banjul is at risk of submerging under water by a meter rise in sea levels as a result of climate change and global warming. 43 | 44 | 45 | 46 | ==Transport== 47 | 48 | The primary method reaching the city by land is by roadway. A highway connects Banjul to Serrekunda which crosses the Denton Bridge, however ferries provide another mode of transportation. As of May 2014, ferries sail regularly from Banjul across the Gambia River to Barra. The city is served by the Banjul International Airport. Banjul is on the Trans–West African Coastal Highway connecting it to Dakar and Bissau, and will eventually provide a paved highway link to 11 other nations of the Economic Community of West African States (ECOWAS). 49 | 50 | 51 | File:Banjul International Airport.jpg|Banjul International Airport 52 | File:Banjul ferry.jpg|Banjul Ferry 53 | 54 | 55 | ==Districts== 56 | Districts of Banjul 57 | 58 | Banjul Division (Greater Banjul Area) is divided into two districts: 59 | *Banjul 60 | *Kanifing 61 | 62 | ==Education== 63 | The University of the Gambia was founded in 1999. 64 | 65 | International schools: 66 | * Banjul American Embassy School 67 | * École Française de Banjul in Bakau. 68 | * Marina International School 69 | 70 | == Places of worship == 71 | Among the places of worship, they are predominantly Muslim mosques. There are also Christian churches and temples : Roman Catholic Diocese of Banjul (Catholic Church), Church of the Province of West Africa (Anglican Communion), Assemblies of God. 72 | 73 | ==See also== 74 | 75 | 76 | *Divisions of the Gambia 77 | *Districts of the Gambia 78 | 79 | ==References== 80 | 81 | 82 | ==Bibliography== 83 | * 84 | * Matthew James Park, Heart of Banjul: The History of Banjul, The Gambia, 1816-1965. PhD dissertation, Michigan State University, 2016. 85 | * 86 | 87 | ==External links== 88 | 89 | 90 | * Access Gambia - Hotels, News, Travel & Photos 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/67_Palikir.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | '''Palikir''' () is the capital city of the Federated States of Micronesia located in the western Pacific Ocean. A town of slightly under 5,000 residents, it is part of the larger Sokehs municipality, which had a population of 6.647 , out of the nation's total population of 106,487. It is situated on the northwest side of Pohnpei island (population 34,789), a high volcanic island surrounded by a fringing coral reef. Nearby to the northeast is the island's largest settlement, the coastal town of Kolonia. It was declared the capital of Micronesia in 1989. 6 | 7 | ==History== 8 | Pohnpei was ruled by tribal chiefs in ancient times. Palikir was formerly a tiny village of little consequence. The island of Pohnpei was encountered by the Portuguese and Spanish in the 15th century, but colonial settlement did not occur until 1886 by the Spanish. Later Germany attained the Caroline Islands via purchase from Spain at the end of the Spanish–American War in 1898. During World War I control passed to the Japanese. During World War II, the Japanese built an airport near Kolonia. Subsequent to World War II, the island was administered by the United States Government until FSM attained independence in 1979. The government of the Federated States of Micronesia decided to convert the Palikir area into a town to house the central administration of the islands as a purpose built capital city. It was declared the capital of Micronesia in 1989. US aid of US$15 million was made available to develop the site into a modern town. All government offices, some residential houses, and the residence of the President of the Federated States of Micronesia were built. It is now the hub of the federal administration of the country, despite still being a village with a population of 4,645. 9 | 10 | ==Geography== 11 | Palikir is located in the northwestern center of Pohnpei Island (formerly known as Ponape). Geologically the island terrain consists of high mountains to low coral atolls. It is the largest, highest, wettest and most scenic island of the Federated States of Micronesia. Palikir is southwest of Kolonia, which is Pohnpei's largest town and state capital of Pohnpei State. Underwater reefs are found all round the coastal region of the island. to the southeast, Mount Nanlaud is the highest point of the Federated States of Micronesia and of Pohnpei at as indicated on the definitive USGS 1:25,000 scale topographic survey. Palikir is surrounded by heavily wooded forest. 12 | 13 | ==Climate== 14 | Palikir features a tropical rainforest climate under the Köppen climate classification. However, as a trade-wind climate which besides knows frequent cyclones it is not equatorial. Common to many areas with this climate, Palikir sees very little variance in its temperatures during the course of the year, averaging roughly daily throughout the year. However, the town sees an extraordinary amount of precipitation during the course of the year. On average of rainfall falls on Palikir annually. It is the wettest capital city in the world. 15 | 16 | 17 | 18 | ==Demographics== 19 | The nationality of the people is Micronesian with the most common ethnicities being Chuukese, Kosraen, Pohnpeian, and Yapese. English is the common and official language while each of the major islands have their own local language such as Trukese, Pohnpeian, Yapese, and Kosrean. 96% of the population is Christian with Roman Catholicism being the majority religion at over 50% of the population. The city has been categorized as having a "high degree of hardship with a typical hardship premium of 30%" from an international perspective. 20 | 21 | ==Administration== 22 | Since 1989, Palikir is the federal capital of the Federated States of Micronesia (FSM), which attained independence from, and remains since in free association with, the United States in May 1979. FSM has a constitutional government headed by a president. 23 | 24 | ==Economy== 25 | The economy of the capital city is reflected in the economic resources of the FSM Islands (600 islands, atolls and islets (including Pohnpei Island)) as a whole. The economy of the island consists basically of subsistence farming and fishing (fish processing and aquaculture). Tropical agricultural and plantation products like copra, breadfruit, taro, betel nuts, sweet potatoes, cassava, tropical fruits and vegetables, trochus shells, cacao and rice are produced. Livestock farming exists, fe. pigs and poultry being raised. Products such as fish, bananas, black pepper, and garments are mainly exported to Japan. Imported items are food, manufactured goods, machinery and equipment and beverages. 26 | 27 | The country is independent, but in fact depends on financial support stemming from its Compact of Free Association with the US. the inflation rate was 2% and the cost of living (for imported goods) in Palikir is reportedly very high in comparison with other places in the world. 28 | 29 | ==Education== 30 | Pohnpei State Department of Education operates public schools: 31 | * Palikir Elementary School 32 | 33 | Bailey Olter High School (former Pohnpei Island Central School or PICS) in Kolonia serves students from Sokehs. 34 | 35 | ==Notable people== 36 | * Bailey Olter, politician 37 | * Emelihter Kihleng, poet 38 | 39 | ==References== 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/6_Vienna.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/85_Saint-Denis__Réunion.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Bilingual sign in French and Réunion Creole 9 | '''Saint-Denis''' (, , unofficially '''Saint-Denis de La Réunion''' for disambiguation; ) is the ''préfecture'' (administrative capital) of the French overseas department and region of Réunion, in the Indian Ocean. It is located at the island's northernmost point, close to the mouth of the Rivière Saint-Denis. 10 | 11 | Saint Denis is the most populous commune in the French overseas departments and the twentieth most populous in all of France. At the 2018 census, there were 309,635 inhabitants in the metropolitan area of Saint Denis (as defined by INSEE), 150,535 of whom lived in the city (commune) of Saint-Denis proper and the remainder in the neighbouring communes of La Possession, Sainte-Marie, Sainte-Suzanne, Saint-André, and Bras-Panon. 12 | 13 | ==History== 14 | Saint-Denis's former city hall and the Column of Victory. 15 | Former defense at beach in front of Saint-Denis 16 | Saint-Denis was founded by Étienne Regnault in 1669 and became the capital of Réunion in 1738. 17 | 18 | 19 | 20 | ==Geography== 21 | Saint Denis from the SPOT satellite 22 | 23 | The city is located on the north end of the island, and was a port. Saint Denis was "originally the main port of Réunion, but an artificial harbour at Le Port, on the northwest coast, replaced it in the 1880s, because of unpredictable winds and tides at Saint-Denis." The city includes some of the island's mountains, with a peak elevation of within the metro area, which begins at sea level at the coast line. 24 | 25 | The city has many neighbourhoods: 26 | Le Barachois, Bellepierre, Bois-de-Nèfles, La Bretagne (Le Cerf), Le Brûlé, Les Camélias, Centre-ville, Champ-Fleuri, La Montagne(Le Colorado, Ruisseau Blanc, Saint-Bernard), Montgaillard, La Providence, La Rivière Saint-Denis (La Redoute), Ruisseau des Noirs, Saint-François, Saint-Jacques, Sainte-Clotilde (Le Butor, le Chaudron, Commune Prima, Domenjod, Le Moufia), La Source, La Trinité, Vauban 27 | 28 | 29 | 30 | == Climate == 31 | Saint-Denis features a tropical monsoon climate (Köppen ''Am'') with two distinct seasons: a hot and humid wet season from December to April and a very warm, less humid drier season for the remaining seven months of the year, with July to October qualifying as true dry season months. The dry season does typically feature relatively light rain, but it is not wet enough to be a tropical rainforest climate. During the wet season, tropical cyclones often affect the city. 32 | 33 | 34 | == Demography == 35 | Saint-Denis is the most populous commune in the French overseas departments. The population of St Denis has grown substantially since 1954, both in the commune and the metropolitan area. In the 64 years from 1954 to the census in 2018, population has more than tripled. The annual rate of population growth has been lower in the 21st century than in the 20th century. 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | The places of birth of the 304,223 residents in the Saint-Denis metropolitan area at the 2015 census were the following: 50 | *81.1% were born in Réunion 51 | *11.1% in Metropolitan France 52 | *1.1% in Mayotte 53 | *0.3% in other parts of Overseas France 54 | *6.4% in foreign countries (notably Madagascar, the Union of the Comoros, and Mauritius); half of them were immigrants and the other half were children of French citizens born abroad (children of Réunionese settlers in Madagascar for example) 55 | 56 | ==Transport and accommodation== 57 | The closest airport is Roland Garros Airport, 7 km east of the city in Sainte-Marie, Réunion, which is also the main international airport of Réunion. Air Austral is the regional air carrier, with its Indian Ocean hub located at the airport. The airline has begun serving some cities in mainland France. Five or six other airlines serve the airport. There is a good road network in Saint-Denis. 58 | 59 | The hotels in Saint-Denis include Mercure Creolia Hotel, Austral Hotel and Best Western. 60 | 61 | ==Mayors== 62 | * 2020–present: Ericka Bareigts, PS 63 | * 2008–2020: Gilbert Annette, PS 64 | * 2001–2008: René-Paul Victoria, UMP 65 | * 1994–2001: Michel Tamaya, PS 66 | * 1989–1994: Gilbert Annette, PS 67 | * 1969–1989: Auguste Legros, RPR 68 | 69 | ==Culture == 70 | *Léon Dierx Museum (art gallery and museum) 71 | *Jardin de l'État (public gardens – includes a natural history museum) 72 | *Le Barachois, seafront park 73 | *La Roche Écrite ( south of the city), summit overlooking Saint-Denis, with impressive views over the city 74 | * Brasseries de Bourbon 75 | 76 | == Places of worship == 77 | Cathedral of Saint Denis. 78 | Among the places of worship, they are predominantly Christian churches and temples : Roman Catholic Diocese of Saint-Denis de La Réunion (Catholic Church), Assemblies of God. There are also Muslim mosques. 79 | 80 | ==Education== 81 | The University of Reunion Island admits 15,000 students each year, with 6 campus sites in Saint-Denis. Course work is aligned with European standards for university education. There is a school of engineering as well. The language is French, and there are connection with educational institutions in France on the continent of Europe. 82 | 83 | The commune maintains various elementary schools for each sector. 84 | 85 | ==Economy== 86 | IBM has an office in Saint-Denis. The island began organizing to be a digital hub for nearby African nations, relying on its two undersea cables for good internet connections. The potential for services would alter the island's economy, now reliant on sugar, an agricultural product. The University in Saint-Denis has programs to educate the young population in digital skills. New businesses are forming to serve the needs of airlines for software. 87 | 88 | ==International relations== 89 | 90 | 91 | Saint Denis, Réunion is twinned with: 92 | 93 | * 20px Metz, France 94 | * 20px Nice, France 95 | * 20px Tangier, Morocco 96 | 97 | == Notable residents == 98 | Sentenced to exile in Réunion, the Moroccan Rais Abd el-Krim lived a few years in Saint-Denis from 1926. 99 | 100 | Prince Bảo Vàng of Vietnam (also known as Yves Claude Vinh San) the son of Emperor Duy Tân, was born and resided in Saint Denis, Réunion for his final years. His family also resided there. 101 | 102 | Other people connected with Saint Denis include: 103 | Monument honoring Roland Garros at Le Barachois 104 | * Félix Guyon (1831–1920), urologist 105 | * Édouard Hervé (1835–1899), journalist and academician 106 | * Juliette Dodu (1848–1909), resistant to the war of 1870 107 | * Ambroise Vollard (1866–1939), art dealer and gallery 108 | * Raymond Vergès (1882–1957), mayor of the town, founder of Témoignages 109 | * Roland Garros (1888–1918), aviator 110 | * Émile Hugot (1904–1993), industrialist in sugarcane 111 | * Jean-Henri Azéma (1913–2000), poet 112 | * Raymond Barre 1924–2007, politician 113 | * Daniel Sangouma (1965), sprinter 114 | * Gérald De Palmas (1967), singer 115 | * Surya Bonaly (1973), International Olympic Skater 116 | * Willy Grondin (1974), football player 117 | * Daniel Narcisse (1979), International handball 118 | * Valérie Gauvin (1996), football player 119 | * Julienne Salvat (1932–2019), teacher, poet, ''femme de lettres'', actress 120 | 121 | ==See also== 122 | * Communes of the Réunion department 123 | 124 | ==References== 125 | 126 | 127 | ==External links== 128 | 129 | 130 | 131 | * Saint Denis Official website 132 | * Tourism Réunion office website 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/86_Adamstown__Pitcairn_Islands.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | '''Adamstown''' is the capital of, and the only settlement on, the Pitcairn Islands. 5 | 6 | ==Overview== 7 | Adamstown has a population of 40, which is the entire population of the Pitcairn Islands. All the other islands in the group are uninhabited. Adamstown is where most residents live, while they grow food in other areas of the island. 8 | 9 | Adamstown is the third smallest capital in the world by population. It has access to television, satellite Internet, and a telephone; however, the main means of communication remains ham radio. The "Hill of Difficulty" connects the island's jetty to the town. 10 | 11 | ==History== 12 | 13 | The history of the Pitcairn Islands begins with the settlement of the islands by Polynesians in the 11th century. The Polynesians established a culture that flourished for four centuries and then vanished. Pitcairn was settled again in 1790 by a group of British mutineers on HMS ''Bounty'' and Tahitians. Adamstown is named for the last surviving mutineer, John Adams. 14 | 15 | ==Geography== 16 | 17 | The settlement is located on the central-north side of the island of Pitcairn, facing the Pacific Ocean and close to the Bounty Bay, the only seaport of the island. 18 | 19 | ===Climate=== 20 | 21 | Adamstown has a tropical rainforest climate (Af) under the Köppen climate classification system. The hamlet features a wet, warm climate averaging of rain a year. The wettest month is December and temperatures do not vary significantly throughout the year. 22 | 23 | 24 | 25 | ==Personalities== 26 | 27 | *Ned Young (1762–1800) 28 | *Fletcher Christian (1764–1793) 29 | *John Adams (1768–1829) 30 | *Joshua Hill (1773–1844?) 31 | *Thursday October Christian (1790–1831) 32 | *Steve Christian (b. 1951) 33 | *Brenda Christian (b. 1953) 34 | *Meralda Warren (b. 1959) 35 | 36 | ==See also== 37 | *Bounty Bible 38 | * 39 | *Island Council of Pitcairn 40 | *Pitcairn sexual assault trial of 2004 41 | *List of rulers of the Pitcairn Islands 42 | 43 | ==Notes and references== 44 | 45 | 46 | ==External links== 47 | * 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/87_Laayoune.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | '''Laâyoune''' ( , also , ) or '''El Aaiún''' ( , ; Hassaniya Arabic: , romanized: ; ; ) is the largest city of the disputed territory of Western Sahara, with a population of 217,732 in 2014. The city is under ''de facto'' administration by Morocco. The modern city is thought to have been founded by the Spanish captain Antonio de Oro in 1938. In 1940, Spain designated it as the capital of the Spanish Sahara. Laâyoune is the capital of the Laâyoune-Sakia El Hamra region administered by Morocco, under the supervision of the UN peacekeeping mission MINURSO. 8 | 9 | The town is divided in two by the dry river of Saguia el-Hamra. On the south side is the old lower town, constructed by Spanish colonists. A cathedral from that era is still active; its priests serve this city and Dakhla further south. 10 | 11 | ==History== 12 | ''Laâyoune'' or ''El Aaiún'' are respectively the French and Spanish transliterations of the Maghrebi Arabic name ''Layoun'', which means "the springs", in reference to the oases that furnish the town's water supply. 13 | 14 | The town was the scene of the Zemla Intifada that occurred on June 17, 1970 that culminated in a massacre, resulting in the deaths ranging from 2 to 11 people. 15 | 16 | ==Climate== 17 | Laayoune has a hot desert climate (Köppen climate classification ''BWh''), moderated by the Canary Current, with an average annual temperature just over . 18 | 19 | 20 | ==Demographics== 21 | Laayoune has a population of 217,732 and is the largest city in Western Sahara. 22 | 23 | 24 | 25 | Year 26 | 27 | Population 28 | 29 | 30 | 31 | 1982 (Census) 32 | 33 | 93,875 34 | 35 | 36 | 37 | 1994 (Census) 38 | 39 | 136,950 40 | 41 | 42 | 43 | 2004 (Census) 44 | 45 | 183,691 46 | 47 | 48 | 49 | 2014 (Census) 50 | 51 | 217,732 52 | 53 | 54 | 55 | 56 | ==Economy and status== 57 | 58 | The city is a hub for fishing and for phosphate mining in the region. In 2010, the country was negotiating a new fishing agreement with Europe over offshore fishing. 59 | 60 | 61 | 62 | == Sport == 63 | The football club of the city is Jeunesse Massira. The club plays in the Moroccan Premier League, the highest football league in the country. Jeunesse Massira uses Stade Sheikh Mohamed Laghdaf for training and games. 64 | 65 | == Transport == 66 | Laayoune is served by Hassan I Airport. 67 | 68 | == Education == 69 | Schools in Laâyoune include a Spanish international school, Colegio Español La Paz, owned by the Spanish government. 70 | 71 | == Diplomatic missions == 72 | On 18 December 2019, Comoros became the first nation to open a consulate in Laayoune in support of Moroccan claims to Western Sahara. In January 2020, Gabon opened a consulate general in Laayoune. Later on, São Tomé and Príncipe, the Central African Republic, Ivory Coast, Burundi, Eswatini, Zambia, the United Arab Emirates, and Bahrain, also opened consulates in Laayoune. 73 | 74 | == Gallery == 75 | 76 | File:Mosque moulay abd el aziz laayoune.jpg|Mosque of Moulay Abd el Aziz 77 | File:Laayoune Cathedral 2011.jpg|The old Spanish Cathedral of Saint Francis of Assisi, chiefly serves European UN personnel 78 | File:Street view from Laayoune 2011.jpg|Avenue Makkah al-Mukarramah 79 | File:Monumental Arch, Laayoune.jpg|Monumental arch near the airport 80 | File:Road to Laayoune Port.jpg|Road to Laayoune Port 81 | File:Laayoune Bus Station.jpg|Laayoune bus station. 82 | 83 | 84 | ==See also== 85 | 86 | *List of cities in Western Sahara 87 | 88 | ==References== 89 | 90 | 91 | ==External links== 92 | 93 | * Official TV channel 94 | * Official radio channel 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/88_City_of_San_Marino.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | The '''City of San Marino''' (), also known simply as '''San Marino''' and locally as '''Città''', is the capital city of the Republic of San Marino, Southern Europe. The city has a population of 4,044. It is on the western slopes of San Marino's highest point, Monte Titano. 8 | 9 | ==Geography== 10 | Although not the capital, most of the businesses are in Borgo Maggiore. It is the third largest city in the country, after Dogana and Borgo Maggiore. It borders the San Marino municipalities Acquaviva, Borgo Maggiore, Fiorentino, and Chiesanuova and the Italian municipality San Leo. 11 | 12 | Akademio Internacia de la Sciencoj San Marino was centered here. 13 | 14 | ==History== 15 | ''Due to its being the capital and previously the only city in San Marino, the history of this city is almost the same as the History of San Marino. For more information on that topic, see that article.'' 16 | 17 | The city was founded by Saint Marinus and several Christian refugees in the year 301. From then on the city became a center of Christian refugees who fled from Roman persecution. 18 | 19 | The urban heart of the city was protected by three towers: the first, Guaita, constructed in the 11th century, was famous for being impenetrable, which to a great extent discouraged attacks on the city. 20 | 21 | Due to the Crusades, it was felt necessary to construct a second tower, Cesta (13th century). But the Sanmarinense defensive system was not completed until the construction of a third tower, the Montale (14th century) - the smallest of all and constructed on the last of the summits of Monte Titano. 22 | 23 | With the population of the city increasing, the territory of the country was extended by a few square kilometers. Since the Sanmarinese policy was not to invade or to use war to obtain new territories, it was by means of purchases and treaties that San Marino obtained the other eight ''castelli'' which make up the country. 24 | 25 | ==Parishes== 26 | The City of San Marino has the following 7 parishes or wards (''curazie''): 27 | * Cà Berlone 28 | * Canepa 29 | * Casole 30 | * Castellaro 31 | * Montalbo 32 | * Murata 33 | * Santa Mustiola 34 | 35 | ==Economy== 36 | 37 | 38 | The economy of the city of San Marino has always been closely bound to that of the country. Until recently, the main economic activities of the locality were stone extraction and carving. Today, there is a more varied economy, including tourism, commerce, sale of postage stamps, and a small agricultural industry, although the latter is in decline. 39 | 40 | ===Landmarks=== 41 | 42 | 43 | The city is visited by more than three million people per year, and has developed progressively as a tourist centre. Of the tourists, 85% are Italian. There are also more than a thousand retail outlets, where one can find a great variety of products. 44 | 45 | ====Main sights==== 46 | *Basilica di San Marino 47 | * Palazzo dei Capitani 48 | * Palazzo Pubblico 49 | * Teatro Titano 50 | * The Three Towers of San Marino 51 | * Piazza del Titano 52 | * Piazza Garibaldi 53 | * Monastery of Santa Clara 54 | * Grand Hotel San Marino 55 | 56 | ===Transport=== 57 | 58 | 59 | The town is known for its long, winding cobblestoned streets, as its altitude and steep approach put it beyond the reach of the San Marino Superhighway. San Marino is also notable in that cars are prohibited in much of the town center. 60 | 61 | Before the Second World War, a railway was built from San Marino to Rimini under the dictatorship of Benito Mussolini. Its tunnels, and the railway station 'Piazzale Lo Stradone', still exist. Proposals for the reopening of this railway have been presented to the government on several occasions, but thus far without action. 62 | 63 | There is a regular bus service to Rimini, and a cable car line connects the capital with Borgo Maggiore. 64 | 65 | A series of lifts also connects the upper part of town with the lower. 66 | 67 | ==Sports== 68 | The city of San Marino has two football teams: the S.S. Murata and the S.P. Tre Penne. The city had the Olympic Flame pass through San Marino during the run-up to the 2006 Winter Olympics. 69 | 70 | ==Photogallery== 71 | 72 | File:San Marino ratusz.jpg|''Palazzo Pubblico'', the Town Hall 73 | File:Fortress of Guaita 2013-09-19.jpg|Guaita tower 74 | File:Cesta 2013-09-19.jpg|Cesta tower 75 | File:Montale.JPG|Montale tower 76 | File:Hastalapolastra.jpg|Via Paul III 77 | File:Funala RSM.jpg|Piazza Giuseppe Garibaldi 78 | File:Statua della Libertà.jpg|Statue of Liberty in the square of the Town Hall 79 | File:The Walls of the Liberty DLO.jpg|Panoramic view from Murata 80 | 81 | 82 | ==International relations== 83 | Map of the municipality of San Marino 84 | 85 | ===Twin towns—Sister cities=== 86 | The City of San Marino is twinned with: 87 | * San Leo, Italy 88 | * Rab, Croatia 89 | * Rønne, Denmark 90 | * Scranton, Pennsylvania, United States 91 | 92 | == See also == 93 | 94 | * Carcere dei Cappuccini, the only prison in San Marino 95 | 96 | ==References== 97 | 98 | 99 | ==External links== 100 | 101 | * San Marino's page on giuntedicastello.sm 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /explore_the_world/data/dataset/98_Victoria__Seychelles.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | '''Victoria''' () is the capital and largest city of the Republic of the Seychelles, situated on the north-eastern side of Mahé island, the archipelago's main island. The city was first established as the seat of the British colonial government. In 2010, the population of Greater Victoria (including the suburbs) was 26,450 out of the country's total population of 90,945. 5 | 6 | ==History== 7 | The area that would become Victoria was originally settled in 1778 by French colonists after they claimed the island in 1756. The town was called ''L'Établissement'' until 1841 when it was renamed to Victoria by the British, after Queen Victoria. 8 | 9 | == Economy == 10 | Tourism is an important sector of the economy. The principal exports of Victoria are vanilla, coconuts, coconut oil, fish and guano. 11 | 12 | == Education == 13 | The Mont Fleuri campus of the University of Seychelles is in Victoria. 14 | 15 | == Culture == 16 | Victoria Clocktower 17 | Attractions in the city include a clocktower modelled on Little Ben in London, the courthouse, the Botanical Gardens, the National Museum of History, the Natural History Museum and the Sir Selwyn Selwyn-Clarke Market. Victoria Market and the brightly coloured fish and fruit markets is the local hot spot for the Seychellois people. 18 | 19 | == Places of worship == 20 | Immaculate Conception Cathedral 21 | Arulmigu Navasakti Vinayagar Temple 22 | There are two cathedrals in Victoria, Immaculate Conception Cathedral (Roman Catholic) and St Paul's Cathedral (Anglican). There are also Baptist and Pentecostal churches, mosques and Hindu temples. 23 | 24 | == Sports == 25 | Stade Linité, the national stadium, is in Victoria. It is mostly used for football matches. 26 | 27 | == Transport == 28 | Victoria is served by Seychelles International Airport, completed in 1971. The inner harbour lies immediately east of the town, where tuna fishing and canning is a major industry. One of the largest bridges in Victoria was destroyed by tsunami waves from the 2004 Indian Ocean earthquake. 29 | 30 | ==Districts== 31 | Four of the districts of Seychelles are in Victoria. 32 | *Greater Victoria 33 | **English River (La Rivière Anglaise), the central district 34 | **Saint Louis 35 | **Mont Fleuri 36 | **Bel Air 37 | 38 | ==Twin towns and sister cities== 39 | Victoria is twinned with: 40 | 41 | 42 | 43 | 44 | 45 | Country 46 | 47 | City 48 | 49 | 50 | 51 | 52 | 53 | 25px Djibouti 54 | 55 | 56 | 57 | 58 | 59 | Daliyat al-Karmel 60 | 61 | 62 | 63 | 64 | 65 | Haikou 66 | 67 | 68 | 69 | ==Climate== 70 | Victoria features a tropical rainforest climate (Köppen climate classification ''Af'') with high temperatures throughout the course of the year. The capital does have noticeably wetter and drier periods during the year, with June and July being its driest months and December through February being the city's wettest months. However, since in no month does the average monthly precipitation falls below in Victoria, the city does not have a true dry season month. This lack of a true dry season month is a primary reason why the climate falls under the tropical rainforest climate category. The capital averages about of rainfall annually. Although being very rainy, skies are usually clear to partly clear and completely cloudy days remain scarce throughout the year even during the rainiest months. 71 | 72 | 73 | 74 | ==See also== 75 | *Romainville Island, Seychelles 76 | 77 | 78 | ==References== 79 | 80 | 81 | ==External links== 82 | 83 | * 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /explore_the_world/deploy/docker-compose.prod.yml: -------------------------------------------------------------------------------- 1 | # This compose file overrides the base one in the demo folder and is meant to be used in production 2 | version: "3" 3 | 4 | services: 5 | haystack-api: 6 | image: "deepset/haystack:gpu-v1.12.2" 7 | deploy: 8 | resources: 9 | reservations: 10 | devices: 11 | - driver: nvidia 12 | count: 1 13 | capabilities: [gpu] 14 | restart: always 15 | environment: 16 | CONCURRENT_REQUEST_PER_WORKER: 16 17 | HAYSTACK_EXECUTION_CONTEXT: "public_demo" 18 | PIPELINE_YAML_PATH: /opt/venv/lib/python3.7/site-packages/rest_api/pipeline/pipelines_dpr.haystack-pipeline.yml 19 | 20 | elasticsearch: 21 | restart: always 22 | 23 | ui: 24 | restart: always 25 | environment: 26 | DEFAULT_DOCS_FROM_RETRIEVER: 7 27 | DEFAULT_NUMBER_OF_ANSWERS: 5 28 | DISABLE_FILE_UPLOAD: 1 29 | -------------------------------------------------------------------------------- /explore_the_world/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | elasticsearch: 5 | image: "deepset/elasticsearch-countries-and-capitals" 6 | ports: 7 | - 9200:9200 8 | restart: on-failure 9 | 10 | haystack-api: 11 | image: "deepset/haystack:cpu" 12 | ports: 13 | - 8000:8000 14 | restart: on-failure 15 | environment: 16 | - DOCUMENTSTORE_PARAMS_HOST=elasticsearch 17 | - PIPELINE_YAML_PATH=/opt/venv/lib/python3.10/site-packages/rest_api/pipeline/pipelines_dpr.haystack-pipeline.yml 18 | depends_on: 19 | elasticsearch: 20 | condition: service_healthy 21 | 22 | ui: 23 | image: "deepset/demo-explore-the-world" 24 | ports: 25 | - 8501:8501 26 | restart: on-failure 27 | environment: 28 | - API_ENDPOINT=http://haystack-api:8000 29 | # The value fot the following variables will be read from the host, if present. 30 | # They can also be temporarily set for docker-compose, for example: 31 | # $ DISABLE_FILE_UPLOAD=1 DEFAULT_DOCS_FROM_RETRIEVER=5 docker-compose up 32 | - DISABLE_FILE_UPLOAD 33 | - DEFAULT_QUESTION_AT_STARTUP 34 | - DEFAULT_DOCS_FROM_RETRIEVER 35 | - DEFAULT_NUMBER_OF_ANSWERS 36 | command: "/bin/bash -c 'sleep 15 && python -m streamlit run ui/webapp.py'" 37 | -------------------------------------------------------------------------------- /explore_the_world/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "ui" 7 | description = 'Minimal UI for Haystack (https://github.com/deepset-ai/haystack)' 8 | readme = "README.md" 9 | requires-python = ">=3.7" 10 | license = "Apache-2.0" 11 | keywords = [] 12 | authors = [ 13 | { name = "deepset.ai", email = "malte.pietsch@deepset.ai" }, 14 | ] 15 | classifiers = [ 16 | "Development Status :: 5 - Production/Stable", 17 | "Intended Audience :: Science/Research", 18 | "Topic :: Scientific/Engineering :: Artificial Intelligence", 19 | "Operating System :: OS Independent", 20 | "Programming Language :: Python", 21 | "Programming Language :: Python :: 3.7", 22 | "Programming Language :: Python :: 3.8", 23 | "Programming Language :: Python :: 3.9", 24 | "Programming Language :: Python :: 3.10", 25 | "Programming Language :: Python :: Implementation :: CPython", 26 | ] 27 | dependencies = [ 28 | "streamlit >= 1.9.0, < 2", 29 | "st-annotated-text >= 2.0.0, < 3", 30 | "markdown >= 3.3.4, < 4" 31 | ] 32 | dynamic = ["version"] 33 | 34 | [project.urls] 35 | Documentation = "https://github.com/deepset-ai/haystack/tree/main/ui#readme" 36 | Issues = "https://github.com/deepset-ai/haystack/issues" 37 | Source = "https://github.com/deepset-ai/haystack/tree/main/ui" 38 | 39 | [tool.hatch.version] 40 | path = "ui/__about__.py" 41 | 42 | [tool.hatch.build.targets.sdist] 43 | [tool.hatch.build.targets.wheel] 44 | 45 | [tool.hatch.envs.default] 46 | dependencies = [ 47 | "pytest", 48 | "pytest-cov", 49 | ] 50 | [tool.hatch.envs.default.scripts] 51 | cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=ui --cov=tests" 52 | no-cov = "cov --no-cov" 53 | 54 | [[tool.hatch.envs.test.matrix]] 55 | python = ["37", "38", "39", "310"] 56 | 57 | [tool.coverage.run] 58 | branch = true 59 | parallel = true 60 | omit = [ 61 | "ui/__about__.py", 62 | ] 63 | 64 | [tool.coverage.report] 65 | exclude_lines = [ 66 | "no cov", 67 | "if __name__ == .__main__.:", 68 | "if TYPE_CHECKING:", 69 | ] 70 | 71 | [tool.black] 72 | line-length = 120 73 | skip_magic_trailing_comma = true # For compatibility with pydoc>=4.6, check if still needed. 74 | -------------------------------------------------------------------------------- /explore_the_world/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepset-ai/haystack-demos/b2cd2f19c893d7df301eb16891cbcd2c5890ca2e/explore_the_world/screenshot.png -------------------------------------------------------------------------------- /explore_the_world/screenshot_eval_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepset-ai/haystack-demos/b2cd2f19c893d7df301eb16891cbcd2c5890ca2e/explore_the_world/screenshot_eval_mode.png -------------------------------------------------------------------------------- /explore_the_world/test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepset-ai/haystack-demos/b2cd2f19c893d7df301eb16891cbcd2c5890ca2e/explore_the_world/test/__init__.py -------------------------------------------------------------------------------- /explore_the_world/test/test_ui_utils.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import patch 2 | 3 | from ui.utils import haystack_is_ready 4 | 5 | 6 | def test_haystack_is_ready(): 7 | with patch("requests.get") as mocked_get: 8 | mocked_get.return_value.status_code = 200 9 | assert haystack_is_ready() 10 | 11 | 12 | def test_haystack_is_ready_fail(): 13 | with patch("requests.get") as mocked_get: 14 | mocked_get.return_value.status_code = 400 15 | assert not haystack_is_ready() 16 | -------------------------------------------------------------------------------- /explore_the_world/ui/__about__.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from pathlib import Path 4 | 5 | 6 | __version__ = "0.0.0" 7 | try: 8 | __version__ = open(Path(__file__).parent.parent / "VERSION.txt", "r").read() 9 | except Exception as e: 10 | logging.exception("No VERSION.txt found!") 11 | -------------------------------------------------------------------------------- /explore_the_world/ui/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepset-ai/haystack-demos/b2cd2f19c893d7df301eb16891cbcd2c5890ca2e/explore_the_world/ui/__init__.py -------------------------------------------------------------------------------- /explore_the_world/ui/eval_labels_example.csv: -------------------------------------------------------------------------------- 1 | "Question Text";"Answer" 2 | "What is the capital of France?";"Paris" 3 | "What's the tallest mountain in Africa?";"Mount Kilimanjaro" 4 | "What's the climate of Beijing?";"monsoon-influenced humid continental" 5 | "What's the longest river of Europe?";"The Volga" 6 | "What's the deepest lake in the world?";"Lake Bajkal" 7 | "How many people live in the capital of the US?";"689,545" 8 | "Which Chinese city is the largest?";"Shanghai" 9 | "What's the type of government of the UK?";"unitary parliamentary democracy and constitutional monarchy" 10 | "What currency is used in Hungary?";"Hungarian forint" 11 | "In which city is the Louvre?";"Paris" 12 | "Who is the current king of Spain?";"Felipe VI" 13 | "Which countries border with Mongolia?";"Russia and China" 14 | "What's the current name of Swaziland?";"Eswatini" -------------------------------------------------------------------------------- /explore_the_world/ui/utils.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=missing-timeout 2 | 3 | from typing import List, Dict, Any, Tuple, Optional 4 | 5 | import os 6 | import logging 7 | from time import sleep 8 | 9 | import requests 10 | import streamlit as st 11 | 12 | 13 | API_ENDPOINT = os.getenv("API_ENDPOINT", "http://localhost:8000") 14 | STATUS = "initialized" 15 | HS_VERSION = "hs_version" 16 | DOC_REQUEST = "query" 17 | DOC_FEEDBACK = "feedback" 18 | DOC_UPLOAD = "file-upload" 19 | 20 | 21 | def haystack_is_ready(): 22 | """ 23 | Used to show the "Haystack is loading..." message 24 | """ 25 | url = f"{API_ENDPOINT}/{STATUS}" 26 | try: 27 | if requests.get(url).status_code < 400: 28 | return True 29 | except Exception as e: 30 | logging.exception(e) 31 | sleep(1) # To avoid spamming a non-existing endpoint at startup 32 | return False 33 | 34 | 35 | def haystack_version(): 36 | """ 37 | Get the Haystack version from the REST API 38 | """ 39 | url = f"{API_ENDPOINT}/{HS_VERSION}" 40 | return requests.get(url, timeout=0.1).json()["hs_version"] 41 | 42 | 43 | def query(query, filters={}, top_k_reader=5, top_k_retriever=5) -> Tuple[List[Dict[str, Any]], Dict[str, str]]: 44 | """ 45 | Send a query to the REST API and parse the answer. 46 | Returns both a ready-to-use representation of the results and the raw JSON. 47 | """ 48 | 49 | url = f"{API_ENDPOINT}/{DOC_REQUEST}" 50 | params = {"filters": filters, "Retriever": {"top_k": top_k_retriever}, "Reader": {"top_k": top_k_reader}} 51 | req = {"query": query, "params": params} 52 | response_raw = requests.post(url, json=req) 53 | 54 | if response_raw.status_code >= 400 and response_raw.status_code != 503: 55 | raise Exception(f"{vars(response_raw)}") 56 | 57 | response = response_raw.json() 58 | if "errors" in response: 59 | raise Exception(", ".join(response["errors"])) 60 | 61 | # Format response 62 | results = [] 63 | answers = response["answers"] 64 | for answer in answers: 65 | if answer.get("answer", None): 66 | results.append( 67 | { 68 | "context": "..." + answer["context"] + "...", 69 | "answer": answer.get("answer", None), 70 | "source": answer["meta"]["name"], 71 | "relevance": round(answer["score"] * 100, 2), 72 | "document": [doc for doc in response["documents"] if doc["id"] in answer["document_ids"]][0], 73 | "offset_start_in_doc": answer["offsets_in_document"][0]["start"], 74 | "_raw": answer, 75 | } 76 | ) 77 | else: 78 | results.append( 79 | { 80 | "context": None, 81 | "answer": None, 82 | "document": None, 83 | "relevance": round(answer["score"] * 100, 2), 84 | "_raw": answer, 85 | } 86 | ) 87 | return results, response 88 | 89 | 90 | def send_feedback(query, answer_obj, is_correct_answer, is_correct_document, document) -> None: 91 | """ 92 | Send a feedback (label) to the REST API 93 | """ 94 | url = f"{API_ENDPOINT}/{DOC_FEEDBACK}" 95 | req = { 96 | "query": query, 97 | "document": document, 98 | "is_correct_answer": is_correct_answer, 99 | "is_correct_document": is_correct_document, 100 | "origin": "user-feedback", 101 | "answer": answer_obj, 102 | } 103 | response_raw = requests.post(url, json=req) 104 | if response_raw.status_code >= 400: 105 | raise ValueError(f"An error was returned [code {response_raw.status_code}]: {response_raw.json()}") 106 | 107 | 108 | def upload_doc(file): 109 | url = f"{API_ENDPOINT}/{DOC_UPLOAD}" 110 | files = [("files", file)] 111 | response = requests.post(url, files=files).json() 112 | return response 113 | 114 | 115 | def get_backlink(result) -> Tuple[Optional[str], Optional[str]]: 116 | if result.get("document", None): 117 | doc = result["document"] 118 | if isinstance(doc, dict): 119 | if doc.get("meta", None): 120 | if isinstance(doc["meta"], dict): 121 | if doc["meta"].get("url", None) and doc["meta"].get("title", None): 122 | return doc["meta"]["url"], doc["meta"]["title"] 123 | return None, None 124 | -------------------------------------------------------------------------------- /healthcare/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10-slim 2 | 3 | # copy code 4 | COPY . /ui 5 | 6 | # install as a package 7 | RUN pip install --upgrade pip && \ 8 | pip install /ui/ 9 | 10 | WORKDIR /ui 11 | EXPOSE 8501 12 | 13 | # cmd for running the API 14 | CMD ["python", "-m", "streamlit", "run", "ui/webapp.py"] 15 | -------------------------------------------------------------------------------- /healthcare/README.md: -------------------------------------------------------------------------------- 1 | ## Question Answering Application for Healthcare 2 | 3 | This is a streamlit-based NLP application powering a question answering demo on healthcare data. It's easy to change and extend and can be used to try out Haystack's capabilities. 4 | 5 | A video presentation of this demo is available on [YouTube](https://www.youtube.com/watch?v=pOnkGdOvYfo). To get started with Haystack please visit the [README](https://github.com/deepset-ai/haystack/tree/main#key-components) or check out our [tutorials](https://haystack.deepset.ai/tutorials/first-qa-system). 6 | 7 | ## Usage 8 | 9 | The easiest way to run the application is through [Docker compose](https://docs.docker.com/compose/). 10 | From this folder, just run: 11 | 12 | ```sh 13 | docker compose up -d 14 | ``` 15 | 16 | Docker will start three containers: 17 | - `elasticsearch`, running an Elasticsearch instance with some data pre-loaded. 18 | - `haystack-api`, running a pre-loaded Haystack pipeline behind a RESTful API. 19 | - `ui`, running the streamlit application showing the UI and querying Haystack under the hood. 20 | 21 | Once all the containers are up and running, you can open the user interface pointing your 22 | browser to [http://localhost:8501](http://localhost:8501). 23 | 24 | ## Screencast 25 | https://user-images.githubusercontent.com/4181769/231965471-48d581a2-e1aa-4316-b3a4-990d9c86800e.mov 26 | 27 | ## Evaluation Mode 28 | 29 | The evaluation mode leverages the feedback REST API endpoint of haystack. The user has the options 30 | "Wrong answer", "Wrong answer and wrong passage" and "Wrong answer and wrong passage" to give 31 | feedback. 32 | 33 | In order to use the UI in evaluation mode, you need an ElasticSearch instance with pre-indexed files 34 | and the Haystack REST API. You can set the environment up via docker images. For ElasticSearch, you 35 | can check out our [documentation](https://haystack.deepset.ai/usage/document-store#initialisation) 36 | and for setting up the REST API this [link](https://github.com/deepset-ai/haystack/blob/main/README. 37 | md#7-rest-api). 38 | 39 | To enter the evaluation mode, select the checkbox "Evaluation mode" in the sidebar. The UI will load 40 | the predefined questions from the file [`eval_labels_examples`](https://raw.githubusercontent.com/ 41 | deepset-ai/haystack/main/ui/ui/eval_labels_example.csv). The file needs to be prefilled with your 42 | data. This way, the user will get a random question from the set and can give his feedback with the 43 | buttons below the questions. To load a new question, click the button "Get random question". 44 | 45 | The file just needs to have two columns separated by semicolon. You can add more columns but the UI 46 | will ignore them. Every line represents a questions answer pair. The columns with the questions needs 47 | to be named “Question Text” and the answer column “Answer” so that they can be loaded correctly. 48 | Currently, the easiest way to create the file is manually by adding question answer pairs. 49 | 50 | The feedback can be exported with the API endpoint `export-doc-qa-feedback`. To learn more about 51 | finetuning a model with user feedback, please check out our [docs](https://haystack.deepset.ai/usage/ 52 | domain-adaptation#user-feedback). 53 | 54 | ## Query different data 55 | 56 | If you want to use this application to query a different corpus, the easiest way is to build the 57 | Elasticsearch image, load your own text data and then use the same Compose file to run all the 58 | three containers needed. This will require [Docker](https://docs.docker.com/get-docker/) to be 59 | properly installed on your machine. 60 | 61 | ### Running your custom build 62 | 63 | Once done, modify the `elasticsearch` section in the `docker-compose.yml` file, changing this line: 64 | ```yaml 65 | image: "julianrisch/elasticsearch-healthcare" 66 | ``` 67 | 68 | to: 69 | 70 | ```yaml 71 | image: "my-docker-acct/elasticsearch-custom" 72 | ``` 73 | 74 | Finally, run the compose file as usual: 75 | ```sh 76 | docker-compose up 77 | ``` 78 | 79 | ## Development 80 | 81 | If you want to change the streamlit application, you need to setup your Python environment first. 82 | From a virtual environment, run: 83 | ```sh 84 | pip install -e . 85 | ``` 86 | 87 | The app requires the Haystack RESTful API to be ready and accepting connections at `http://localhost:8000`, you can use Docker compose to start only the required containers: 88 | 89 | ```sh 90 | docker-compose up elasticsearch haystack-api 91 | ``` 92 | 93 | At this point you should be able to make changes and run the streamlit application with: 94 | 95 | ``` 96 | streamlit run ui/webapp.py 97 | ``` 98 | 99 | ## Using GPUs with Docker 100 | 101 | Assuming you have [nvidia drivers installed](https://developer.nvidia.com/cuda-downloads) on your machine, you can configure docker to use the GPU for the Haystack API container to speed it up. 102 | First, configure the nvidia repository as described here: https://nvidia.github.io/nvidia-container-runtime/. For example: 103 | ```sh 104 | curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \ 105 | sudo apt-key add - 106 | distribution=$(. /etc/os-release;echo $ID$VERSION_ID) 107 | curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \ 108 | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list 109 | sudo apt-get update 110 | ``` 111 | Then, install nvidia-container-runtime as described here: https://docs.docker.com/config/containers/resource_constraints/#access-an-nvidia-gpu. 112 | For example: 113 | ```sh 114 | sudo apt-get install nvidia-container-runtime 115 | ``` 116 | Restart the Docker daemon (or simply the machine). 117 | Finally, you can change the docker compose file `healthcare/docker-compose.yml` so that a docker image prepared for usage with GPUs is used and one GPU is reserved for the Haystack API container: 118 | ```yaml 119 | haystack-api: 120 | image: "deepset/haystack:gpu-v1.14.0" 121 | ports: 122 | - 8000:8000 123 | restart: on-failure 124 | volumes: 125 | - ./haystack-api:/home/node/app 126 | environment: 127 | - DOCUMENTSTORE_PARAMS_HOST=elasticsearch 128 | - PIPELINE_YAML_PATH=/home/node/app/pipelines_biobert.haystack-pipeline.yml 129 | depends_on: 130 | elasticsearch: 131 | condition: service_healthy 132 | deploy: 133 | resources: 134 | reservations: 135 | devices: 136 | - driver: nvidia 137 | count: 1 138 | capabilities: [gpu] 139 | ``` 140 | -------------------------------------------------------------------------------- /healthcare/Slides - How to Build a QA Application With Haystack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepset-ai/haystack-demos/b2cd2f19c893d7df301eb16891cbcd2c5890ca2e/healthcare/Slides - How to Build a QA Application With Haystack.pdf -------------------------------------------------------------------------------- /healthcare/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | elasticsearch: 5 | image: "julianrisch/elasticsearch-healthcare" 6 | ports: 7 | - 9200:9200 8 | restart: on-failure 9 | # Uncomment the healthcheck section on Apple M1, as on M1 elasticsearch might need longer to start 10 | healthcheck: 11 | test: ["CMD", "curl", "-f", "http://localhost:9200/_cat/health"] 12 | interval: 10s 13 | timeout: 1s 14 | retries: 30 15 | start_period: "30s" 16 | 17 | haystack-api: 18 | image: "deepset/haystack:cpu-v1.14.0" 19 | ports: 20 | - 8000:8000 21 | restart: on-failure 22 | volumes: 23 | - ./haystack-api:/home/node/app 24 | environment: 25 | - DOCUMENTSTORE_PARAMS_HOST=elasticsearch 26 | - PIPELINE_YAML_PATH=/home/node/app/pipelines_biobert.haystack-pipeline.yml 27 | depends_on: 28 | elasticsearch: 29 | condition: service_healthy 30 | 31 | ui: 32 | image: "julianrisch/demo-healthcare" 33 | ports: 34 | - 8501:8501 35 | restart: on-failure 36 | environment: 37 | - API_ENDPOINT=http://haystack-api:8000 38 | # The value fot the following variables will be read from the host, if present. 39 | # They can also be temporarily set for docker-compose, for example: 40 | # $ DISABLE_FILE_UPLOAD=1 DEFAULT_DOCS_FROM_RETRIEVER=5 docker-compose up 41 | - DEFAULT_QUESTION_AT_STARTUP 42 | - DEFAULT_DOCS_FROM_RETRIEVER 43 | - DEFAULT_NUMBER_OF_ANSWERS 44 | command: "/bin/bash -c 'sleep 15 && python -m streamlit run ui/webapp.py'" 45 | -------------------------------------------------------------------------------- /healthcare/haystack-api/pipelines_biobert.haystack-pipeline.yml: -------------------------------------------------------------------------------- 1 | version: ignore 2 | 3 | components: 4 | - name: DocumentStore 5 | type: ElasticsearchDocumentStore 6 | params: 7 | host: localhost 8 | - name: Retriever # Selects the most relevant documents from the document store and passes them on to the Reader 9 | type: EmbeddingRetriever # Uses a Transformer model to encode the document and the query 10 | params: 11 | document_store: DocumentStore 12 | embedding_model: sentence-transformers/multi-qa-mpnet-base-dot-v1 # multi-qa-MiniLM-L6-dot-v1 13 | embed_meta_fields: 14 | - filename 15 | top_k: 10 # The number of results to return 16 | - name: BM25 17 | type: BM25Retriever 18 | params: 19 | document_store: DocumentStore 20 | top_k: 10 21 | 22 | - name: Joiner 23 | type: JoinDocuments 24 | params: 25 | join_mode: reciprocal_rank_fusion 26 | - name: Reader # The component that actually fetches answers from among the 20 documents returned by retriever 27 | type: FARMReader # Transformer-based reader, specializes in extractive QA 28 | params: 29 | model_name_or_path: dmis-lab/biobert-large-cased-v1.1-squad # dmis-lab/biobert-base-cased-v1.1-squad 30 | context_window_size: 700 # The size of the window around the answer span 31 | - name: FileTypeClassifier # Routes files based on their extension to appropriate converters, by default txt, pdf, md, docx, html 32 | type: FileTypeClassifier 33 | - name: TextConverter # Converts files into documents 34 | type: TextConverter 35 | - name: PDFConverter # Converts PDFs into documents 36 | type: PDFToTextConverter 37 | - name: Preprocessor # Splits documents into smaller ones and cleans them up 38 | type: PreProcessor 39 | params: 40 | # With a vector-based retriever, it's good to split your documents into smaller ones 41 | split_by: word # The unit by which you want to split the documents 42 | split_length: 250 # The max number of words in a document 43 | split_overlap: 20 # Enables the sliding window approach 44 | split_respect_sentence_boundary: True # Retains complete sentences in split documents 45 | language: en # Used by NLTK to best detect the sentence boundaries for that language 46 | 47 | 48 | # Here you define how the nodes are organized in the pipelines 49 | # For each node, specify its input 50 | pipelines: 51 | - name: query 52 | nodes: 53 | - name: Retriever 54 | inputs: [Query] 55 | - name: BM25 56 | inputs: [Query] 57 | - name: Joiner 58 | inputs: [Retriever, BM25] 59 | - name: Reader 60 | inputs: [Joiner] 61 | - name: indexing 62 | nodes: 63 | # Depending on the file type, we use a Text or PDF converter 64 | - name: FileTypeClassifier 65 | inputs: [File] 66 | - name: TextConverter 67 | inputs: [FileTypeClassifier.output_1] # Ensures this converter receives TXT files 68 | - name: PDFConverter 69 | inputs: [FileTypeClassifier.output_2] # Ensures this converter receives PDFs 70 | - name: Preprocessor 71 | inputs: [TextConverter, PDFConverter] 72 | - name: Retriever 73 | inputs: [Preprocessor] 74 | - name: DocumentStore 75 | inputs: [Retriever] 76 | -------------------------------------------------------------------------------- /healthcare/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "ui" 7 | description = 'Minimal UI for Haystack (https://github.com/deepset-ai/haystack)' 8 | readme = "README.md" 9 | requires-python = ">=3.7" 10 | license = "Apache-2.0" 11 | keywords = [] 12 | authors = [ 13 | { name = "deepset.ai", email = "malte.pietsch@deepset.ai" }, 14 | ] 15 | classifiers = [ 16 | "Development Status :: 5 - Production/Stable", 17 | "Intended Audience :: Science/Research", 18 | "Topic :: Scientific/Engineering :: Artificial Intelligence", 19 | "Operating System :: OS Independent", 20 | "Programming Language :: Python", 21 | "Programming Language :: Python :: 3.7", 22 | "Programming Language :: Python :: 3.8", 23 | "Programming Language :: Python :: 3.9", 24 | "Programming Language :: Python :: 3.10", 25 | "Programming Language :: Python :: Implementation :: CPython", 26 | ] 27 | dependencies = [ 28 | "streamlit >= 1.9.0, < 2", 29 | "st-annotated-text >= 2.0.0, < 3", 30 | "markdown >= 3.3.4, < 4" 31 | ] 32 | dynamic = ["version"] 33 | 34 | [project.urls] 35 | Documentation = "https://github.com/deepset-ai/haystack/tree/main/ui#readme" 36 | Issues = "https://github.com/deepset-ai/haystack/issues" 37 | Source = "https://github.com/deepset-ai/haystack/tree/main/ui" 38 | 39 | [tool.hatch.version] 40 | path = "ui/__about__.py" 41 | 42 | [tool.hatch.build.targets.sdist] 43 | [tool.hatch.build.targets.wheel] 44 | 45 | [tool.hatch.envs.default] 46 | dependencies = [ 47 | "pytest", 48 | "pytest-cov", 49 | ] 50 | [tool.hatch.envs.default.scripts] 51 | cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=ui --cov=tests" 52 | no-cov = "cov --no-cov" 53 | 54 | [[tool.hatch.envs.test.matrix]] 55 | python = ["37", "38", "39", "310"] 56 | 57 | [tool.coverage.run] 58 | branch = true 59 | parallel = true 60 | omit = [ 61 | "ui/__about__.py", 62 | ] 63 | 64 | [tool.coverage.report] 65 | exclude_lines = [ 66 | "no cov", 67 | "if __name__ == .__main__.:", 68 | "if TYPE_CHECKING:", 69 | ] 70 | 71 | [tool.black] 72 | line-length = 120 73 | skip_magic_trailing_comma = true # For compatibility with pydoc>=4.6, check if still needed. 74 | -------------------------------------------------------------------------------- /healthcare/ui/__about__.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from pathlib import Path 4 | 5 | 6 | __version__ = "0.0.0" 7 | try: 8 | __version__ = open(Path(__file__).parent.parent / "VERSION.txt", "r").read() 9 | except Exception as e: 10 | logging.exception("No VERSION.txt found!") 11 | -------------------------------------------------------------------------------- /healthcare/ui/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepset-ai/haystack-demos/b2cd2f19c893d7df301eb16891cbcd2c5890ca2e/healthcare/ui/__init__.py -------------------------------------------------------------------------------- /healthcare/ui/eval_labels_example.csv: -------------------------------------------------------------------------------- 1 | "Question Text";"Answer" 2 | "What are treatments for oesophageal cancer?";"radical surgery" 3 | "What are symptoms of an infusion reaction?";"" 4 | "What reduces inflammation in cancer patients?";"physical exercise" 5 | "What are the symptoms of cancer related fatigue?";"diminished energy, increased need to rest" 6 | "How can pain be treated in cancer patients?";"using opioid combination therapies and carefully dosed adjuvants" 7 | "What side-effects can occur if pain is treated with opioids?"; 8 | "What symptoms may occur when using Ipilimumab?";"Pruritus, maculopapular rash, cough, shortness of breath, chills, rigors, facial flushing, chest, abdominal or back pain." 9 | "How should a patient with an anaphylactic reaction be handled?"; "an observation period" 10 | "Should stem-cell transplantation be offered to young adults?";"In the younger population, consolidation with autologous stem cell transplantation (ASCT) in patients achieving a CR has been shown to improve long-term outcomes" -------------------------------------------------------------------------------- /healthcare/ui/utils.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=missing-timeout 2 | 3 | from typing import List, Dict, Any, Tuple, Optional 4 | 5 | import os 6 | import logging 7 | from time import sleep 8 | 9 | import requests 10 | import streamlit as st 11 | 12 | 13 | API_ENDPOINT = os.getenv("API_ENDPOINT", "http://localhost:8000") 14 | STATUS = "initialized" 15 | HS_VERSION = "hs_version" 16 | DOC_REQUEST = "query" 17 | DOC_FEEDBACK = "feedback" 18 | DOC_UPLOAD = "file-upload" 19 | 20 | 21 | def haystack_is_ready(): 22 | """ 23 | Used to show the "Haystack is loading..." message 24 | """ 25 | url = f"{API_ENDPOINT}/{STATUS}" 26 | try: 27 | if requests.get(url).status_code < 400: 28 | return True 29 | except Exception as e: 30 | logging.exception(e) 31 | sleep(1) # To avoid spamming a non-existing endpoint at startup 32 | return False 33 | 34 | 35 | def haystack_version(): 36 | """ 37 | Get the Haystack version from the REST API 38 | """ 39 | url = f"{API_ENDPOINT}/{HS_VERSION}" 40 | return requests.get(url, timeout=0.1).json()["hs_version"] 41 | 42 | 43 | def query(query, filters={}, top_k_reader=5, top_k_retriever=5) -> Tuple[List[Dict[str, Any]], Dict[str, str]]: 44 | """ 45 | Send a query to the REST API and parse the answer. 46 | Returns both a ready-to-use representation of the results and the raw JSON. 47 | """ 48 | 49 | url = f"{API_ENDPOINT}/{DOC_REQUEST}" 50 | params = {"filters": filters, "Retriever": {"top_k": top_k_retriever}, "Reader": {"top_k": top_k_reader}} 51 | req = {"query": query, "params": params} 52 | response_raw = requests.post(url, json=req) 53 | 54 | if response_raw.status_code >= 400 and response_raw.status_code != 503: 55 | raise Exception(f"{vars(response_raw)}") 56 | 57 | response = response_raw.json() 58 | if "errors" in response: 59 | raise Exception(", ".join(response["errors"])) 60 | 61 | # Format response 62 | results = [] 63 | answers = response["answers"] 64 | for answer in answers: 65 | if answer.get("answer", None): 66 | results.append( 67 | { 68 | "context": "..." + answer["context"] + "...", 69 | "answer": answer.get("answer", None), 70 | "source": answer["meta"]["name"], 71 | "relevance": round(answer["score"] * 100, 2), 72 | "document": [doc for doc in response["documents"] if doc["id"] in answer["document_ids"]][0], 73 | "offset_start_in_doc": answer["offsets_in_document"][0]["start"], 74 | "_raw": answer, 75 | } 76 | ) 77 | else: 78 | results.append( 79 | { 80 | "context": None, 81 | "answer": None, 82 | "document": None, 83 | "relevance": round(answer["score"] * 100, 2), 84 | "_raw": answer, 85 | } 86 | ) 87 | return results, response 88 | 89 | 90 | def send_feedback(query, answer_obj, is_correct_answer, is_correct_document, document) -> None: 91 | """ 92 | Send a feedback (label) to the REST API 93 | """ 94 | url = f"{API_ENDPOINT}/{DOC_FEEDBACK}" 95 | req = { 96 | "query": query, 97 | "document": document, 98 | "is_correct_answer": is_correct_answer, 99 | "is_correct_document": is_correct_document, 100 | "origin": "user-feedback", 101 | "answer": answer_obj, 102 | } 103 | response_raw = requests.post(url, json=req) 104 | if response_raw.status_code >= 400: 105 | raise ValueError(f"An error was returned [code {response_raw.status_code}]: {response_raw.json()}") 106 | 107 | 108 | def upload_doc(file): 109 | url = f"{API_ENDPOINT}/{DOC_UPLOAD}" 110 | files = [("files", file)] 111 | response = requests.post(url, files=files).json() 112 | return response 113 | 114 | 115 | def get_backlink(result) -> Tuple[Optional[str], Optional[str]]: 116 | if result.get("document", None): 117 | doc = result["document"] 118 | if isinstance(doc, dict): 119 | if doc.get("meta", None): 120 | if isinstance(doc["meta"], dict): 121 | if doc["meta"].get("url", None) and doc["meta"].get("title", None): 122 | return doc["meta"]["url"], doc["meta"]["title"] 123 | return None, None 124 | -------------------------------------------------------------------------------- /qdrant_indexing/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM deepset/hayhooks:v0.6.0 2 | 3 | RUN pip install qdrant-haystack sentence-transformers 4 | 5 | CMD ["hayhooks", "run", "--host", "0.0.0.0"] 6 | -------------------------------------------------------------------------------- /qdrant_indexing/README.md: -------------------------------------------------------------------------------- 1 | # Qdrant Indexing and Querying using Haystack and Hayhooks 2 | 3 | This folder contains an example of how to use [Docker Compose](https://docs.docker.com/compose/) to orchestrate 4 | a simple web application serving two Haystack pipelines using [Hayhooks](https://github.com/deepset-ai/hayhooks), one for *indexing documents* and a second to *query them*, 5 | using [Qdrant](https://github.com/qdrant/qdrant) for storage and retrieval. 6 | 7 | ## Quickstart 8 | 9 | To jump straight into running the demo, clone this repo and cd into the current folder: 10 | 11 | ```bash 12 | git clone https://github.com/deepset-ai/haystack-demos.git 13 | cd haystack-demos/qdrant_indexing 14 | ``` 15 | 16 | ## Pipelines 17 | 18 | We have implemented two [pipeline wrappers](https://github.com/deepset-ai/hayhooks?tab=readme-ov-file#why-a-pipeline-wrapper) in the `./pipelines` folder: 19 | 20 | - `qdrant_indexing`: This pipeline is used to **index** documents into Qdrant. 21 | - `qdrant_query`: This pipeline is used to **query** documents from Qdrant. 22 | 23 | They will be automatically loaded by Hayhooks when the server starts. 24 | 25 | ## Build and run the containers 26 | 27 | Run this command to pull the Qdrant Docker image, build the one defined by this demo and run both of them: 28 | 29 | ```bash 30 | docker-compose up 31 | 32 | # or, if you want to run the containers in the background 33 | 34 | docker-compose up -d 35 | ``` 36 | 37 | Eventually, you should have two containers running: `qdrant` for the local Qdrant instance and `hayhooks`. Check it out by running: 38 | 39 | ```bash 40 | docker-compose ps 41 | ``` 42 | 43 | Check if the Hayhooks server is running by going to [http://localhost:1416/docs](http://localhost:1416/docs#) in your browser. 44 | 45 | You should also see the documentation for the two pipelines under the `pipelines` section of docs: 46 | 47 | ![Hayhooks pipelines](./docs/pipelines.png) 48 | 49 | ## Inspect the pipelines 50 | 51 | To better understand what the two pipelines do, you can visualize their graph using the `/draw/` endpoint. For example, 52 | to visualize `qdrant_indexing` you can point your browser to 53 | [http://localhost:1416/draw/qdrant_indexing](http://localhost:1416/draw/qdrant_indexing). 54 | 55 | ## Interact with the deployed pipelines 56 | 57 | You have two ways to interact with the pipelines: 58 | 59 | - Using the Hayhooks CLI 60 | - Using the Hayhooks API 61 | 62 | ## Index some text using Hayhooks API 63 | 64 | To index a file containing some text, we can make a POST request to the `/qdrant_indexing` endpoint: 65 | 66 | ```bash 67 | curl -X POST http://localhost:1416/qdrant_indexing/run -F "files=@test_file.txt" 68 | ``` 69 | 70 | Upon a successful request, you should get the following JSON response: 71 | 72 | ```json 73 | { 74 | "result": { 75 | "success":true 76 | } 77 | } 78 | ``` 79 | 80 | ## Index some text using Hayhooks CLI 81 | 82 | To use the Hayhooks CLI, you need to install `hayhooks` first: 83 | 84 | ```bash 85 | pip install hayhooks 86 | ``` 87 | 88 | Then you can run: 89 | 90 | ```bash 91 | hayhooks pipeline run qdrant_indexing --file test_file.txt 92 | ``` 93 | 94 | This will run the `qdrant_indexing` pipeline with `test_file.txt` and index the text into Qdrant 95 | 96 | ## Query the indexed text using Hayhooks API 97 | 98 | Similarly to indexing, we can query our data by making a POST request to the `/qdrant_query/run` endpoint: 99 | 100 | ```bash 101 | curl -X "POST" "http://localhost:1416/qdrant_query/run" \ 102 | -H 'Content-Type: application/json; charset=utf-8' \ 103 | -d $'{ "query": "GitHub" }' 104 | ``` 105 | 106 | The response should be something like: 107 | 108 | ```js 109 | { 110 | "result": { 111 | "retriever": { 112 | "documents": [ 113 | { 114 | "id": "6b2aec5ac2978cf866a5f27c8fc92e7b06eb9742096093ca238a1fb8309cf139", 115 | "content": "Alerts are an extension of Markdown used to emphasize critical information. On GitHub, they are displayed with distinctive colors and icons to indicate the importance of the content.", 116 | // ... 117 | } 118 | ] 119 | } 120 | } 121 | } 122 | ``` 123 | 124 | ## Query the indexed text using Hayhooks CLI 125 | 126 | You'll need to install `hayhooks` first: 127 | 128 | ```bash 129 | pip install hayhooks 130 | ``` 131 | 132 | Then you can run: 133 | 134 | ```bash 135 | hayhooks pipeline run qdrant_query --param 'query="Github"' 136 | ``` 137 | 138 | *Happy Hacking!* 139 | -------------------------------------------------------------------------------- /qdrant_indexing/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | qdrant: 3 | image: qdrant/qdrant:latest 4 | restart: always 5 | container_name: qdrant 6 | ports: 7 | - 6333:6333 8 | - 6334:6334 9 | expose: 10 | - 6333 11 | - 6334 12 | - 6335 13 | configs: 14 | - source: qdrant_config 15 | target: /qdrant/config/production.yaml 16 | volumes: 17 | - ./qdrant_data:/qdrant_data 18 | 19 | hayhooks: 20 | build: . # Build from local Dockerfile 21 | container_name: hayhooks 22 | ports: 23 | - "1416:1416" 24 | volumes: 25 | - ./pipelines:/pipelines 26 | environment: 27 | - HAYHOOKS_PIPELINES_DIR=/pipelines 28 | - LOG=DEBUG 29 | depends_on: 30 | - qdrant 31 | 32 | configs: 33 | qdrant_config: 34 | content: | 35 | log_level: INFO 36 | -------------------------------------------------------------------------------- /qdrant_indexing/docs/pipelines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepset-ai/haystack-demos/b2cd2f19c893d7df301eb16891cbcd2c5890ca2e/qdrant_indexing/docs/pipelines.png -------------------------------------------------------------------------------- /qdrant_indexing/pipelines/qdrant_indexing/pipeline_wrapper.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | from haystack.dataclasses import ByteStream 3 | from fastapi import UploadFile 4 | from hayhooks import BasePipelineWrapper, log 5 | from haystack import Pipeline 6 | from haystack.components.converters import TextFileToDocument 7 | from haystack.components.embedders import SentenceTransformersDocumentEmbedder 8 | from haystack.components.writers import DocumentWriter 9 | from haystack_integrations.document_stores.qdrant import QdrantDocumentStore 10 | 11 | 12 | class PipelineWrapper(BasePipelineWrapper): 13 | def setup(self) -> None: 14 | indexing = Pipeline() 15 | indexing.add_component("converter", TextFileToDocument()) 16 | indexing.add_component("embedder", SentenceTransformersDocumentEmbedder()) 17 | document_store = QdrantDocumentStore(host="qdrant") 18 | indexing.add_component("writer", DocumentWriter(document_store=document_store)) 19 | indexing.connect("converter", "embedder") 20 | indexing.connect("embedder", "writer") 21 | 22 | self.pipeline = indexing 23 | 24 | def run_api(self, files: Optional[List[UploadFile]] = None) -> dict: 25 | if files: 26 | for file in files: 27 | text = file.file.read().decode("utf-8") 28 | log.debug(f"Indexing file: {file.filename}") 29 | 30 | self.pipeline.run( 31 | {"converter": {"sources": [ByteStream(text.encode())]}} 32 | ) 33 | else: 34 | log.debug("No files to index") 35 | 36 | return {"success": True} 37 | -------------------------------------------------------------------------------- /qdrant_indexing/pipelines/qdrant_query/pipeline_wrapper.py: -------------------------------------------------------------------------------- 1 | from haystack import Pipeline 2 | from hayhooks import BasePipelineWrapper, log 3 | from haystack.components.embedders import SentenceTransformersTextEmbedder 4 | from haystack_integrations.components.retrievers.qdrant import QdrantEmbeddingRetriever 5 | from haystack_integrations.document_stores.qdrant import QdrantDocumentStore 6 | 7 | 8 | class PipelineWrapper(BasePipelineWrapper): 9 | def setup(self) -> None: 10 | query = Pipeline() 11 | query.add_component("embedder", SentenceTransformersTextEmbedder()) 12 | query.add_component( 13 | "retriever", QdrantEmbeddingRetriever(QdrantDocumentStore(host="qdrant")) 14 | ) 15 | query.connect("embedder.embedding", "retriever.query_embedding") 16 | 17 | self.pipeline = query 18 | 19 | def run_api(self, query: str) -> dict: 20 | log.debug(f"Querying with: '{query}'") 21 | return self.pipeline.run({"embedder": {"text": query}}) 22 | -------------------------------------------------------------------------------- /qdrant_indexing/test_file.txt: -------------------------------------------------------------------------------- 1 | Alerts are an extension of Markdown used to emphasize critical information. On GitHub, they are displayed with distinctive colors and icons to indicate the importance of the content. --------------------------------------------------------------------------------