GithubHelp home page GithubHelp logo

news_predictions's Introduction

News Predictions

Flask application with models for classification and summarization of news in Russian.

Description

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

About the code:

This project is a modular bot, made using Python 3 and the following:

Setting up

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"

Using Docker

Simply, run the following command:

docker-compose up --build -d

Without Docker

Run main file news_predictions/app/src/wsgi.py => python3 main.py

Using handlers

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
    

Authors

Contributors names and contact info

ex. Artem Ponomarev ex. @aspnmrv

news_predictions's People

Contributors

aspnmrv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.