brucewlee / lingfeat

[EMNLP 2021] LingFeat - A Comprehensive Linguistic Features Extraction ToolKit for Readability Assessment
Creative Commons Attribution Share Alike 4.0 International
120 stars 16 forks source link

KeyError: dtype('float32') #1

Open giangdip2410 opened 2 years ago

giangdip2410 commented 2 years ago

Thank you for your great work. I test with a sentence: "The commutator is peculiar, consisting of only three segments of a copper ring, while in the simplest of other continuous current generators several times that number exist, and frequently 120! segments are to be found. These three segments are made so as to be removable in a moment for cleaning or replacement. They are mounted upon a metal support, and are surrounded on all sides by a free air space, and cannot, therefore, lose their insulated condition. This feature of air insulation is peculiar to this system, and is very important as a factor in the durability of the commutator. Besides this, the commutator is sustained by supports carried in flanges upon the shaft, which flanges, as an additional safeguard, are coated all over with hard rubber, one of the finest known insulators. It may be stated, without fear of contradiction, that no other commutator made is so thoroughly insulated and protected. The three commutator segments virtually constitute a single copper ring, mounted in free air, and cut into three equal pieces by slots across its face." When I call 3 API below it's error

WoKF = LingFeat.WoKF_() # Wikipedia Knowledge Features

WBKF = LingFeat.WBKF_() # WeeBit Corpus Knowledge Features

OSKF = LingFeat.OSKF_() # OneStopEng Corpus Knowledge Features

Do you know how to fix this issue. Thank you. I install library with second option on google colab: !git clone https://github.com/brucewlee/lingfeat.git !pip install -r lingfeat/requirements.txt

KeyError Traceback (most recent call last) in () ----> 1 WoKF = LingFeat.WoKF_() # Wikipedia Knowledge Features

6 frames /usr/local/lib/python3.7/dist-packages/gensim/models/ldamodel.py in inference(self, chunk, collect_sstats) 665 # phinorm is the normalizer. 666 # TODO treat zeros explicitly, instead of adding epsilon? --> 667 eps = DTYPE_TO_EPS[self.dtype] 668 phinorm = np.dot(expElogthetad, expElogbetad) + eps 669

KeyError: dtype('float32')

brucewlee commented 2 years ago

I'll look into this

Kulisap1994 commented 2 years ago

Hi, your work is interesting. I look forward to testing out the knowledge features of your research work. :)

brucewlee commented 2 years ago

@giangdip2410 Currently, I'm a little busy for EMNLP 2022. I will fix the pointed out mistake in mid-June.

@Kulisap1994 Thank you for your interest! If you need any assistance in reproducing the results, please email me or leave comment :)

venkatsubash2003 commented 1 year ago

I'm getting the same keyError that @giangdip2410 got.Can you please help me out with this?

brucewlee commented 1 year ago

@venkatsubash2003 I'm building a new library that mitigates all such issues (lmk if you want to contribute). But try upgrading Gensim and tell me if it works!

venkatsubash2003 commented 1 year ago

@brucewlee I would like to contribute as well.