Sasidhar1826/common_metaphors_detection_dataset
Viewer • Updated • 600 • 30
How to use Sasidhar1826/common_metaphors_detection with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Sasidhar1826/common_metaphors_detection") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Sasidhar1826/common_metaphors_detection")
model = AutoModelForSequenceClassification.from_pretrained("Sasidhar1826/common_metaphors_detection")This model achieves an accuracy of 64% on specific metaphor data of small dataset. This is build upon bert-base-uncased this is not yet too much reliable to use in full scale as the metaphors meanings varies over the context of the sentences and the trained data is specific for only some cases. If you train it over VU Amsterdam Metaphor Corpus you can get better results in overall.
You can load this model in your Hugging Face code as follows:
from transformers import AutoModel
model = AutoModel.from_pretrained('Sasidhar1826/common_metaphors_detection')