nlp-text-classification-model's People
Forkers
yuexue07 liketheflower wiwern muhammed-unal noetejaxun entrmatrix bianag shaileshadhikari ansarishadab121 brighameaquinto csantanaes a-s-munaf zitagcc atonendeley kimerajoseph saruto119 kchyavana shotovenkatesh redadna nosibasaif adityarathi99 nelsonpaz valicsek margaretnm thordust rayanpoudyal m-josephh jenowish4u samoo09 liuclarahy twonp168 manu87ds juliajung11 latse-m luluk3 maher121 humans-huddle ayindeyakubu lyla-vela rishimj anaortizsalazar293 andreluispinto bgoldfe2 sinikishan abasfreky1 fardeen-gitnlp-text-classification-model's Issues
'KeyedVectors' object has no attribute 'syn0'
Hi,
I'm using your code here, based on your article in Medium. Because of gensim's update from 3.8 to 4 (which was a major revision) I received some errors.
The first was that model.wv.index2word
has been moved to model.wv.index_to_key
. So I changed the code accordingly to get rid of this error.
#w2v = dict(zip(model.wv.index2word, model.wv.syn0)) #combination of word and its vector
w2v = dict(zip(model.wv.index_to_key, model.wv.syn0)) #combination of word and its vector
However, this then triggered a new error that I haven't been able to figure out.
AttributeError Traceback (most recent call last)
<ipython-input-54-04b58a6eb72e> in <module>
6 #if min_count=2 means if the word is present less than 2 times across all the documents then we shouldn't consider it
7
----> 8 w2v = dict(zip(model.wv.index_to_key, model.wv.syn0)) #combination of word and its vector
9 #w2v = dict(zip(model.wv.index2word, model.wv.syn0)) #combination of word and its vector
10
AttributeError: 'KeyedVectors' object has no attribute 'syn0'
Checking the web, the recommended solution for a object has no attribute 'syn0'
is to change from model.syn0
to model.wv.syn0
... but of course this is what the code already is.
Do you have any idea how I can correct this code?
Thanks!
Requirements
Hello,
During my study on this NLP modelling I realized that @vijayaiitk should have mentioned the versions for gensim and some other modules. Because the deprecated versions do not work. For example gensim 3.8.3 should be added to the requirements otherwise visitors who try will encounter repetitive issues related to version.
If you can add requirements I would appreciate it,
Thanks
Question for classes: target -1, 0 and 1
if my target has 3 classes: positive negative and neutral, will your algorithm work or will I need to modify something?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.