PereLluis13 commited on
Commit
d24237e
1 Parent(s): 5f91acc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -1
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"]["output_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):