Skip to content

Instantly share code, notes, and snippets.

@tomasonjo
Created October 23, 2021 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomasonjo/58b3ee6a6df5d6ccdd72447896238af3 to your computer and use it in GitHub Desktop.
Save tomasonjo/58b3ee6a6df5d6ccdd72447896238af3 to your computer and use it in GitHub Desktop.
from transformers import AutoTokenizer
from zero_shot_re import RelTaggerModel, RelationExtractor
model = RelTaggerModel.from_pretrained("fractalego/fewrel-zero-shot")
tokenizer = AutoTokenizer.from_pretrained("bert-large-uncased-whole-word-masking-finetuned-squad")
relations = ['associated', 'interacts']
extractor = RelationExtractor(model, tokenizer, relations)
@arartawil
Copy link

zero_shot_re there is an error in this package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment