pkuseg-python icon indicating copy to clipboard operation
pkuseg-python copied to clipboard

Using Pre-Downloaded Domain Model is messy

Open tsafs opened this issue 1 year ago • 1 comments

Hey there :)

I'm using spacy-pkuseg version 0.0.33. Since this is spacy-pkuseg, I'm not sure if this is the right place to report. I haven't looked through the your/their source code.

At some point pkuseg loads a domain model:

Downloading: "https://github.com/lancopku/pkuseg-python/releases/download/v0.0.16/mixed.zip" to /home/python/.pkuseg/mixed.zip 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 47330222/47330222 [00:01<00:00, 39315899.62it/s] WARNING: features.msgpack does not exist, try loading features.pkl

My goal is to pre-download this requirement such that it is not downloaded at runtime.

My first approach was to put the mixed.zip file at ~/.pkuseg/mixed.zip. This doesn't work. pkuseg re-downloads the file.

My second approach was to extract the mixed.zip contents and put it into ~/.pkuseg/mixed. I then deleted the original zip file. This doesn't work. pkuseg re-downloads the file.

My third approach was to keep and not remove the mixed.zip after extraction at ~/.pkuseg/mixed.zip. This did work, i.e. the file was not re-downloaded.

My issue is that I would expect both the first and second approach to work out of the box.

Is this some error in my application or is this some faulty check within pkuseg / spacy-pkuseg?

Thank you

tsafs avatar Jun 05 '24 12:06 tsafs

@.***,本次回复为系统自动回复!

lcyyyyyyyyyyy avatar Jun 05 '24 12:06 lcyyyyyyyyyyy