Skip to main content

What is ExtensionBot?

 

This work is supported by funding from a cooperative agreement with USDA-NIFA and in partnership with Oklahoma State University, New Technologies for Ag Extension, grant no 2020-41595-30123.

ExtensionBot is a chatbot that is built and deployed by the Extension Foundation. We are working closely with Eduworks Corporation on the development and deployment of the technology. ExtensionBot is backed by an LLM (Large Language Model) that is trained exclusively on data provided by Cooperative Extension institutions and Ask Extension.

Our larger goal is to build an LLM that is trained on Extension Resources from across the Cooperative Extension service. Each new institution or contributing member strengthens the LLM.

Contributing Institutions

Below is a list of current contributing institutions along with the number of resources that have been provided.

  • Oklahoma State University (1540)
  • Oregon State University (5203)
  • Ask Extension Knowledgebase (313,443)

ExtensionBot Data Specification

If you would like to have your own instance of ExtensionBot that is custom trained on your institution’s data here is the spec you want to follow. Contact Mark Locklear for more information. Also, you can view our information session HERE.

ExtensionBot Configuration

Configuration parameters are set in the chat.js file of the frontend Widget and change the slot values in Rasa on page reload.

The default parameters are shown below:

{

“client”: “general”,

“search_size”: 100,

“list_of_states”: [],

“state_downweight”: 0,

“source_downweight”: 1,

“cut_off”: 0.4,

“max_return_amount”: 10

}

client

The client key determines the target client. It’s based on each data source we currently have for each client.

List of clients available:

  1. general: This indicates there is no preference and all data sources are available to the model.
  2. oklahoma_state: Data scraped from the Oklahoma State extension site.
  3. oregon_state: Data from the scraped Oregon State extension site
  4. ask_extension_kb: Questions and answers from the OS Ticket API.
  5. uc_ipm: Data scraped from UC IPM

Note: make sure to spell the client names exactly as shown above

source_downweight

The source downweight parameter is designed to reduce the scores from sources outside of the client’s source. Meaning, if the client is Oklahoma State, any exterior source (oregon_state, ask_extension_kb, uc_ipm), would be multiplied by the downweight term. Effectively reducing the scores of exterior sources and favoring the client’s data.

The value should be set between 0 and 1

If  source_downweight is set to 1, no filtering is done based on source. The scores will be purely the cosine similarity value between the query/document embeddings.

If source_downweight is set to 0, results from other sources will be completely filtered out of the results.

If source_downweight is between 0 and 1, the scores from other sources will be mulitiplied by the source_downweight. Effectively reducing their score since the downweight value is a fraction.

In general, source_downweight should either be set to 0, 1, or a value close to 1 (say 0.8 or higher). If a source_downweight term is small, the end result would just be completely filtering out the results with an additional computation.

By default, this value is set to 1. Meaning, no favoring/filtering based on source.



list_of_states

Indicates the states that are either favored or filtered from the results. Data here should be stored in string format with capital letters for state names. (e.g., [“Oklahoma”, “Oregon”, “North Carolina”])

By default, this is an empty list. An empty list here indicates that you’re not doing any filtering of the results based on states regardless of the state_downweight value (see below).

state_downweight:

State downweight is a penalty term that reduces scores from results coming from sources not in your state list. It does this by multiplying the model’s score by the set state_downweight value.

By default, this is set to 0. A value of 0 here indicates that states not in your state list are completely filtered out of the results. It works the same as source_downweight in practice. Just applied to states rather than source.

Note: If list_of_states is empty, state_downweight is not applied and any state can be shown.

cut_off:

Cut off is a paramter that removes all sources with a score below your cut off threshold. By default, it’s set to 0.4. This means that any score below 0.4 will not be shown to the user.

If there are no scores above your threshold, the chatbot should indicate that it is incapable of finding a good result and direct you to your extension office for more help.

max_return_amount:

Max return amount shows the number of possible links to show to the user in the slideshow.

By default, it’s set to 10. Meaning, if there are 10+ results above your cut_off threshold, it will only show the top 10.

search_size

This is the number of returns prior to any kind of filtering based on client/state. Just raw results from Elastic Search prior to the filtering algorithms.

By default, this is set to 100. Meaning each query will return the top 100 results from Elastic Search. Then these will eventually get filtered down to up to the max_return_amount to show to the user.

In general, I don’t see much of a reason for clients to play with this term. It’s mostly used to give a good number of results prior to filtering while not being overly computationally expensive.

Configuration Commands to play with

This won’t be enabled in production. However, if you want to play with configuration settings, you can change each field using the following format:

set parameter value

Examples

set client oklahoma_state

set states to Oregon, Oklahoma, Tennessee, North Carolina

set state_downweight 0.9

set max_return_amount 4

set source_downweight 0.95

set search_size 90

set cut_off 0.4

View current parameters

To view configuration parameters in the chatbot dialogue, enter the following command: show parameters

State-specific configuration



<!– Begin Ask Extension Widget embed code –>

<div id=”ae-chatbot-widget”>auto-loaded widget needs a div on your web page with this id</div>

<script>

    const ae_widget_config_params = {

        client: “ask_extension_kb”,

        list_of_states: [“Minnesota”],

        state_downweight: 0,

        source_downweight: 1,

        search_size: 100,

        cut_off: 0.59,

        max_return_amount: 10

    }

</script>

<script src=”https://chat.ask.eduworks.com/static/js/widget-loader.js”></script>

<!– End Ask Extension Widget embed code –>

Add Comment

Comments (0)

Post

About the Extension Foundation

This website is supported in part by New Technologies for Ag Extension (funding opportunity no. USDA-NIFA-OP-010186), grant no. 2023-41595-41325 from the USDA National Institute of Food and Agriculture. Any opinions, findings, conclusions, or recommendations expressed in this publication are those of the author(s) and do not necessarily reflect the view of the U.S. Department of Agriculture or the Extension Foundation. For more information, please visit extension.org. You can view the terms of use at extension.org/about/terms.

×
×
×
Link copied to your clipboard.
×