<a href="https://explosion.ai"><img src="https://explosion.ai/assets/img/logo.svg" width="125" height="125" align="right" /></a>
# spacy-transformers: Use pretrained transformers like BERT, XLNet and GPT-2 in spaCy
This package provides [spaCy](https://github.com/explosion/spaCy) components and
architectures to use transformer models via
[Hugging Face's `transformers`](https://github.com/huggingface/transformers) in
spaCy. The result is convenient access to state-of-the-art transformer
architectures, such as BERT, GPT-2, XLNet, etc.
> **This release requires [spaCy v3](https://spacy.io/usage/v3).** For
> the previous version of this library, see the
> [`v0.6.x` branch](https://github.com/explosion/spacy-transformers/tree/v0.6.x).
[![Azure Pipelines](https://img.shields.io/azure-devops/build/explosion-ai/public/18/master.svg?logo=azure-pipelines&style=flat-square)](https://dev.azure.com/explosion-ai/public/_build?definitionId=18)
[![PyPi](https://img.shields.io/pypi/v/spacy-transformers.svg?style=flat-square&logo=pypi&logoColor=white)](https://pypi.python.org/pypi/spacy-transformers)
[![GitHub](https://img.shields.io/github/release/explosion/spacy-transformers/all.svg?style=flat-square&logo=github)](https://github.com/explosion/spacy-transformers/releases)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/ambv/black)
## Features
- Use pretrained transformer models like **BERT**, **RoBERTa** and **XLNet** to
power your spaCy pipeline.
- Easy **multi-task learning**: backprop to one transformer model from several
pipeline components.
- Train using spaCy v3's powerful and extensible config system.
- Automatic alignment of transformer output to spaCy's tokenization.
- Easily customize what transformer data is saved in the `Doc` object.
- Easily customize how long documents are processed.
- Out-of-the-box serialization and model packaging.
## ð Installation
Installing the package from pip will automatically install all dependencies,
including PyTorch and spaCy. Make sure you install this package **before** you
install the models. Also note that this package requires **Python 3.6+**,
**PyTorch v1.5+** and **spaCy v3.0+**.
```bash
pip install spacy[transformers]
```
For GPU installation, find your CUDA version using `nvcc --version` and add the
[version in brackets](https://spacy.io/usage/#gpu), e.g.
`spacy[transformers,cuda92]` for CUDA9.2 or `spacy[transformers,cuda100]` for
CUDA10.0.
If you are having trouble installing PyTorch, follow the
[instructions](https://pytorch.org/get-started/locally/) on the official website
for your specific operating system and requirements, or try the following:
```bash
pip install spacy-transformers -f https://download.pytorch.org/whl/torch_stable.html
```
## ð Documentation
> â ï¸ **Important note:** This package has been extensively refactored to take
> advantage of [spaCy v3.0](https://spacy.io). Previous versions that
> were built for [spaCy v2.x](https://v2.spacy.io) worked considerably
> differently. Please see previous tagged versions of this README for
> documentation on prior versions.
- ð
[Embeddings, Transformers and Transfer Learning](https://spacy.io/usage/embeddings-transformers):
How to use transformers in spaCy
- ð [Training Pipelines and Models](https://spacy.io/usage/training):
Train and update components on your own data and integrate custom models
- ð
[Layers and Model Architectures](https://spacy.io/usage/layers-architectures):
Power spaCy components with custom neural networks
- ð [`Transformer`](https://spacy.io/api/transformer): Pipeline
component API reference
- ð
[Transformer architectures](https://spacy.io/api/architectures#transformers):
Architectures and registered functions
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共45个文件
py:33个
txt:5个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:spacy-transformers-1.1.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
spacy-transformers-1.1.0.tar.gz (45个子文件)
spacy-transformers-1.1.0
MANIFEST.in 34B
PKG-INFO 5KB
LICENSE 1KB
spacy_transformers
span_getters.py 2KB
truncate.py 4KB
align.py 7KB
tests
test_truncation.py 4KB
test_deprecations.py 440B
util.py 5KB
__init__.py 0B
test_serialize.py 9KB
test_alignment.py 2KB
test_spanners.py 2KB
test_configs.py 2KB
regression
test_spacy_issue6401.py 2KB
__init__.py 0B
test_spacy_issue7029.py 2KB
test_data_classes.py 834B
test_model_wrapper.py 2KB
test_tok2vectransformer.py 3KB
test_pipeline_component.py 14KB
util.py 5KB
__init__.py 499B
data_classes.py 13KB
layers
_util.py 656B
hf_shim.py 5KB
hf_wrapper.py 2KB
listener.py 2KB
transformer_model.py 11KB
trfs2arrays.py 2KB
__init__.py 256B
split_trf.py 427B
pipeline_component.py 17KB
architectures.py 11KB
annotation_setters.py 643B
setup.cfg 3KB
setup.py 179B
spacy_transformers.egg-info
PKG-INFO 5KB
requires.txt 505B
not-zip-safe 1B
SOURCES.txt 2KB
entry_points.txt 820B
top_level.txt 19B
dependency_links.txt 1B
README.md 4KB
共 45 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于opencv的人脸识别考勤系统python源码+数据.zip
- IOT安装包 iotech-iot-1.5-dev-1.5.0-amd64.deb
- 基于物品的协同过滤算法(推荐视频)工具类(见仁见智)
- 21信管2班 武学芹组+独立样本T检验数据分析案例.zip
- demo_ccms_global_open_wlan.py
- 小程序项目源码-小契约(交友互动小程序).zip
- 小程序项目源码-健身房预约课程小程序.zip
- 小程序项目源码-wechat-app-xiaoyima-master小程序.zip
- 小程序项目源码-滑动选项卡小程序.zip
- 小程序项目源码-学习Demo影视推荐、音乐播放、地图小程序.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功