Flask application with models for classification and summarization of news in Russian.
The application contains two handlers with calls to the text classification model (/predict) and the summarization model (/summary_v2)
- /predict: Uses trained
fasttext
model for classification - /summary: We use a model pre-trained on the dataset of russian news
mbart_ru_sum_gazeta
The application is used to operate another application - a telegram bot and placed in a separate repository
This project is a modular bot, made using Python 3 and the following:
- FastText
- Pre-trained model mbart_ru_sum_gazeta
- Flask
Before all, clone this repository.
You need to have a trained fasttext classification model and filling congig.yml file:
CLASSIFICATOR_MODEL_RU: "fasstext_model.bin"
SUMMARIZE_MODEL_RU: "IlyaGusev/mbart_ru_sum_gazeta"
Simply, run the following command:
docker-compose up --build -d
Run main file news_predictions/app/src/wsgi.py => python3 main.py
It is possible to use only Russian text for models.
- classification
curl -i -H "Content-Type: application/json" -X POST -d '{"news": ["какая-то первая новость", "какая-то вторая новость"]}' http://localhost:5000/predict
- summarization
curl -i -H "Content-Type: application/json" -X POST -d ‘{“text: “текст для суммаризации”}’ http://localhost:5000/summary_v2
Contributors names and contact info
ex. Artem Ponomarev ex. @aspnmrv