Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
robinho Update links file and reduce tests threshold, because thats the data … May 9, 2019
tests Update links file and reduce tests threshold, because thats the data … May 9, 2019


JSON API endpoints

The JSON API is currently running under the url


You can predict the category of a news by calling:

GET /predict?title=string&content=string

Response format:

  predictions: {
    fake_news: float,
    extremely_biased: float,
    clickbait: float
  keywords: [ string ]


Postman is an app that helps you make requests when developing APIs.

We have a postman collection ready for you to use for debugging the API, just download postman and import the dev/postman_collection.json file.

Postman Collection


With Docker


make build
make run

Test Suite

make test

Without Docker

You will need Python 3 with pip, then you can install the dependencies:

pip3 install Cython
pip3 install -r requirements.txt
python3 -m nltk.downloader stopwords

Now you can retrain the model:

make retrain

Then use the saved model to do predictions, by running the Robinho bot in the terminal mode:

python3 .

> Chora bandidagem, chora turma dos direitos humanos. Michel Temer acaba de sancionar o projeto de lei aprovado pelo...

Looks like Extremely Biased

> Pato rebate provocação de Neymar com foto. Neymar e Alexandre Pato resolveram brincar com os cabelos um do outro...

There doesn't seem to be anything wrong with this content


To run the server:

python3 . --server

Running the Telegram Bot

In order to run the Telegram Bot from your machine you'll need to create a bot and get a token from it. To do that, follow this tutorial.

Then export the acquired token as the TELEGRAM_TOKEN env var and start the server:

export TELEGRAM_TOKEN='mytoken'
python3 . --server

Test Suite

You can run all tests with:

python3 -m unittest


The deploy is made by CircleCI using docker on heroku.

Read more about deploying docker with heroku on the oficial docs.

You can’t perform that action at this time.