Skip to content

Commit

Permalink
Update resource & mirror sites
Browse files Browse the repository at this point in the history
  • Loading branch information
hanlpbot committed Nov 28, 2023
1 parent 19eb67a commit 6bbf1ff
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ resources.
By default, models are downloaded from a global CDN we maintain. However, in some regions the downloading speed can
be slow occasionally. If you happen to be in one of those regions, you can find some third party mirror sites
on our [bbs](https://bbs.hankcs.com/). When you find a working URL, say
[https://od.hankcs.com/hanlp/data/](https://od.hankcs.com/hanlp/data/), you can set a `HANLP_URL`
[https://ftp.hankcs.com/hanlp/](https://ftp.hankcs.com/hanlp/), you can set a `HANLP_URL`
environment variable and HanLP will pick it up at the next startup.

```bash
export HANLP_URL=https://od.hankcs.com/hanlp/data/
export HANLP_URL=https://ftp.hankcs.com/hanlp/
```

## Control Verbosity
Expand Down
2 changes: 1 addition & 1 deletion hanlp/datasets/srl/ontonotes5/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def make_ontonotes_language_jsonlines(conll12_ontonotes_path, output_path=None,
pprint(stats)
conll12_json_file = f'{lang_dir}/{split}.{language}.conll12.jsonlines'
print(f'Applying CoNLL 12 official splits on {v5_json_file} to {conll12_json_file}')
id_file = get_resource(f'https://od.hankcs.com/research/emnlp2021/conll.cemantix.org.zip#2012/download/ids/'
id_file = get_resource(f'https://file.hankcs.com/research/emnlp2021/conll.cemantix.org.zip#2012/download/ids/'
f'{language}/coref/{split}.id')
filter_data(v5_json_file, conll12_json_file, id_file)

Expand Down
2 changes: 1 addition & 1 deletion hanlp/metrics/amr/smatch_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_amr_utils(amr_version):
elif amr_version == '2.0':
utils_tar_gz = 'https://www.cs.jhu.edu/~s.zhang/data/AMR/amr_2.0_utils.tar.gz'
elif amr_version == '3.0':
utils_tar_gz = 'https://od.hankcs.com/research/amr2020/amr_3.0_utils.tgz'
utils_tar_gz = 'https://file.hankcs.com/research/amr2020/amr_3.0_utils.tgz'
else:
raise ValueError(f'Unsupported AMR version {amr_version}')
return utils_tar_gz
Expand Down
6 changes: 3 additions & 3 deletions hanlp/utils/io_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ def download(url, save_path=None, save_dir=hanlp_home(), prefix=HANLP_URL, appen
else:
hints += 'using some decent downloading tools.[/green]\n'
if not url.startswith(HANLP_URL):
hints += 'For third party data, you may find it on our mirror site:\n' \
'https://od.hankcs.com/hanlp/data/\n'
hints += 'See also https://hanlp.hankcs.com/docs/install.html#install-models for instructions.'
hints += 'For third party data, unrestricted connectivity to the global network may be required.'
else:
hints += 'See also https://hanlp.hankcs.com/docs/install.html#install-models for instructions.'
message = f'Download failed due to [red]{repr(e)}[/red].\n' \
f'{hints}'
if verbose:
Expand Down
2 changes: 1 addition & 1 deletion hanlp/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Author: hankcs
# Date: 2019-12-28 19:26

__version__ = '2.1.0-beta.52'
__version__ = '2.1.0-beta.53'
"""HanLP version"""


Expand Down

0 comments on commit 6bbf1ff

Please sign in to comment.