Simple, Keras-powered multilingual NLP framework, allows you to build your models in 5 minutes for named entity recognition (NER), part-of-speech tagging (PoS) and text classification tasks. Includes BERT, GPT-2 and word2vec embedding.
Project description
BAND:BERT Application aNd Deployment
A simple and efficient BERT model training and deployment framework,一个简单高效的 BERT 模型训练和部署框架
BAND
BAND:BERT Application aNd Deployment
探索本项目的文档 »
查看Demo
·
报告Bug
·
提出新特性
·
问题交流
目录
上手指南
开发前的配置要求
- Linux (Centos,Ubuntu.....)
- Python>=3.6
- Tensorflow>=1.13.1
安装方法
安装band有两种方式:
- Install from PyPi
pip install band
- Install From Git
pip install git+https://www.github.com/sunyancn/band.git
文本分类Demo
-
训练模型
import band from band.corpus import SMP2018ECDTCorpus from band.tasks.classification import BiLSTM_Model from band.callbacks import EvalCallBack from band import utils # Dataset dataset = SMP2018ECDTCorpus() model = BiLSTM_Model() eval_callback = EvalCallBack(kash_model=model, valid_x=dataset.valid_x, valid_y=dataset.valid_y, step=5) model.fit(dataset.train_x, dataset.train_y, dataset.valid_x, dataset.valid_y, batch_size=32, callbacks=[eval_callback]) model.evaluate(dataset.test_x, dataset.test_y) # Save model to `saved_classification_model` dir model.save('saved_classification_model') # Load model loaded_model = band.utils.load_model('saved_classification_model') # Use model to predict loaded_model.predict(dataset.test_x[:10]) # Save model utils.convert_to_saved_model(model, model_path='saved_model/bilstm', version='1')
-
部署模型
simple_tensorflow_serving --model_base_path="saved_model/bilstm"
-
启动WebAPP,参考代码
python app.py
开发的架构
部署
暂无
使用到的框架
作者
您可以通过以下方式联系我:
- Email: sunyanhust@163.com
- NLP技术QQ交流群:859886087
您也可以在贡献者名单中参看所有参与该项目的开发者。
贡献者
请阅读CONTRIBUTING.md 查阅为该项目做出贡献的开发者。
如何参与开源项目
贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献都是非常感谢的。
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
版权说明
该项目签署了Apache授权许可,详情请参阅 LICENSE
版本控制
该项目使用Git进行版本管理。您可以在repository参看当前可用版本。
鸣谢
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.