Easy-to-use Information Extraction Framework
Project description
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,感谢以上诸位作者的付出。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastie-1.0.1.dev0.tar.gz.
File metadata
- Download URL: fastie-1.0.1.dev0.tar.gz
- Upload date:
- Size: 155.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a205edef056f382e73eb2dd714c99f8bdc8d54e43f1a5c48eb27aa2c6c8146e
|
|
| MD5 |
6ab30d1a91f70f5ebacf1d58461fdfa7
|
|
| BLAKE2b-256 |
e0363edf6e875ea72b410d21238179a80df1e88478d7236eeee5fdbfe4de986b
|
File details
Details for the file fastie-1.0.1.dev0-py3-none-any.whl.
File metadata
- Download URL: fastie-1.0.1.dev0-py3-none-any.whl
- Upload date:
- Size: 209.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
927d79e182a83b38c904f25c3e2ccef9b0362c94f0376b0349263ac4b5d53f72
|
|
| MD5 |
92c1fc1f2241262052666bcfecefd1b7
|
|
| BLAKE2b-256 |
6220ca7bb92df5aea4b4c452a1bf559be43da041281d7cdc7cc48113a934dcb5
|