Giter VIP home page Giter VIP logo

sentimentanalysis's People

Contributors

barissayil avatar dependabot[bot] avatar

Stargazers

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

Watchers

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

sentimentanalysis's Issues

"string indices must be integers" error

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!

AttributeError: 'tuple' object has no attribute 'last_hidden_state'

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'

RuntimeError

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?

Error saving model

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

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.