dennlinger commited on
Commit
f2c7d95
1 Parent(s): 26d06e2

Add usage example

Browse files
Files changed (1) hide show
  1. README.md +6 -3
README.md CHANGED
@@ -2,10 +2,13 @@
2
  This network has been fine-tuned for the task described in the paper *Topical Change Detection in Documents via Embeddings of Long Sequences* and is our best-performing base-transformer model. You can find more detailed information in our GitHub page for the paper [here](https://github.com/dennlinger/TopicalChange), or read the [paper itself](https://arxiv.org/abs/2012.03619). The weights are based on RoBERTa-base.
3
 
4
  # Load the model
 
 
5
  ```python
6
- from transformers import AutoModelForSequenceClassification, AutoTokenizer
7
- tokenizer = AutoTokenizer.from_pretrained('dennlinger/roberta-cls-consec')
8
- model = AutoModelForSequenceClassification.from_pretrained('dennlinger/roberta-cls-consec')
 
9
  ```
10
 
11
  # Input Format
2
  This network has been fine-tuned for the task described in the paper *Topical Change Detection in Documents via Embeddings of Long Sequences* and is our best-performing base-transformer model. You can find more detailed information in our GitHub page for the paper [here](https://github.com/dennlinger/TopicalChange), or read the [paper itself](https://arxiv.org/abs/2012.03619). The weights are based on RoBERTa-base.
3
 
4
  # Load the model
5
+ The preferred way is through pipelines
6
+
7
  ```python
8
+ from transformers import pipeline
9
+ pipe = pipeline("text-classification", model="dennlinger/roberta-cls-consec")
10
+
11
+ pipe("{First paragraph} [SEP] {Second paragraph}")
12
  ```
13
 
14
  # Input Format