Skip to main content

Overview of Dependencies

Author: Muhammed Emre Bayraktaroglu

The Chatbot of the revamped HungerMapLive has several dependencies that are essential for its functionality. These dependencies include various data retrieval scripts, utility modules, and data uploaders, but also external libraries and APIs. This document provides an overview of the dependencies required to run the Chatbot successfully and how several modules are interconnected.

Chatbot Overview

Chatbot Overview

The Chatbot is one of the core components of the HungerMapLive project, providing users with a conversational interface to access information about food security, conflict events, and disaster reports. The Chatbot interacts with a MongoDB database to retrieve and display relevant data to users. Following external dependencies are essential and required to run the Chatbot:

DependencyDescription
FlaskA lightweight WSGI web application framework for Python
dotenvA Python module that reads key-value pairs from a .env file and adds them to the environment variables
pymongoA Python driver for MongoDB that enables interaction with MongoDB databases
openaiA Python client for the OpenAI API, used for natural language processing tasks
tiktokenA fast python BPE tokenizer for OpenAI's GPT models
certifiA Python package that provides Mozilla's CA Bundle - used for the MongoDB connection

Data Parsing and Uploading Scripts

The Chatbot relies on data provided from the MongoDB database, which is populated by various data parsing and uploading scripts. These scripts fetch data World Food Programme APIs and store it in the database for the Chatbot to access.

note

You can enlarge pictures by clicking on them.

Data Parsers Data Uploaders

UtilitiesDescription
country_utils.pyProvides utility functions for converting country codes into readable country names
loc_utils.pyContains utility functions for geolocation and locating places though coordinates
db_utils.pyContains utility functions for interacting with the MongoDB database
csv_utils.pyContains utility functions for reading and writing CSV files
db_vectorizing.pyContains utility functions for vectorizing MongoDB documents for Vector Search

Utilities

Common utility modules are used across the Chatbot project to streamline various tasks. These utilities include functions for database interaction, data processing, and file handling.

Utilities Overview

Dependencies for the Chatbot utilities additionally include:

UtilityDescription
requestsA Python library for making HTTP requests
pandasA data manipulation library for Python - using for CSVs
pycountryA Python library providing ISO country codes and names
geopyA Python client for several popular geocoding web services - particularly useful for geolocation tasks