Sreevishnu commited on
Commit
d0fa5eb
1 Parent(s): 73e253b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -4
README.md CHANGED
@@ -9,7 +9,7 @@ tags:
9
 
10
  # Funnel Transformer small (B4-4-4 with decoder) fine-tuned on IMDB for Sentiment Analysis
11
 
12
- This are the model weights for the Funnel Transformer small model fine-tuned on the IMDB dataset for performing Sentiment Analysis.
13
 
14
  The original model weights for English language are from [funnel-transformer/small](https://huggingface.co/funnel-transformer/small) and it uses 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 difference between english and English.
15
 
@@ -33,9 +33,14 @@ This way, the model learns an inner representation of the English language that
33
  Here is how to use this model to get the features of a given text in PyTorch:
34
 
35
  ```python
36
- from transformers import FunnelTokenizer, FunnelModel
37
- tokenizer = FunnelTokenizer.from_pretrained("Sreevishnu/funnel-transformer-small-imdb")
38
- model = FunneModel.from_pretrained("Sreevishnu/funnel-transformer-small-imdb")
 
 
 
 
 
39
  text = "Replace me by any text you'd like."
40
  encoded_input = tokenizer(text, return_tensors='pt')
41
  output = model(**encoded_input)
9
 
10
  # Funnel Transformer small (B4-4-4 with decoder) fine-tuned on IMDB for Sentiment Analysis
11
 
12
+ These are the model weights for the Funnel Transformer small model fine-tuned on the IMDB dataset for performing Sentiment Analysis with `max_position_embeddings=1024`.
13
 
14
  The original model weights for English language are from [funnel-transformer/small](https://huggingface.co/funnel-transformer/small) and it uses 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 difference between english and English.
15
 
33
  Here is how to use this model to get the features of a given text in PyTorch:
34
 
35
  ```python
36
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
37
+ tokenizer = AutoTokenizer.from_pretrained(
38
+ "Sreevishnu/funnel-transformer-small-imdb",
39
+ use_fast=True)
40
+ model = AutoModelForSequenceClassification.from_pretrained(
41
+ "Sreevishnu/funnel-transformer-small-imdb",
42
+ num_labels=2,
43
+ max_position_embeddings=1024)
44
  text = "Replace me by any text you'd like."
45
  encoded_input = tokenizer(text, return_tensors='pt')
46
  output = model(**encoded_input)