Update README.md
Browse files
README.md
CHANGED
@@ -29,21 +29,19 @@ This model is designed to:
|
|
29 |
|
30 |
## Example Code
|
31 |
|
32 |
-
You can use the following code to perform operations such as getting distinct elements from a list or splitting text into sentences.
|
33 |
-
|
34 |
```python
|
35 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
36 |
|
37 |
tokenizer = T5Tokenizer.from_pretrained("Babelscape/t5-base-summarization-claim-extractor")
|
38 |
-
model = T5ForConditionalGeneration.from_pretrained("Babelscape/t5-base-summarization-claim-extractor")
|
39 |
-
device = "cuda:0"
|
40 |
summary = 'Simone Biles made a triumphant return to the Olympic stage at the Paris 2024 Games, competing in the women’s gymnastics qualifications. Overcoming a previous struggle with the “twisties” that led to her withdrawal from events at the Tokyo 2020 Olympics, Biles dazzled with strong performances on all apparatus, helping the U.S. team secure a commanding lead in the qualifications. Her routines showcased her resilience and skill, drawing enthusiastic support from a star-studded audience'
|
41 |
|
42 |
-
tok_input = tokenizer.batch_encode_plus([summary], return_tensors="pt", padding=True)
|
43 |
claims = model.generate(**tok_input)
|
44 |
claims = tokenizer.batch_decode(claims, skip_special_tokens=True)
|
45 |
|
46 |
```
|
|
|
47 |
|
48 |
|
49 |
### Training
|
|
|
29 |
|
30 |
## Example Code
|
31 |
|
|
|
|
|
32 |
```python
|
33 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
34 |
|
35 |
tokenizer = T5Tokenizer.from_pretrained("Babelscape/t5-base-summarization-claim-extractor")
|
36 |
+
model = T5ForConditionalGeneration.from_pretrained("Babelscape/t5-base-summarization-claim-extractor")
|
|
|
37 |
summary = 'Simone Biles made a triumphant return to the Olympic stage at the Paris 2024 Games, competing in the women’s gymnastics qualifications. Overcoming a previous struggle with the “twisties” that led to her withdrawal from events at the Tokyo 2020 Olympics, Biles dazzled with strong performances on all apparatus, helping the U.S. team secure a commanding lead in the qualifications. Her routines showcased her resilience and skill, drawing enthusiastic support from a star-studded audience'
|
38 |
|
39 |
+
tok_input = tokenizer.batch_encode_plus([summary], return_tensors="pt", padding=True)
|
40 |
claims = model.generate(**tok_input)
|
41 |
claims = tokenizer.batch_decode(claims, skip_special_tokens=True)
|
42 |
|
43 |
```
|
44 |
+
**Note**: The model outputs the claims in a single string. **Kindly remember to split the string into sentences** in order to retrieve the singular claims.
|
45 |
|
46 |
|
47 |
### Training
|