https://github.com/conect2ai/methodsx2024-safecycle-assist

https://github.com/conect2ai/methodsx2024-safecycle-assist

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: conect2ai
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 64.5 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme

README.md

Introduction

This repository contains the code for the method "SafeCycle-Assist", designed to support safer cycling patterns in urban environments, leveraging for that Large Language Models (LLMs), AI-based agents, and open geospatial data. This repository is an implementation of the method, which employs the OpenAI API to generate a risk assessment for a cycling trip or point of interest, as well as data from the CityZones tool. To contextualize the model, the prompt in context was used as one of the inputs.

Requirements

To run the code, you need to clone the repository and install the requirements:

  1. Clone the repository and navigate to the project folder:

bash git clone https://github.com/conect2ai/METHODXS2024-safecycle-assist.git && cd METHODSX2024-safecycle-assist

  1. Create a virtual environment and activate it:

bash python -m venv venv && source venv/bin/activate

  1. Install the requirements:

bash pip install -r requirements.txt

Usage

Initially, you need to set your OpenAI API key as an environment variable:

bash export OPENAI_API_KEY="<INSERT API KEY HERE>"

To run the code, you can use the following command:

bash python app.py --prompt "<INSERT PROMPT HERE>"

Examples

Here are some examples of how to use the code:

Example 1

bash python app.py --prompt "What is the risk of a cycling trip starting from point with latitude 41.1246 and longitude -8.5717, ending at latitude 41.1570 and longitude -8.6393"

Example 2

bash python app.py --prompt "I am planning a cycling trip that will cross the point at latitude 41.1246 and longitude -8.5717. What is the risk associate to this zone?"

Results

The code will output the risk associated with the trip.

Example 1

Output for the Example 1:

The computed risk levels for the cycling trip from the starting point at latitude 41.1246 and longitude -8.5717 to the ending point at latitude 41.1570 and longitude -8.6393 are as follows: - Low Risk: 53.79% - Medium Risk: 30.30% - High Risk: 15.91%

Based on these risk percentages, the route is considered to have a low risk overall. It is suitable for most cyclists, including beginners. The path is within close proximity to emergency services, ensuring a safer journey. Remember to stay on designated cycling lanes for maximum safety. Enjoy your ride!

Example 2

Output for the Example 2:

The risk level associated with the point at latitude 41.1246 and longitude -8.5717 is high (Level 3). This indicates that the area poses significant hazards and is recommended only for very experienced cyclists. It is far from emergency services and other emergency-related amenities.

Given the high risk level, I recommend considering an alternative route to ensure your safety. If you provide me with the starting and ending points of your trip, I can assist you in evaluating a safer route. Remember to wear appropriate safety gear, check the weather conditions, carry a basic repair kit, stay hydrated, and share your route details with someone in case of an emergency.

Aknowledgements

This work is financially supported by national funds through the FCT/MCTES (PIDDAC), under the RELIABLE project PTDC/EEI-AUT/3522/2020 (DOI 10.54499/PTDC/EEI-AUT/3522/2020), the Associate Laboratory Advanced Production and Intelligent Systems – ARISE LA/P/0112/2020 (DOI 10.54499/LA/P/0112/2020) and the Base Funding (UIDB/00147/2020) and Programmatic Funding (UIDP/00147/2020) of the R&D Unit Center for Systems and Technologies – SYSTEC. Additionally, this study was partly financed by the Brazilian fostering agency CNPq (National Council for Scientific and Technological Development), Process No. 405531/2022-2.

Owner

  • Name: conect2ai
  • Login: conect2ai
  • Kind: organization

GitHub Events

Total
  • Fork event: 1
Last Year
  • Fork event: 1

Dependencies

requirements.txt pypi
  • PyYAML ==6.0.1
  • SQLAlchemy ==2.0.30
  • aiohttp ==3.9.5
  • aiosignal ==1.3.1
  • annotated-types ==0.7.0
  • anyio ==4.4.0
  • attrs ==23.2.0
  • certifi ==2024.6.2
  • charset-normalizer ==3.3.2
  • click ==8.1.7
  • click-plugins ==1.1.1
  • cligj ==0.7.2
  • colorama ==0.4.6
  • distro ==1.9.0
  • fiona ==1.9.6
  • frozenlist ==1.4.1
  • geopandas ==0.14.4
  • greenlet ==3.0.3
  • h11 ==0.14.0
  • httpcore ==1.0.5
  • httpx ==0.27.0
  • idna ==3.7
  • joblib ==1.4.2
  • jsonpatch ==1.33
  • jsonpointer ==2.4
  • langchain ==0.2.2
  • langchain-core ==0.2.4
  • langchain-openai ==0.1.8
  • langchain-text-splitters ==0.2.1
  • langsmith ==0.1.73
  • multidict ==6.0.5
  • networkx ==3.3
  • numpy ==1.26.4
  • openai ==1.31.1
  • orjson ==3.10.3
  • osmnx ==1.9.3
  • packaging ==23.2
  • pandas ==2.2.2
  • pydantic ==2.7.3
  • pydantic_core ==2.18.4
  • pyproj ==3.6.1
  • python-dateutil ==2.9.0.post0
  • pytz ==2024.1
  • regex ==2024.5.15
  • requests ==2.32.3
  • scikit-learn ==1.5.0
  • scipy ==1.13.1
  • shapely ==2.0.4
  • six ==1.16.0
  • sniffio ==1.3.1
  • tenacity ==8.3.0
  • threadpoolctl ==3.5.0
  • tiktoken ==0.7.0
  • tqdm ==4.66.4
  • typing_extensions ==4.12.1
  • tzdata ==2024.1
  • urllib3 ==2.2.1
  • yarl ==1.9.4