Huatuo

Huatuo 是一个提供医疗命名实体识别服务的库
使用python进行测试:
import Huatuo
sentence = '没有及时的盖被子,都会导致感冒的情况发生,下面我们一起了解下热感冒了吃什么好的快吧!风热感冒常伴有内火患者会出现咳嗽以及嗓子痒痛,在药物治疗的饿同时可以患者可以适当的吃冰糖雪梨茶,冰糖雪梨能够有效的去火,缓解患者因咽喉肿痛引起的咳嗽嗓子疼痛症状'
current_dir = ''
config_path = ''
checkpoint_path = ''
dict_path = ''
model_path = ''
ner_result = Huatuo.diagnosis(sentence, config_path, checkpoint_path, dict_path, model_path)
运行以上脚本输出结果:
[{'start_idx': 13, 'end_idx': 14, 'type': 'disease', 'entity': '感冒'}, {'start_idx': 31, 'end_idx': 32, 'type': 'disease', 'entity': '感冒'}, {'start_idx': 44, 'end_idx': 45, 'type': 'disease', 'entity': '感冒'}, {'start_idx': 42, 'end_idx': 45, 'type': 'disease', 'entity': '风热感冒'}, {'start_idx': 56, 'end_idx': 57, 'type': 'disease', 'entity': '咳嗽'}, {'start_idx': 62, 'end_idx': 62, 'type': 'symptom', 'entity': '痒'}, {'start_idx': 62, 'end_idx': 63, 'type': 'disease', 'entity': '痒痛'}, {'start_idx': 84, 'end_idx': 85, 'type': 'food', 'entity': '冰糖'}, {'start_idx': 84, 'end_idx': 87, 'type': 'food', 'entity': '冰糖雪梨'}, {'start_idx': 87, 'end_idx': 87, 'type': 'food', 'entity': '梨'}, {'start_idx': 84, 'end_idx': 88, 'type': 'food', 'entity': '冰糖雪梨茶'}, {'start_idx': 90, 'end_idx': 91, 'type': 'food', 'entity': '冰糖'}, {'start_idx': 90, 'end_idx': 93, 'type': 'food', 'entity': '冰糖雪梨'}, {'start_idx': 93, 'end_idx': 93, 'type': 'food', 'entity': '梨'}, {'start_idx': 107, 'end_idx': 110, 'type': 'symptom', 'entity': '咽喉肿痛'}, {'start_idx': 114, 'end_idx': 115, 'type': 'disease', 'entity': '咳嗽'}, {'start_idx': 118, 'end_idx': 119, 'type': 'disease', 'entity': '疼痛'}, {'start_idx': 120, 'end_idx': 121, 'type': 'disease', 'entity': '症状'}]
使用方式
usage: Huatuo [-h] [--sentence TEXT_OF_SENTENCE] [--out NERRESULT]
optional arguments:
-h, --help show this help message and exit
--sentence TEXT_OF_SENTENCE sentence with medical information
--current_dir current parent directory
--config_path bert_config.json path
--checkpoint_path bert_model.ckpt path
--dict_path vocab.txt path
--model_path best_model_cmeee_globalpointer.weights path
--out NERRESULT ner result
安装
$ pip install Huatuo
Tip
模型文件请联系作者(e-mail: easonai@yeah.net)获取
License
Metadata
Release files for Huatuo 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Huatuo-0.1.5.tar.gz | 679.3 kB | Without provenance | Details for Huatuo-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Huatuo-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for Huatuo-0.1.5-py3-none-any.whl |
Total release size: 1.4 MB
Release files / Huatuo-0.1.5.tar.gz
| Download URL | Huatuo-0.1.5.tar.gz |
|---|---|
| Size | 679.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a22e9e99e57d86ac4c60ad66912d929e075c12b115106b5317fcca0d67408690
|
|
BLAKE2b-256 checksum How to use checksums |
dca069e2d5833d7d9be78efe561e8d22f8c746c892bd9edd54757bf5bd368740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.10
|
Release files / Huatuo-0.1.5-py3-none-any.whl
| Download URL | Huatuo-0.1.5-py3-none-any.whl |
|---|---|
| Size | 685.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
066b703520aaa8218157a452c087a37fdc2ca3d11d76c48c833f31038494ba36
|
|
BLAKE2b-256 checksum How to use checksums |
074f21791dded2425e456dca8f814ddaa225456217556f6179bb2171459ede63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.10
|
Security for Huatuo 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.