alexeyev / abae-pytorch Goto Github PK
View Code? Open in Web Editor NEWPyTorch implementation of 'An Unsupervised Neural Attention Model for Aspect Extraction' by He et al. ACL2017'
License: MIT License
PyTorch implementation of 'An Unsupervised Neural Attention Model for Aspect Extraction' by He et al. ACL2017'
License: MIT License
For me, even using example_run.sh
, it fails in the _reconstruction_loss
method, after the model finished training.
I tried with other datasets as well and it also fails at the same matrix multiplication.
Traceback (most recent call last):
File "main.py", line 88, in <module>
y_pred = model(x, negative_samples)
File "/home/alex/.conda/envs/fastai/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__
result = self.forward(*input, **kwargs)
File "/usr/local/workspace_common/Data-Science/named_entity_recognition/abae_pytorch/model.py", line 109, in forward
averaged_negative_samples)
File "/usr/local/workspace_common/Data-Science/named_entity_recognition/abae_pytorch/model.py", line 118, in _reconstruction_loss
negative_dot_products = torch.matmul(averaged_negative_emb, recovered_emb.unsqueeze(2)).squeeze()
RuntimeError: The size of tensor a (50) must match the size of tensor b (39) at non-singleton dimension 0
i'm working on aspect extraction, could you please guide for Aspect prediction and Saving model production.
I used the trained model ,which was saved during training. The code is
model = torch.load("xxxxx/xxxxx.bin")
aspects = model.get_aspect_words(w2v_model, logger,topn=10)
Is this the right way to get the aspects ?
thank you very much.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.