RiverText: A Python Library for Training and Evaluating Incremental Word Embeddings from Text Data Streams Conference: Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval; July 23–27, 2023; Taipei, Taiwan Proceedings of the 46th Internation
Gabriel Iturra-Bocaz, Felipe Bravo-Marquez · 2025
Read RiverText: A Python Library for Training and Evaluating Incremental Word Embeddings from Text Data Streams Conference: Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval; July 23–27, 2023; Taipei, Taiwan Proceedings of the 46th Internation by Gabriel Iturra-Bocaz, Felipe Bravo-Marquez (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-23192.txt.
Introduction
Gabriel Iturra-Bocaz and Felipe Bravo-Marquez present RiverText, a Python library for word embeddings that learn from endless text streams. Classic embeddings freeze language in place, so they miss new slang, hashtags, and brand names as they appear online. Incremental methods update word meanings as fresh text flows in, and RiverText gathers several of them in one frame.
The library offers Skip-gram, Continuous Bag of Words, and Word Context Matrix methods, all trained through PyTorch. It also retools classic tests of word similarity and grouping so they work in a streaming setting. The authors compare the methods under varied settings and discuss the trade-offs. The open-source tool targets researchers who study social media and other fast-moving text.
Catalog record
| CREATOR | Gabriel Iturra-Bocaz, Felipe Bravo-Marquez |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 45 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2506-23192
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
RiverText: A Python Library for Training and Evaluating Incremental Word Embeddings from Text Data Streams Conference: Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval; July 23–27, 2023; Taipei, Taiwan Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR ’23), July 23–27, 2023, Taipei, Taiwan Price: 15.00 DOI: 10.1145/3539618.3591908 ISBN: 978-1-4503-9408-6/23/07 CCS: Computing methodologies Online learning settings CCS: Computing methodologies Language resources Gabriel Iturra-Bocaz, Felipe Bravo-Marquez Abstract . Word embeddings have become essential components in various information retrieval and natural language processing tasks, such as ranking, document classification, and question answering. However, despite their widespread use, traditional word embedding models present a limitation in their static nature, which hampers their ability to adapt to the constantly evolving language patterns that emerge in sources such as social media and the web (e.g., new hashtags or brand names). To overcome this problem, incremental word embedding algorithms are introduced, capable of dynamically updating word representations in response to new language patterns and processing continuous data streams. This paper presents RiverText, a Python library for training and evaluating incremental word embeddings from text data streams. Our tool is a resource for the information retrieval and natural language processing communities that work with word embeddings in streaming scenarios, such as analyzing social media. The library implements different incremental word embedding techniques, such as Skip-gram, Continuous Bag of Words, and Word Context Matrix, in a standardized framework. In addition, it uses PyTorch as its backend for neural network training. We have implemented a module that adapts existing intrinsic static word embedding evaluation tasks for word similarity and word categorization to a streaming setting. Finally, we compare the implemented methods with different hyperparameter settings and discuss the results. Our open-source library is available at https://github.com/dccuchile/rivertext . 1. Introduction Word embeddings (WE) ( Mikolov et al. 2013 ; Turney and Pantel 2010 ) , which are mappings from discrete words to dense continuous vectors, have been widely incorporated into modern information retrieval (IR) and natural language processing (NLP) systems because of their inherent ability to capture the syntactic and semantic properties of words. There are essentially two main approaches to constructing these vectors (which are equivalent in ( Levy and Goldberg 2014 ) ): 1) count-based approaches that explicitly build a word-context matrix of word-word co-occurrence counts ( Turney and Pantel 2010 ) and 2) distributed methods that rely on the internal structure of a neural network trained on an auxiliary predictive task (e.g., predicting the center word from a context window) ( Mikolov et al. 2013 ) . However, the static nature of standard WE algorithms prevents them from incorporating new words, such as hashtags or new brand names, and adapting to semantic changes in existing words. For example, when unexpected events associated with an entity suddenly occur (e.g., a scandal related to a public figure or a company may change its perceived sentiment). Another scenario is when a given word acquires a new meaning in a particular event; for example, the word “ukrop” changed its meaning from “dill” to “Ukrainian patriot” during the Russian-Ukrainian crisis ( Stewart et al. 2017 ) . To incorporate these changes into traditional WE, they must be retrained or aligned with new models to incorporate knowledge from new text sources, which is computationally inefficient. The research community has proposed several methods for incremental learning in WE to address the drawbacks in traditional approaches. However, these methods, such as the incremental word context matrix (IWCM) ( Bravo-Marquez et al. 2022 ) , incremental skip-gram negative sampling (ISG) ( Kaji and Kobayashi 2017 ; May et al. 2017 ) , and incremental hierarchical softmax ( Peng et al. 2018 ) , lack a unified and transparent setup for comparison, hindering the examination and understanding of their quality and performance. This lack of information is crucial for deploying these algorithms in real-world NLP or IR systems. In this paper, we integrate these attempts into a new Python library called RiverText. This resource aims to unify and standardize the aforementioned methods into an easy-to-use toolkit. RiverText extends the interfaces provided by River ( Montiel et al. 2021 ) , a machine-learning library for data streams, by enabling continuous learning of word embeddings from text streams, either from one instance at a time or from a mini-batch of ( Read et al. [n. d.] ) examples. In addition, it uses PyTorch ( Paszke et al. 2019 ) as its backend for implementing neural networks. RiverText (as well as River) is based on the stream machine learning paradigm ( Geng and Smith-Miles 2009 ; Read et al. [n. d.] ; Ade and Deshmukh 2013 ) , which posits the following requirements for a learning algorithm ( Aggarwal 2007 ; Muthukrishnan et al. 2005 ; Bifet et al. 2018 ) : (1) be able to process one instance (or mini-batch) at a time, and inspect it (at most) once; (2) be able to process data with limited resources (time and memory); (3) be able to generate a prediction or transformation at any time; (4) be able to adapt to temporal changes. In RiverText, we developed a standardized procedure to evaluate incremental WE methods in order to track the quality of embeddings throughout the stream. Our procedure performs a periodic evaluation (e.g., after processing a certain number of text instances) of existing intrinsic WE evaluation tasks for word similarity and categorization. In addition, we perform a comprehensive evaluation of three incremental WE methods: IWCM, ISG, and incremental continuous bag-of-words (ICBOW). We list our contributions below: • To the best of our knowledge, we develop the first open-source library that standardizes the training and evaluation of incremental WE from text data streams. • We propose the first implementation of ICBOW with negative sampling that combines the techniques exposed in the ISG method. • We perform the first unified benchmarking procedure of several incremental WE models. This article is organized as follows. First, in Section 2 , we review related work. Second, in Section 3 , we explain an overview of the software. In Section 4 , we present our experiments showing our benchmark. The conclusion and future work are discussed in Section 5 . 2. Related Work In this section, we review the literature on the three main aspects on which this work is based: 1) incremental WE models, 2) stream machine learning libraries, and 3) intrinsic evaluation of WE. First, we cover the models implemented in our framework and others, such as Incremental GloVe ( Pennington et al. 2014 ) , which is not added to our library but will be included in the next version. Second, we review the main libraries used by the research community for machine learning of data streams. Finally, we discuss intrinsic evaluation approaches for WE. 2.1. Incremental Word Embedding Models As we pointed out previously, WE can be divided into count-based approaches and distributed methods, both based on the distributional hypothesis ( Harris 1954 ) (i.e., words appearing in the same contexts tend to have similar meanings). According to this classification, we implemented the following models discussed below: The Incremental Word Context Matrix model (proposed by Bravo-Marquez et al. (