Skip to main content

Provide medical NER service

Project description

Huatuo Version MIT License

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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Huatuo-0.1.5.tar.gz (679.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Huatuo-0.1.5-py3-none-any.whl (685.2 kB view details)

Uploaded Python 3

File details

Details for the file Huatuo-0.1.5.tar.gz.

File metadata

  • Download URL: Huatuo-0.1.5.tar.gz
  • Upload date:
  • Size: 679.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for Huatuo-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a22e9e99e57d86ac4c60ad66912d929e075c12b115106b5317fcca0d67408690
MD5 09b1447ec192ab9888a7734c163fed1c
BLAKE2b-256 dca069e2d5833d7d9be78efe561e8d22f8c746c892bd9edd54757bf5bd368740

See more details on using hashes here.

File details

Details for the file Huatuo-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: Huatuo-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 685.2 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for Huatuo-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 066b703520aaa8218157a452c087a37fdc2ca3d11d76c48c833f31038494ba36
MD5 cbbdd39173288be409627bacbcb62fcd
BLAKE2b-256 074f21791dded2425e456dca8f814ddaa225456217556f6179bb2171459ede63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page