barissayil / sentimentanalysis Goto Github PK
View Code? Open in Web Editor NEWSentiment analysis neural network trained by fine-tuning BERT, ALBERT, or DistilBERT on the Stanford Sentiment Treebank.
License: MIT License
Sentiment analysis neural network trained by fine-tuning BERT, ALBERT, or DistilBERT on the Stanford Sentiment Treebank.
License: MIT License
My (limited) understanding is that in the transfomers code some pretrained models have renamed or moved. huggingface/transformers#4636
Can you achieve three classifications?positive、negative and neutral
Hi,
Would it be possible for you to share pre-trained model weights for this model?
Thanks
Hi @barissayil,
Thanks you for sharing your excellent work. I met an error of "string indices must be integers" When I run the analyze.py file. The error is showed below:
The error are list below:
Please wait while the analyser is being prepared.
Input sentiment to analyze: I am happy.
Traceback (most recent call last):
File "analyze.py", line 53, in <module>
classify_sentiment(sentence)
File "analyze.py", line 14, in classify_sentiment
logit = model(input_ids=input_ids, attention_mask=attention_mask)
File "/Users/insight/opt/anaconda3/envs/meetingminutes-sentiment/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/Users/insight/Projects/MeetingMinutes-Minning/bert-extractive-summarizer/sentiment/SentimentAnalysis/modeling.py", line 23, in forward
cls_reps = reps[:, 0]
TypeError: string indices must be integers
Could you please give me some suggestion to find the solution? Thanks a lot!
Hey, thanks for the code.
When I was running, there was some error. Could you please help me to check it. Thank
File "F:\PycharmProjects\SentimentAnalysis-master\modeling.py", line 25, in forward cls_reps = outputs.last_hidden_state[:, 0] AttributeError: 'tuple' object has no attribute 'last_hidden_state'
Hey barissayil,
Can you please include in the repository a setup.py file ? I cant use pip to install it as a package.
Thanks,
Roi.
Can I use this model for direct inference on japanese text or is re-training necessary ?
Hi, when I uncommented the choosing device part and tried to execute the analize.py, I received runtime error, it seems some of the tensors are still on cpu.
# device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# model = model.to(device)
"
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper__index_select)
"
So do you know how to solve this?
When I run train.py the following error occurs:
Epoch 0 complete! Validation Accuracy : 0.8917410969734192, Validation Loss : 0.27176217176020145
Best validation accuracy improved from 0 to 0.8917410969734192, saving model...
Traceback (most recent call last):
File "train.py", line 106, in
train(net, criterion, optimizer, train_loader, val_loader, args)
File "train.py", line 77, in train
torch.save(net.state_dict(), 'models/model'.format(ep, args.freeze_bert))
NameError: name 'ep' is not defined
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.