This release is a pre-release and may not be stable for production use.
FastIE
此项目为开源文本分类、实体抽取、关系抽取和事件抽取模型的训练和推理提供统一的框架,具有以下特性
-
✨ 支持多种开源文本分类、实体抽取、关系抽取和事件抽取模型
-
👑 支持百度 UIE 模型的训练和推理
-
🚀 统一的训练和推理框架
-
🎯 集成对抗训练方法,简便易用
📢 更新日志
- 【2024.8.30】 发布初始版本
📦 快速安装
pip 安装
pip install --upgrade fastie
源码安装
git clone https://github.com/xusenlinzy/FastIE.git
pip install -e .
🚀 模型训练
实体抽取
cd examples/named_entity_recognition
fastie-cli train global_pointer.yaml
具体参数详见 named_entity_recognition
关系抽取
cd examples/relation_extraction
fastie-cli train gplinker.yaml
具体参数详见 relation_extraction
事件抽取
cd examples/event_extraction
fastie-cli train gplinker.yaml
具体参数详见 event_extraction
📊 模型推理
本项目实现了对各类模型推理代码的封装,只需要4行代码即可推理!
from transformers import AutoModel, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("path_to_model", trust_remote_code=True)
model = AutoModel.from_pretrained("path_to_model", trust_remote_code=True)
print(model.predict(tokenizer, "因肺过度充气,常将肝脏推向下方。"))
一键启动模型接口或DEMO
# fastie-cli api --model_name_or_path path_to_model --port 9000
fastie-cli demo --model_name_or_path path_to_model --port 9000
致谢
本项目受益于 LLaMA-Factory,感谢以上诸位作者的付出。
Metadata
Release files for fastie 1.0.1.dev0
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 |
|---|---|---|---|---|
| fastie-1.0.1.dev0.tar.gz | 155.8 kB | Without provenance | Details for fastie-1.0.1.dev0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastie-1.0.1.dev0-py3-none-any.whl | Python 3 | none | any | Details for fastie-1.0.1.dev0-py3-none-any.whl |
Total release size: 365.2 kB
Release files / fastie-1.0.1.dev0.tar.gz
| Download URL | fastie-1.0.1.dev0.tar.gz |
|---|---|
| Size | 155.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a205edef056f382e73eb2dd714c99f8bdc8d54e43f1a5c48eb27aa2c6c8146e
|
|
BLAKE2b-256 checksum How to use checksums |
e0363edf6e875ea72b410d21238179a80df1e88478d7236eeee5fdbfe4de986b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / fastie-1.0.1.dev0-py3-none-any.whl
| Download URL | fastie-1.0.1.dev0-py3-none-any.whl |
|---|---|
| Size | 209.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
927d79e182a83b38c904f25c3e2ccef9b0362c94f0376b0349263ac4b5d53f72
|
|
BLAKE2b-256 checksum How to use checksums |
6220ca7bb92df5aea4b4c452a1bf559be43da041281d7cdc7cc48113a934dcb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for fastie 1.0.1.dev0
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.