Transformers
PyTorch
Safetensors
English
bart
text2text-generation
seq2seq
relation-extraction
Eval Results (legacy)
Instructions to use Babelscape/rebel-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Babelscape/rebel-large with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Babelscape/rebel-large") model = AutoModelForSeq2SeqLM.from_pretrained("Babelscape/rebel-large") - Notebooks
- Google Colab
- Kaggle
Commit ·
d24237e
1
Parent(s): 5f91acc
Update README.md
Browse files
README.md
CHANGED
|
@@ -66,7 +66,7 @@ from transformers import pipeline
|
|
| 66 |
|
| 67 |
triplet_extractor = pipeline('text2text-generation', model='Babelscape/rebel-large', tokenizer='Babelscape/rebel-large')
|
| 68 |
# We need to use the tokenizer manually since we need special tokens.
|
| 69 |
-
extracted_text = triplet_extractor.tokenizer.batch_decode(triplet_extractor("Punta Cana is a resort town in the municipality of Higuey, in La Altagracia Province, the eastern most province of the Dominican Republic", return_tensors=True, return_text=False)[0]["generated_token_ids"]
|
| 70 |
print(extracted_text[0])
|
| 71 |
# Function to parse the generated text and extract the triplets
|
| 72 |
def extract_triplets(text):
|
|
|
|
| 66 |
|
| 67 |
triplet_extractor = pipeline('text2text-generation', model='Babelscape/rebel-large', tokenizer='Babelscape/rebel-large')
|
| 68 |
# We need to use the tokenizer manually since we need special tokens.
|
| 69 |
+
extracted_text = triplet_extractor.tokenizer.batch_decode([triplet_extractor("Punta Cana is a resort town in the municipality of Higuey, in La Altagracia Province, the eastern most province of the Dominican Republic", return_tensors=True, return_text=False)[0]["generated_token_ids"]])
|
| 70 |
print(extracted_text[0])
|
| 71 |
# Function to parse the generated text and extract the triplets
|
| 72 |
def extract_triplets(text):
|