Code Monkey home page Code Monkey logo

Comments (10)

AlexBlack2202 avatar AlexBlack2202 commented on August 15, 2024 1

@rain1024 Thank you for your reply.
My underthesea is 1.1.5

import underthesea
underthesea .version
'1.1.5'

from underthesea.

AlexBlack2202 avatar AlexBlack2202 commented on August 15, 2024 1

I read in fasttext issue and there is someone have this problem when load model in windows. It cannot load the labels and some otherthing of the model. This is not underthesea error.
The problenm is in this link
https://github.com/salestock/fastText.py/issues/112

from underthesea.

rain1024 avatar rain1024 commented on August 15, 2024

@AlexBlack2202 What version of underthesea are you using?

I re-test classify module with these commands below and it works

conda create -n underthesea_test python=3.5
source activate underthesea_test
pip install underthesea

pip install Cython
pip install future scipy numpy scikit-learn
pip install -U fasttext --no-cache-dir --no-deps --force-reinstall
underthesea data
$ python
Python 3.5.5 |Anaconda, Inc.| (default, Mar  9 2018, 19:48:53) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from underthesea import classify
>>> classify("Hội đồng tư vấn kinh doanh Asean vinh danh giải thưởng quốc tế")
['Kinh doanh']

from underthesea.

rain1024 avatar rain1024 commented on August 15, 2024

Did you test my suggestion in your branch new conda environment?

Does it work?

from underthesea.

AlexBlack2202 avatar AlexBlack2202 commented on August 15, 2024

Hi @rain1024
I do not use conda, i use purge python 3.6.3

Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

from underthesea.

rain1024 avatar rain1024 commented on August 15, 2024

I think you should re-install underthesea and follow my steps above.

from underthesea.

AlexBlack2202 avatar AlexBlack2202 commented on August 15, 2024

Thank @rain1024
I have installed in another computer with anaconda. And it still have that problem.

looking deeply in your file model_fasttext.py and i've got something

import fasttext
model= fasttext.load_model("fasttext.model")
dir (model)
['class', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', '_model', 'bucket', 'dim', 'encoding', 'epoch', 'label_prefix', 'labels', 'loss_name', 'lr_update_rate', 'maxn', 'min_count', 'minn', 'model_name', 'neg', 'predict', 'predict_proba', 't', 'test', 'word_ngrams', 'ws']
//I load model successfull

model.predict("HLV ngoại đòi gần tỷ mỗi tháng dẫn dắt tuyển Việt Nam")
[[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]

It return a list of empty list. So when do .replace("label", "") it wrong.

i check the fasttext version in my computer

import pkg_resources

pkg_resources.get_distribution("fasttext").version
'0.8.3'

I think it is not compatiple of my fasttext version and your model. Can you please tell me your fasttext version?

from underthesea.

rain1024 avatar rain1024 commented on August 15, 2024

@AlexBlack2202

Here are my dependencies

$ source activate underthesea_test
$ pip freeze
certifi==2018.1.18
click==6.7
Cython==0.27.3
fasttext==0.8.3
future==0.16.0
joblib==0.11
languageflow==1.1.6rc2
numpy==1.14.1
pandas==0.22.0
python-crfsuite==0.9.5
python-dateutil==2.7.0
pytz==2018.3
scikit-learn==0.19.0
scipy==1.0.0
six==1.11.0
underthesea==1.1.6
xgboost==0.7.post3

According to this result, I have fasttext 0.8.3 in my environment

What is your operating system?

from underthesea.

AlexBlack2202 avatar AlexBlack2202 commented on August 15, 2024

@rain1024
I use windown 10. When i use in bash window 10 (base on ubuntu). It run successfull.
But it can not run in window 10. The only thing difference is xgboost. In my window is xgboost==0.7 and in bash is xgboost==0.7.post3

from underthesea.

rain1024 avatar rain1024 commented on August 15, 2024

@AlexBlack2202 Thanks for your clarification.

I will close this issue here

from underthesea.

Related Issues (20)

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.