tg: @MyCityGuideBot
A perfect assistant for urban adventurers and culture enthusiasts
Features:
- Responds with audio to voice message
- Generates description for uploaded picture
/story
- Discover an intriguing fact about a random city- Supports 2 languages: English & Russian
Demo slide deck is available via link
-
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
-
brew install ngrok
-
brew install pre-commit pre-commit install
-
brew install --cask google-cloud-sdk
poetry install
poetry run jupyter lab
-
Make sure you have access to the Google project
mipt-hack-01
(contact tg: @fancyeagle if not)gcloud auth application-default login
-
Register your bot for testing with BotFather and save a telegram token as env variable:
export TELEGRAM_TOKEN=some_value
-
If you didn't create a virtual environment with poetry before, create it:
poetry install
-
Execute the following commands in terminal to start bot service locally:
export FLASK_APP=bot_service.app:app export FLASK_RUN_PORT=5005 export FLASK_ENV=development export PROJECT_ID=mipt-hack-01 poetry run flask run --reload
-
Create a tunnel for the local HTTP server from the previous step using
ngrok
, making it accessible from the public internet:ngrok http 127.0.0.1:5005
-
Using
sh/webhook.sh
script, register the webhook with Telegram API, so that the bot will trigger local service on each request:sh sh/webhook.sh set <PUBLIC_URL> <TELEGRAM_TOKEN>
PUBLIC_URL
- the url generated by ngrok on step 4, e.g.:https://fce9-2a02-a447-94fc-1-50f5-8a25-6ab-eecc.ngrok.io
TELEGRAM_TOKEN
- the token generated by BotFather on step 1
-
After you finished with testing, you can disconnect your bot using the following command:
sh sh/webook.sh delete <TELEGRAM_TOKEN>
To ensure the model accurately recognizes artwork, a set of Behavior-Driven Development (BDD) tests has been created. These tests verify that the model's responses correctly match the paintings and landmarks present in the photo.
Before running tests, download data.zip
and extract it to tests/bdd
folder.
Running all tests:
poetry run pytest tests/bdd
Running tests for category:
poetry run pytest tests/bdd -k "paintings"
poetry run pytest tests/bdd -k "landmarks"
It appears that the model incorrectly identified the painting "The Stroll at Giverny" by Claude Monet as "Woman and Children in a Field" by Berthe Morisot. This misidentification can be due to several factors related to the model's training and the inherent challenges in artwork recognition.