Run this model with HF Jobs
Run funnel-transformer/intermediate-base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/funnel-transformer/intermediate-base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/funnel-transformer/intermediate-base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use funnel-transformer/intermediate-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use funnel-transformer/intermediate-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="funnel-transformer/intermediate-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("funnel-transformer/intermediate-base") model = AutoModel.from_pretrained("funnel-transformer/intermediate-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Migrate model card from transformers-repo
Browse filesRead announcement at https://discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755
Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/funnel-transformer/intermediate-base/README.md
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394---language: enlicense: apache-2.0datasets:- bookcorpus- wikipedia- gigaword---
# Funnel Transformer intermediate model (B6-6-6 without decoder)
Pretrained model on English language using a similar objective objective as [ELECTRA](https://huggingface.co/transformers/model_doc/electra.html). It was introduced in[this paper](https://arxiv.org/pdf/2006.03236.pdf) and first released in[this repository](https://github.com/laiguokun/Funnel-Transformer). This model is uncased: it does not make a differencebetween english and English.
Disclaimer: The team releasing Funnel Transformer did not write a model card for this model so this model card has beenwritten by the Hugging Face team.
## Model description
Funnel Transformer is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means itwas pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots ofpublicly available data) with an automatic process to generate inputs and labels from those texts.
More precisely, a small language model corrupts the input texts and serves as a generator of inputs for this model, andthe pretraining objective is to predict which token is an original and which one has been replaced, a bit like a GAN training.
This way, the model learns an inner representation of the English language that can then be used to extract featuresuseful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standardclassifier using the features produced by the BERT model as inputs.
**Note:** This model does not contain the decoder, so it ouputs hidden states that have a sequence length of one fourthof the inputs. It's good to use for tasks requiring a summary of the sentence (like sentence classification) but not ifyou need one input per initial token. You should use the `intermediate` model in that case.
## Intended uses & limitations
You can use the raw model to extract a vector representation of a given text, but it's mostly intended tobe fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=funnel-transformer) to look forfine-tuned versions on a task that interests you.
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)to make decisions, such as sequence classification, token classification or question answering. For tasks such as textgeneration you should look at model like GPT2.
### How to use
Here is how to use this model to get the features of a given text in PyTorch:
```pythonfrom transformers import FunnelTokenizer, FunnelBaseModeltokenizer = FunnelTokenizer.from_pretrained("funnel-transformer/intermediate-base")model = FunnelBaseModel.from_pretrained("funnel-transformer/intermediate-base")text = "Replace me by any text you'd like."encoded_input = tokenizer(text, return_tensors='pt')output = model(**encoded_input)```
and in TensorFlow:
```pythonfrom transformers import FunnelTokenizer, TFFunnelBaseModeltokenizer = FunnelTokenizer.from_pretrained("funnel-transformer/intermediate-base")model = TFFunnelBaseModel.from_pretrained("funnel-transformer/intermediate-base")text = "Replace me by any text you'd like."encoded_input = tokenizer(text, return_tensors='tf')output = model(encoded_input)```
## Training data
The BERT model was pretrained on:- [BookCorpus](https://yknzhu.wixsite.com/mbweb), a dataset consisting of 11,038 unpublished books,- [English Wikipedia](https://en.wikipedia.org/wiki/English_Wikipedia) (excluding lists, tables and headers),- [Clue Web](https://lemurproject.org/clueweb12/), a dataset of 733,019,372 English web pages,- [GigaWord](https://catalog.ldc.upenn.edu/LDC2011T07), an archive of newswire text data,- [Common Crawl](https://commoncrawl.org/), a dataset of raw web pages.
### BibTeX entry and citation info
```bibtex@misc{dai2020funneltransformer, title={Funnel-Transformer: Filtering out Sequential Redundancy for Efficient Language Processing}, author={Zihang Dai and Guokun Lai and Yiming Yang and Quoc V. Le}, year={2020}, eprint={2006.03236}, archivePrefix={arXiv}, primaryClass={cs.LG}}```
README.mdAdded+94