Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


🙂 State-of-the-art natural language processing for Ruby


  • Sentiment analysis
  • Question answering
  • Named-entity recognition
  • Text generation

Build Status


Add this line to your application’s Gemfile:

gem "informers"

Getting Started

Sentiment Analysis

First, download the pretrained model.

Predict sentiment

model ="sentiment-analysis.onnx")
model.predict("This is super cool")

This returns

{label: "positive", score: 0.999855186578301}

Predict multiple at once

model.predict(["This is super cool", "I didn't like it"])

Question Answering

First, download the pretrained model.

Ask a question with some context

model ="question-answering.onnx")
  question: "Who invented Ruby?",
  context: "Ruby is a programming language created by Matz"

This returns

{answer: "Matz", score: 0.9980658360049758, start: 42, end: 46}

Named-Entity Recognition

First, export the pretrained model.

Get entities

model ="ner.onnx")
model.predict("Nat works at GitHub in San Francisco")

This returns

  {text: "Nat",           tag: "person",   score: 0.9840519576513487, start: 0,  end: 3},
  {text: "GitHub",        tag: "org",      score: 0.9426134775785775, start: 13, end: 19},
  {text: "San Francisco", tag: "location", score: 0.9952414982243061, start: 23, end: 36}

Text Generation

First, export the pretrained model.

Pass a prompt

model ="text-generation.onnx")
model.predict("As far as I am concerned, I will", max_length: 50)

This returns

As far as I am concerned, I will be the first to admit that I am not a fan of the idea of a "free market." I think that the idea of a free market is a bit of a stretch. I think that the idea

Feature Extraction

First, export a pretrained model.

model ="feature-extraction.onnx")
model.predict("This is super cool")

Fill Mask

First, export a pretrained model.

model ="fill-mask.onnx")
model.predict("This is a great <mask>")


Task Description Contributor License Link
Sentiment analysis DistilBERT fine-tuned on SST-2 Hugging Face Apache-2.0 Link
Question answering DistilBERT fine-tuned on SQuAD Hugging Face Apache-2.0 Link
Named-entity recognition BERT fine-tuned on CoNLL03 Bayerische Staatsbibliothek In-progress Link
Text generation GPT-2 OpenAI Custom Link

Some models are quantized to make them faster and smaller.


Check out Trove for deploying models.

trove push sentiment-analysis.onnx


This project uses many state-of-the-art technologies:

Some code was ported from Transformers and is available under the same license.


View the changelog


Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone
cd informers
bundle install

export MODELS_PATH=path/to/onnx/models
bundle exec rake test