skip to main content
10.1145/3539618.3591908acmconferencesArticle/Chapter ViewAbstractPublication PagesirConference Proceedingsconference-collections
research-article

RiverText: A Python Library for Training and Evaluating Incremental Word Embeddings from Text Data Streams

Published: 18 July 2023 Publication History

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.

Supplemental Material

MP4 File
RiverText is a Python library designed to address the limitations of traditional word embedding models by providing a comprehensive framework for training and evaluating incremental word embeddings from data streams. These incremental words embeddings allow for dynamic updating of word representations in response to evolving language patterns in sources such as social media and the web. The library implements popular techniques like Skip-gram, Continuous Bag of Words, and Word Context Matrix, using PyTorch as the backend for efficient neural network training. In addition, RiverText includes a module that adapts static intrinsic NLP evaluation tasks to a streaming setting. The open-source library, available at https://dccuchile.github.io/rivertext/, provides detailed documentation and examples to facilitate quick and easy adoption. RiverText is expected to be a valuable resource for researchers and practitioners working with large-scale streaming text data.

References

[1]
RR Ade and PR Deshmukh. 2013. Methods for incremental learning: a survey. International Journal of Data Mining & Knowledge Management Process, Vol. 3, 4 (2013), 119.
[2]
Charu C Aggarwal. 2007. Data streams: models and algorithms. Vol. 31. Springer.
[3]
Abdulrahman Almuhareb and Massimo Poesio. 2005. Concept learning and categorization from the web. In proceedings of the annual meeting of the Cognitive Science society, Vol. 27.
[4]
Matej Artac, Matjaz Jogan, and Ales Leonardis. 2002. Incremental PCA for on-line visual learning and recognition. In 2002 International Conference on Pattern Recognition, Vol. 3. IEEE, 781--784.
[5]
Stefan Behnel, Robert Bradshaw, Craig Citro, Lisandro Dalcin, Dag Sverre Seljebotn, and Kurt Smith. 2010. Cython: The best of both worlds. Computing in Science & Engineering, Vol. 13, 2 (2010), 31--39.
[6]
Albert Bifet, Ricard Gavalda, Geoffrey Holmes, and Bernhard Pfahringer. 2018. Machine learning for data streams: with practical examples in MOA. MIT press.
[7]
Albert Bifet, Geoffrey Holmes, and Bernhard Pfahringer. 2011. Moa-tweetreader: real-time analysis in twitter streaming data. In International conference on discovery science. Springer, 46--60.
[8]
Albert Bifet, Geoff Holmes, Bernhard Pfahringer, Philipp Kranen, Hardy Kremer, Timm Jansen, and Thomas Seidl. 2010. Moa: Massive online analysis, a framework for stream classification and clustering. In Proceedings of the first workshop on applications of pattern analysis. PMLR, 44--50.
[9]
Felipe Bravo-Marquez, Arun Khanchandani, and Bernhard Pfahringer. 2022. Incremental Word Vectors for Time-Evolving Sentiment Lexicon Induction. Cognitive Computation, Vol. 14, 1 (2022), 425--441.
[10]
Elia Bruni, Nam-Khanh Tran, and Marco Baroni. 2014. Multimodal distributional semantics. Journal of artificial intelligence research, Vol. 49 (2014), 1--47.
[11]
Evandro Cunha, Gabriel Magno, Giovanni Comarela, Virgilio Almeida, Marcos André Goncc alves, and Fabricio Benevenuto. 2011. Analyzing the dynamic evolution of hashtags on twitter: a language-based approach. In Proceedings of the workshop on language in social media (LSM 2011). 58--65.
[12]
Jurafsky Daniel, Martin James H, et al. 2007. Speech and language processing: An introduction to natural language processing, computational linguistics, and speech recognition. prentice hall.
[13]
Peter Emerson. 2013. The original Borda count and partial voting. Social Choice and Welfare, Vol. 40, 2 (2013), 353--358.
[14]
Xin Geng and Kate Smith-Miles. 2009. Incremental Learning.
[15]
Anna Gladkova and Aleksandr Drozd. 2016. Intrinsic evaluations of word embeddings: What can we do better?. In Proceedings of the 1st Workshop on Evaluating Vector-Space Representations for NLP. 36--42.
[16]
Yoav Goldberg. 2017. Neural network methods for natural language processing. Synthesis lectures on human language technologies, Vol. 10, 1 (2017), 1--309.
[17]
Amit Goyal, Jagadeesh Jagarlamudi, Hal Daumé III, and Suresh Venkatasubramanian. 2010. Sketching techniques for large scale NLP. In Proceedings of the NAACL HLT 2010 Sixth Web as Corpus Workshop. 17--25.
[18]
Max Halford, Geoffrey Bolmier, Raphael Sourty, Robin Vaysse, and Adil Zouitine. 2019. creme, a Python library for online machine learning.
[19]
Zellig S Harris. 1954. Distributional structure. Word, Vol. 10, 2--3 (1954), 146--162.
[20]
Sam Henry, Clint Cuffy, and Bridget T McInnes. 2018. Vector representations of multi-word terms for semantic relatedness. Journal of biomedical informatics, Vol. 77 (2018), 111--119.
[21]
Stanisław Jastrzebski, Damian Leśniak, and Wojciech Marian Czarnecki. 2017. How to evaluate word embeddings? on importance of data efficiency and simple supervised tasks. arXiv preprint arXiv:1702.02170 (2017).
[22]
Nobuhiro Kaji and Hayato Kobayashi. 2017. Incremental skip-gram model with negative sampling. arXiv preprint arXiv:1704.03956 (2017).
[23]
Omer Levy and Yoav Goldberg. 2014. Neural word embedding as implicit matrix factorization. Advances in neural information processing systems, Vol. 27 (2014).
[24]
Christopher D Manning. 2008. Introduction to information retrieval. Syngress Publishing,.
[25]
James H Martin. 2009. Speech and language processing: An introduction to natural language processing, computational linguistics, and speech recognition. Pearson/Prentice Hall.
[26]
Chandler May, Kevin Duh, Benjamin Van Durme, and Ashwin Lall. 2017. Streaming word embeddings with the space-saving algorithm. arXiv preprint arXiv:1704.07463 (2017).
[27]
Ahmed Metwally, Divyakant Agrawal, and Amr El Abbadi. 2005. Efficient computation of frequent and top-k elements in data streams. In International conference on database theory. Springer, 398--412.
[28]
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed representations of words and phrases and their compositionality. Advances in neural information processing systems, Vol. 26 (2013).
[29]
Jayadev Misra and David Gries. 1982. Finding repeated elements. Science of computer programming, Vol. 2, 2 (1982), 143--152.
[30]
Jacob Montiel, Max Halford, Saulo Martiello Mastelini, Geoffrey Bolmier, Raphael Sourty, Robin Vaysse, Adil Zouitine, Heitor Murilo Gomes, Jesse Read, Talel Abdessalem, et al. 2021. River: machine learning for streaming data in Python. (2021).
[31]
Jacob Montiel, Jesse Read, Albert Bifet, and Talel Abdessalem. 2018. Scikit-multiflow: A multi-output streaming framework. The Journal of Machine Learning Research, Vol. 19, 1 (2018), 2915--2914.
[32]
Shanmugavelayutham Muthukrishnan et al. 2005. Data streams: Algorithms and applications. Foundations and Trends® in Theoretical Computer Science, Vol. 1, 2 (2005), 117--236.
[33]
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. 2019. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, Vol. 32 (2019).
[34]
Hao Peng, Mengjiao Bao, Jianxin Li, Md Zakirul Alam Bhuiyan, Yaopeng Liu, Yu He, and Erica Yang. 2018. Incremental term representation learning for social network analysis. Future Generation Computer Systems, Vol. 86 (2018), 1503--1512.
[35]
Hao Peng, Jianxin Li, Yangqiu Song, and Yaopeng Liu. 2017. Incrementally learning the hierarchical softmax function for neural language models. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 31.
[36]
Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP). 1532--1543.
[37]
Savs a Petrović, Miles Osborne, and Victor Lavrenko. 2010. The edinburgh twitter corpus. In Proceedings of the NAACL HLT 2010 workshop on computational linguistics in a world of social media. 25--26.
[38]
Kira Radinsky, Eugene Agichtein, Evgeniy Gabrilovich, and Shaul Markovitch. 2011. A word at a time: computing word relatedness using temporal semantic analysis. In Proceedings of the 20th international conference on World wide web. 337--346.
[39]
Jesse Read, Albert Bifet, Bernhard Pfahringer, and Geoff Holmes. [n.,d.]. Batch-Incremental vs. Instance-Incremental Learning in Dynamic and Evolving Data. ([n.,d.]).
[40]
Tobias Schnabel, Igor Labutov, David Mimno, and Thorsten Joachims. 2015. Evaluation methods for unsupervised word embeddings. In Proceedings of the 2015 conference on empirical methods in natural language processing. 298--307.
[41]
Ian Stewart, Dustin Arendt, Eric Bell, and Svitlana Volkova. 2017. Measuring, predicting and visualizing short-term change in word representation and usage in vkontakte social network. In Eleventh international AAAI conference on web and social media.
[42]
Peter D Turney and Patrick Pantel. 2010. From frequency to meaning: Vector space models of semantics. Journal of artificial intelligence research, Vol. 37 (2010), 141--188.
[43]
Clark Wissler. 1905. The Spearman correlation formula. Science, Vol. 22, 558 (1905), 309--311.
[44]
Michael Zhai, Johnny Tan, and Jinho Choi. 2016. Intrinsic and extrinsic evaluations of word embeddings. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 30.

Cited By

View all
  • (2024)Concept Drift Adaptation in Text Stream Mining Settings: A Systematic ReviewACM Transactions on Intelligent Systems and Technology10.1145/370492216:2(1-67)Online publication date: 21-Nov-2024
  • (2023)The Impact of Preprocessing Techniques Towards Word EmbeddingAdvances in Visual Informatics10.1007/978-981-99-7339-2_35(421-429)Online publication date: 15-Nov-2023

Index Terms

  1. RiverText: A Python Library for Training and Evaluating Incremental Word Embeddings from Text Data Streams

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      SIGIR '23: Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval
      July 2023
      3567 pages
      ISBN:9781450394086
      DOI:10.1145/3539618
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Sponsors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 18 July 2023

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. data streams
      2. incremental learning
      3. word embeddings

      Qualifiers

      • Research-article

      Funding Sources

      • ANID-Millennium Science Initiative Program
      • ANID CHILE FONDECYT
      • CENIA ANID CENTROS BASALES

      Conference

      SIGIR '23
      Sponsor:

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)31
      • Downloads (Last 6 weeks)5
      Reflects downloads up to 05 Mar 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2024)Concept Drift Adaptation in Text Stream Mining Settings: A Systematic ReviewACM Transactions on Intelligent Systems and Technology10.1145/370492216:2(1-67)Online publication date: 21-Nov-2024
      • (2023)The Impact of Preprocessing Techniques Towards Word EmbeddingAdvances in Visual Informatics10.1007/978-981-99-7339-2_35(421-429)Online publication date: 15-Nov-2023

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media