Place the model files in the corresponding directory
This repository is a pytorch implementation for relation extraction on twitter text. The workflow is as folllows: Tweet —-> extracted triples
Replace the text by the twitter you want to work on and the model checkpoint you want to use in predict.py:
result = token_classifier("Covid breaks out in Hamburg city of Germany in 2022. ^^")
model_checkpoint = 'bert-base-uncased-lsoie/checkpoint-64110'
python predict.py
The code will return you the triples in list form.
[['Covid', 'breaks', 'in Hamburg city of Germany'], ['Covid', 'breaks', 'in 2022']]
Change the variable in In config.py
dataset="lsoie"/'wnut17'
model_checkpoint=model from huggingface hub/local direcrtory
python train.py
The pipeline of this module is based on following parts: