Nlp with Ruby Overview
Curated List: Practical Natural Language Processing done in Ruby
🏠 Home · 🔥 Feed · 📮 Subscribe · ❤️ Sponsor · 😺 arbox/nlp-with-ruby · ⭐ 967 · 🏷️ Computer Science
[RubyML (⭐1.8k) | RubyDataScience (⭐617) | RubyInterop (⭐34)]
Awesome NLP with Ruby
Useful resources for text processing in Ruby
This curated list comprises awesome resources, libraries, information sources about computational processing of texts in human languages with the Ruby programming language. That field is often referred to as NLP, Computational Linguistics, HLT (Human Language Technology) and can be brought in conjunction with Artificial Intelligence, Machine Learning, Information Retrieval, Text Mining, Knowledge Extraction and other related disciplines.
This list comes from our day to day work on Language Models and NLP Tools. Read why this list is awesome. Our FAQ describes the important decisions and useful answers you may be interested in.
✨ Every contribution is welcome! Add links through pull requests or create an issue to start a discussion.
Follow us on Twitter
and please spread the word using the #RubyNLP
hash tag!
Contents
- ✨ Tutorials
- NLP Pipeline Subtasks
- High Level Tasks
- Dialog Agents, Assistants, and Chatbots
- Linguistic Resources
- Machine Learning Libraries
- Data Visualization
- Optical Character Recognition
- Text Extraction
- Full Text Search, Information Retrieval, Indexing
- Language Aware String Manipulation
- Articles, Posts, Talks, and Presentations
- Projects and Code Examples
- Books
- Community
- Needs your Help!
- Related Resources
- License
✨ Tutorials
Please help us to fill out this section! 😃
NLP Pipeline Subtasks
An NLP Pipeline starts with a plain text.
Pipeline Generation
- composable_operations (⭐47) - Definition framework for operation pipelines.
- ruby-spark (⭐224) - Spark bindings with an easy to understand DSL.
- phobos (⭐211) - Simplified Ruby Client for Apache Kafka.
- parallel (⭐3.9k) - Supervisor for parallel execution on multiple CPUs or in many threads.
- pwrake (⭐57) - Rake extensions to run local and remote tasks in parallel.
Multipurpose Engines
- open-nlp (⭐89) - Ruby Bindings for the OpenNLP Toolkit.
- stanford-core-nlp (⭐429) - Ruby Bindings for the Stanford CoreNLP (⭐8.7k) tools.
- treat (⭐1.4k) - Natural Language Processing framework for Ruby (like NLTK for Python).
- nlp_toolz (⭐2) - Wrapper over some OpenNLP classes and the original Berkeley Parser (⭐176).
- open_nlp (⭐11) - JRuby Bindings for the OpenNLP Toolkit.
- ruby-spacy (⭐34) — Wrapper module for spaCy NLP library via PyCall (⭐866).
On-line APIs
- alchemyapi_ruby (⭐36) - Legacy Ruby SDK for AlchemyAPI/Bluemix.
- wit-ruby (⭐280) - Ruby client library for the Wit.ai Language Understanding Platform.
- wlapi (⭐19) - Ruby client library for Wortschatz Leipzig web services.
- monkeylearn-ruby (⭐79) - Sentiment Analysis, Topic Modelling, Language Detection, Named Entity Recognition via a Ruby based Web API client.
- google-cloud-language (⭐1.2k) - Google's Natural Language service API for Ruby.
Language Identification
Language Identification is one of the first crucial steps in every NLP Pipeline.
- scylla (⭐34) - Language Categorization and Identification.
Segmentation
Tools for Tokenization, Word and Sentence Boundary Detection and Disambiguation.
- tokenizer (⭐44) - Simple multilingual tokenizer. [tutorial]
- pragmatic_tokenizer (⭐87) - Multilingual tokenizer to split a string into tokens.
- nlp-pure (⭐19) - Natural language processing algorithms implemented in pure Ruby with minimal dependencies.
- textoken (⭐31) - Simple and customizable text tokenization library.
- pragmatic_segmenter (⭐503) - Word Boundary Disambiguation with many cookies.
- punkt-segmenter (⭐89) - Pure Ruby implementation of the Punkt Segmenter.
- tactful_tokenizer (⭐79) - RegExp based tokenizer for different languages.
- scapel (⭐53) - Sentence Boundary Disambiguation tool.
Lexical Processing
Stemming
Stemming is the term used in information retrieval to describe the process for
reducing wordforms to some base representation. Stemming should be distinguished
from Lemmatization since stems
are not necessarily have
linguistic motivation.
- ruby-stemmer (⭐255) - Ruby-Stemmer exposes the SnowBall API to Ruby.
- uea-stemmer (⭐50) - Conservative stemmer for search and indexing.
Lemmatization
Lemmatization is considered a process of finding a base form of a word. Lemmas are often collected in dictionaries.
- lemmatizer (⭐102) - WordNet based Lemmatizer for English texts.
Lexical Statistics: Counting Types and Tokens
- wc (⭐6) - Facilities to count word occurrences in a text.
- word_count (⭐4) -
Word counter for
String
andHash
objects. - words_counted (⭐156) - Pure Ruby library counting word statistics with different custom options.
Filtering Stop Words
- stopwords-filter (⭐68) - Filter and Stop Word Lexicon based on the SnowBall lemmatizer.
Phrasal Level Processing
- n_gram (⭐36) - N-Gram generator.
- ruby-ngram (⭐11) - Break words and phrases into ngrams.
- raingrams (⭐69) - Flexible and general-purpose ngrams library written in pure Ruby.
Syntactic Processing
Constituency Parsing
- stanfordparser - Ruby based wrapper for the Stanford Parser.
- rley (⭐34) - Pure Ruby implementation of the Earley Parsing Algorithm for Context-Free Constituency Grammars.
- rsyntaxtree (⭐67) - Visualization for syntactic trees in Ruby based on RMagick (⭐645). [dep: ImageMagick]
Semantic Analysis
- amatch (⭐354) - Set of five distance types between strings (including Levenshtein, Sellers, Jaro-Winkler, 'pair distance').
- damerau-levenshtein (⭐127) - Calculates edit distance using the Damerau-Levenshtein algorithm.
- hotwater (⭐80) - Fast Ruby FFI string edit distance algorithms.
- levenshtein-ffi (⭐148) - Fast string edit distance computation, using the Damerau-Levenshtein algorithm.
- tf_idf (⭐36) - Term Frequency / Inverse Document Frequency in pure Ruby.
- tf-idf-similarity (⭐652) - Calculate the similarity between texts using TF/IDF.
Pragmatical Analysis
- SentimentLib (⭐13) - Simple extensible sentiment analysis gem.
High Level Tasks
Spelling and Error Correction
- gingerice (⭐479) - Spelling and Grammar corrections via the Ginger API.
- hunspell-i18n (⭐4) - Ruby bindings to the standard Hunspell Spell Checker.
- ffi-hunspell (⭐49) - FFI based Ruby bindings for Hunspell.
- hunspell (⭐34) - Ruby bindings to Hunspell via Ruby C API.
Text Alignment
- alignment (⭐1) - Alignment routines for bilingual texts (Gale-Church implementation).
Machine Translation
- google-api-client (⭐2.6k) - Google API Ruby Client.
- microsoft_translator (⭐21) - Ruby client for the microsoft translator API.
- termit (⭐507) - Google Translate with speech synthesis in your terminal.
- zipf (⭐2) - implementation of BLEU and other base algorithms.
Sentiment Analysis
- stimmung (⭐20) - Semantic Polarity based on the SentiWS lexicon.
Numbers, Dates, and Time Parsing
- chronic (⭐3.1k) - Pure Ruby natural language date parser.
- chronic_between (⭐27) - Simple Ruby natural language parser for date and time ranges.
- chronic_duration (⭐347) - Pure Ruby parser for elapsed time.
- kronic (⭐151) - Methods for parsing and formatting human readable dates.
- nickel (⭐107) - Extracts date, time, and message information from naturally worded text.
- tickle (⭐75) - Parser for recurring and repeating events.
- numerizer (⭐34) - Ruby parser for English number expressions.
Named Entity Recognition
- ruby-ner (⭐17) - Named Entity Recognition with Stanford NER and Ruby.
- ruby-nlp (⭐87) - Ruby Binding for Stanford Pos-Tagger and Name Entity Recognizer.
Text-to-Speech-to-Text
- espeak-ruby (⭐186) - Small Ruby API for utilizing 'espeak' and 'lame' to create text-to-speech mp3 files.
- tts (⭐89) - Text-to-Speech conversion using the Google translate service.
- att_speech (⭐20) - Ruby wrapper over the AT&T Speech API for speech to text.
- pocketsphinx-ruby (⭐253) - Pocketsphinx bindings.
Dialog Agents, Assistants, and Chatbots
- chatterbot (⭐493) - Straightforward ruby-based Twitter Bot Framework, using OAuth to authenticate.
- lita (⭐1.7k) - Highly extensible chat operation bot framework written with persistent storage on Redis.
Linguistic Resources
- rwordnet (⭐88) - Pure Ruby self contained API library for the Princeton WordNet®.
- wordnet (⭐134) - Performance tuned bindings for the Princeton WordNet®.
Machine Learning Libraries
Machine Learning Algorithms in pure Ruby or written in other programming languages with appropriate bindings for Ruby.
For more up-to-date list please look at the Awesome ML with Ruby list.
- rb-libsvm (⭐276) - Support Vector Machines with Ruby.
- weka (⭐67) - JRuby bindings for Weka, different ML algorithms implemented through Weka.
- decisiontree (⭐1.4k) - Decision Tree ID3 Algorithm in pure Ruby [post].
- rtimbl (⭐5) - Memory based learners from the Timbl framework.
- classifier-reborn (⭐531) - General classifier module to allow Bayesian and other types of classifications.
- lda-ruby (⭐132) - Ruby implementation of the LDA (Latent Dirichlet Allocation) for automatic Topic Modelling and Document Clustering.
- liblinear-ruby-swig (⭐82) - Ruby interface to LIBLINEAR (much more efficient than LIBSVM for text classification).
- linnaeus (⭐37) - Redis-backed Bayesian classifier.
- maxent_string_classifier (⭐9) - JRuby maximum entropy classifier for string data, based on the OpenNLP Maxent framework.
- naive_bayes (⭐46) - Simple Naive Bayes classifier.
- nbayes (⭐149) - Full-featured, Ruby implementation of Naive Bayes.
- omnicat (⭐11) - Generalized rack framework for text classifications.
- omnicat-bayes (⭐32) - Naive Bayes text classification implementation as an OmniCat classifier strategy.
- ruby-fann (⭐451) - Ruby bindings to the Fast Artificial Neural Network Library (FANN).
- rblearn (⭐1) - Feature Extraction and Crossvalidation library.
Data Visualization
Please refer to the Data Visualization (⭐617) section on the Data Science with Ruby list.
Optical Character Recognition
- tesseract-ocr (⭐605) - FFI based wrapper over the Tesseract OCR Engine (⭐47k).
Text Extraction
- yomu (⭐478) - library for extracting text and metadata from files and documents using the Apache Tika content analysis toolkit.
Full Text Search, Information Retrieval, Indexing
- rsolr (⭐416) - Ruby and Rails client library for Apache Solr.
- sunspot (⭐3k) - Rails centric client for Apache Solr.
- thinking-sphinx (⭐1.6k) - Active Record plugin for using Sphinx in (not only) Rails based projects.
- elasticsearch (⭐1.9k) - Ruby client and API for Elasticsearch.
- elasticsearch-rails (⭐3k) - Ruby and Rails integrations for Elasticsearch.
- google-api-client (⭐2.6k) - Ruby API library for Google services.
Language Aware String Manipulation
Libraries for language aware string manipulation, i.e. search, pattern matching, case conversion, transcoding, regular expressions which need information about the underlying language.
- fuzzy_match (⭐650) - Fuzzy string comparison with Distance measures and Regular Expression.
- fuzzy-string-match (⭐268) - Fuzzy string matching library for Ruby.
- active_support (⭐52k) -
RoR
ActiveSupport
gem has various string extensions that can handle case. - fuzzy_tools (⭐22) - Toolset for fuzzy searches in Ruby tuned for accuracy.
- u - U extends Ruby’s Unicode support.
- unicode (⭐82) - Unicode normalization library.
- CommonRegexRuby (⭐78) - Find a lot of kinds of common information in a string.
- regexp-examples (⭐508) - Generate strings that match a given regular expression.
- verbal_expressions (⭐570) - Make difficult regular expressions easy.
- translit_kit (⭐5) - Transliterate Hebrew & Yiddish text into Latin characters.
- re2 (⭐87) - hight-speed Regular Expression library for Text Mining and Text Extraction.
- regex_sample (⭐1) - sample string generation from a given Regular Expression.
- iuliia (⭐8) — transliteration Cyrillic to Latin in many possible ways (defined by the reference implementation (⭐59)).
Articles, Posts, Talks, and Presentations
- 2019
- 2018
- Natural Language Processing and Tweet Sentiment Analysis by Cassandra Corrales [post]
- 2017
- The Google NLP API Meets Ruby by Aja Hammerly [post]
- Syntax Isn't Everything: NLP For Rubyists by Aja Hammerly [slides]
- Scientific Computing on JRuby by Prasun Anand [slides | video | slides | slides]
- Unicode Normalization in Ruby by Starr Horne [post]
- 2016
- Quickly Create a Telegram Bot in Ruby by Ardian Haxha [tutorial]
- Deep Learning: An Introduction for Ruby Developers by Geoffrey Litt [slides]
- How I made a pure-Ruby word2vec program more than 3x faster by Kei Sawada [slides]
- Dōmo arigatō, Mr. Roboto: Machine Learning with Ruby by Eric Weinstein [slides | video]
- 2015
- N-gram Analysis for Fun and Profit by Jesus Castello [tutorial]
- Machine Learning made simple with Ruby by Lorenzo Masini [tutorial]
- Using Ruby Machine Learning to Find Paris Hilton Quotes by Rick Carlino [tutorial]
- Exploring Natural Language Processing in Ruby by Kevin Dias [slides]
- Machine Learning made simple with Ruby by Lorenzo Masini [post]
- Practical Data Science in Ruby by Bobby Grayson [slides]
- 2014
- Natural Language Parsing with Ruby by Glauco Custódio [tutorial]
- Demystifying Data Science: Analyzing Conference Talks with Rails and Ngrams by Todd Schneider [video | code (⭐33)]
- Natural Language Processing with Ruby by Konstantin Tennhard [video | video | video | slides]
- 2013
- How to parse 'go' - Natural Language Processing in Ruby by Tom Cartwright [slides | video]
- Natural Language Processing in Ruby by Brandon Black [slides | video]
- Natural Language Processing with Ruby: n-grams by Nathan Kleyn [tutorial | code (⭐33)]
- Seeking Lovecraft, Part 1: An introduction to NLP and the Treat Gem by Robert Qualls [tutorial]
- 2012
- Machine Learning with Ruby, Part One by Vasily Vasinov [tutorial]
- 2011
- Ruby one-liners by Benoit Hamelin [post]
- Clustering in Ruby by Colin Drake [post/)]
- 2010
- bayes_motel – Bayesian classification for Ruby by Mike Perham [post]
- 2009
- Porting the UEA-Lite Stemmer to Ruby by Jason Adams [post]
- NLP Resources for Ruby by Jason Adams [post]
- 2008
- Support Vector Machines (SVM) in Ruby by Ilya Grigorik [post]
- Practical text classification with Ruby by Gleicon Moraes [post | code (⭐11)]
- 2007
- Decision Tree Learning in Ruby by Ilya Grigorik [post]
- 2006
- Speak My Language: Natural Language Processing With Ruby by Michael Granger [slides | write-up | write-up]
Projects and Code Examples
- Going the Distance (⭐60) - Implementations of various distance algorithms with example calculations.
- Named entity recognition with Stanford NER and Ruby (⭐17) - NER Examples in Ruby and Java with some explanations.
- Words Counted - examples of customizable word statistics powered by words_counted (⭐156).
- RSyntaxTree - Web based demonstration of the syntactic tree visualization.
Books
- Miller, Rob. Text Processing with Ruby: Extract Value from the Data That Surrounds You. Pragmatic Programmers, 2015. [link]
- Watson, Mark. Scripting Intelligence: Web 3.0 Information Gathering and Processing. APRESS, 2010. [link]
- Watson, Mark. Practical Semantic Web and Linked Data Applications. Lulu, 2010. [link]
Community
Needs your Help!
All projects in this section are really important for the community but need more attention. Please if you have spare time and dedication spend some hours on the code here.
- ferret (⭐280) - Information Retrieval in C and Ruby.
- summarize (⭐205) - Ruby native wrapper for Open Text Summarizer (⭐220).
Related Resources
- Neural Machine Translation Implementations (⭐364)
- Awesome Ruby (⭐12k) - Among other awesome items a short list of NLP related projects.
- Ruby NLP (⭐1.2k) - State-of-Art collection of Ruby libraries for NLP.
- Speech and Natural Language Processing (⭐2.1k) - General List of NLP related resources (mostly not for Ruby programmers).
- Scientific Ruby - Linear Algebra, Visualization and Scientific Computing for Ruby.
- iRuby (⭐728) - IRuby kernel for Jupyter (formelly IPython).
- Awesome OCR (⭐2.2k) - Multitude of OCR (Optical Character Recognition) resources.
- Awesome TensorFlow (⭐17k) - Machine Learning with TensorFlow libraries.
- ImageMagick
License
Awesome NLP with Ruby
by Andrei Beliankou and
Contributors (⭐966).
To the extent possible under law, the person who associated CC0 with
Awesome NLP with Ruby
has waived all copyright and related or neighboring rights
to Awesome NLP with Ruby
.
You should have received a copy of the CC0 legalcode along with this work. If not, see https://creativecommons.org/publicdomain/zero/1.0/.