undertheseanlp / underthesea

Underthesea - Vietnamese NLP Toolkit
http://undertheseanlp.com
GNU General Public License v3.0
1.37k stars 271 forks source link

Please upload dependence parsing module #597

Closed htluandc2 closed 1 year ago

htluandc2 commented 1 year ago

Hi there, when i run:

from underthesea import dependency_parse text = 'Tối 29/11, Việt Nam thêm 2 ca mắc Covid-19' dependency_parse(text)

Then dependence file can not download. Downloading: "https://github.com/undertheseanlp/underthesea/releases/download/v1.3-resources/vi-dp-v1a1.zip" to vi-dp-v1a1.zip

File /opt/homebrew/Caskroom/miniforge/base/envs/env_tf/lib/python3.9/urllib/request.py:641, in HTTPDefaultErrorHandler.http_error_default(self, req, fp, code, msg, hdrs) 640 def http_error_default(self, req, fp, code, msg, hdrs): --> 641 raise HTTPError(req.full_url, code, msg, hdrs, fp)

HTTPError: HTTP Error 404: Not Found

Please upload this file. Thank you very much!

rain1024 commented 1 year ago

@htluandc2 Which version of underthesea are you using?

$ underthesea info 

or use pip

$ pip freeze | grep underthesea

The error you are facing is fixed in underthesea version 1.3.5 (Same as #540). You should update underthesea version

$ pip install underthesea[deep]==1.3.5

>>> from underthesea import dependency_parse
>>> text = 'Tối 29/11, Việt Nam thêm 2 ca mắc Covid-19'
>>> dependency_parse(text)
[('Tối', 5, 'obl:tmod'),
 ('29/11', 1, 'compound'),
  (',', 4, 'punct'),
  ('Việt Nam', 5, 'nsubj'),
  ('thêm', 0, 'root'),
  ('2', 7, 'nummod'),
  ('ca', 5, 'obj'),
  ('mắc', 5, 'obj'),
  ('Covid-19', 5, 'punct')]

This image below is screenshot of my termial

Screen Shot 2022-11-15 at 20 06 43
htluandc2 commented 1 year ago

Thank you for your immediate support. But when I reinstall underthesea, I faced new error:

% pip install underthesea[deep]==1.3.5       
zsh: no matches found: underthesea[deep]==1.3.5

When I install without [deep]

% pip install underthesea==1.3.5
ERROR: Could not find a version that satisfies the requirement underthesea-core==0.0.5a2 (from underthesea) (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4a0, 0.0.4a1, 0.0.4a2, 0.0.4a3, 0.0.4a4, 0.0.4a5, 0.0.4a6, 0.0.4a8)
ERROR: No matching distribution found for underthesea-core==0.0.5a2

My enviroment:

% ipython
Python 3.9.13 (main, Aug 25 2022, 18:24:45)
rain1024 commented 1 year ago

@htluandc2

zsh: no matches found: underthesea[deep]==1.3.5

I faced the same result when using pip with zsh. I haven't figure out what is the problem here. For installation underthesea[deep], I must run without zsh.

Update: Maybe it's the reason behind this error https://stackoverflow.com/a/30539963/772391

In my zsh environment, Quotation Mark " is the rescure :D

pip install "underthesea[deep]==1.3.5"

% pip install underthesea==1.3.5 My enviroment: % ipython Python 3.9.13 (main, Aug 25 2022, 18:24:45)

Please try with older verion of python, such as python 3.8 or 3.7. Then let me known what happens. I will invest this issue further in next release (1.4.0)

Thank you :D