Spaces:
Sleeping
Sleeping
File size: 72,283 Bytes
2800072 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 21,
"id": "408e9000-977d-4f3f-a001-b06c55095c5f",
"metadata": {},
"outputs": [],
"source": [
"## Handle secrets either from env vars or streamlit manager\n",
"import streamlit as st\n",
"import os\n",
"api_key = os.getenv(\"LITELLM_KEY\")\n",
"if api_key is None:\n",
" api_key = st.secrets[\"LITELLM_KEY\"]\n",
"cirrus_key = os.getenv(\"CIRRUS_KEY\")\n",
"if cirrus_key is None:\n",
" cirrus_key = st.secrets[\"CIRRUS_KEY\"] "
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "802c676d-98c9-4e1f-b755-9eb6fbc09754",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import requests\n",
"import zipfile\n",
"\n",
"def download_and_unzip(url, output_dir):\n",
" response = requests.get(url)\n",
" zip_file_path = os.path.basename(url)\n",
" with open(zip_file_path, 'wb') as f:\n",
" f.write(response.content)\n",
" with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:\n",
" zip_ref.extractall(output_dir)\n",
" os.remove(zip_file_path)\n",
"\n",
"download_and_unzip(\"https://minio.carlboettiger.info/public-data/hwc.zip\", \"hwc\")"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "00e3d915-4803-477f-9c19-db421cf129ac",
"metadata": {},
"outputs": [],
"source": [
"import pathlib\n",
"from langchain_community.document_loaders import PyPDFLoader\n",
"\n",
"def pdf_loader(path):\n",
" all_documents = []\n",
" docs_dir = pathlib.Path(path)\n",
" for file in docs_dir.iterdir():\n",
" loader = PyPDFLoader(file)\n",
" documents = loader.load()\n",
" all_documents.extend(documents)\n",
" return all_documents\n",
"\n",
"docs = pdf_loader('hwc/')"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "d830b309-c047-491a-8114-ef9ad18dead5",
"metadata": {},
"outputs": [],
"source": [
"# NRP embedding model tends to throw errors\n",
"# embedding = OpenAIEmbeddings(model = \"embed-mistral\", api_key = api_key, base_url = \"https://llm.nrp-nautilus.io\")"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "4af17831-eb29-44c4-8a02-6d0cc996b70e",
"metadata": {},
"outputs": [],
"source": [
"## Use the model on Cirrus instead:\n",
"\n",
"from langchain_openai import OpenAIEmbeddings\n",
"embedding = OpenAIEmbeddings(\n",
" model = \"cirrus\",\n",
" api_key = cirrus_key, \n",
" base_url = \"https://llm.cirrus.carlboettiger.info/v1\",\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "efc963ed-d20d-49ce-b86c-05beb0947336",
"metadata": {},
"outputs": [],
"source": [
"# Build a retrival agent\n",
"from langchain_text_splitters import RecursiveCharacterTextSplitter\n",
"text_splitter = RecursiveCharacterTextSplitter(chunk_size=5000, chunk_overlap=500)\n",
"splits = text_splitter.split_documents(docs)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "bb5e99f3-3b58-423d-8945-bddc034c19fb",
"metadata": {},
"outputs": [],
"source": [
"# slow part here, runs on remote GPU\n",
"from langchain_core.vectorstores import InMemoryVectorStore\n",
"vectorstore = InMemoryVectorStore.from_documents(documents = splits, embedding = embedding)\n",
"retriever = vectorstore.as_retriever()"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "ad666954-aa66-40ac-a54e-2272f77f2d1c",
"metadata": {},
"outputs": [],
"source": [
"# Choose any of the models listed by their short-name:\n",
"# see `curl -H \"Authorization: Bearer $OPENAI_API_KEY\" https://llm.nrp-nautilus.io/v1/models`\n",
"\"\"\"\n",
"models = {\"llama3\": \"llama3-sdsc\", \n",
" \"deepseek-small\": \"DeepSeek-R1-Distill-Qwen-32B\",\n",
" \"deepseek\": \"deepseek-r1-qwen-qualcomm\",\n",
" \"gemma3\": \"gemma3\",\n",
" \"phi3\": \"phi3\",\n",
" \"olmo\": \"olmo\"\n",
" }\n",
"\"\"\"\n",
"from langchain_openai import ChatOpenAI\n",
"#llm = ChatOpenAI(model = models['gemma3'],\n",
" #api_key = api_key, \n",
" #base_url = \"https://llm.nrp-nautilus.io\", \n",
" #temperature=0)\n",
"\n",
"\n",
"from langchain.chains import create_retrieval_chain\n",
"from langchain.chains.combine_documents import create_stuff_documents_chain\n",
"from langchain_core.prompts import ChatPromptTemplate\n",
"\n",
"system_prompt = (\n",
" \"You are an assistant for question-answering tasks. \"\n",
" \"Use the following scientific articles as the retrieved context to answer \"\n",
" \"the question. Appropriately cite the articles from the context on which your answer is based using (Author, Year) format. \"\n",
" \"Do not attempt to cite articles that are not in the context.\"\n",
" \"If you don't know the answer, say that you don't know.\"\n",
" \"Use up to five sentences maximum and keep the answer concise.\\n\\n\"\n",
" \"{context}\"\n",
")\n",
"\"\"\"\n",
"prompt = ChatPromptTemplate.from_messages(\n",
" [\n",
" (\"system\", system_prompt),\n",
" (\"human\", \"{input}\"),\n",
" ]\n",
")\n",
"question_answer_chain = create_stuff_documents_chain(retriever, prompt)\n",
"rag_chain = create_retrieval_chain(retriever, question_answer_chain)\n",
"\"\"\"\n",
"\n",
"#call the retriever by ourselves\n",
"def test_retriever_only(query: str, k: int = 5):\n",
" retriever.search_kwargs[\"k\"] = k \n",
" retrieved_docs = retriever.invoke(query)\n",
" \n",
" print(f\"\\n Query: {query}\")\n",
" print(f\"\\n Top {k} Retrieved Documents:\\n\" + \"-\"*60)\n",
" \n",
" for i, doc in enumerate(retrieved_docs):\n",
" print(f\"\\n--- Document #{i+1} ---\")\n",
" print(doc.page_content[:1000]) \n",
" if hasattr(doc, \"metadata\") and doc.metadata:\n",
" print(\"\\n[Metadata]:\", doc.metadata)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "e59dc0c7-5f40-4994-b925-11e4a6605a7a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" Query: I live in Tanzania and am having issues with lions breaking into my boma and preying on cattle. What are a few ways to help me prevent this from happening in the future? Can you check these pdfs to see which ones might help?\n",
"\n",
" Top 5 Retrieved Documents:\n",
"------------------------------------------------------------\n",
"\n",
"--- Document #1 ---\n",
"hypothesis was that index of pre- and post-ban use\n",
"was the same for both types of feeding sites.\n",
"We calculated the average annual number of\n",
"observed bears during pre- and post-ban periods\n",
"for each feeding site. We then used these averages\n",
"instead of raw data from individual counts. We\n",
"calculated an annual index of feeding site use by\n",
"pooling data from all feeding sites (average number\n",
"of bears counted at feeding sites in post-ban period\n",
"divided by average number of bears counted in pre-\n",
"ban period). Subsequently, we used bootstrapping\n",
"with 1,000 simulations to test for differences between\n",
"SUPPLEMENTAL FEEDING AND BEAR DEPREDATIONS N Kavcˇicˇ et al. 113\n",
"Ursus 24(2):111–119 (2013)\n",
"\n",
"[Metadata]: {'producer': 'GPL Ghostscript 9.26', 'creator': '', 'creationdate': '2022-06-06T23:09:49-07:00', 'moddate': '2022-06-06T23:09:49-07:00', 'title': '', 'author': '', 'subject': '', 'keywords': '', 'source': 'hwc\\\\Kavcic et al. 2013.pdf', 'total_pages': 9, 'page': 2, 'page_label': '3'}\n",
"\n",
"--- Document #2 ---\n",
"ESPINOSA AND JACOBSON 59\n",
"TABLE 3\n",
"Linear Multiple Regressions Showing the Association of Variables With People’s Attitudes, Behavioral\n",
"Intentions and Perceived Program Impacts\n",
"A) Attitude B) Attitude C) Behavioral\n",
"toward toward intention in a D) Bear Project\n",
"bear protection bear presence conflict with a bear support\n",
"Explanatory Std. Beta Std. Beta Std. Beta Std. Beta\n",
"variables coefficient Sig. coefficient Sig. coefficient Sig. coefficient Sig.\n",
"Gender∗ −.137 .182 −.302 .010 −.544 .000 −.339 .002\n",
"Age −.154 .076 .001 .995 .016 .855 .026 .778\n",
"Monthly income −.108 .180 .081 .367 −.036 .643 .189 .027\n",
"Cow predation by\n",
"bears∗∗\n",
"−.139 .077 −.196 .028 −.024 .754 .001 .994\n",
"Environmental\n",
"knowledge\n",
".484 .000 .189 .144 .235 .037 .182 .117\n",
"Participation in\n",
"Bear Project∗∗\n",
".145 .087 .149 .132 .063 .447 .387 .000\n",
"Adjusted R2 .266 .081 .159 .232\n",
"SE of the estimate .773 1 .108 .916 .850\n",
"N 121 121 145 114\n",
"∗Male = 1, Female = 0; ∗∗ Yes = 1, No = 0.\n",
"each lasting approximately 1.5 hrs, were conducted with teachers (\n",
"\n",
"[Metadata]: {'producer': 'Acrobat Distiller 6.0.1 (Windows)', 'creator': 'dvips(k) 5.95a Copyright 2005 Radical Eye Software', 'creationdate': '2011-11-09T13:01:02+05:30', 'moddate': '2011-11-09T13:01:23+05:30', 'title': 'Human-Wildlife Conflict and Environmental Education: Evaluating a Community Program to Protect the A', 'source': 'hwc\\\\Espinosa et al. 2011.pdf', 'total_pages': 12, 'page': 5, 'page_label': '59'}\n",
"\n",
"--- Document #3 ---\n",
"KEYWORDS\n",
"bio-logging, crop guarding, crop-foraging, fencing, home range, human-wildlife conflict\n",
"mitigation, primate, raiding frequency, social sciences, space use\n",
"1 | INTRODUCTION\n",
"With an expanding human population that is encroach-\n",
"ing on natural landscapes, negative interactions between\n",
"people and wildlife are increasing. Such interactions are\n",
"more marked when wildlife searches for and consumes\n",
"food resources in farmlands (Warren et al.,\n",
"2007; Webber\n",
"et al.,2011) and urban areas (Contesse et al.,2004; Yeo &\n",
"Neo, 2010). Crop and urban foraging wildlife can result\n",
"in severe economic losses for people because of the dam-\n",
"age they cause to crops and infrastructure (Tavolaro\n",
"et al., 2022) contributing to negative human –wildlife\n",
"interactions and feelings of insecurity by people, espe-\n",
"cially when large mammals or carnivore species forage in\n",
"human spaces (Soulsbury & White, 2016). For wildlife,\n",
"these interactions can pose significant welfare costs and\n",
"threaten populations of endangered sp\n",
"\n",
"[Metadata]: {'producer': 'Acrobat Distiller 11.0 (Windows); modified using iText 4.2.0 by 1T3XT', 'creator': 'Arbortext Advanced Print Publisher 9.1.520/W Unicode', 'creationdate': '2023-06-16T15:56:20+05:30', 'keywords': '', 'moddate': '2025-05-27T12:15:01-07:00', 'subject': 'Conservat Sci and Prac 2023.5:e12948', 'wps-proclevel': '3', 'wps-journaldoi': '10.1111/(ISSN)2578-4854', 'title': 'Using behavioral studies to adapt management decisions and reduce negative interactions between humans and baboons in Cape Town, South Africa', 'wps-articledoi': '10.1111/csp2.12948', 'source': 'hwc\\\\Fehlmann et al. 2022.pdf', 'total_pages': 16, 'page': 1, 'page_label': '2'}\n",
"\n",
"--- Document #4 ---\n",
"and among lethal interventions, 48.6% investigated culling (N =1 7 ) ,\n",
"34.3% retaliatory killing (N = 12), and 17.1% trophy-hunting (N =6 ) .\n",
"Contrary to the whole body of literature, most of these case studies were\n",
"located in the Neartic (63.6%) followed by the Afrotropic (24.5%) and\n",
"Paleartic (7.7%) (Fig. 3). Nonetheless, the species included in the case studies\n",
"reflected the generalfindings, with most of the management experiments\n",
"being conducted on wolves (29.4%) followed by bears (23.8%) and leopards\n",
"(16.1%) (Fig. 2). Surprisingly, almost none of the experiments were con-\n",
"ducted on tigers, despite their strong presence in the whole literature and\n",
"their heavy impact, including attacks on humans (Dhungana et al., 2016).\n",
"Fig. 2.Species prevalence in literature (black bars,N = 525) and case studies (gray bars, N = 143).\n",
"Fig. 3.Geographic prevalence in literature (black bars, N = 525) and case studies (gray bars,N = 143), with species involved per geographic area. In circles, mean result\n",
"\n",
"[Metadata]: {'producer': 'PyPDF', 'creator': 'Elsevier', 'creationdate': '2022-06-07T02:40:21+00:00', 'author': 'Charlotte Lorand', 'crossmarkdomains[1]': 'elsevier.com', 'crossmarkdomains[2]': 'sciencedirect.com', 'crossmarkdomainexclusive': 'true', 'crossmarkmajorversiondate': '2010-04-23', 'elsevierwebpdfspecifications': '7.0', 'keywords': 'Human-carnivore coexistence; Lethal control; Non-lethal management; Conservation interventions; Effectiveness; Evidence-based', 'moddate': '2022-06-07T02:40:21+00:00', 'subject': 'Science of the Total Environment, 838 (2022) 156195. doi:10.1016/j.scitotenv.2022.156195', 'title': \"Effectiveness of interventions for managing human-large carnivore conflicts worldwide: Scare them off, don't remove them\", 'doi': '10.1016/j.scitotenv.2022.156195', 'robots': 'noindex', 'source': 'hwc\\\\Lorand et al. 2022.pdf', 'total_pages': 11, 'page': 5, 'page_label': '6'}\n",
"\n",
"--- Document #5 ---\n",
"because they have longer perimeters (Fig. 1B). Finally, 80–85% of\n",
"the cost of materials of most fences is in the corner and end systems;\n",
"therefore, an effort should be made to minimize these.\n",
"We designed a computer model to assist with determining if\n",
"fencing is economically feasible for reducing deer damage and, if\n",
"so, which fence design would be optimal (VerCauteren et al.\n",
"2006). Our interactive model provides economic analyses and\n",
"predicts the scenarios associated with fencing relative to area and\n",
"perimeter of the protected plot, value and percentage of crop\n",
"damaged annually prior to fencing, cost of the fence, and efficacy\n",
"of the fence. Users of the model can easily adjust the above\n",
"variables to fit their individual situations and needs. By running a\n",
"series of simulations, users can answer questions directly related to\n",
"the economics associated with different fence designs for their\n",
"situation.\n",
"Negative Impacts\n",
"Fences can effectively protect human commodities; however, they\n",
"can have neg\n",
"\n",
"[Metadata]: {'producer': 'PDFlib PLOP 2.0.0p6 (SunOS)/Acrobat Distiller 6.0 (Windows); modified using iText 4.2.0 by 1T3XT', 'creator': '3B2 Total Publishing System 8.07c/W', 'creationdate': '2006-04-19T19:41:41-05:00', 'moddate': '2025-05-27T12:08:26-07:00', 'subject': 'Wildlife Society Bulletin 2006.34:191-200', 'wps-proclevel': '2', 'wps-journaldoi': '10.1111/wsb4.2006.34.issue-1', 'title': 'From the Field: Fences and Deer‐Damage Management: A Review of Designs and Efficacy', 'wps-articledoi': '10.2193/0091-7648(2006)34[191:FADMAR]2.0.CO;2', 'source': 'hwc\\\\VerCauteren et al. 2006.pdf', 'total_pages': 10, 'page': 3, 'page_label': '4'}\n"
]
},
{
"data": {
"text/plain": [
"<function __main__.test_retriever_only(query: str, k: int = 5)>"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_query = \"I live in Tanzania and am having issues with lions breaking into my boma and preying on cattle. What are a few ways to help me prevent this from happening in the future? Can you check these pdfs to see which ones might help?\"\n",
"test_retriever_only(test_query, k=5)\n",
"test_retriever_only"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "968cd90b-0bc6-42f9-a097-97d3f347d93e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" Query: What should I do if elephants are destroying my crops? And what are the most cost-effective prevention methods, if there are any you know of? Can you check these pdfs to see which ones might help?\n",
"\n",
" Top 5 Retrieved Documents:\n",
"------------------------------------------------------------\n",
"\n",
"--- Document #1 ---\n",
"hypothesis was that index of pre- and post-ban use\n",
"was the same for both types of feeding sites.\n",
"We calculated the average annual number of\n",
"observed bears during pre- and post-ban periods\n",
"for each feeding site. We then used these averages\n",
"instead of raw data from individual counts. We\n",
"calculated an annual index of feeding site use by\n",
"pooling data from all feeding sites (average number\n",
"of bears counted at feeding sites in post-ban period\n",
"divided by average number of bears counted in pre-\n",
"ban period). Subsequently, we used bootstrapping\n",
"with 1,000 simulations to test for differences between\n",
"SUPPLEMENTAL FEEDING AND BEAR DEPREDATIONS N Kavcˇicˇ et al. 113\n",
"Ursus 24(2):111–119 (2013)\n",
"\n",
"[Metadata]: {'producer': 'GPL Ghostscript 9.26', 'creator': '', 'creationdate': '2022-06-06T23:09:49-07:00', 'moddate': '2022-06-06T23:09:49-07:00', 'title': '', 'author': '', 'subject': '', 'keywords': '', 'source': 'hwc\\\\Kavcic et al. 2013.pdf', 'total_pages': 9, 'page': 2, 'page_label': '3'}\n",
"\n",
"--- Document #2 ---\n",
"ESPINOSA AND JACOBSON 59\n",
"TABLE 3\n",
"Linear Multiple Regressions Showing the Association of Variables With People’s Attitudes, Behavioral\n",
"Intentions and Perceived Program Impacts\n",
"A) Attitude B) Attitude C) Behavioral\n",
"toward toward intention in a D) Bear Project\n",
"bear protection bear presence conflict with a bear support\n",
"Explanatory Std. Beta Std. Beta Std. Beta Std. Beta\n",
"variables coefficient Sig. coefficient Sig. coefficient Sig. coefficient Sig.\n",
"Gender∗ −.137 .182 −.302 .010 −.544 .000 −.339 .002\n",
"Age −.154 .076 .001 .995 .016 .855 .026 .778\n",
"Monthly income −.108 .180 .081 .367 −.036 .643 .189 .027\n",
"Cow predation by\n",
"bears∗∗\n",
"−.139 .077 −.196 .028 −.024 .754 .001 .994\n",
"Environmental\n",
"knowledge\n",
".484 .000 .189 .144 .235 .037 .182 .117\n",
"Participation in\n",
"Bear Project∗∗\n",
".145 .087 .149 .132 .063 .447 .387 .000\n",
"Adjusted R2 .266 .081 .159 .232\n",
"SE of the estimate .773 1 .108 .916 .850\n",
"N 121 121 145 114\n",
"∗Male = 1, Female = 0; ∗∗ Yes = 1, No = 0.\n",
"each lasting approximately 1.5 hrs, were conducted with teachers (\n",
"\n",
"[Metadata]: {'producer': 'Acrobat Distiller 6.0.1 (Windows)', 'creator': 'dvips(k) 5.95a Copyright 2005 Radical Eye Software', 'creationdate': '2011-11-09T13:01:02+05:30', 'moddate': '2011-11-09T13:01:23+05:30', 'title': 'Human-Wildlife Conflict and Environmental Education: Evaluating a Community Program to Protect the A', 'source': 'hwc\\\\Espinosa et al. 2011.pdf', 'total_pages': 12, 'page': 5, 'page_label': '59'}\n",
"\n",
"--- Document #3 ---\n",
"Americas. In recent decades, extensive fragmentation of\n",
"jaguar habitat and expansion of human activities into such\n",
"areas has increased both jaguar depredation on livestock as\n",
"well as conflict with humans (Rabinowitz and Nottingham\n",
"1986, Weber and Rabinowitz 1996). However, there has\n",
"been limited assessment of the magnitude of jaguar use of\n",
"livestock as prey or of factors predisposing livestock to\n",
"depredation by jaguars. For instance, the demonstrated\n",
"preference by jaguars for forested habitats in close\n",
"association with standing water is attributed to increased\n",
"wild prey vulnerability to predation in such habitats\n",
"(Crawshaw and Quigley 1991, Quigley and Crawshaw\n",
"1992). Similar patterns may apply to jaguar selection of\n",
"domestic prey. Inappropriate husbandry practices and wild\n",
"prey availability and vulnerability are factors reported to\n",
"influence vulnerability of livestock to depredation by jaguars,\n",
"particularly among calves (Quigley and Crawshaw 1992,\n",
"Hoogesteijn et al. 1993, Polisar et al.\n",
"\n",
"[Metadata]: {'producer': 'PDFlib PLOP 2.0.0p6 (SunOS)/Acrobat Distiller 7.0.5 (Windows); modified using iText 4.2.0 by 1T3XT', 'creator': '3B2 Total Publishing System 8.07c/W', 'creationdate': '2007-08-21T03:47:13-05:00', 'moddate': '2025-05-27T11:54:37-07:00', 'subject': 'J Wildl Manag 2007.71:2379-2386', 'wps-proclevel': '2', 'wps-journaldoi': '10.1111/jwmg.2007.71.issue-7', 'title': 'Evaluation of Potential Factors Predisposing Livestock to Predation by Jaguars', 'wps-articledoi': '10.2193/2006-520', 'source': 'hwc\\\\Azevedo and Murray 2007.pdf', 'total_pages': 8, 'page': 0, 'page_label': '1'}\n",
"\n",
"--- Document #4 ---\n",
"Convention on the Conservation of European Wildlife and Natural HabitatsNature\n",
"and Environment Series 113. Council of Europe, Strasbourg.\n",
"Boitani, L., Ciucci, P., Raganella-Pelliccioni, E., 2010.Ex-post compensation payments for\n",
"wolf predation on livestock in Italy: a tool for conservation? Wildl. Res. 37, 722–730.\n",
"Bradley, E.H., Pletscher, D.H., 2005.Assessing factors related to wolf depredation of cattle\n",
"in fenced pastures in Montana and Idaho. Wildl. Soc. Bull. 33, 1256–1265.\n",
"Breck, S.W., Meier, T., 2004.Managing wolf depredation in the United States: past, pres-\n",
"ent, and future. Sheep Goat Res. J. 19 (Special Issue: Predation), 41–46.\n",
"Burnham, K.P., Anderson, D.R., 2002.Model Selection and Multimodel Inference. A Practi-\n",
"cal Information-Theoretic Approach. Springer-Verlag.\n",
"Cade, B.S., 2015.Model averaging and muddled multimodel inferences. Ecology 96,\n",
"2370–2382.\n",
"Chapron, G., Kaczensky, P., Linnell, J.D., von Arx, M., Huber, D., Andrén, H., ... Boitani, L.,\n",
"2014. Recovery of large c\n",
"\n",
"[Metadata]: {'producer': 'PDF Architect 3', 'creator': 'PDF Architect 3', 'creationdate': '2017-01-25T14:50:41+00:00', 'author': 'V. Pimenta', 'moddate': '2017-01-25T14:52:31+00:00', 'source': 'hwc\\\\Pimenta et al. 2017.pdf', 'total_pages': 20, 'page': 8, 'page_label': '9'}\n",
"\n",
"--- Document #5 ---\n",
"attacked bomas ranged from 54% (at 0–1 km); 31% (at 1–2 km); 11% (at 2–3 km) to 4% (at >3\n",
"km from the park boundary). We also found a significant yearly increase in mean distance of\n",
"attacks from the park boundary, from the application of flashlights in 2012 (Mann-Whitney U\n",
"test t = 11.291, df = 79.002, p-value = 0.0001) (Fig 7). The yearly regression with intercept of\n",
"2.001+03 and slope of 0.008, shows that every 3 years, there is 2km increase in distance of\n",
"attack.\n",
"The fence height in relation to percentages of attack (high = 12%, medium 23%, short =\n",
"71% and χ\n",
"2\n",
"= 8.088, df = 2, p-value = 0.017.This shows that bomas without flashlights and\n",
"those with short-medium fences are more likely to be attacked by lion than those with flash-\n",
"lights and higher fences. The data normality distribution test was W = 0.87567, p-value <\n",
"0.00001.\n",
"Fig 5. Cumulative flashlights installed and Mean nocturnal and diurnal livestock predation at bomas with and without\n",
"flashlights .\n",
"https://do i.org/10.1371/j o\n",
"\n",
"[Metadata]: {'producer': 'PDFlib+PDI 8.0.2p1 (C++/Win64); modified using iTextSharp™ 5.5.3 ©2000-2014 iText Group NV (AGPL-version)', 'creator': 'Arbortext Advanced Print Publisher 11.0.2857/W Unicode-x64', 'creationdate': '2018-01-10T21:11:13+05:30', 'title': 'Effectiveness of a LED flashlight technique in reducing livestock depredation by lions (Panthera leo) around Nairobi National Park, Kenya', 'eps_processor': 'PStill version 1.76.22', 'moddate': '2018-01-10T21:12:24+05:30', 'author': \"Francis Lesilau, Myrthe Fonck, Maria Gatta, Charles Musyoki, Maarten van 't Zelfde, Gerard A. Persoon, Kees C. J. M. Musters, Geert R. de Snoo, Hans H. de Iongh\", 'source': 'hwc\\\\Lesilau et al. 2018.pdf', 'total_pages': 18, 'page': 9, 'page_label': '10'}\n"
]
},
{
"data": {
"text/plain": [
"<function __main__.test_retriever_only(query: str, k: int = 5)>"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_query = \"What should I do if elephants are destroying my crops? And what are the most cost-effective prevention methods, if there are any you know of? Can you check these pdfs to see which ones might help?\"\n",
"test_retriever_only(test_query, k=5)\n",
"test_retriever_only"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "327f96c5-2656-4ed6-8bba-2bd4bd652f83",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" Query: I know jaguars can prey on goats and cattle, which I have; what measures can I take to save them from getting harmed? Can you check these pdfs to see which ones might help? \n",
"\n",
" Top 5 Retrieved Documents:\n",
"------------------------------------------------------------\n",
"\n",
"--- Document #1 ---\n",
"458 SELECTIVE REMOVAL OF COYOTES * Blejwas et al. J. Wildl. Manage. 66(2):2002 \n",
" was monitored, predation resumed only after the \n",
" new pair had formed (K. M. Blejwas, unpublished \n",
" data). These data suggest that loss of a mate and \n",
" the associated process of forming a new pair \n",
" bond alters the behavior of the surviving breeder, \n",
" temporarily interrupting predation on sheep. \n",
" Why Breeding Coyotes Kill Sheep \n",
" It is not surprising that breeding pairs are \n",
" responsible for most depredations of ewes and \n",
" large lambs. Most observations of coyotes attack- \n",
" ing large ungulate prey indicate that these are \n",
" cooperative endeavors involving more than 1 coy- \n",
" ote (Cahalane 1947, Robinson 1952, Bowyer \n",
" 1987, Gese and Grothe 1995, Lingle 2000). Most \n",
" observations of coyotes attacking ungulate fawns \n",
" also involve pairs or groups of coyotes (Mac- \n",
" Connell-Yount and Smith 1978, Hamlin and \n",
" Schweitzer 1979, Truett 1979, Bowyer 1987), and \n",
" a pair may be present even when only 1 coyote is \n",
" in\n",
"\n",
"[Metadata]: {'producer': 'iText® 5.5.8 ©2000-2015 iText Group NV (AGPL-version); modified using iText® 7.1.3 ©2000-2018 iText Group NV (JSTOR Michigan; licensed version)', 'creator': 'page2pdf-2.1', 'creationdate': '2016-08-07T19:47:10+00:00', 'moddate': '2020-09-14T14:51:37+00:00', 'title': 'The Effectiveness of Selective Removal of Breeding Coyotes in Reducing Sheep Predation', 'source': 'hwc\\\\Blejwas et al. 2002.pdf', 'total_pages': 13, 'page': 8, 'page_label': '459'}\n",
"\n",
"--- Document #2 ---\n",
"Gittleman, J.L., Funk, S.M., Macdonald, D.W. & Wayne,\n",
"R.K. (2001). Why ‘carnivore conservation’? InCarnivore\n",
"conservation: 1–8. Gittleman, J.L., Funk, S.M., Macdo-\n",
"nald, D. & Wayne, R.K. (Eds). Cambridge: Cambridge\n",
"University Press.\n",
"Gonz ´alez, F. (1995). Livestock predation in the Venezuelan\n",
"Llanos. Cat News 22, 14–15.\n",
"Hoogesteijn, R., Hoogesteijn, A. & Mondolfi, E. (1993).\n",
"Jaguar predation and conservation: cattle mortality caused\n",
"by felines on three ranches in the Venezuelan Llanos. In\n",
"Mammals as predators : 391–407. Dunstone, N. & Gorman,\n",
"M.L. (Eds). London: Oxford University Press.\n",
"Hoogesteijn, R. & Mondolfi, E. (1992).The jaguar. Caracas:\n",
"Armitano Publishers.\n",
"Instituto Brasileiro de Geografia e Estat´ıstica (IBGE). (2004)\n",
"Pesquisa Pecu´aria Municipal 1990–2003. Available at\n",
"http://www.ibge.gov.br/bda/pecua.\n",
"Iriarte, J.A., Johnson, W.E. & Franklin, W.L. (1991). Feeding\n",
"ecology of the Patagonia puma in southernmost Chile.Rev.\n",
"Chil. Hist. Nat. 64, 145–156.\n",
"Jackson, R., Wang, Z.Y., Lu, \n",
"\n",
"[Metadata]: {'producer': 'PDFlib PLOP 3.0 (.NET/Win32)/Acrobat Distiller 6.0.1 (Windows); modified using iText 4.2.0 by 1T3XT', 'creator': '3B2 Total Publishing System 8.07f/W', 'creationdate': '2006-03-25T19:46:31+05:30', 'moddate': '2025-05-27T11:47:43-07:00', 'subject': 'Animal Conservation 2006.9:179-188', 'wps-proclevel': '2', 'title': 'Human–wildlife conflicts in a fragmented Amazonian forest landscape: determinants of large felid depredation on livestock', 'wps-articledoi': '10.1111/j.1469-1795.2006.00025.x', 'source': 'hwc\\\\Michalski et al. 2006.pdf', 'total_pages': 10, 'page': 8, 'page_label': '9'}\n",
"\n",
"--- Document #3 ---\n",
"See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/305358233\n",
"Fencing: A Valuable Tool for Reducing Wildlife-Vehicle Collisions and\n",
"Funnelling Fauna to Crossing Structures\n",
"Chapter · January 2015\n",
"DOI: 10.1002/9781118568170.ch20\n",
"CITATIONS\n",
"54\n",
"READS\n",
"3,350\n",
"3 authors, including:\n",
"Rodney van der Ree\n",
"University of Melbourne\n",
"148 PUBLICATIONS 5,823 CITATIONS \n",
"SEE PROFILE\n",
"All content following this page was uploaded by Rodney van der Ree on 23 July 2018.\n",
"The user has requested enhancement of the downloaded file.\n",
"\n",
"[Metadata]: {'producer': 'PDFlib PLOP 2.0.0p6 (SunOS)/iTextSharp™ 5.5.0 ©2000-2013 iText Group NV (AGPL-version)', 'creator': 'PyPDF', 'creationdate': '2015-03-24T09:28:20+05:30', 'title': 'Fencing', 'wps-articledoi': '10.1002/9781118568170.ch20', 'wps-proclevel': '3', 'moddate': '2015-04-24T21:50:27-04:00', 'author': 'Rodney van der Ree', 'rgid': 'PB:305358233_AS:651478247145472@1532335926046', 'source': 'hwc\\\\van der Ree et al. 2015.pdf', 'total_pages': 14, 'page': 0, 'page_label': '159'}\n",
"\n",
"--- Document #4 ---\n",
"timating the percent loss of kernels (Woronecki et al.\n",
"1980) and converting to yield loss per hectare. Fruit loss\n",
"can be estimated by counting the numbers of undamaged,\n",
"pecked, and removed fruits per sampled branch (Tobin\n",
"and Dolbeer 1987). Sprouting rice removed by birds can\n",
"be estimated by companng plant density in exposed plots\n",
"with that in adjacent plots with wire bird exclosures (Otis\n",
"et al. 1983). The seeded surface area of sunflower heads\n",
"destroyed by birds can be estimated with the aid of a clear\n",
"plastic template (Dolbeer 1975).\n",
"Losses of agricultural crops to birds can be estimated\n",
"indirectly through avian bioenergetics. By estimating the\n",
"number of birds of the depredating species feeding in an\n",
"area, thc percentage of thc agncultural crop in the birds'\n",
"diet, the caloric value of the crop, and the daily caloric\n",
"requirements of the birds, one can project thc total bio-\n",
"mass of crop removed by birds on a daily or seasonal\n",
"basis (Weathcrhead et al. 1982, White et al. 1985).\n",
"Specie\n",
"\n",
"[Metadata]: {'producer': 'Canon iR C5800', 'creator': 'Canon iR C5800', 'creationdate': '2009-03-09T08:39:40-05:00', 'subject': 'Image', 'source': 'hwc\\\\Dolbeer et al. 1994.pdf', 'total_pages': 34, 'page': 2, 'page_label': '3'}\n",
"\n",
"--- Document #5 ---\n",
"7,3 1 7e325\n",
".\n",
"Hovick, T. J., Elmore, R. D., Dahlgren, D. K., Fuhlendorf, S. D., & Engle, D. M. (2014).\n",
"Evidence of negative effects of anthropogenic structures on wildlife: A review of\n",
"grouse survival and behaviour.Journal of Applied Ecology, 51, 1680e1689.\n",
"Huijser, M., McGowen, P., Fuller, J., Hardy, A., Kociolek, A., Clevenger, A. P., et al.\n",
"(2008). Wildlifeevehicle collision reduction study: Report to congress [No.\n",
"FHWAeHRTe08e034]. Washington, D.C.: U.S. Department of Transportation.\n",
"Hunt, W. G., McClure, C. J. W., & Allison, T. D. (2015). Do raptors react to ultraviolet\n",
"light? Journal of Raptor Research, 49, 342e343.\n",
"Jaeger, M. M., Blejwas, K. M., Sacks, B. N., Neale, J. C. C., Conner, M. M., &\n",
"McCullough, D. R. (2001). Targeting alphas can make coyote control more\n",
"effective and socially acceptable.California Agriculture, 55,3 2e36.\n",
"Johnson, H. E., Breck, S. W., Baruch-Mordo, S., Lewis, D. L., Lackey, C. W.,\n",
"Wilson, K. R., et al. (2015). Shifting perceptions of risk and reward: Te\n",
"\n",
"[Metadata]: {'producer': 'Acrobat Distiller 8.1.0 (Windows)', 'creator': 'Elsevier', 'creationdate': '2016-09-26T20:02:29+05:30', 'crossmarkdomains[2]': 'elsevier.com', 'crossmarkmajorversiondate': '2010-04-23', 'subject': 'Animal Behaviour, 120 (2016) 245-254. doi:10.1016/j.anbehav.2016.07.013', 'author': 'Bradley F. Blackwell', 'elsevierwebpdfspecifications': '6.5', 'crossmarkdomainexclusive': 'true', 'robots': 'noindex', 'moddate': '2016-09-26T20:03:01+05:30', 'doi': '10.1016/j.anbehav.2016.07.013', 'crossmarkdomains[1]': 'sciencedirect.com', 'title': 'No single solution: application of behavioural principles in mitigating human-wildlife conflict', 'source': 'hwc\\\\Blackwell et al. 2016.pdf', 'total_pages': 10, 'page': 8, 'page_label': '253'}\n"
]
},
{
"data": {
"text/plain": [
"<function __main__.test_retriever_only(query: str, k: int = 5)>"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_query = \"I know jaguars can prey on goats and cattle, which I have; what measures can I take to save them from getting harmed? Can you check these pdfs to see which ones might help? \"\n",
"test_retriever_only(test_query, k=5)\n",
"test_retriever_only"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "5afb060d-0444-4167-bdd5-b63501475773",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" Query: I am trying to prevent coyotes from eating the calves of my free-range cattle. What may work best and incentivize them to stay away? Can you check these pdfs to see which ones might help? https://minio.carlboettiger.info/public-data/hwc.zip\n",
"\n",
" Top 5 Retrieved Documents:\n",
"------------------------------------------------------------\n",
"\n",
"--- Document #1 ---\n",
"242 Conflict Intervention Priorities\n",
"helps foster more effective collaboration (Game et al.\n",
"2013; Lute et al. 2018). Third, both the survey results\n",
"and feedback were consistent with recent scholarship\n",
"(Redpath et al. 2017) that highlights participatory and\n",
"stakeholder-first conflict interventions as best practice\n",
"and advocates multipronged (Hazzah et al. 2014) and\n",
"adaptive management strategies (Bunnefeld et al. 2017).\n",
"Education and awareness programs were often cited in\n",
"feedback as being necessary additions to any interven-\n",
"tions. However, given the failures of many awareness-\n",
"based conservation programs (Schultz 2011), a further\n",
"exploration into why and where conservation decision\n",
"makers deem them most appropriate is important. Ap-\n",
"proaches that are specifically aimed at a particular au-\n",
"dience, such as social marketing (Salazar et al. 2018),\n",
"may be more effective than simple information provision\n",
"or—often-problematic—enforcement (Duffy et al. 2019).\n",
"However, how different interventio\n",
"\n",
"[Metadata]: {'producer': 'Acrobat Distiller 10.1.10 (Windows); modified using iText 4.2.0 by 1T3XT', 'creator': 'LaTeX with hyperref package', 'creationdate': '2020-01-16T12:33:42+05:30', 'keywords': '', 'moddate': '2025-05-27T12:12:25-07:00', 'subject': 'Conservation Biology 2020.34:232-243', 'wps-proclevel': '3', 'wps-journaldoi': '10.1111/(ISSN)1523-1739', 'author': '', 'title': 'Predicting intervention priorities for wildlife conflicts', 'wps-articledoi': '10.1111/cobi.13372', 'source': 'hwc\\\\Baynham-Herd et al. 2019.pdf', 'total_pages': 12, 'page': 10, 'page_label': '242'}\n",
"\n",
"--- Document #2 ---\n",
"Fig 1. The effects of AC programs on three metrics of black bear wariness, Whistler BC, 2007–2008. A and B show\n",
"the average observed percent change in overt reaction distance and displace ment distance among bears in the AC\n",
"Group and the Control Group. Error bars represent standard error. C shows the predicted effect of the number of AC\n",
"events conduc ted during the previous 30 days on the likeliho od that a bear will flee from research ers prior to their\n",
"beginning AC treatm ent.\n",
"https://d oi.org/10.1371/j ournal.pon e.0295989.g0 01\n",
"PLOS ONE\n",
"Aversive condition ing of conflict black bears\n",
"PLOS ONE | https://doi.or g/10.137 1/journal.po ne.02959 89 January 2, 2024 8 / 19\n",
"\n",
"[Metadata]: {'producer': 'PDFlib+PDI 9.3.1p2 (C++/Win64)', 'creator': 'PTC Arbortext Layout Developer 12.1.6180/W-x64', 'creationdate': '2023-12-25T16:46:13+05:30', 'title': 'Aversive conditioning increases short-term wariness but does not change habitat use in black bears associated with conflict', 'epsprocessor': 'PStill version 1.84.42', 'author': 'Lori Homstol, Sage Raymond, Claire Edwards, Anthony N. Hamilton, Colleen Cassady St. Clair', 'moddate': '2023-12-25T16:46:13+05:30', 'source': 'hwc\\\\Homstol et al. 2024.pdf', 'total_pages': 19, 'page': 7, 'page_label': '8'}\n",
"\n",
"--- Document #3 ---\n",
"51] and other carnivores, such as coyotes (Canis latrans) [69, 70], African lions (Panthera leo)\n",
"[71], and wolves (Canis lupus) [72]. The relative effectiveness of these AC programs for\n",
"increasing wariness could relate to several aspects of program implementation. Because we\n",
"subjected bears to aversive stimuli as they engaged in problematic behaviour [48, 50], we\n",
"increased the likelihood that bears associated the conditioning stimulus (conflict behaviour)\n",
"with the unconditioned stimulus (pain/ stress) [38, 52]. This principle of immediacy in aver-\n",
"sive conditioning [54] is not achieved when aversive conditioning occurs upon release of a\n",
"captured bear, sometimes hours later and kilometres distant from the capture location where\n",
"conflict occurred [32]. Repetition of treatments allowed bears to generalize among experiences\n",
"instead of associating the painful stimulus with a single location or human individual, which\n",
"has been identified as important to AC programs targeting bold coyotes [69\n",
"\n",
"[Metadata]: {'producer': 'PDFlib+PDI 9.3.1p2 (C++/Win64)', 'creator': 'PTC Arbortext Layout Developer 12.1.6180/W-x64', 'creationdate': '2023-12-25T16:46:13+05:30', 'title': 'Aversive conditioning increases short-term wariness but does not change habitat use in black bears associated with conflict', 'epsprocessor': 'PStill version 1.84.42', 'author': 'Lori Homstol, Sage Raymond, Claire Edwards, Anthony N. Hamilton, Colleen Cassady St. Clair', 'moddate': '2023-12-25T16:46:13+05:30', 'source': 'hwc\\\\Homstol et al. 2024.pdf', 'total_pages': 19, 'page': 12, 'page_label': '13'}\n",
"\n",
"--- Document #4 ---\n",
"8 \n",
" \n",
" \n",
" \n",
" \n",
" \n",
"Figure A5. Silhouette width plot of the k-medoid partitions with k = 2 to 10 used to estimate the best \n",
"number of clusters to describe livestock husbandry systems within the wolf range in northern Portugal \n",
"(see the main text for details). \n",
" \n",
"2 4 6 8 10 \n",
"0.20 0.22 0.24 0.26 0.28 0.30 0.32 \n",
"Number of clusters \n",
"Silhouette Width\n",
"\n",
"[Metadata]: {'producer': 'PDF Architect 3', 'creator': 'PDF Architect 3', 'creationdate': '2017-01-25T14:50:41+00:00', 'author': 'V. Pimenta', 'moddate': '2017-01-25T14:52:31+00:00', 'source': 'hwc\\\\Pimenta et al. 2017.pdf', 'total_pages': 20, 'page': 17, 'page_label': '18'}\n",
"\n",
"--- Document #5 ---\n",
"3\n",
"Vol.:(0123456789)Scientific RepoRtS | (2020) 10:15341 | https://doi.org/10.1038/s41598-020-72343-6\n",
"www.nature.com/scientificreports/\n",
"numbers increase and more bears need more food26,43,44. Hence, the effectiveness of anti-bear interventions can \n",
"be lower than expected when hungry bears become persistent and more aggressive in damaging behaviour. As \n",
"high density may lead to more bears involved in conflicts, it also could increase the demand for bear removal45 \n",
"and affect the effectiveness of removal techniques such as translocation and lethal control.\n",
"In this paper, we compiled a global database of intervention effectiveness against bears and studied how it \n",
"is related to bear species and densities, duration of intervention application, and intervention techniques. We \n",
"attempted to find and describe the most effective and the least effective interventions against bears. Further, we \n",
"tested several hypotheses: (1) lethal control and invasive management are less effective th\n",
"\n",
"[Metadata]: {'producer': 'Adobe PDF Library 15.0; modified using iText® 5.3.5 ©2000-2012 1T3XT BVBA (SPRINGER SBM; licensed version)', 'creator': 'Springer', 'creationdate': '2020-09-14T15:09:33+05:30', 'crossmarkdomains[1]': 'springer.com', 'moddate': '2020-09-14T15:58:07+02:00', 'crossmarkmajorversiondate': '2010-04-23', 'subject': 'Scientific Reports, https://doi.org/10.1038/s41598-020-72343-6', 'author': 'Igor Khorozyan', 'title': 'Variation and conservation implications of the effectiveness of anti-bear interventions', 'crossmarkdomainexclusive': 'true', 'robots': 'noindex', 'doi': '10.1038/s41598-020-72343-6', 'crossmarkdomains[2]': 'springerlink.com', 'source': 'hwc\\\\Khorozyan and Waltert 2020.pdf', 'total_pages': 9, 'page': 2, 'page_label': '3'}\n"
]
},
{
"data": {
"text/plain": [
"<function __main__.test_retriever_only(query: str, k: int = 5)>"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_query = \"I am trying to prevent coyotes from eating the calves of my free-range cattle. What may work best and incentivize them to stay away? Can you check these pdfs to see which ones might help? https://minio.carlboettiger.info/public-data/hwc.zip\"\n",
"test_retriever_only(test_query, k=5)\n",
"test_retriever_only\n"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "64e672ff-8341-4144-a0cf-b9756661475e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" Query: Deers keep destroying and takiing over our large agricultural fields. Is there anything I can try to prevent this that won’t break the bank? Can you check these pdfs to see which ones might help? https://minio.carlboettiger.info/public-data/hwc.zip\n",
"\n",
" Top 5 Retrieved Documents:\n",
"------------------------------------------------------------\n",
"\n",
"--- Document #1 ---\n",
"242 Conflict Intervention Priorities\n",
"helps foster more effective collaboration (Game et al.\n",
"2013; Lute et al. 2018). Third, both the survey results\n",
"and feedback were consistent with recent scholarship\n",
"(Redpath et al. 2017) that highlights participatory and\n",
"stakeholder-first conflict interventions as best practice\n",
"and advocates multipronged (Hazzah et al. 2014) and\n",
"adaptive management strategies (Bunnefeld et al. 2017).\n",
"Education and awareness programs were often cited in\n",
"feedback as being necessary additions to any interven-\n",
"tions. However, given the failures of many awareness-\n",
"based conservation programs (Schultz 2011), a further\n",
"exploration into why and where conservation decision\n",
"makers deem them most appropriate is important. Ap-\n",
"proaches that are specifically aimed at a particular au-\n",
"dience, such as social marketing (Salazar et al. 2018),\n",
"may be more effective than simple information provision\n",
"or—often-problematic—enforcement (Duffy et al. 2019).\n",
"However, how different interventio\n",
"\n",
"[Metadata]: {'producer': 'Acrobat Distiller 10.1.10 (Windows); modified using iText 4.2.0 by 1T3XT', 'creator': 'LaTeX with hyperref package', 'creationdate': '2020-01-16T12:33:42+05:30', 'keywords': '', 'moddate': '2025-05-27T12:12:25-07:00', 'subject': 'Conservation Biology 2020.34:232-243', 'wps-proclevel': '3', 'wps-journaldoi': '10.1111/(ISSN)1523-1739', 'author': '', 'title': 'Predicting intervention priorities for wildlife conflicts', 'wps-articledoi': '10.1111/cobi.13372', 'source': 'hwc\\\\Baynham-Herd et al. 2019.pdf', 'total_pages': 12, 'page': 10, 'page_label': '242'}\n",
"\n",
"--- Document #2 ---\n",
"8 \n",
" \n",
" \n",
" \n",
" \n",
" \n",
"Figure A5. Silhouette width plot of the k-medoid partitions with k = 2 to 10 used to estimate the best \n",
"number of clusters to describe livestock husbandry systems within the wolf range in northern Portugal \n",
"(see the main text for details). \n",
" \n",
"2 4 6 8 10 \n",
"0.20 0.22 0.24 0.26 0.28 0.30 0.32 \n",
"Number of clusters \n",
"Silhouette Width\n",
"\n",
"[Metadata]: {'producer': 'PDF Architect 3', 'creator': 'PDF Architect 3', 'creationdate': '2017-01-25T14:50:41+00:00', 'author': 'V. Pimenta', 'moddate': '2017-01-25T14:52:31+00:00', 'source': 'hwc\\\\Pimenta et al. 2017.pdf', 'total_pages': 20, 'page': 17, 'page_label': '18'}\n",
"\n",
"--- Document #3 ---\n",
"Fig 1. The effects of AC programs on three metrics of black bear wariness, Whistler BC, 2007–2008. A and B show\n",
"the average observed percent change in overt reaction distance and displace ment distance among bears in the AC\n",
"Group and the Control Group. Error bars represent standard error. C shows the predicted effect of the number of AC\n",
"events conduc ted during the previous 30 days on the likeliho od that a bear will flee from research ers prior to their\n",
"beginning AC treatm ent.\n",
"https://d oi.org/10.1371/j ournal.pon e.0295989.g0 01\n",
"PLOS ONE\n",
"Aversive condition ing of conflict black bears\n",
"PLOS ONE | https://doi.or g/10.137 1/journal.po ne.02959 89 January 2, 2024 8 / 19\n",
"\n",
"[Metadata]: {'producer': 'PDFlib+PDI 9.3.1p2 (C++/Win64)', 'creator': 'PTC Arbortext Layout Developer 12.1.6180/W-x64', 'creationdate': '2023-12-25T16:46:13+05:30', 'title': 'Aversive conditioning increases short-term wariness but does not change habitat use in black bears associated with conflict', 'epsprocessor': 'PStill version 1.84.42', 'author': 'Lori Homstol, Sage Raymond, Claire Edwards, Anthony N. Hamilton, Colleen Cassady St. Clair', 'moddate': '2023-12-25T16:46:13+05:30', 'source': 'hwc\\\\Homstol et al. 2024.pdf', 'total_pages': 19, 'page': 7, 'page_label': '8'}\n",
"\n",
"--- Document #4 ---\n",
"3\n",
"Vol.:(0123456789)Scientific RepoRtS | (2020) 10:15341 | https://doi.org/10.1038/s41598-020-72343-6\n",
"www.nature.com/scientificreports/\n",
"numbers increase and more bears need more food26,43,44. Hence, the effectiveness of anti-bear interventions can \n",
"be lower than expected when hungry bears become persistent and more aggressive in damaging behaviour. As \n",
"high density may lead to more bears involved in conflicts, it also could increase the demand for bear removal45 \n",
"and affect the effectiveness of removal techniques such as translocation and lethal control.\n",
"In this paper, we compiled a global database of intervention effectiveness against bears and studied how it \n",
"is related to bear species and densities, duration of intervention application, and intervention techniques. We \n",
"attempted to find and describe the most effective and the least effective interventions against bears. Further, we \n",
"tested several hypotheses: (1) lethal control and invasive management are less effective th\n",
"\n",
"[Metadata]: {'producer': 'Adobe PDF Library 15.0; modified using iText® 5.3.5 ©2000-2012 1T3XT BVBA (SPRINGER SBM; licensed version)', 'creator': 'Springer', 'creationdate': '2020-09-14T15:09:33+05:30', 'crossmarkdomains[1]': 'springer.com', 'moddate': '2020-09-14T15:58:07+02:00', 'crossmarkmajorversiondate': '2010-04-23', 'subject': 'Scientific Reports, https://doi.org/10.1038/s41598-020-72343-6', 'author': 'Igor Khorozyan', 'title': 'Variation and conservation implications of the effectiveness of anti-bear interventions', 'crossmarkdomainexclusive': 'true', 'robots': 'noindex', 'doi': '10.1038/s41598-020-72343-6', 'crossmarkdomains[2]': 'springerlink.com', 'source': 'hwc\\\\Khorozyan and Waltert 2020.pdf', 'total_pages': 9, 'page': 2, 'page_label': '3'}\n",
"\n",
"--- Document #5 ---\n",
"51] and other carnivores, such as coyotes (Canis latrans) [69, 70], African lions (Panthera leo)\n",
"[71], and wolves (Canis lupus) [72]. The relative effectiveness of these AC programs for\n",
"increasing wariness could relate to several aspects of program implementation. Because we\n",
"subjected bears to aversive stimuli as they engaged in problematic behaviour [48, 50], we\n",
"increased the likelihood that bears associated the conditioning stimulus (conflict behaviour)\n",
"with the unconditioned stimulus (pain/ stress) [38, 52]. This principle of immediacy in aver-\n",
"sive conditioning [54] is not achieved when aversive conditioning occurs upon release of a\n",
"captured bear, sometimes hours later and kilometres distant from the capture location where\n",
"conflict occurred [32]. Repetition of treatments allowed bears to generalize among experiences\n",
"instead of associating the painful stimulus with a single location or human individual, which\n",
"has been identified as important to AC programs targeting bold coyotes [69\n",
"\n",
"[Metadata]: {'producer': 'PDFlib+PDI 9.3.1p2 (C++/Win64)', 'creator': 'PTC Arbortext Layout Developer 12.1.6180/W-x64', 'creationdate': '2023-12-25T16:46:13+05:30', 'title': 'Aversive conditioning increases short-term wariness but does not change habitat use in black bears associated with conflict', 'epsprocessor': 'PStill version 1.84.42', 'author': 'Lori Homstol, Sage Raymond, Claire Edwards, Anthony N. Hamilton, Colleen Cassady St. Clair', 'moddate': '2023-12-25T16:46:13+05:30', 'source': 'hwc\\\\Homstol et al. 2024.pdf', 'total_pages': 19, 'page': 12, 'page_label': '13'}\n"
]
},
{
"data": {
"text/plain": [
"<function __main__.test_retriever_only(query: str, k: int = 5)>"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_query = \"Deers keep destroying and takiing over our large agricultural fields. Is there anything I can try to prevent this that won’t break the bank? Can you check these pdfs to see which ones might help? https://minio.carlboettiger.info/public-data/hwc.zip\"\n",
"test_retriever_only(test_query, k=5)\n",
"test_retriever_only"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "02565fb4-321b-4cfc-be06-7ffaf1f7f37e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" Query: We live in a suburb and bears sometimes come into our town to eat from our fruit trees and trash. What are the best ways for us to prevent this as a community without removing our fruit trees? Can you check these pdfs to see which ones might help? https://minio.carlboettiger.info/public-data/hwc.zip\n",
"\n",
" Top 5 Retrieved Documents:\n",
"------------------------------------------------------------\n",
"\n",
"--- Document #1 ---\n",
"242 Conflict Intervention Priorities\n",
"helps foster more effective collaboration (Game et al.\n",
"2013; Lute et al. 2018). Third, both the survey results\n",
"and feedback were consistent with recent scholarship\n",
"(Redpath et al. 2017) that highlights participatory and\n",
"stakeholder-first conflict interventions as best practice\n",
"and advocates multipronged (Hazzah et al. 2014) and\n",
"adaptive management strategies (Bunnefeld et al. 2017).\n",
"Education and awareness programs were often cited in\n",
"feedback as being necessary additions to any interven-\n",
"tions. However, given the failures of many awareness-\n",
"based conservation programs (Schultz 2011), a further\n",
"exploration into why and where conservation decision\n",
"makers deem them most appropriate is important. Ap-\n",
"proaches that are specifically aimed at a particular au-\n",
"dience, such as social marketing (Salazar et al. 2018),\n",
"may be more effective than simple information provision\n",
"or—often-problematic—enforcement (Duffy et al. 2019).\n",
"However, how different interventio\n",
"\n",
"[Metadata]: {'producer': 'Acrobat Distiller 10.1.10 (Windows); modified using iText 4.2.0 by 1T3XT', 'creator': 'LaTeX with hyperref package', 'creationdate': '2020-01-16T12:33:42+05:30', 'keywords': '', 'moddate': '2025-05-27T12:12:25-07:00', 'subject': 'Conservation Biology 2020.34:232-243', 'wps-proclevel': '3', 'wps-journaldoi': '10.1111/(ISSN)1523-1739', 'author': '', 'title': 'Predicting intervention priorities for wildlife conflicts', 'wps-articledoi': '10.1111/cobi.13372', 'source': 'hwc\\\\Baynham-Herd et al. 2019.pdf', 'total_pages': 12, 'page': 10, 'page_label': '242'}\n",
"\n",
"--- Document #2 ---\n",
"8 \n",
" \n",
" \n",
" \n",
" \n",
" \n",
"Figure A5. Silhouette width plot of the k-medoid partitions with k = 2 to 10 used to estimate the best \n",
"number of clusters to describe livestock husbandry systems within the wolf range in northern Portugal \n",
"(see the main text for details). \n",
" \n",
"2 4 6 8 10 \n",
"0.20 0.22 0.24 0.26 0.28 0.30 0.32 \n",
"Number of clusters \n",
"Silhouette Width\n",
"\n",
"[Metadata]: {'producer': 'PDF Architect 3', 'creator': 'PDF Architect 3', 'creationdate': '2017-01-25T14:50:41+00:00', 'author': 'V. Pimenta', 'moddate': '2017-01-25T14:52:31+00:00', 'source': 'hwc\\\\Pimenta et al. 2017.pdf', 'total_pages': 20, 'page': 17, 'page_label': '18'}\n",
"\n",
"--- Document #3 ---\n",
"51] and other carnivores, such as coyotes (Canis latrans) [69, 70], African lions (Panthera leo)\n",
"[71], and wolves (Canis lupus) [72]. The relative effectiveness of these AC programs for\n",
"increasing wariness could relate to several aspects of program implementation. Because we\n",
"subjected bears to aversive stimuli as they engaged in problematic behaviour [48, 50], we\n",
"increased the likelihood that bears associated the conditioning stimulus (conflict behaviour)\n",
"with the unconditioned stimulus (pain/ stress) [38, 52]. This principle of immediacy in aver-\n",
"sive conditioning [54] is not achieved when aversive conditioning occurs upon release of a\n",
"captured bear, sometimes hours later and kilometres distant from the capture location where\n",
"conflict occurred [32]. Repetition of treatments allowed bears to generalize among experiences\n",
"instead of associating the painful stimulus with a single location or human individual, which\n",
"has been identified as important to AC programs targeting bold coyotes [69\n",
"\n",
"[Metadata]: {'producer': 'PDFlib+PDI 9.3.1p2 (C++/Win64)', 'creator': 'PTC Arbortext Layout Developer 12.1.6180/W-x64', 'creationdate': '2023-12-25T16:46:13+05:30', 'title': 'Aversive conditioning increases short-term wariness but does not change habitat use in black bears associated with conflict', 'epsprocessor': 'PStill version 1.84.42', 'author': 'Lori Homstol, Sage Raymond, Claire Edwards, Anthony N. Hamilton, Colleen Cassady St. Clair', 'moddate': '2023-12-25T16:46:13+05:30', 'source': 'hwc\\\\Homstol et al. 2024.pdf', 'total_pages': 19, 'page': 12, 'page_label': '13'}\n",
"\n",
"--- Document #4 ---\n",
"Fig 1. The effects of AC programs on three metrics of black bear wariness, Whistler BC, 2007–2008. A and B show\n",
"the average observed percent change in overt reaction distance and displace ment distance among bears in the AC\n",
"Group and the Control Group. Error bars represent standard error. C shows the predicted effect of the number of AC\n",
"events conduc ted during the previous 30 days on the likeliho od that a bear will flee from research ers prior to their\n",
"beginning AC treatm ent.\n",
"https://d oi.org/10.1371/j ournal.pon e.0295989.g0 01\n",
"PLOS ONE\n",
"Aversive condition ing of conflict black bears\n",
"PLOS ONE | https://doi.or g/10.137 1/journal.po ne.02959 89 January 2, 2024 8 / 19\n",
"\n",
"[Metadata]: {'producer': 'PDFlib+PDI 9.3.1p2 (C++/Win64)', 'creator': 'PTC Arbortext Layout Developer 12.1.6180/W-x64', 'creationdate': '2023-12-25T16:46:13+05:30', 'title': 'Aversive conditioning increases short-term wariness but does not change habitat use in black bears associated with conflict', 'epsprocessor': 'PStill version 1.84.42', 'author': 'Lori Homstol, Sage Raymond, Claire Edwards, Anthony N. Hamilton, Colleen Cassady St. Clair', 'moddate': '2023-12-25T16:46:13+05:30', 'source': 'hwc\\\\Homstol et al. 2024.pdf', 'total_pages': 19, 'page': 7, 'page_label': '8'}\n",
"\n",
"--- Document #5 ---\n",
"* Correspondence: B. F. Blackwell, U.S. Department of Agriculture, Animal and\n",
"Plant Health Inspection Service, Wildlife Services, National Wildlife Research\n",
"Center, Ohio Field Station, Sandusky, OH, 44870, U.S.A.\n",
"E-mail address: bradley.f.blackwell@aphis.usda.gov (B. F. Blackwell).\n",
"Contents lists available atScienceDirect\n",
"Animal Behaviour\n",
"journal homepage: www.elsevier.com/locate/anbehav\n",
"http://dx.doi.org/10.1016/j.anbehav.2016.07.013\n",
"0003-3472/Published by Elsevier Ltd on behalf of The Association for the Study of Animal Behaviour.\n",
"Animal Behaviour 120 (2016) 245e254\n",
"SPECIAL ISSUE: CONSERVATION BEHAVIOUR\n",
"\n",
"[Metadata]: {'producer': 'Acrobat Distiller 8.1.0 (Windows)', 'creator': 'Elsevier', 'creationdate': '2016-09-26T20:02:29+05:30', 'crossmarkdomains[2]': 'elsevier.com', 'crossmarkmajorversiondate': '2010-04-23', 'subject': 'Animal Behaviour, 120 (2016) 245-254. doi:10.1016/j.anbehav.2016.07.013', 'author': 'Bradley F. Blackwell', 'elsevierwebpdfspecifications': '6.5', 'crossmarkdomainexclusive': 'true', 'robots': 'noindex', 'moddate': '2016-09-26T20:03:01+05:30', 'doi': '10.1016/j.anbehav.2016.07.013', 'crossmarkdomains[1]': 'sciencedirect.com', 'title': 'No single solution: application of behavioural principles in mitigating human-wildlife conflict', 'source': 'hwc\\\\Blackwell et al. 2016.pdf', 'total_pages': 10, 'page': 0, 'page_label': '245'}\n"
]
},
{
"data": {
"text/plain": [
"<function __main__.test_retriever_only(query: str, k: int = 5)>"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_query = \"We live in a suburb and bears sometimes come into our town to eat from our fruit trees and trash. What are the best ways for us to prevent this as a community without removing our fruit trees? Can you check these pdfs to see which ones might help? https://minio.carlboettiger.info/public-data/hwc.zip\"\n",
"test_retriever_only(test_query, k=5)\n",
"test_retriever_only"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "ed58ac9d-edda-483b-b617-1e8bed445fe7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" Query: If we live in an area with a lot of wolves, what cattle husbandry strategies should I employ to prevent any sort of wildlife-human conflict? Can you check these pdfs to see which ones might help? https://minio.carlboettiger.info/public-data/hwc.zip\n",
"\n",
" Top 5 Retrieved Documents:\n",
"------------------------------------------------------------\n",
"\n",
"--- Document #1 ---\n",
"242 Conflict Intervention Priorities\n",
"helps foster more effective collaboration (Game et al.\n",
"2013; Lute et al. 2018). Third, both the survey results\n",
"and feedback were consistent with recent scholarship\n",
"(Redpath et al. 2017) that highlights participatory and\n",
"stakeholder-first conflict interventions as best practice\n",
"and advocates multipronged (Hazzah et al. 2014) and\n",
"adaptive management strategies (Bunnefeld et al. 2017).\n",
"Education and awareness programs were often cited in\n",
"feedback as being necessary additions to any interven-\n",
"tions. However, given the failures of many awareness-\n",
"based conservation programs (Schultz 2011), a further\n",
"exploration into why and where conservation decision\n",
"makers deem them most appropriate is important. Ap-\n",
"proaches that are specifically aimed at a particular au-\n",
"dience, such as social marketing (Salazar et al. 2018),\n",
"may be more effective than simple information provision\n",
"or—often-problematic—enforcement (Duffy et al. 2019).\n",
"However, how different interventio\n",
"\n",
"[Metadata]: {'producer': 'Acrobat Distiller 10.1.10 (Windows); modified using iText 4.2.0 by 1T3XT', 'creator': 'LaTeX with hyperref package', 'creationdate': '2020-01-16T12:33:42+05:30', 'keywords': '', 'moddate': '2025-05-27T12:12:25-07:00', 'subject': 'Conservation Biology 2020.34:232-243', 'wps-proclevel': '3', 'wps-journaldoi': '10.1111/(ISSN)1523-1739', 'author': '', 'title': 'Predicting intervention priorities for wildlife conflicts', 'wps-articledoi': '10.1111/cobi.13372', 'source': 'hwc\\\\Baynham-Herd et al. 2019.pdf', 'total_pages': 12, 'page': 10, 'page_label': '242'}\n",
"\n",
"--- Document #2 ---\n",
"Fig 1. The effects of AC programs on three metrics of black bear wariness, Whistler BC, 2007–2008. A and B show\n",
"the average observed percent change in overt reaction distance and displace ment distance among bears in the AC\n",
"Group and the Control Group. Error bars represent standard error. C shows the predicted effect of the number of AC\n",
"events conduc ted during the previous 30 days on the likeliho od that a bear will flee from research ers prior to their\n",
"beginning AC treatm ent.\n",
"https://d oi.org/10.1371/j ournal.pon e.0295989.g0 01\n",
"PLOS ONE\n",
"Aversive condition ing of conflict black bears\n",
"PLOS ONE | https://doi.or g/10.137 1/journal.po ne.02959 89 January 2, 2024 8 / 19\n",
"\n",
"[Metadata]: {'producer': 'PDFlib+PDI 9.3.1p2 (C++/Win64)', 'creator': 'PTC Arbortext Layout Developer 12.1.6180/W-x64', 'creationdate': '2023-12-25T16:46:13+05:30', 'title': 'Aversive conditioning increases short-term wariness but does not change habitat use in black bears associated with conflict', 'epsprocessor': 'PStill version 1.84.42', 'author': 'Lori Homstol, Sage Raymond, Claire Edwards, Anthony N. Hamilton, Colleen Cassady St. Clair', 'moddate': '2023-12-25T16:46:13+05:30', 'source': 'hwc\\\\Homstol et al. 2024.pdf', 'total_pages': 19, 'page': 7, 'page_label': '8'}\n",
"\n",
"--- Document #3 ---\n",
"51] and other carnivores, such as coyotes (Canis latrans) [69, 70], African lions (Panthera leo)\n",
"[71], and wolves (Canis lupus) [72]. The relative effectiveness of these AC programs for\n",
"increasing wariness could relate to several aspects of program implementation. Because we\n",
"subjected bears to aversive stimuli as they engaged in problematic behaviour [48, 50], we\n",
"increased the likelihood that bears associated the conditioning stimulus (conflict behaviour)\n",
"with the unconditioned stimulus (pain/ stress) [38, 52]. This principle of immediacy in aver-\n",
"sive conditioning [54] is not achieved when aversive conditioning occurs upon release of a\n",
"captured bear, sometimes hours later and kilometres distant from the capture location where\n",
"conflict occurred [32]. Repetition of treatments allowed bears to generalize among experiences\n",
"instead of associating the painful stimulus with a single location or human individual, which\n",
"has been identified as important to AC programs targeting bold coyotes [69\n",
"\n",
"[Metadata]: {'producer': 'PDFlib+PDI 9.3.1p2 (C++/Win64)', 'creator': 'PTC Arbortext Layout Developer 12.1.6180/W-x64', 'creationdate': '2023-12-25T16:46:13+05:30', 'title': 'Aversive conditioning increases short-term wariness but does not change habitat use in black bears associated with conflict', 'epsprocessor': 'PStill version 1.84.42', 'author': 'Lori Homstol, Sage Raymond, Claire Edwards, Anthony N. Hamilton, Colleen Cassady St. Clair', 'moddate': '2023-12-25T16:46:13+05:30', 'source': 'hwc\\\\Homstol et al. 2024.pdf', 'total_pages': 19, 'page': 12, 'page_label': '13'}\n",
"\n",
"--- Document #4 ---\n",
"3\n",
"Vol.:(0123456789)Scientific RepoRtS | (2020) 10:15341 | https://doi.org/10.1038/s41598-020-72343-6\n",
"www.nature.com/scientificreports/\n",
"numbers increase and more bears need more food26,43,44. Hence, the effectiveness of anti-bear interventions can \n",
"be lower than expected when hungry bears become persistent and more aggressive in damaging behaviour. As \n",
"high density may lead to more bears involved in conflicts, it also could increase the demand for bear removal45 \n",
"and affect the effectiveness of removal techniques such as translocation and lethal control.\n",
"In this paper, we compiled a global database of intervention effectiveness against bears and studied how it \n",
"is related to bear species and densities, duration of intervention application, and intervention techniques. We \n",
"attempted to find and describe the most effective and the least effective interventions against bears. Further, we \n",
"tested several hypotheses: (1) lethal control and invasive management are less effective th\n",
"\n",
"[Metadata]: {'producer': 'Adobe PDF Library 15.0; modified using iText® 5.3.5 ©2000-2012 1T3XT BVBA (SPRINGER SBM; licensed version)', 'creator': 'Springer', 'creationdate': '2020-09-14T15:09:33+05:30', 'crossmarkdomains[1]': 'springer.com', 'moddate': '2020-09-14T15:58:07+02:00', 'crossmarkmajorversiondate': '2010-04-23', 'subject': 'Scientific Reports, https://doi.org/10.1038/s41598-020-72343-6', 'author': 'Igor Khorozyan', 'title': 'Variation and conservation implications of the effectiveness of anti-bear interventions', 'crossmarkdomainexclusive': 'true', 'robots': 'noindex', 'doi': '10.1038/s41598-020-72343-6', 'crossmarkdomains[2]': 'springerlink.com', 'source': 'hwc\\\\Khorozyan and Waltert 2020.pdf', 'total_pages': 9, 'page': 2, 'page_label': '3'}\n",
"\n",
"--- Document #5 ---\n",
"8 \n",
" \n",
" \n",
" \n",
" \n",
" \n",
"Figure A5. Silhouette width plot of the k-medoid partitions with k = 2 to 10 used to estimate the best \n",
"number of clusters to describe livestock husbandry systems within the wolf range in northern Portugal \n",
"(see the main text for details). \n",
" \n",
"2 4 6 8 10 \n",
"0.20 0.22 0.24 0.26 0.28 0.30 0.32 \n",
"Number of clusters \n",
"Silhouette Width\n",
"\n",
"[Metadata]: {'producer': 'PDF Architect 3', 'creator': 'PDF Architect 3', 'creationdate': '2017-01-25T14:50:41+00:00', 'author': 'V. Pimenta', 'moddate': '2017-01-25T14:52:31+00:00', 'source': 'hwc\\\\Pimenta et al. 2017.pdf', 'total_pages': 20, 'page': 17, 'page_label': '18'}\n"
]
},
{
"data": {
"text/plain": [
"<function __main__.test_retriever_only(query: str, k: int = 5)>"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_query = \"If we live in an area with a lot of wolves, what cattle husbandry strategies should I employ to prevent any sort of wildlife-human conflict? Can you check these pdfs to see which ones might help? https://minio.carlboettiger.info/public-data/hwc.zip\"\n",
"test_retriever_only(test_query, k=5)\n",
"test_retriever_only"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|