Code Monkey home page Code Monkey logo

dccuchile / rivertext Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 0.0 10.08 MB

RiverText is a framework that standardizes the Incremental Word Embeddings proposed in the state-of-art. Please feel welcome to open an issue in case you have any questions or a pull request if you want to contribute to the project!

Home Page: https://dccuchile.github.io/rivertext/

License: MIT License

Python 100.00%
incremental-learning nlp-machine-learning streaming-algorithms streaming-data online-learning pytorch-nlp cbow skipgram-algorithm wordembeddings

rivertext's People

Contributors

giturra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rivertext's Issues

IWord2Vec does not work

The following code will not work correctly
Is this project still under development and does not work?

from torch.utils.data import DataLoader
from rivertext.models.iw2v import IWord2Vec
from rivertext.utils import TweetStream
from tqdm import tqdm
ts = TweetStream("a.txt")
dataloader = DataLoader(ts, batch_size=32)
iw2v = IWord2Vec(window_size=3, vocab_size=3, emb_size=3, sg=1, neg_samples_sum=1,  device="cuda:0")
for batch in tqdm(dataloader):
   iw2v.learn_many(batch)
print(iw2v.vocab2dict())
0it [00:00, ?it/s]/home/pf/glove/rivertext/rivertext/models/iword2vec/unigram_table.py:83: RuntimeWarning: invalid value encountered in true_divide
  nums = self.max_size * counts_pow / z
0it [00:00, ?it/s]
Traceback (most recent call last):
  File "/home/pf/glove/rivertext/a.py", line 9, in <module>
    iw2v.learn_many(batch)
  File "/home/pf/glove/rivertext/rivertext/models/iw2v.py", line 267, in learn_many
    batch = self.prep(tokens)
  File "/home/pf/glove/rivertext/rivertext/models/iword2vec/preprocessing.py", line 261, in __call__
    self.update_unigram_table(token)
  File "/home/pf/glove/rivertext/rivertext/models/iword2vec/preprocessing.py", line 98, in update_unigram_table
    self.rebuild_unigram_table()
  File "/home/pf/glove/rivertext/rivertext/models/iword2vec/preprocessing.py", line 78, in rebuild_unigram_table
    self.unigram_table.build(self.vocab, self.alpha)
  File "/home/pf/glove/rivertext/rivertext/models/iword2vec/unigram_table.py", line 84, in build
    nums = np.vectorize(round_number)(nums)
  File "/home/pf/.local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 2304, in __call__
    return self._vectorize_call(func=func, args=vargs)
  File "/home/pf/.local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 2382, in _vectorize_call
    ufunc, otypes = self._get_ufunc_and_otypes(func=func, args=args)
  File "/home/pf/.local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 2342, in _get_ufunc_and_otypes
    outputs = func(*inputs)
  File "/home/pf/glove/rivertext/rivertext/utils/rand.py", line 17, in round_number
    c = ceil(num)
ValueError: cannot convert float NaN to integer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.