Before you begin, make sure you have Docker and Python installed.
Model used in vector_search: https://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
A script in Python that loads strings to Elasticsearch Docker container and then allow user to search from CLI. Make sure Docker and python are installed on your machine.
docker run -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.13.4 --restart=alwaysdocker start $(docker ps -a -q --filter "ancestor=elasticsearch:7.13.4")curl -X DELETE 'http://localhost:9200/_all'
curl -X DELETE 'http://localhost:9200/text_index'- Open
@BotFather. - Type
/newbotand follow the instructions to create a new bot. @BotFatherwill provide a token for the new bot.
git clone https://github.com/deep-foundation/russian-laws-botcd russian-laws-botAfter entering the code folder, you will need to set up environment variables. To do this, create a .env file. In this file you can change the values as follows:
OPENAI_API_KEY=your_openai_api_key
TELEGRAM_TOKEN=your_telegram_bot_tokenpip install --upgrade pip
pip install -r requirements.txtWithout logs:
python ./main.pyWith logs:
python main.py 2>&1 | tee log.txtAnd if python is not available, but python3 is.
python3 main.py 2>&1 | tee log.txtdocker build -t russian-laws-bot .docker run -p 8080:8080 --name container-russian-laws-bot russian-laws-bot